mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
22 lines
495 B
Go
22 lines
495 B
Go
package model
|
|
|
|
type TransactionType struct {
|
|
tableName struct{} `pg:"transactionTypes,alias:transactionTypes"`
|
|
BaseModel
|
|
Name string `json:"name" pg:"name"`
|
|
Type string `json:"type" pg:"type,notnull"`
|
|
}
|
|
|
|
type NewTransactionTypeBody struct {
|
|
Name string `json:"name" form:"name"`
|
|
Type string `json:"type" form:"type"`
|
|
}
|
|
|
|
func (body *NewTransactionTypeBody) ToTransactionType() *TransactionType {
|
|
tm := new(TransactionType)
|
|
tm.Init()
|
|
tm.Name = body.Name
|
|
tm.Type = body.Type
|
|
return tm
|
|
}
|