Skip to main content

Type Alias: UpdateMerchantDtoPayload\<T\>

@arolariu/website


@arolariu/website / types/invoices/Merchant / UpdateMerchantDtoPayload

Type Alias: UpdateMerchantDtoPayload<T>

UpdateMerchantDtoPayload<T> = object & Partial<Omit<Merchant, "id">>

Defined in: types/invoices/Merchant.ts:232

DTO payload for updating an existing merchant.

Type Declaration

id

readonly id: T

The unique identifier of the merchant.

Type Parameters

T

T = string

The type of the merchant identifier. Defaults to string.

Remarks

Partial Updates: Only provided fields are updated. The id is required for lookup.

Immutable Fields:

  • id: Cannot be changed after creation
  • createdAt: Audit timestamp is immutable

Impact: Updating a merchant affects all invoices referencing it. Changes are reflected immediately across all user views.

Example

const updatePayload: UpdateMerchantDtoPayload = {
id: "merchant-uuid",
category: MerchantCategory.HYPERMARKET,
phoneNumber: "+40 21 999 8888"
};

await fetch(`/api/merchants/${updatePayload.id}`, {
method: "PATCH",
body: JSON.stringify(updatePayload)
});

See

Merchant for the entity structure

// was this page useful?