Skip to main content

Type Alias: UpdateInvoiceDtoPayload\<T\>

@arolariu/website


@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

readonly id: T

The unique identifier of the invoice.

userIdentifier

readonly userIdentifier: 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 creation
  • userIdentifier: Invoice ownership cannot be transferred
  • createdAt: 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

// was this page useful?