Skip to content

public.payment

Description

Columns

Name Type Default Nullable Children Parents Comment
id uuid false Unique identifier of the payment.(DC2Type:uuid)
status varchar(255) false Current status of the payment (PENDING, SUCCEEDED, FAILED, EXPIRED).
total_amount bigint false
total_currency character(3) false (DC2Type:currency)
stripe_client_secret varchar(255) NULL::character varying true Stripe client secret for payment intent initialization.
is_paid boolean false false Whether the payment has been successfully completed.
paid_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time when the payment was successfully completed.(DC2Type:datetimetz_immutable)
voucher_id uuid true public.voucher Optional voucher applied to reduce the payment amount.(DC2Type:uuid)
stripe_payment_intent_id varchar(255) NULL::character varying true Unique Stripe payment intent identifier.
payment_source varchar(255) NULL::character varying true Payment source: ONLINE (Stripe) or POS (point of sale).
expired_at timestamp(0) with time zone NULL::timestamp with time zone true The date and time when the payment expired without completion.(DC2Type:datetimetz_immutable)
voucher_redemption_id uuid true public.voucher_redemption Voucher redemption record if a voucher was used.(DC2Type:uuid)
cart_id uuid false public.cart Cart associated with this payment.(DC2Type:uuid)

Constraints

Name Type Definition
fk_6d28840d1ad5cdbf FOREIGN KEY FOREIGN KEY (cart_id) REFERENCES cart(id)
payment_pkey PRIMARY KEY PRIMARY KEY (id)
fk_6d28840d28aa1b6f FOREIGN KEY FOREIGN KEY (voucher_id) REFERENCES voucher(id)
fk_6d28840d5c6f8643 FOREIGN KEY FOREIGN KEY (voucher_redemption_id) REFERENCES voucher_redemption(id)

Indexes

Name Definition
payment_pkey CREATE UNIQUE INDEX payment_pkey ON public.payment USING btree (id)
idx_6d28840d28aa1b6f CREATE INDEX idx_6d28840d28aa1b6f ON public.payment USING btree (voucher_id)
uniq_6d28840dfc72f97e CREATE UNIQUE INDEX uniq_6d28840dfc72f97e ON public.payment USING btree (stripe_payment_intent_id)
uniq_6d28840d5c6f8643 CREATE UNIQUE INDEX uniq_6d28840d5c6f8643 ON public.payment USING btree (voucher_redemption_id)
uniq_6d28840d1ad5cdbf CREATE UNIQUE INDEX uniq_6d28840d1ad5cdbf ON public.payment USING btree (cart_id)

Relations

er


Generated by tbls