Skip to content

public.receipt_copies

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
idintegernextval('receipt_copies_id_seq'::regclass)falsepublic.receipt_copiesReceipt copy identifier.
receipt_idintegerfalsepublic.receiptsParent receipt ID.
copy_numberintegerfalseCopy sequence number.
delivery_methodvarchar(50)falseDelivery method: sms, email, print, or none.
delivery_statusvarchar(50)falseDelivery status: PENDING, SENT, FAILED.
mobile_numbervarchar(20)trueMobile number for SMS delivery.
emailvarchar(255)trueEmail address for email delivery.
statusvarchar(20)falseCopy status: VALID, INVALID, or DISABLED.
original_copy_idintegertruepublic.receipt_copiesOriginal copy ID (for re-issued copies).
created_attimestamp with time zonenow()falseCopy created timestamp.
delivered_attimestamp with time zonetrueDelivery timestamp.
disabled_attimestamp with time zonetrueDisabled timestamp.
disabled_reasontexttrueDisable reason.
error_messagetexttrueDelivery error message.

Viewpoints

NameDefinition
Receipts & SlipsReceipt and credit card slip generation and delivery

Constraints

NameTypeDefinition
receipt_copies_delivery_method_checkCHECKCHECK (((delivery_method)::text = ANY ((ARRAY['sms'::character varying, 'email'::character varying, 'print'::character varying, 'none'::character varying])::text[])))
receipt_copies_status_checkCHECKCHECK (((status)::text = ANY ((ARRAY['valid'::character varying, 'invalid'::character varying, 'disabled'::character varying])::text[])))
receipt_copies_receipt_id_fkeyFOREIGN KEYFOREIGN KEY (receipt_id) REFERENCES receipts(id) ON DELETE CASCADE
receipt_copies_original_copy_id_fkeyFOREIGN KEYFOREIGN KEY (original_copy_id) REFERENCES receipt_copies(id) ON DELETE SET NULL
receipt_copies_pkeyPRIMARY KEYPRIMARY KEY (id)

Indexes

NameDefinition
receipt_copies_pkeyCREATE UNIQUE INDEX receipt_copies_pkey ON public.receipt_copies USING btree (id)
ix_receipt_copies_receipt_idCREATE INDEX ix_receipt_copies_receipt_id ON public.receipt_copies USING btree (receipt_id)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service