Skip to content

public.payments

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
iduuidfalsepublic.refunds public.bill_operation_histories public.slips
bill_iduuidfalsepublic.bills
split_idintegertruepublic.splits
payment_provider_method_idintegerfalsepublic.payment_provider_methods
idempotency_keyvarchar(100)false
transaction_idvarchar(255)true
amountnumeric(12,2)false
tip_amountnumeric(12,2)0.00false
total_amountnumeric(12,2)false
currencyvarchar(3)'JPY'::character varyingfalse
approval_codevarchar(50)true
card_last_4varchar(4)true
card_brandvarchar(20)true
entry_methodvarchar(20)true
statusvarchar(50)true
error_codevarchar(50)true
error_messagetexttrue
metadatajsonbtrue
processed_attimestamp with time zonetrue
created_attimestamp with time zonenow()true
updated_attimestamp with time zonenow()true
merchant_idintegerfalsepublic.merchants
store_idintegerfalsepublic.stores
cash_receivednumeric(12,2)true
change_amountnumeric(12,2)true
settlement_iduuidtruepublic.settlements
refund_amountbiginttrue
refunded_attimestamp with time zonetrue
card_document_numbervarchar(20)true
card_arnvarchar(100)true

Viewpoints

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

Constraints

NameTypeDefinition
payments_amount_checkCHECKCHECK ((amount > (0)::numeric))
payments_tip_checkCHECKCHECK ((tip_amount >= (0)::numeric))
payments_merchant_id_fkeyFOREIGN KEYFOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT
payments_payment_provider_method_id_fkeyFOREIGN KEYFOREIGN KEY (payment_provider_method_id) REFERENCES payment_provider_methods(id) ON DELETE RESTRICT
payments_store_id_fkeyFOREIGN KEYFOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT
payments_bill_id_fkeyFOREIGN KEYFOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE RESTRICT
payments_split_id_fkeyFOREIGN KEYFOREIGN KEY (split_id) REFERENCES splits(id) ON DELETE RESTRICT
payments_pkeyPRIMARY KEYPRIMARY KEY (id)
payments_settlement_id_fkeyFOREIGN KEYFOREIGN KEY (settlement_id) REFERENCES settlements(id) ON DELETE SET NULL

Indexes

NameDefinition
payments_pkeyCREATE UNIQUE INDEX payments_pkey ON public.payments USING btree (id)
ix_payments_bill_idCREATE INDEX ix_payments_bill_id ON public.payments USING btree (bill_id)
ix_payments_created_atCREATE INDEX ix_payments_created_at ON public.payments USING btree (created_at)
ix_payments_idempotency_keyCREATE UNIQUE INDEX ix_payments_idempotency_key ON public.payments USING btree (idempotency_key)
ix_payments_split_idCREATE INDEX ix_payments_split_id ON public.payments USING btree (split_id)
ix_payments_statusCREATE INDEX ix_payments_status ON public.payments USING btree (status)
ix_payments_merchant_idCREATE INDEX ix_payments_merchant_id ON public.payments USING btree (merchant_id)
ix_payments_store_idCREATE INDEX ix_payments_store_id ON public.payments USING btree (store_id)
ix_payments_settlement_idCREATE INDEX ix_payments_settlement_id ON public.payments USING btree (settlement_id)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service