It adds the method to the OpenAPI spec and generates a new server config. The requirement for the ID on the Transaction component is removed, so that it can be reused for insertions. It also adds two new middlewares, a logging and a spec validator. If a request does not follow the spec, a 400 is returned immediately. Issue: #18
28 lines
382 B
Go
28 lines
382 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
const InvalidId uint64 = 0
|
|
|
|
type Transaction struct {
|
|
Id uint64
|
|
Date time.Time
|
|
Description string
|
|
Value decimal.Decimal
|
|
}
|
|
|
|
type Transactions = []Transaction
|
|
|
|
type Bank struct {
|
|
Id string
|
|
Name string
|
|
NordigenId uuid.UUID
|
|
}
|
|
|
|
type Banks = []Bank
|