This patch introduces the Transaction entity. It also creates a placeholder Handle type with a Transactions method as a placeholder for the future DB adaptation. Incorporates the new types into the retriveTransactions HTTP handler.
18 lines
524 B
Go
18 lines
524 B
Go
package db
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.rosemyrtle.work/personal-finance/server/internal/model"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type Handle struct{}
|
|
|
|
func (*Handle) Transactions() []model.Transaction {
|
|
return []model.Transaction{
|
|
{Id: 1, Date: time.Date(2024, 01, 24, 0, 0, 0, 0, time.UTC), Description: "Groceries", Value: decimal.NewFromFloat(-50.0), Category: "Food"},
|
|
{Id: 2, Date: time.Date(2024, 01, 23, 0, 0, 0, 0, time.UTC), Description: "Salary", Value: decimal.NewFromFloat(3000.0), Category: "Income"},
|
|
}
|
|
}
|