feat(transaction): #66 implement transactions
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m49s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m29s

This commit was merged in pull request #72.
This commit is contained in:
2025-05-13 23:02:53 +02:00
parent c9ea9bd935
commit dbf272e3f3
19 changed files with 794 additions and 57 deletions

View File

@@ -17,21 +17,27 @@ type Transaction struct {
Id uuid.UUID
UserId uuid.UUID `db:"user_id"`
AccountId uuid.UUID `db:"account_id"`
// nil indicates that the transaction is not yet associated with a piggy bank
TreasureChestId *uuid.UUID `db:"treasure_chest_id"`
// The internal transaction is amove between e.g. an account and a piggy bank to execute a savings plan
Internal bool
// The value of the transacion. Negative for outgoing and positive for incoming
Value int64
Timestamp time.Time
Note string
Note string
// account id is only nil, if the transaction is a deposit to a treasure chest
AccountId *uuid.UUID `db:"account_id"`
TreasureChestId *uuid.UUID `db:"treasure_chest_id"`
// The value of the transacion. Negative for outgoing and positive for incoming transactions.
Value int64
CreatedAt time.Time `db:"created_at"`
CreatedBy uuid.UUID `db:"created_by"`
UpdatedAt *time.Time `db:"updated_at"`
UpdatedBy *uuid.UUID `db:"updated_by"`
}
type TransactionInput struct {
Id string
AccountId string
TreasureChestId string
Value string
Timestamp string
TimezoneOffsetMinutes string
Note string
}