model

package
v0.0.0-...-df4a25f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyPassword

func VerifyPassword(passwordHashed string, password string) error

Types

type Customer

type Customer struct {
	gorm.Model
	FirstName   string `json:"first_name" gorm:"size:70;not null"`
	LastName    string `json:"last_name" gorm:"size:70;not null"`
	DNI         string `json:"dni" gorm:"size:15;unique;not null"`
	Email       string `json:"email" gorm:"size:100;unique;not null"`
	PhoneNumber string `json:"phone_number" gorm:"unique;size:15"`
	PetID       uint   `json:"pet_id" gorm:"index" validate:"required"`
	Pet         Pet    `json:"-" gorm:"foreignKey:PetID;constraint:OnDelete:CASCADE"`
}

type Employee

type Employee struct {
	gorm.Model
	FirstName    string       `json:"first_name" gorm:"size:70;not null" validate:"required,min=2,max=70"`
	LastName     string       `json:"last_name" gorm:"size:70;not null" validate:"required,min=3,max=90"`
	DNI          string       `json:"dni" gorm:"size:15;unique;not null" validate:"required,max=70"`
	Email        string       `json:"email" gorm:"size:100;unique;not null" validate:"required,email"`
	PhoneNumber  string       `json:"phone_number" gorm:"unique;size:15" validate:"required,numeric"`
	Direction    string       `json:"direction" gorm:"size:100" validate:"required,max=100"`
	BirthDate    time.Time    `json:"-" gorm:"not null"`
	BirthDateRaw string       `json:"birth_date" validate:"required"`
	TypeID       uint         `json:"type_id" gorm:"index" validate:"required"`
	EmployeeType EmployeeType `json:"employee_type" gorm:"foreignKey:TypeID"`
}

type EmployeeType

type EmployeeType struct {
	gorm.Model
	Name string `json:"name" gorm:"unique;not null;size:20"`
}

type Pet

type Pet struct {
	gorm.Model
	Name   string  `json:"name" gorm:"size:70"`
	Specie string  `json:"specie" gorm:"size:50"`
	Gender string  `json:"gender" gorm:"size:10"`
	Race   string  `json:"race" gorm:"size:50"`
	Age    uint    `json:"age"`
	Weight float64 `json:"weight"`
}

type User

type User struct {
	gorm.Model
	Email    string `json:"email" gorm:"size:100;unique;not_null"`
	Password string `json:"password" gorm:"size:100"`
	IsAdmin  bool   `json:"is_admin" gorm:"dafault:false"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳