From d5d8a84a9a49399eb11a2c9203dffa20685bb7ce Mon Sep 17 00:00:00 2001 From: Tim Wundenberg Date: Sun, 15 Jun 2025 12:51:29 +0200 Subject: [PATCH] wip --- internal/service/transaction.go | 12 ------------ internal/types/transaction.go | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/service/transaction.go b/internal/service/transaction.go index 9dada59..cabf5ed 100644 --- a/internal/service/transaction.go +++ b/internal/service/transaction.go @@ -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 := "" diff --git a/internal/types/transaction.go b/internal/types/transaction.go index b53d0c2..a4f8a9e 100644 --- a/internal/types/transaction.go +++ b/internal/types/transaction.go @@ -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"`