Skip to content

public.bill_operation_histories

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
iduuidgen_random_uuid()falseOperation history identifier (UUID).
merchant_idintegerfalsepublic.merchantsParent merchant ID.
store_idintegerfalsepublic.storesParent store ID.
caller_typevarchar(20)'user'::character varyingfalseCaller type: device or user.
caller_idvarchar(50)trueCaller identifier.
bill_iduuidfalsepublic.billsTarget bill ID.
payment_iduuidtruepublic.paymentsTarget payment ID (optional).
operation_typevarchar(20)falseOperation type: bill or payment.
operation_actionvarchar(50)falseOperation action: created, updated, etc.
metadatajsonb'{}'::jsonbtrueFull entity snapshot (JSON).
created_attimestamp with time zonenow()falseRecord creation timestamp.

Viewpoints

NameDefinition
Order & BillingOrder lifecycle — Orders → Bills → Payments → Settlements

Constraints

NameTypeDefinition
bill_operation_histories_caller_type_checkCHECKCHECK (((caller_type)::text = ANY ((ARRAY['device'::character varying, 'user'::character varying])::text[])))
bill_operation_histories_operation_type_checkCHECKCHECK (((operation_type)::text = ANY ((ARRAY['bill'::character varying, 'payment'::character varying])::text[])))
bill_operation_histories_merchant_id_fkeyFOREIGN KEYFOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT
bill_operation_histories_store_id_fkeyFOREIGN KEYFOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT
bill_operation_histories_bill_id_fkeyFOREIGN KEYFOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE CASCADE
bill_operation_histories_payment_id_fkeyFOREIGN KEYFOREIGN KEY (payment_id) REFERENCES payments(id) ON DELETE SET NULL
bill_operation_histories_pkeyPRIMARY KEYPRIMARY KEY (id)

Indexes

NameDefinition
bill_operation_histories_pkeyCREATE UNIQUE INDEX bill_operation_histories_pkey ON public.bill_operation_histories USING btree (id)
idx_boh_bill_createdCREATE INDEX idx_boh_bill_created ON public.bill_operation_histories USING btree (bill_id, created_at)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service