public.payments
Description
Labels
svc-smarttab
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | uuid | false | public.refunds public.bill_operation_histories public.slips | |||
| bill_id | uuid | false | public.bills | |||
| split_id | integer | true | public.splits | |||
| payment_provider_method_id | integer | false | public.payment_provider_methods | |||
| idempotency_key | varchar(100) | false | ||||
| transaction_id | varchar(255) | true | ||||
| amount | numeric(12,2) | false | ||||
| tip_amount | numeric(12,2) | 0.00 | false | |||
| total_amount | numeric(12,2) | false | ||||
| currency | varchar(3) | 'JPY'::character varying | false | |||
| approval_code | varchar(50) | true | ||||
| card_last_4 | varchar(4) | true | ||||
| card_brand | varchar(20) | true | ||||
| entry_method | varchar(20) | true | ||||
| status | varchar(50) | true | ||||
| error_code | varchar(50) | true | ||||
| error_message | text | true | ||||
| metadata | jsonb | true | ||||
| processed_at | timestamp with time zone | true | ||||
| created_at | timestamp with time zone | now() | true | |||
| updated_at | timestamp with time zone | now() | true | |||
| merchant_id | integer | false | public.merchants | |||
| store_id | integer | false | public.stores | |||
| cash_received | numeric(12,2) | true | ||||
| change_amount | numeric(12,2) | true | ||||
| settlement_id | uuid | true | public.settlements | |||
| refund_amount | bigint | true | ||||
| refunded_at | timestamp with time zone | true | ||||
| card_document_number | varchar(20) | true | ||||
| card_arn | varchar(100) | true |
Viewpoints
| Name | Definition |
|---|---|
| Order & Billing | Order lifecycle — Orders → Bills → Payments → Settlements |
Constraints
| Name | Type | Definition |
|---|---|---|
| payments_amount_check | CHECK | CHECK ((amount > (0)::numeric)) |
| payments_tip_check | CHECK | CHECK ((tip_amount >= (0)::numeric)) |
| payments_merchant_id_fkey | FOREIGN KEY | FOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT |
| payments_payment_provider_method_id_fkey | FOREIGN KEY | FOREIGN KEY (payment_provider_method_id) REFERENCES payment_provider_methods(id) ON DELETE RESTRICT |
| payments_store_id_fkey | FOREIGN KEY | FOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT |
| payments_bill_id_fkey | FOREIGN KEY | FOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE RESTRICT |
| payments_split_id_fkey | FOREIGN KEY | FOREIGN KEY (split_id) REFERENCES splits(id) ON DELETE RESTRICT |
| payments_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| payments_settlement_id_fkey | FOREIGN KEY | FOREIGN KEY (settlement_id) REFERENCES settlements(id) ON DELETE SET NULL |
Indexes
| Name | Definition |
|---|---|
| payments_pkey | CREATE UNIQUE INDEX payments_pkey ON public.payments USING btree (id) |
| ix_payments_bill_id | CREATE INDEX ix_payments_bill_id ON public.payments USING btree (bill_id) |
| ix_payments_created_at | CREATE INDEX ix_payments_created_at ON public.payments USING btree (created_at) |
| ix_payments_idempotency_key | CREATE UNIQUE INDEX ix_payments_idempotency_key ON public.payments USING btree (idempotency_key) |
| ix_payments_split_id | CREATE INDEX ix_payments_split_id ON public.payments USING btree (split_id) |
| ix_payments_status | CREATE INDEX ix_payments_status ON public.payments USING btree (status) |
| ix_payments_merchant_id | CREATE INDEX ix_payments_merchant_id ON public.payments USING btree (merchant_id) |
| ix_payments_store_id | CREATE INDEX ix_payments_store_id ON public.payments USING btree (store_id) |
| ix_payments_settlement_id | CREATE INDEX ix_payments_settlement_id ON public.payments USING btree (settlement_id) |
Relations
Generated by tbls