This commit is contained in:
2025-06-15 12:51:29 +02:00
parent cdeb03e8c9
commit d5d8a84a9a
2 changed files with 13 additions and 12 deletions

View File

@@ -512,18 +512,6 @@ func (s TransactionImpl) validateAndEnrichTransaction(ctx context.Context, tx *s
return &transaction, nil
}
// There are the following constallations and their explanation:
//
// Account | TreasureChest | Value | Description
// --------|---------------|-------|----------------
// Y | Y | + | Invalid
// Y | Y | - | Bought a good
// Y | N | + | Income
// Y | N | - | For moving money between accounts
// N | Y | + | Saving
// N | Y | - | For moving money between treasure chests
// N | N | + | Invalid
// N | N | - | Invalid
func (s TransactionImpl) updateErrors(t *types.Transaction) {
errorStr := ""

View File

@@ -13,6 +13,19 @@ import (
//
// If it becomes necessary to precalculate snapshots for performance reasons, this can be done in the future.
// But the transaction should always be the source of truth.
//
// There are the following constallations and their explanation:
//
// Account | TreasureChest | Value | Description
// --------|---------------|-------|----------------
// Y | Y | + | Invalid
// Y | Y | - | Expense
// Y | N | + | Deposit
// Y | N | - | Withdrawal (for moving between accounts)
// N | Y | + | Saving
// N | Y | - | Withdrawal (for moving between treasure chests)
// N | N | + | Invalid
// N | N | - | Invalid
type Transaction struct {
Id uuid.UUID `db:"id"`
UserId uuid.UUID `db:"user_id"`