49b9805cbe
modified: main_dc/yalarba/api_yal/internal/models/account.go renamed: main_dc/yalarba/api_yal/internal/models/Object.go -> "main_dc/yalarba/api_yal/internal/models/\320\276bject.go" add Onwer Account ass foregn key into Object
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package models
|
||
|
||
import ()
|
||
|
||
type Account struct {
|
||
/*ID, CreatedAt, UpdatedAt, DeletedAt (Update's history)*/
|
||
Base Base `gorm:"embedded"`
|
||
|
||
// Основная информация
|
||
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
||
PasswordHash string `gorm:"not null" json:"-"`
|
||
FullName string `gorm:"not null;default:'Unknown'" json:"full_name"`
|
||
FirstName string `gorm:"not null;default:'FirstName'" json:"first_name"`
|
||
LastName string `gorm:"not null;default:'LastName'" json:"last_name"`
|
||
Phone string `json:"phone"`
|
||
City string `json:"city"`
|
||
|
||
// Бизнес информация (для владельцев объектов)
|
||
OrganizationForm string `json:"organization_form"` // ИП, ООО и т.д.
|
||
OrganizationName string `json:"organization_name"`
|
||
OrganizationShort string `json:"organization_short"`
|
||
INN string `json:"inn"` // ИНН организации
|
||
PersonalINN string `json:"personal_inn"` // Личный ИНН
|
||
|
||
// Статус
|
||
IsActive bool `gorm:"default:true" json:"is_active"`
|
||
IsVerified bool `gorm:"default:false" json:"is_verified"`
|
||
Role string `gorm:"default:user" json:"role"` // user, admin, moderator
|
||
|
||
|
||
// Связь: один Account имеет много Objects
|
||
Objects []Оbject `json:"objects"` // Обратная связь
|
||
}
|