PointsJournalEntryDebitCredits


Columns

Column Type Size Nulls Auto Default Children Parents Comments
pointsJournalEntryId uuid 2147483647 null
PointsJournalEntries.id PointsTopUpJournalEntryDebitCredits_pointsJournalEntryId_fkey R
pointsAccountId uuid 2147483647 null
PointsAccounts.id PointsTopUpJournalEntryDebitCredits_pointsAccountId_fkey R
debit numeric 0 null

points debited from PointsAccount in this journal entry. If null, no points were debited.

credit numeric 0 null

points credited from PointsAccount in this journal entry. If null, no points were credited.

finalAccountBalance numeric 0 null

The final balance of the PointsAccount after this journal entry.

Indexes

Constraint Name Type Sort Column(s)
PointsTopUpJournalEntryDebitCredits_pkey Primary key Asc/Asc pointsJournalEntryId + pointsAccountId

Check Constraints

Constraint Name Constraint
PointsTopUpJournalEntryDebitCredits_finalAccountBalance_check (("finalAccountBalance" >= (0)::numeric))
PointsJournalEntryDebitCredits_check ((((debit IS NOT NULL) AND (debit >= (0)::numeric) AND (credit IS NULL)) OR ((credit IS NOT NULL) AND (credit >= (0)::numeric) AND (debit IS NULL))))

Relationships