RecurringCreditTopUp


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 gen_random_uuid()
creditProductPurchaseOrderId uuid 2147483647 null
CreditProductPurchaseOrders.id RecurringCreditTopUp_creditProductPurchaseOrderId_fkey C
amount int4 10 null
frequency "employer_purchases"."enum_employer_purchases_recurring_credit_frequency" 2147483647 null
nextAllocationDate timestamptz 35,6 null
startDate timestamptz 35,6 now()
endDate timestamptz 35,6 null
createdAt timestamptz 35,6 now()
updatedAt timestamptz 35,6 now()
timePeriod int4 10 null
timePeriodUnit "employer_purchases"."enum_employer_purchases_timePeriodUnit" 2147483647 null
alreadyAllocatedCount int4 10 null

Denotes the number of times allocation already happened

companyId uuid 2147483647 null
Companies.id RecurringCreditTopUp_companyId_fkey C
productId uuid 2147483647 null
Products.id RecurringCreditTopUp_productId_fkey C
offlineSalesTransactionId uuid 2147483647 null
OfflineSalesTransactions.id RecurringCreditTopUp_offlineSalesTransactionId_fkey C

Indexes

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

Check Constraints

Constraint Name Constraint
timePeriod_and_timePeriodUnit_check (((("timePeriod" IS NOT NULL) AND ("timePeriod" > 0) AND ("timePeriodUnit" IS NOT NULL)) OR (("timePeriod" IS NULL) AND ("timePeriodUnit" IS NULL))))
RecurringCreditTopUp_creditProductPurchaseOrderId_offlineSalesT ((("creditProductPurchaseOrderId" IS NOT NULL) OR ("offlineSalesTransactionId" IS NOT NULL)))
RecurringCreditTopUp_nextAllocationDate_less_than_equal_endDate ((("nextAllocationDate" IS NULL) OR (("nextAllocationDate" >= "startDate") AND ("nextAllocationDate" < "endDate"))))
RecurringCreditTopUp_amount_check ((amount > 0))
RecurringCreditTopUp_startDate_less_than_equal_endDate_check (("startDate" < "endDate"))

Relationships