Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | bigserial | 19 | √ | nextval('employer_purchases."CompanyPaymentProviderLogs_id_seq"'::regclass) |
|
|
|||||
| paymentNumber | varchar | 64 | null |
|
|
A unique 18- or 19-digit numeric string generated by the Snowflake algorithm, used to identify this payment record across all systems. |
|||||
| orderType | "employer_purchases"."enum_CompanyPaymentProviderLogs_orderType" | 2147483647 | null |
|
|
Identifies the order table from which this payment originates. Required because a single payment log table serves multiple order types. VIRTUAL_PRODUCT: the payment is associated with an order in CompanyVirtualProductOrders. RECHARGE: the payment is associated with an order in CompanyRechargeOrders. |
|||||
| orderNumber | varchar | 64 | null |
|
|
||||||
| companyId | uuid | 2147483647 | null |
|
|
||||||
| userId | uuid | 2147483647 | null |
|
|
||||||
| currency | varchar | 8 | √ | null |
|
|
|||||
| paidAmount | numeric | 15,2 | null |
|
|
||||||
| paymentProvider | "employer_purchases"."enum_CompanyPaymentProviderLogs_paymentProvider" | 2147483647 | null |
|
|
||||||
| paymentMethod | varchar | 20 | √ | null |
|
|
|||||
| paymentStatus | "employer_purchases"."enum_CompanyPaymentProviderLogs_paymentStatus" | 2147483647 | null |
|
|
||||||
| settlementAmount | numeric | 15,2 | √ | 0 |
|
|
|||||
| settlementCurrency | varchar | 8 | √ | NULL::character varying |
|
|
|||||
| processingStatus | "employer_purchases"."enum_CompanyPaymentProviderLogs_processingStatus" | 2147483647 | 'UNPROCESSED'::employer_purchases."enum_CompanyPaymentProviderLogs_processingStatus" |
|
|
||||||
| prepayId | varchar | 255 | null |
|
|
The pre-payment identifier issued by the payment provider before the user completes payment. For ONE_TIME purchases — Xendit: the invoice ID; 2C2P: the payment token. For SUBSCRIPTION purchases — Xendit: the subscription_id; 2C2P: the recurringUniqueID. |
|||||
| paymentUrl | varchar | 255 | √ | null |
|
|
The URL to which the user is redirected to complete payment. Xendit: invoice_url. 2C2P: webPaymentUrl. Null for payment methods that do not require a redirect. |
||||
| transactionId | varchar | 255 | √ | null |
|
|
The transaction identifier generated by the payment provider upon successful payment processing. Usually assigned by the provider after the payment is confirmed. |
||||
| providerExtractedInfo | jsonb | 2147483647 | null |
|
|
A structured object containing key fields extracted from the provider’s API response (paymentSnapshot), such as payment status, transaction ID, and amounts. Stored separately from the raw snapshot for fast access and querying. |
|||||
| paymentSnapshot | jsonb | 2147483647 | null |
|
|
The complete, unmodified response payload returned by the payment provider’s API. Preserved as-is for audit, debugging, and reconciliation purposes. |
|||||
| processInfo | jsonb | 2147483647 | √ | null |
|
|
|||||
| reconcileStatus | "employer_purchases"."enum_CompanyPaymentProviderLogs_reconcileStatus" | 2147483647 | √ | 'UNRECONCILED'::employer_purchases."enum_CompanyPaymentProviderLogs_reconcileStatus" |
|
|
|||||
| reconcileTime | timestamptz | 35,6 | √ | null |
|
|
|||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
||||||
| subscriptionId | uuid | 2147483647 | √ | null |
|
|
|||||
| purchaseType | "employer_purchases"."enum_CompanyPaymentProviderLogs_purchaseType" | 2147483647 | null |
|
|
ONE_TIME: A standalone payment for a one-time purchase, with no associated subscription. SUBSCRIPTION: The initial payment that activates a new subscription. RENEWAL: A recurring payment automatically triggered for an active subscription’s renewal cycle. |
|||||
| billingCycle | varchar | 16 | √ | null |
|
|
Sequential cycle number for this payment within the order. “1” is the initial period, “2” is the first renewal, “3” is the second renewal, etc. Null for one-time purchases. |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CompanyPaymentProviderLogs_pkey | Primary key | Asc | id |
| CompanyPaymentProviderLogs_billingCycle_idx | Performance | Asc | billingCycle |
| CompanyPaymentProviderLogs_companyId_idx | Performance | Asc | companyId |
| CompanyPaymentProviderLogs_createdAt_idx | Performance | Asc | createdAt |
| CompanyPaymentProviderLogs_orderNumber_idx | Performance | Asc | orderNumber |
| CompanyPaymentProviderLogs_orderType_idx | Performance | Asc | orderType |
| CompanyPaymentProviderLogs_orderType_orderNumber_billingCycle_k | Must be unique | Asc/Asc/Asc | orderType + orderNumber + billingCycle |
| CompanyPaymentProviderLogs_paymentNumber_key | Must be unique | Asc | paymentNumber |
| CompanyPaymentProviderLogs_paymentProvider_idx | Performance | Asc | paymentProvider |
| CompanyPaymentProviderLogs_paymentStatus_idx | Performance | Asc | paymentStatus |
| CompanyPaymentProviderLogs_processingStatus_idx | Performance | Asc | processingStatus |
| CompanyPaymentProviderLogs_purchaseType_idx | Performance | Asc | purchaseType |
| CompanyPaymentProviderLogs_reconcileStatus_idx | Performance | Asc | reconcileStatus |
| CompanyPaymentProviderLogs_subscriptionId_idx | Performance | Asc | subscriptionId |
| CompanyPaymentProviderLogs_transactionId_idx | Performance | Asc | transactionId |
| CompanyPaymentProviderLogs_userId_idx | Performance | Asc | userId |

