Files
tp/main_dc/yalarba/api_yal/internal/models/account.go
T
valitovgaziz 49b9805cbe modified: main_dc/yalarba/api_yal/internal/database/psql_db.go
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
2026-02-11 06:30:14 +05:00

34 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"` // Обратная связь
}