Discover Packages
github.com/patricksferraz/loyalty-card
domain
entity
package
Version:
v0.0.0-...-cab7180
Opens a new window with list of versions in this module.
Published: Mar 23, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Base struct {
ID *string `json:"id" gorm:"type:uuid;primaryKey" valid:"uuid"`
CreatedAt *time .Time `json:"created_at" gorm:"column:created_at;autoUpdateTime" valid:"required"`
UpdatedAt *time .Time `json:"updated_at" gorm:"column:updated_at;autoCreateTime" valid:"-"`
}
type FilterTag struct {
Name *string `json:"name" valid:"-"`
}
type Guest struct {
Base `json:",inline" valid:"-"`
Name *string `json:"name" gorm:"column:name;not null" valid:"required"`
Doc *string `json:"doc,omitempty" gorm:"column:doc;type:varchar(15);unique" valid:"doc"`
}
type Score struct {
Base `json:",inline" valid:"-"`
Date *time .Time `json:"date" gorm:"column:date;not null" valid:"required"`
Description *string `json:"description,omitempty" gorm:"column:description;type:varchar(255)" valid:"-"`
WasUsed *bool `json:"was_used" gorm:"column:was_used;not null" valid:"-"`
UsedIn *time .Time `json:"used_in,omitempty" gorm:"column:used_in" valid:"-"`
Tags []*Tag `json:"tags,omitempty" gorm:"many2many:scores_tags" valid:"-"`
GuestID *string `json:"guest_id" gorm:"column:guest_id;type:uuid;not null" valid:"uuid"`
Guest *Guest `json:"-" valid:"-"`
}
type Tag struct {
Base `json:",inline" valid:"-"`
Name *string `json:"name" gorm:"column:name;not null;unique" valid:"required"`
Scores []*Score `json:"scores,omitempty" gorm:"many2many:scores_tags" valid:"-"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.