wip
This commit is contained in:
@@ -512,18 +512,6 @@ func (s TransactionImpl) validateAndEnrichTransaction(ctx context.Context, tx *s
|
|||||||
return &transaction, nil
|
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) {
|
func (s TransactionImpl) updateErrors(t *types.Transaction) {
|
||||||
errorStr := ""
|
errorStr := ""
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,19 @@ import (
|
|||||||
//
|
//
|
||||||
// If it becomes necessary to precalculate snapshots for performance reasons, this can be done in the future.
|
// 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.
|
// 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 {
|
type Transaction struct {
|
||||||
Id uuid.UUID `db:"id"`
|
Id uuid.UUID `db:"id"`
|
||||||
UserId uuid.UUID `db:"user_id"`
|
UserId uuid.UUID `db:"user_id"`
|
||||||
|
|||||||
Reference in New Issue
Block a user