feat/user: moved Registration to Registrator

This commit is contained in:
2025-12-09 16:18:36 +07:00
parent 36e65abfac
commit bd1d5bdde6
14 changed files with 105 additions and 69 deletions

No files matched your search

+27 -17
View File
@@ -13,23 +13,24 @@ import (
)
type CreateDto struct {
Name string `json:"name" validate:"maxLength=25"`
Password string `json:"password" validate:"maxLength=255"`
Name string `json:"name" validate:"required;maxLength=50"`
Password string `json:"password" validate:"required;maxLength=255"`
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20" validate:"required"`
Status_Code erc.UserStatusCode `json:"status_code" validate:"maxLength=10"`
Person_Id *uint `json:"-"`
Person *ep.UpdateDto `json:"person"`
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
PersonContacts []epc.UpdateDto `json:"personContacts"`
Code *string `json:"code" validate:"maxLength=20"`
Employee *EmployeUpdateDto `json:"employee"`
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
Infra_Code *string `json:"infra_code"`
Installation_Code *string `json:"installation_code"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
ContractPosition_Code erg.ContractPositionCode `json:"contractPosition_code" gorm:"not null;size:20"`
Employee *EmployeUpdateDto `json:"employee"`
Person *ep.UpdateDto `json:"person"`
PersonAddresses []epa.UpdateDto `json:"personAddresses"`
PersonContacts []epc.UpdateDto `json:"personContacts"`
Person_Id *uint `json:"-"`
Code *string `json:"code" validate:"maxLength=20"`
IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
Installation_Code *string `json:"installation_code"`
Unit_Code *string `json:"unit_code"`
Specialist_Code *string `json:"specialist_code"`
Subspecialist_Code *string `json:"subspecialist_code"`
Infra_Code *string `json:"infra_code"`
}
type ReadListDto struct {
@@ -88,11 +89,20 @@ func (d *User) ToResponse() ResponseDto {
type EmployeUpdateDto struct {
Id uint `json:"id"`
User_Id *uint `json:"-"`
Person_Id *uint `json:"-"`
Division_Code *string `json:"division_code"`
Number *string `json:"number" validate:"maxLength=20"`
Position_Code erg.EmployeePositionCode `json:"position_code" validate:"maxLength=20"`
Status_Code erc.ActiveStatusCode `json:"status_code" validate:"maxLength=10"`
Person_Id *uint `json:"-"`
// TODO: Extras
// Code *string `json:"code" validate:"maxLength=20"`
// IHS_Number *string `json:"ihs_number" validate:"maxLength=20"`
// SIP_Number *string `json:"sip_number" validate:"maxLength=20"`
// Installation_Code *string `json:"installation_code"`
// Unit_Code *string `json:"unit_code"`
// Specialist_Code *string `json:"specialist_code"`
// Subspecialist_Code *string `json:"subspecialist_code"`
// Infra_Code *string `json:"infra_code"`
}
func ToResponseList(data []User) []ResponseDto {