package entity import ( "time" "github.com/google/uuid" ) type Clients struct { ID uuid.UUID `json:"id" gorm:"primaryKey;type:UUID"` Name string `json:"name" gorm:"type:varchar"` Slug string `json:"slug" gorm:"type:varchar;uniqueIndex"` Description *string `json:"description" gorm:"type:text"` ClientType string `json:"client_type" gorm:"type:varchar;default:'sub_client'"` // 'parent_client', 'sub_client', 'standalone' ParentClientId *uuid.UUID `json:"parent_client_id" gorm:"type:UUID;index"` ParentClient *Clients `json:"parent_client,omitempty" gorm:"foreignKey:ParentClientId;references:ID"` SubClients []Clients `json:"sub_clients,omitempty" gorm:"foreignKey:ParentClientId;references:ID"` // Additional tenant information fields LogoUrl *string `json:"logo_url" gorm:"type:varchar"` // Logo tenant URL LogoImagePath *string `json:"logo_image_path" gorm:"type:varchar"` // Logo image path in MinIO Address *string `json:"address" gorm:"type:text"` // Alamat PhoneNumber *string `json:"phone_number" gorm:"type:varchar"` // Nomor telepon Website *string `json:"website" gorm:"type:varchar"` // Website resmi // Metadata Settings *string `json:"settings" gorm:"type:jsonb"` // JSON for custom settings MaxUsers *int `json:"max_users" gorm:"type:int4"` // Limit for sub clients MaxStorage *int64 `json:"max_storage" gorm:"type:int8"` // In bytes CreatedById *uint `json:"created_by_id" gorm:"type:int4"` IsActive *bool `json:"is_active" gorm:"type:bool;default:true"` CreatedAt time.Time `json:"created_at" gorm:"default:now()"` UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"` }