CompanyProductInventoryLogs


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 gen_random_uuid()
CompanyProductInventoryAddThroughCreditLogs.companyProductInventoryLogId CompanyProductInventoryAddTh_companyProductInventoryLogId_fkey2 C
CompanyProductInventoryAddThroughFreeTrialOfferLogs.companyProductInventoryLogId CompanyProductInventoryAddTh_companyProductInventoryLogId_fkey5 C
CompanyProductInventoryAddThroughOfflineSalesLogs.companyProductInventoryLogId CompanyProductInventoryAddTh_companyProductInventoryLogId_fkey1 C
CompanyProductInventoryAddThroughPurchaseLogs.companyProductInventoryLogId CompanyProductInventoryAddThr_companyProductInventoryLogId_fkey C
CompanyProductInventoryAddThroughSalesTransactionLogs.companyProductInventoryLogId CompanyProductInventoryAddTh_companyProductInventoryLogId_fkey3 C
CompanyProductInventoryAddThroughSubscriptionLogs.companyProductInventoryLogId CompanyProductInventoryAddTh_companyProductInventoryLogId_fkey4 C
CompanyProductInventoryAmountExpiryLogs.companyProductInventoryLogId CompanyProductInventoryAmount_companyProductInventoryLogId_fkey C
CompanyProductInventorySubscriptionLogs.companyProductInventoryLogId CompanyProductInventorySubscr_companyProductInventoryLogId_fkey C
CompanyProductInventoryUsageAfterCreditProductPurchaseLogs.companyProductInventoryLogId CompanyProductInventoryUsage_companyProductInventoryLogId_fkey1 C
CompanyProductInventoryUsageAfterPurchaseLogs.companyProductInventoryLogId CompanyProductInventoryUsageA_companyProductInventoryLogId_fkey C
CompanyProductInventoryUsageFromBalanceLogs.companyProductInventoryLogId CompanyProductInventoryUsageF_companyProductInventoryLogId_fkey C
JobProductInventoryAddViaCompanyProductUsageLogs.companyProductInventoryLogId JobProductInventoryAddViaComp_companyProductInventoryLogId_fkey N
companyId uuid 2147483647 null
Companies.id CompanyProductInventoryLogs_companyId_fkey C
productId uuid 2147483647 null
Products.id CompanyProductInventoryLogs_productId_fkey C
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
Users.id CompanyProductInventoryLogs_userId_fkey N
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))

Relationships