Use CPONE user name for HIS LoginBuat

This commit is contained in:
2026-09-25 22:09:05 +07:00
parent 20ec75fbcf
commit 0d2044926e
22 changed files with 127 additions and 47 deletions

View File

@@ -69,7 +69,8 @@ func TestStoreMedrecValidPayloadAndCreatedResponseParity(t *testing.T) {
"nik_karyawan":" TSB2026002 ",
"dependant_id":"D001",
"nama_karyawan":" Budi Santos ",
"channel":" cpone "
"channel":" cpone ",
"login_buat":" Joko Hudoro "
}`
request := httptest.NewRequest(http.MethodPost, "/api/cpone/patients/medrec", strings.NewReader(body))
@@ -93,7 +94,7 @@ func TestStoreMedrecValidPayloadAndCreatedResponseParity(t *testing.T) {
if repo.params.Phone != "081234567890" || repo.params.Mobile != "081234567890" {
t.Fatalf("phone normalization mismatch: %+v", repo.params)
}
if repo.params.Email != "budi@example.com" || repo.params.PlaceOfBirth != "JAKARTA" || repo.params.Channel != "CPONE" {
if repo.params.Email != "budi@example.com" || repo.params.PlaceOfBirth != "JAKARTA" || repo.params.Channel != "CPONE" || repo.params.LoginBuat != "Joko Hudoro" {
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" {
@@ -112,6 +113,7 @@ func TestStoreMedrecValidationParity(t *testing.T) {
"jenis_nomer_sosial": "KTP",
"nomer_sosial": "3174011501900001",
"telepon": "081234567890",
"login_buat": "Joko Hudoro",
}
tomorrow := time.Now().AddDate(0, 0, 1).Format("2006-01-02")
@@ -168,7 +170,7 @@ func TestStoreMedrecNikFallbackAndOutcomeForwarding(t *testing.T) {
Data: data,
}}
handler := Handler{patientRepo: repo}
body := `{"nama":"BUDI","jenis_kelamin":"P","tgl_lahir":"1990-01-15","nik":"3174011501900001","ponsel":"08123"}`
body := `{"nama":"BUDI","jenis_kelamin":"P","tgl_lahir":"1990-01-15","nik":"3174011501900001","ponsel":"08123","login_buat":"Joko Hudoro"}`
request := httptest.NewRequest(http.MethodPost, "/api/cpone/patients/medrec", strings.NewReader(body))
recorder := httptest.NewRecorder()
handler.StoreMedrec(recorder, request)
@@ -180,7 +182,7 @@ func TestStoreMedrecNikFallbackAndOutcomeForwarding(t *testing.T) {
func TestStoreMedrecRepositoryErrorParity(t *testing.T) {
handler := Handler{patientRepo: &fakePatientRepository{err: errors.New("database unavailable")}}
body := `{"nama":"BUDI","jenis_kelamin":"L","tgl_lahir":"1990-01-15","nomer_sosial":"3174011501900001","telepon":"08123"}`
body := `{"nama":"BUDI","jenis_kelamin":"L","tgl_lahir":"1990-01-15","nomer_sosial":"3174011501900001","telepon":"08123","login_buat":"Joko Hudoro"}`
request := httptest.NewRequest(http.MethodPost, "/api/cpone/patients/medrec", strings.NewReader(body))
recorder := httptest.NewRecorder()
handler.StoreMedrec(recorder, request)