feat(cpone): support company patient fields
This commit is contained in:
@@ -66,6 +66,10 @@ func TestStoreMedrecValidPayloadAndCreatedResponseParity(t *testing.T) {
|
||||
"kecamatan":" KECAMATAN CONTOH ",
|
||||
"kelurahan":" KELURAHAN CONTOH ",
|
||||
"kode_pos":" 12345 ",
|
||||
"perusahaan_id":" PE260700001 ",
|
||||
"nik_karyawan":" TSB2026002 ",
|
||||
"dependant_id":"D001",
|
||||
"nama_karyawan":" Budi Santos ",
|
||||
"channel":" cpone "
|
||||
}`
|
||||
|
||||
@@ -93,6 +97,9 @@ func TestStoreMedrecValidPayloadAndCreatedResponseParity(t *testing.T) {
|
||||
if repo.params.Email != "budi@example.com" || repo.params.PlaceOfBirth != "JAKARTA" || repo.params.Channel != "CPONE" {
|
||||
t.Fatalf("text normalization mismatch: %+v", repo.params)
|
||||
}
|
||||
if repo.params.CompanyID != "PE260700001" || repo.params.EmployeeID != "TSB2026002" || repo.params.DependantID != "D001" || repo.params.EmployeeName != "Budi Santos" {
|
||||
t.Fatalf("company patient fields mismatch: %+v", repo.params)
|
||||
}
|
||||
if repo.params.DateOfBirth.Format("2006-01-02") != "1990-01-15" {
|
||||
t.Fatalf("birth date mismatch: %s", repo.params.DateOfBirth)
|
||||
}
|
||||
@@ -125,6 +132,7 @@ func TestStoreMedrecValidationParity(t *testing.T) {
|
||||
{name: "missing phone", mutate: func(p map[string]any) { delete(p, "telepon") }, message: "Telepon atau ponsel wajib diisi"},
|
||||
{name: "invalid email", mutate: func(p map[string]any) { p["email"] = "invalid" }, message: "The email must be a valid email address."},
|
||||
{name: "long hospital code", mutate: func(p map[string]any) { p["rs"] = strings.Repeat("X", 21) }, message: "The rs must not be greater than 20 characters."},
|
||||
{name: "long dependant id", mutate: func(p map[string]any) { p["dependant_id"] = "D0001" }, message: "The dependant id must not be greater than 4 characters."},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
|
||||
Reference in New Issue
Block a user