Files
wallet-go-api/pkg/model/subscriptionType.go
2022-10-07 23:48:35 +02:00

23 lines
505 B
Go

package model
type SubscriptionType struct {
tableName struct{} `pg:"subscriptionTypes,alias:subscriptionTypes"`
BaseModel
Name string `json:"name" pg:"name"`
Type string `json:"type" pg:"type,notnull"`
}
type NewSubscriptionTypeBody struct {
Name string `json:"name" form:"name"`
Type string `json:"type" form:"type"`
}
func (body *NewSubscriptionTypeBody) ToSubscriptionType() *SubscriptionType {
tm := new(SubscriptionType)
tm.Init()
tm.Name = body.Name
tm.Type = body.Type
return tm
}