Merge branch 'migration' of https://github.com/dikstub-rssa/simrs-be into migration-vanilia
This commit is contained in:
+6
-6
@@ -1,4 +1,4 @@
|
||||
package doctor
|
||||
package registrator
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
@@ -23,9 +23,9 @@ type FilterDto struct {
|
||||
}
|
||||
|
||||
type ReadDetailDto struct {
|
||||
Id *uint16 `json:"id"`
|
||||
Code *string `json:"code"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Id *uint `json:"id"`
|
||||
Employee_Id *uint `json:"employee_id"`
|
||||
Includes string `json:"includes"`
|
||||
}
|
||||
|
||||
type UpdateDto struct {
|
||||
@@ -51,7 +51,7 @@ type ResponseDto struct {
|
||||
Installation *ei.Installation `json:"installation,omitempty"`
|
||||
}
|
||||
|
||||
func (d Registration) ToResponse() ResponseDto {
|
||||
func (d Registrator) ToResponse() ResponseDto {
|
||||
resp := ResponseDto{
|
||||
Employee_Id: d.Employee_Id,
|
||||
Employee: d.Employee,
|
||||
@@ -62,7 +62,7 @@ func (d Registration) ToResponse() ResponseDto {
|
||||
return resp
|
||||
}
|
||||
|
||||
func ToResponseList(data []Registration) []ResponseDto {
|
||||
func ToResponseList(data []Registrator) []ResponseDto {
|
||||
resp := make([]ResponseDto, len(data))
|
||||
for i, u := range data {
|
||||
resp[i] = u.ToResponse()
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package doctor
|
||||
package registrator
|
||||
|
||||
import (
|
||||
ecore "simrs-vx/internal/domain/base-entities/core"
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
ei "simrs-vx/internal/domain/main-entities/installation"
|
||||
)
|
||||
|
||||
type Registration struct {
|
||||
type Registrator struct {
|
||||
ecore.Main // adjust this according to the needs
|
||||
Employee_Id uint `json:"employee_id"`
|
||||
Employee *ee.Employee `json:"employee,omitempty" gorm:"foreignKey:Employee_Id;references:Id"`
|
||||
@@ -13,22 +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"`
|
||||
Unit_Code *string `json:"unit_code"`
|
||||
Infra_Code *string `json:"infra_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 {
|
||||
@@ -87,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 {
|
||||
|
||||
Reference in New Issue
Block a user