schemas

package
v0.0.0-...-565acca Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashPassword

func HashPassword(password string) (string, error)

HashPassword

Types

type CardFidelity

type CardFidelity struct {
	gorm.Model
	UserId      uint
	CompanyId   uint
	TotalPoints int
	Finished    bool
	Point       []Point
}

type CardFidelityResponse

type CardFidelityResponse struct {
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	DeletedAt   time.Time `json:"deletedAt,omitempty"`
	UserId      uint      `json:"userId"`
	CompanyId   uint      `json:"companyId"`
	TotalPoints int       `json:"totalPoints"`
	Finished    bool      `json:"finished"`
	Point       []PointResponse
}

type Company

type Company struct {
	gorm.Model
	Name              string
	CNPJ              string
	Address           string
	AddressNumber     string
	AddressComplement string
	AddressCity       string
	AddressState      string
	AddressZipCode    string
	Users             []User
}

type CompanyResponse

type CompanyResponse struct {
	ID                uint      `json:"id"`
	CreatedAt         time.Time `json:"createdAt"`
	UpdatedAt         time.Time `json:"updatedAt"`
	DeletedAt         time.Time `json:"deletedAt,omitempty"`
	Name              string    `json:"name"`
	CNPJ              string    `json:"cnpj"`
	Address           string    `json:"address"`
	AddressNumber     string    `json:"addressNumber"`
	AddressComplement string    `json:"addressComplement"`
	AddressCity       string    `json:"addressCity"`
	AddressState      string    `json:"addressState"`
	AddressZipCode    string    `json:"addressZipCode"`
	Users             []UserResponse
}

type Point

type Point struct {
	gorm.Model
	CardFidelityId uint
	Point          int
}

type PointResponse

type PointResponse struct {
	ID             uint      `json:"id"`
	CreatedAt      time.Time `json:"createdAt"`
	UpdatedAt      time.Time `json:"updatedAt"`
	DeletedAt      time.Time `json:"deletedAt,omitempty"`
	CardFidelityId uint      `json:"cardFidelityId"`
	Point          int       `json:"point"`
}

type User

type User struct {
	gorm.Model
	Name      string
	Address   string
	Phone     string
	Email     string
	Password  string
	CompanyId uint
	Type      string
	Code      string
}

func (*User) ComparePassword

func (u *User) ComparePassword(password string) error

ComparePassword

func (*User) GenerateToken

func (u *User) GenerateToken() (string, error)

GenerateToken

type UserResponse

type UserResponse struct {
	ID        uint      `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	DeletedAt time.Time `json:"deletedAt,omitempty"`
	Name      string    `json:"name"`
	Address   string    `json:"address"`
	Phone     string    `json:"phone"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	CompanyId uint      `json:"companyId"`
	Type      string    `json:"type"`
	Code      string    `json:"code"`
}

Jump to

Keyboard shortcuts

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