feat(transaction): #66 implement transactions
This commit was merged in pull request #72.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user