Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||||||||||||||||||||||||||||||||
| companyId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||
| userId | uuid | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||
| status | "employer_purchases"."enum_CreditProductPurchaseOrders_status" | 2147483647 | null |
|
|
||||||||||||||||||||||||||||||||||||
| failureType | "employer_purchases"."enum_CreditProductPurchaseOrders_failureType" | 2147483647 | √ | null |
|
|
Contains type of failure if the status is failed |
||||||||||||||||||||||||||||||||||
| productId | uuid | 2147483647 | null |
|
|
||||||||||||||||||||||||||||||||||||
| productQuantity | int4 | 10 | null |
|
|
Represents quantity of a certain product bought by the company |
|||||||||||||||||||||||||||||||||||
| creditQuantity | int4 | 10 | null |
|
|
Represents the final amount of credits required for buying the product with specified customisations and quantity |
|||||||||||||||||||||||||||||||||||
| creditDiscountPercentage | numeric | 0 | √ | null |
|
|
Represents discount percentage of a credit product purchase |
||||||||||||||||||||||||||||||||||
| productTimePeriod | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||
| productTimePeriodUnit | "employer_purchases"."enum_employer_purchases_timePeriodUnit" | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||||||||||||||||||||||||||||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
||||||||||||||||||||||||||||||||||||
| productTimePeriodValidityType | "employer_purchases"."enum_employer_purchases_timePeriodValidityType" | 2147483647 | 'MAX_WITH_CURRENT_EXPIRY'::employer_purchases."enum_employer_purchases_timePeriodValidityType" |
|
|
||||||||||||||||||||||||||||||||||||
| purchaseType | "employer_purchases"."enum_employer_purchases_purchaseType" | 2147483647 | 'ONE_TIME'::employer_purchases."enum_employer_purchases_purchaseType" |
|
|
||||||||||||||||||||||||||||||||||||
| productCustomisations | jsonb | 2147483647 | √ | null |
|
|
Stores information regarding additional customisations for the product being purchased |
||||||||||||||||||||||||||||||||||
| creditDiscountAmount | int4 | 10 | √ | null |
|
|
Represents discount amount of a credit product purchase |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CreditProductPurchaseOrders_pkey | Primary key | Asc | id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| CreditProductPurchaseOrders_failureType_nullable_check | ((((status = 'FAILED'::employer_purchases."enum_CreditProductPurchaseOrders_status") AND ("failureType" IS NOT NULL)) OR ((status <> 'FAILED'::employer_purchases."enum_CreditProductPurchaseOrders_status") AND ("failureType" IS NULL)))) |
| CreditProductPurchaseOrders_creditDiscountPercentage_check | ((("creditDiscountPercentage" IS NULL) OR ("creditDiscountPercentage" > (0)::numeric))) |
| CreditProductPurchaseOrders_creditQuantity_check | (("creditQuantity" > 0)) |
| productTimePeriod_and_productTimePeriodUnit_check | (((("productTimePeriod" IS NOT NULL) AND ("productTimePeriod" > 0) AND ("productTimePeriodUnit" IS NOT NULL)) OR (("productTimePeriod" IS NULL) AND ("productTimePeriodUnit" IS NULL)))) |
| CreditProductPurchaseOrders_creditDiscountAmount_check | ((("creditDiscountAmount" IS NULL) OR ("creditDiscountAmount" > 0))) |
| CreditProductPurchaseOrders_productQuantity_check | (("productQuantity" > 0)) |

