models

package
v0.0.0-...-3b7be81 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyEmail = errors.New("empty email")
	ErrEmptyPhone = errors.New("empty phone")
)
View Source
var (
	ErrEmptyCredentials = errors.New("empty credentials")
)

Functions

This section is empty.

Types

type Act

type Act struct {
	ID               int            `json:"id" db:"id"`
	StaffID          int            `json:"staff_id" db:"staff_id"`
	StaffDesc        *Profile       `json:"staff_desc,omitempty"`
	SuperviserID     int            `json:"superviser_id" db:"superviser_id"`
	SuperviserDesc   *Profile       `json:"superviser_desc,omitempty"`
	ObjectID         int            `json:"object_id" db:"object_id"`
	ObjectDesc       *Object        `json:"object_desc,omitempty"`
	ReviewID         int            `json:"review_id" db:"review_id"`
	ReviewDesc       *Review        `json:"review_desc,omitempty"`
	EndAt            types.NullTime `json:"end_at" db:"end_at"`
	Finished         bool           `json:"finished" db:"finished"`
	Approved         bool           `json:"approved" db:"approved"`
	Reverted         bool           `json:"reverted" db:"reverted"`
	StaffSign        string         `json:"staff_sign" db:"staff_sign"`
	StaffSignAt      types.NullTime `json:"staff_sign_at" db:"staff_sign_at"`
	SuperviserSign   string         `json:"superviser_sign" db:"superviser_sign"`
	SuperviserSignAt types.NullTime `json:"superviser_sign_at" db:"superviser_sign_at"`
	ActDetailDesc    interface{}    `json:"act_detail_desc"`
	Meta             types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Act) SQLParamsRequest

func (u *Act) SQLParamsRequest() []string

type ActsDetail

type ActsDetail struct {
	ActID       int            `json:"act_id" db:"act_id"`
	ElementID   int            `json:"element_id" db:"element_id"`
	ElementDesc interface{}    `json:"element_desc"`
	Defects     types.NullMeta `json:"defects" db:"defects"`
	DefectsDesc interface{}    `json:"defects_desc"`
	Category    int            `json:"category" db:"category"`
	RepairedAt  types.NullTime `json:"repaired_at" db:"repaired_at"`
	Images      types.NullMeta `json:"images" db:"images"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*ActsDetail) SQLParamsRequest

func (u *ActsDetail) SQLParamsRequest() []string

type Category

type Category struct {
	ID           int            `json:"id" db:"id"`
	RapairPeriod int            `json:"rapair_period" db:"rapair_period"`
	Description  string         `json:"description" db:"description"`
	Meta         types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Category) SQLParamsRequest

func (u *Category) SQLParamsRequest() []string

type Credentials

type Credentials struct {
	Password string `json:"user_password"`
	Email    string `json:"user_email"`
	Phone    string `json:"user_phone"`
}

Credentials is a struct for check user

func (*Credentials) String

func (c *Credentials) String() string

func (*Credentials) Validate

func (c *Credentials) Validate() error

type Defect

type Defect struct {
	ID          int            `json:"id" db:"id"`
	ElementType int            `json:"element_type" db:"element_type"`
	Description string         `json:"description" db:"description"`
	Сategory    int            `json:"category" db:"category"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Defect) SQLParamsRequest

func (u *Defect) SQLParamsRequest() []string

type ElementEquipment

type ElementEquipment struct {
	ID          int            `json:"id" db:"id"`
	Description string         `json:"description" db:"description"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*ElementEquipment) SQLParamsRequest

func (u *ElementEquipment) SQLParamsRequest() []string

type ElementType

type ElementType struct {
	ID          int            `json:"id" db:"id"`
	Description string         `json:"description" db:"description"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*ElementType) SQLParamsRequest

func (u *ElementType) SQLParamsRequest() []string

type JournalItem

type JournalItem struct {
	FindAd          types.NullTime `json:"find_at"`
	ObjectDesc      *Object        `json:"object_desc"`
	ElementDesc     interface{}    `json:"element_desc"`
	ElementTypeDesk interface{}    `json:"element_type_desc"`
	DefectsDesc     interface{}    `json:"defects_desc"`
	StaffDesc       interface{}    `json:"staff_desc"`
	Category        int            `json:"category" db:"category"`
	RapairAt        types.NullTime `json:"repair_at" db:"repair_at"`
}

type NewCredentials

type NewCredentials struct {
	Password string     `json:"user_password"`
	Email    string     `json:"user_email"`
	Phone    string     `json:"user_phone"`
	Role     types.Role `json:"user_role"`
}

NewCredentials is a stuct for create user

func (*NewCredentials) String

func (c *NewCredentials) String() string

func (*NewCredentials) Validate

func (c *NewCredentials) Validate() error

type Object

type Object struct {
	ID      int            `json:"id" db:"id"`
	Address string         `json:"object_address" db:"object_address"`
	Name    string         `json:"object_name" db:"object_name"`
	Meta    types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Object) SQLParamsRequest

func (o *Object) SQLParamsRequest() []string

type ObjectsDetail

type ObjectsDetail struct {
	ObjectID        int            `json:"object_id" db:"object_id"`
	ElementID       int            `json:"element_id" db:"element_id"`
	ElementName     string         `json:"element_name" db:"element_name"`
	ElementType     int            `json:"element_type" db:"element_type"`
	ElementEqupment int            `json:"element_equipment" db:"element_equipment"`
	Meta            types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*ObjectsDetail) SQLParamsRequest

func (u *ObjectsDetail) SQLParamsRequest() []string

type Order

type Order struct {
	ID               int            `json:"id" db:"id"`
	ObjectID         int            `json:"object_id" db:"object_id"`
	ObjectDesc       *Object        `json:"object_desc"`
	TechTasksDesc    interface{}    `json:"tech_tasks_desk"`
	SuperviserDesc   *Profile       `json:"superviser_desc"`
	TechTasks        types.NullMeta `json:"tech_tasks" db:"tech_tasks"`
	SuperviserID     int            `json:"superviser_id" db:"superviser_id"`
	StartAt          types.NullTime `json:"start_at" db:"start_at"`
	EndAt            types.NullTime `json:"end_at" db:"end_at"`
	StaffID          int            `json:"staff_id" db:"staff_id"`
	StaffDesc        *Profile       `json:"staff_desc"`
	SuperviserSign   string         `json:"superviser_sign" db:"superviser_sign"`
	SuperviserSignEt types.NullTime `json:"superviser_sign_at" db:"superviser_sign_at"`
	StaffSign        string         `json:"staff_sign" db:"staff_sign"`
	StaffSignEt      types.NullTime `json:"staff_sign_at" db:"staff_sign_at"`
	Meta             types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Order) SQLParamsRequest

func (u *Order) SQLParamsRequest() []string

type Profile

type Profile struct {
	ID               int            `json:"id" db:"id"`
	FirstName        string         `json:"user_first_name" db:"user_first_name"`
	MiddleName       string         `json:"user_middle_name" db:"user_middle_name"`
	LastName         string         `json:"user_last_name" db:"user_last_name"`
	Position         string         `json:"user_position" db:"user_position"`
	Company          string         `json:"user_company" db:"user_company"`
	UserElectroGroup string         `json:"user_electro_group" db:"user_electro_group"`
	PrivateKey       string         `json:"-" db:"user_private_key"`
	PublicKey        string         `json:"user_public_key" db:"user_public_key"`
	Meta             types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Profile) SQLParamsRequest

func (u *Profile) SQLParamsRequest() []string

type Review

type Review struct {
	ID          int            `json:"id" db:"id"`
	Description string         `json:"description" db:"description"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Review) SQLParamsRequest

func (u *Review) SQLParamsRequest() []string
type Search struct {
	Value     string                 `json:"value"`
	ExtFilter map[string]interface{} `json:"ext_filter"`
}

type Session

type Session struct {
	ID     string         `json:"id" db:"id"`
	UserID int            `json:"user_id" db:"user_id"`
	Meta   types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*Session) SQLParamsRequest

func (s *Session) SQLParamsRequest() []string

type TechTask

type TechTask struct {
	ID          int            `json:"id" db:"id"`
	Description string         `json:"description" db:"description"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*TechTask) SQLParamsRequest

func (o *TechTask) SQLParamsRequest() []string

type TechTasks

type TechTasks struct {
	ID          int            `json:"id" db:"id"`
	Description string         `json:"description" db:"description"`
	Meta        types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*TechTasks) SQLParamsRequest

func (u *TechTasks) SQLParamsRequest() []string

type TimeRange

type TimeRange struct {
	TimeStart types.NullTime `json:"time_start"`
	TimeEnd   types.NullTime `json:"time_end"`
}

type Timestamp

type Timestamp struct {
	CreatedAt types.NullTime `json:"created_at" db:"created_at"`
	UpdatedAt types.NullTime `json:"updated_at" db:"updated_at"`
	DeletedAt types.NullTime `json:"deleted_at" db:"deleted_at"`
}

func (*Timestamp) CreateTimestamp

func (t *Timestamp) CreateTimestamp()

func (*Timestamp) DeleteTimestamp

func (t *Timestamp) DeleteTimestamp()

func (*Timestamp) UpdateTimestamp

func (t *Timestamp) UpdateTimestamp()

type UpdateCredentials

type UpdateCredentials struct {
	Password    string `json:"user_password"`
	OldPassword string `json:"user_old_password"`
}

UpdateCredentials is a structs for update user's Credentials

func (*UpdateCredentials) Validate

func (c *UpdateCredentials) Validate() error

type User

type User struct {
	ID    int            `json:"id" db:"id"`
	Hash  string         `json:"-" db:"user_hash"`
	Role  types.Role     `json:"user_role" db:"user_role"`
	Email string         `json:"user_email" db:"user_email"`
	Phone string         `json:"user_phone" db:"user_phone"`
	Meta  types.NullMeta `json:"meta" db:"meta"`
	Timestamp
}

func (*User) SQLParamsRequest

func (u *User) SQLParamsRequest() []string

func (*User) Validate

func (u *User) Validate() error

Jump to

Keyboard shortcuts

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