customerModel

package
v0.0.0-...-e9ec6a3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	CPF       string          `gorm:"primaryKey;type:varchar(11)" json:"cpf"`
	Name      string          `json:"name"`
	Email     string          `gorm:"uniqueIndex" json:"email"`
	Phone     string          `json:"phone"`
	Job       string          `json:"job"`
	BirthDate string          `json:"birth_date"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt time.Time       `json:"updated_at"`
	Tags      []*tagModel.Tag `gorm:"many2many:customer_tags;ForeignKey:cpf;References:id;onDelete:CASCADE" json:"tags"`
	AddressID uuid.UUID       `gorm:"column:address_id;not null" json:"-"`
	Address   CustomerAddress `gorm:"foreignKey:AddressID" json:"address"`
}

type CustomerAddress

type CustomerAddress struct {
	ID           uuid.UUID `gorm:"primarykey" json:"id"`
	CEP          string    `gorm:"not null" json:"cep"`
	City         string    `gorm:"not null" json:"city"`
	Number       string    `gorm:"not null" json:"number"`
	Estate       string    `gorm:"not null" json:"estate"`
	StreetName   string    `json:"street_name"`
	Complement   string    `json:"complement"`
	Neighborhood string    `json:"neighborhood"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL