Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| productId | uuid | 2147483647 | null |
|
|
||||||
| productQuantity | int4 | 10 | null |
|
|
Represents quantity of a certain product |
|||||
| creditQuantity | int4 | 10 | null |
|
|
Represents the total number of credits after discount needed for buying the specified product quantity |
|||||
| timePeriod | int4 | 10 | √ | null |
|
|
|||||
| timePeriodUnit | "employer_purchases"."enum_employer_purchases_timePeriodUnit" | 2147483647 | √ | null |
|
|
|||||
| createdAt | timestamptz | 35,6 | now() |
|
|
||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
||||||
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||
| timePeriodValidityType | "employer_purchases"."enum_employer_purchases_timePeriodValidityType" | 2147483647 | 'MAX_WITH_CURRENT_EXPIRY'::employer_purchases."enum_employer_purchases_timePeriodValidityType" |
|
|
||||||
| tag | "employer_purchases"."enum_CreditProductPackages_tag" | 2147483647 | √ | null |
|
|
|||||
| customisationsCreditPricing | jsonb | 2147483647 | √ | null |
|
|
Stores information regarding additional customisations pricing for a package |
||||
| pricingExperimentVariant | "employer_purchases"."enum_CreditProductPackages_pricingExperimentVariant" | 2147483647 | √ | null |
|
|
This will be null of packages visible to every company. Which company has which variant is controlled via unleash |
||||
| creditDiscountAmount | int4 | 10 | √ | null |
|
|
Represents discount amount of a credit product package |
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CreditProductPackages_pkey | Primary key | Asc | id |
| CreditProductPackages_unique_idx | Must be unique | Asc/Asc/Asc/Asc/Asc | productId + productQuantity + timePeriod + timePeriodUnit + pricingExperimentVariant |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| CreditProductPackages_creditDiscountAmount_check | ((("creditDiscountAmount" IS NULL) OR ("creditDiscountAmount" > 0))) |
| CreditProductPackages_creditQuantity_check | (("creditQuantity" > 0)) |
| CreditProductPackages_productQuantity_check | (("productQuantity" > 0)) |
| timePeriod_and_timePeriodUnit_check | (((("timePeriod" IS NOT NULL) AND ("timePeriod" > 0) AND ("timePeriodUnit" IS NOT NULL)) OR (("timePeriod" IS NULL) AND ("timePeriodUnit" IS NULL)))) |

