Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int8 | 19 | √ | null |
|
|
||||||||||||||
| public_id | varchar | 10 | null |
|
|
|||||||||||||||
| clinic_id | int8 | 19 | null |
|
|
|||||||||||||||
| created_by | int8 | 19 | null |
|
|
|||||||||||||||
| amount | numeric | 12,2 | null |
|
|
|||||||||||||||
| date | date | 13 | null |
|
|
|||||||||||||||
| payment_method | payment_method | 2147483647 | null |
|
|
|||||||||||||||
| idempotency_key | varchar | 2147483647 | √ | null |
|
|
||||||||||||||
| payer_public_id | varchar | 10 | null |
|
|
|||||||||||||||
| voided_at | timestamptz | 35,6 | √ | null |
|
|
||||||||||||||
| void_reason | text | 2147483647 | √ | null |
|
|
||||||||||||||
| created_at | timestamptz | 35,6 | now() |
|
|
|||||||||||||||
| voided_by | int8 | 19 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| payment_pkey | Primary key | Asc | id |
| idx_payment_clinic_date | Performance | Asc/Asc | clinic_id + date |
| idx_payment_patient_id | Performance | Asc | payer_public_id |
| payment_public_id_key | Must be unique | Asc | public_id |
| payment_request_id_key | Must be unique | Asc | idempotency_key |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| payment_void_reason_consistency | (((voided_at IS NULL) = (void_reason IS NULL))) |
| payment_voided_by_consistency | (((voided_at IS NULL) = (voided_by IS NULL))) |
| payment_amount_check | ((amount > (0)::numeric)) |

