Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
|||||||||||||||||||||||||||||||||||||||
| companyId | uuid | 2147483647 | null |
|
|
|||||||||||||||||||||||||||||||||||||||
| productId | uuid | 2147483647 | null |
|
|
|||||||||||||||||||||||||||||||||||||||
| type | "employer_purchases"."enum_EmployerPurchases_CompanyProductInventoryLogs_type" | 2147483647 | null |
|
|
|||||||||||||||||||||||||||||||||||||||
| amount | int4 | 10 | null |
|
|
Represents the amount added/used for a particular product |
||||||||||||||||||||||||||||||||||||||
| finalBalance | int4 | 10 | null |
|
|
Represents the balance after the job product operation is done |
||||||||||||||||||||||||||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
|||||||||||||||||||||||||||||||||||||||
| expiryDateTime | timestamptz | 35,6 | √ | null |
|
|
Represents the end date of a company product balance being set during this event |
|||||||||||||||||||||||||||||||||||||
| userId | uuid | 2147483647 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||
| timePeriod | numeric | 0 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||
| timePeriodUnit | "employer_purchases"."enum_employer_purchases_timePeriodUnit" | 2147483647 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||
| timePeriodValidityType | "employer_purchases"."enum_employer_purchases_timePeriodValidityType" | 2147483647 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| CompanyProductInventoryLogs_pkey | Primary key | Asc | id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| CompanyProductInventoryLogs_finalBalance_check | ((("finalBalance")::numeric >= (0)::numeric)) |
| timePeriod_columns_check | (((("timePeriod" IS NOT NULL) AND ("timePeriod" > (0)::numeric) AND ("timePeriodUnit" IS NOT NULL) AND ("timePeriodValidityType" IS NOT NULL)) OR (("timePeriod" IS NULL) AND ("timePeriodUnit" IS NULL) AND ("timePeriodValidityType" IS NULL)))) |
| CompanyProductInventoryLogs_amount_check | (((amount)::numeric >= (0)::numeric)) |

