Type Alias: UpdateInvoiceDtoPayload\<T\>
@arolariu/website / types/invoices/Invoice / UpdateInvoiceDtoPayload
Type Alias: UpdateInvoiceDtoPayload<T>
UpdateInvoiceDtoPayload<
T> =object&Partial<Omit<Invoice,"id"|"userIdentifier">>
Defined in: types/invoices/Invoice.ts:443
DTO payload for updating an existing invoice via the API.
Type Declaration
id
readonlyid:T
The unique identifier of the invoice.
userIdentifier
readonlyuserIdentifier:string
The user identifier associated with the invoice.
Type Parameters
T
T = string
The type of the invoice identifier. Defaults to string.
Remarks
Partial Updates:
Only the fields provided will be updated. Omitted fields retain
their current values. The id and userIdentifier are required
for authorization and entity lookup.
Authorization:
The userIdentifier must match the invoice owner or be in the
sharedWith list with edit permissions.
Immutable Fields:
id: Cannot be changed after creationuserIdentifier: Invoice ownership cannot be transferredcreatedAt: Audit timestamp is immutable
Example
const updatePayload: UpdateInvoiceDtoPayload = {
id: "invoice-uuid-here",
userIdentifier: "user_abc123",
name: "Updated Invoice Name",
category: InvoiceCategory.FAST_FOOD
};
await fetch(`/api/invoices/${updatePayload.id}`, {
method: "PATCH",
body: JSON.stringify(updatePayload)
});
See
Invoice for the full entity structure