modified: main_dc/yalarba/api_yal/go.mod

modified:   main_dc/yalarba/api_yal/go.sum
	renamed:    main_dc/yalarba/api_es/internal/models/new/account.go -> main_dc/yalarba/api_yal/internal/models/account.go
	renamed:    main_dc/yalarba/api_es/internal/models/new/base.go -> main_dc/yalarba/api_yal/internal/models/base.go
	renamed:    main_dc/yalarba/api_es/internal/models/new/update_history.go -> main_dc/yalarba/api_yal/internal/models/update_history.go
moove new models for full api
This commit is contained in:
2026-02-02 03:58:09 +05:00
parent 46d11edfe0
commit c106fc3921
5 changed files with 16 additions and 0 deletions
@@ -1,29 +0,0 @@
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
}
@@ -1,14 +0,0 @@
package models
import (
"gorm.io/gorm"
"time"
)
type Base struct {
ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
UpdateHistories []UpdateHistory `gorm:"polymorphic:Model" json:"-"`
}
@@ -1,13 +0,0 @@
package models
import (
"time"
)
type UpdateHistory struct {
ID uint `gorm:"primaryKey" json:"id,omitempty"`
ModelID uint `json:"model_id"`
ModelType string `json:"model_type"`
Timestamp time.Time `json:"timestamp"`
UpdatedBy uint `gorm:"index" json:"updated_by"`
}