refunds table
The refunds table in the E-commerce Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to payments and returns.
Refunds are their own rows. Never subtract from payments.amount_cents.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| payment_id | uuid | not null, references payments.id | |
| return_id | uuid | references returns.id | |
| status | refund_status | not null | |
| amount_cents | integer | not null | |
| reason | varchar(255) | ||
| processor_reference | varchar(120) | ||
| created_at | timestamptz | not null |
Relationships
refunds.payment_idreferencespayments.idrefunds.return_idreferencesreturns.id