seeder ongoing

This commit is contained in:
vanilia
2025-12-11 20:22:37 +07:00
parent 233918cecf
commit bc1209a270
2 changed files with 16 additions and 5 deletions
@@ -889,7 +889,7 @@ func ApproveSwitchSpecialist(input e.ApproveCancelSpecialistDto) (*d.Data, error
}
// Set doctor_code; nil indicates no change.
if input.Dst_Doctor_Code == nil {
if input.Dst_Doctor_Code == nil || *input.Dst_Doctor_Code == "" {
input.Dst_Doctor_Code = irData.Doctor_Code
}
@@ -27,14 +27,25 @@ func SeedSpecialist(event *pl.Event, tx *db.Dualtx) error {
return err
}
// Mapping To Installation
// Mapping To Specialist
var speData []es.CreateDto
for _, v := range ruang {
if v.StAktif == 0 {
continue
}
speCode := strconv.Itoa(int(v.No))
var insCode string
if v.KdUnit != 0 {
code := strconv.Itoa(v.KdUnit)
insCode = code
}
codeString := strconv.Itoa(int(v.No))
speData = append(speData, es.CreateDto{
Code: codeString,
Name: v.Nama,
Code: speCode,
Name: v.Nama,
Installation_Code: insCode,
})
}