Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | bigserial | 19 | √ | nextval('employer_purchases."CompanyRechargeOrders_id_seq"'::regclass) |
|
|
|||||
| orderNumber | varchar | 64 | null |
|
|
||||||
| creditPackageId | uuid | 2147483647 | null |
|
|
||||||
| companyId | uuid | 2147483647 | null |
|
|
||||||
| userId | uuid | 2147483647 | null |
|
|
||||||
| status | "employer_purchases"."enum_CompanyRechargeOrders_status" | 2147483647 | null |
|
|
Lifecycle status of the order. PENDING_PAYMENT: the user has submitted the order, credits (if applicable) have been deducted and inventory (if any) has been locked, awaiting payment from the user. PROCESSING: payment was successful but the purchased product has not yet been delivered; the system is processing the fulfilment — the user should see messages such as “recharge processing” or “opening VIP for you, please wait…”. COMPLETED: the product has been successfully delivered (e.g. VIP activated, recharge received). FAILED: payment succeeded but the product could not be delivered to the user; requires manual intervention or automatic retry by the system. CLOSED: cancelled due to unpaid timeout, or closed following a shipment failure when the user requests a refund. REFUNDED: full refund completed. |
|||||
| expiryTime | timestamptz | 35,6 | √ | null |
|
|
|||||
| countryCode | varchar | 8 | null |
|
|
||||||
| currency | varchar | 8 | √ | null |
|
|
|||||
| paidAmount | numeric | 15,2 | 0 |
|
|
||||||
| sellingAmount | numeric | 15,2 | 0 |
|
|
||||||
| purchaseCredits | int8 | 19 | 0 |
|
|
||||||
| giftCredits | int8 | 19 | 0 |
|
|
||||||
| totalCredits | int8 | 19 | 0 |
|
|
||||||
| creditPackageSnapshot | jsonb | 2147483647 | √ | null |
|
|
|||||
| promotionSnapshot | jsonb | 2147483647 | √ | null |
|
|
|||||
| bizContext | jsonb | 2147483647 | √ | null |
|
|
|||||
| tax | jsonb | 2147483647 | null |
|
|
||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
||||||
| referenceId | varchar | 255 | null |
|
|
||||||
| orderSource | "employer_purchases"."enum_CompanyRechargeOrders_orderSource" | 2147483647 | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CompanyRechargeOrders_pkey | Primary key | Asc | id |
| CompanyRechargeOrders_companyId_idx | Performance | Asc | companyId |
| CompanyRechargeOrders_countryCode_idx | Performance | Asc | countryCode |
| CompanyRechargeOrders_createdAt_idx | Performance | Asc | createdAt |
| CompanyRechargeOrders_creditPackageId_idx | Performance | Asc | creditPackageId |
| CompanyRechargeOrders_expiryTime_idx | Performance | Asc | expiryTime |
| CompanyRechargeOrders_orderNumber_key | Must be unique | Asc | orderNumber |
| CompanyRechargeOrders_referenceId_key | Must be unique | Asc | referenceId |
| CompanyRechargeOrders_status_idx | Performance | Asc | status |
| CompanyRechargeOrders_userId_idx | Performance | Asc | userId |

