Documentation ¶
Index ¶
- Variables
- func Delete(ctx context.Context, dbConn *gorm.DB, courtID string) error
- func ValidID(ctx context.Context, dbConn *gorm.DB, courtID int) bool
- type Court
- func Create(ctx context.Context, dbConn *gorm.DB, newCourt *NewCourt) (*Court, error)
- func Read(ctx context.Context, dbConn *gorm.DB) ([]*Court, error)
- func Update(ctx context.Context, dbConn *gorm.DB, updateCourt *UpdateCourt, courtID string) (*Court, error)
- func UpdateActive(ctx context.Context, dbConn *gorm.DB, courtID, status string) (*Court, error)
- type NewCourt
- type UpdateCourt
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCourt = errors.New("invalid court")
)
View Source
var Table = "courts"
Functions ¶
Types ¶
type Court ¶
type Court struct { ID int `json:"id" gorm:"primary_key;unique;not null"` Name string `json:"name" gorm:"not null"` IsActive bool `json:"is_active" gorm:"default:false;not null"` IsDeleted bool `json:"is_deleted" gorm:"default:false;not null"` CreatedAt time.Time `json:"created_at" gorm:"default:CURRENT_TIMESTAMP;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"default:CURRENT_TIMESTAMP;not null"` DeletedAt time.Time `json:"deleted_at" gorm:"default:null"` }
Court contains the schema for specific identity
type UpdateCourt ¶
type UpdateCourt struct {
Name string `json:"name"`
}
UpdateCourt contains the schema to update existing identity
Click to show internal directories.
Click to hide internal directories.