CompanyCreditInventoryLogs


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 gen_random_uuid()
CompanyCreditInventoryAddThroughProductPurchaseLogs.companyCreditInventoryLogId CompanyCreditInventoryAddThro_companyCreditInventoryLogId_fkey1 C
CompanyCreditInventoryAddThroughPurchaseLogs.companyCreditInventoryLogId CompanyCreditInventoryAddThrou_companyCreditInventoryLogId_fkey C
CompanyCreditInventoryAmountExpiryLogs.companyCreditInventoryLogId CompanyCreditInventoryAmountEx_companyCreditInventoryLogId_fkey C
CompanyCreditInventoryUsageFromBalanceLogs.companyCreditInventoryLogId CompanyCreditInventoryUsageFro_companyCreditInventoryLogId_fkey C
OfflineSalesTransactions.companyCreditInventoryLogId OfflineSalesTransactions_companyCreditInventoryLogId_fkey C
companyId uuid 2147483647 null
Companies.id CompanyCreditInventoryLogs_companyId_fkey N
type varchar 2147483647 null
amount int4 10 null

Represents the credit amount added/used

finalBalance int4 10 null

Represents the balance after the operation is done

expiryDateTime timestamptz 35,6 null

Represents the expiry date of a credit balance being set during this event

createdAt timestamptz 35,6 now()
updatedAt timestamptz 35,6 now()
productId uuid 2147483647 null
Products.id CompanyCreditInventoryLogs_productId_fkey R
userId uuid 2147483647 null
Users.id CompanyCreditInventoryLogs_userId_fkey N
companyCreditInventoryBreakdownId uuid 2147483647 null
CompanyCreditInventoryBreakdowns.id CompanyCreditInventoryLogs_companyCreditInventoryBreakdownId_fk N
details jsonb 2147483647 null

Stores additional metadata. Current usage: tracking the origin of credit additions via a reference to the source table and record ID. Scope may evolve in the future.

Indexes

Constraint Name Type Sort Column(s)
CompanyCreditInventoryLogs_pkey Primary key Asc id

Check Constraints

Constraint Name Constraint
CompanyCreditInventoryLogs_amount_check ((amount > 0))
CompanyCreditInventoryLogs_finalBalance_check (("finalBalance" >= 0))

Relationships