diff --git a/healthcrm_test.go b/healthcrm_test.go index 2b2dc9d..be3a951 100644 --- a/healthcrm_test.go +++ b/healthcrm_test.go @@ -1215,6 +1215,7 @@ func TestHealthCRMLib_CreateProfile(t *testing.T) { args: args{ ctx: context.Background(), profile: &ProfileInput{ + ProfileID: gofakeit.UUID(), FirstName: "TestProfile", LastName: "BikoTest", OtherName: "SteveTest", @@ -1268,26 +1269,10 @@ func TestHealthCRMLib_CreateProfile(t *testing.T) { path := fmt.Sprintf("%s/v1/identities/profiles/", BaseURL) httpmock.RegisterResponder(http.MethodPost, path, func(r *http.Request) (*http.Response, error) { resp := &ProfileOutput{ - FirstName: gofakeit.FirstName(), - LastName: gofakeit.LastName(), - OtherName: gofakeit.BeerName(), - DateOfBirth: gofakeit.Date().String(), - Gender: gofakeit.Gender(), - EnrolmentDate: gofakeit.Date().String(), + ID: gofakeit.UUID(), + ProfileID: "232422", + HealthID: "50932", SladeCode: "50202", - ServiceCode: "50", - Contacts: []*ProfileContactOutput{ - { - ContactType: "PHONE_NUMBER", - ContactValue: "+254788223223", - }, - }, - Identifiers: []*ProfileIdentifierOutput{ - { - IdentifierType: "SLADE_CODE", - IdentifierValue: "3243", - }, - }, } return httpmock.NewJsonResponse(http.StatusCreated, resp) }) @@ -1296,6 +1281,7 @@ func TestHealthCRMLib_CreateProfile(t *testing.T) { path := fmt.Sprintf("%s/v1/identities/profiles/", BaseURL) httpmock.RegisterResponder(http.MethodPost, path, func(r *http.Request) (*http.Response, error) { resp := &ProfileInput{ + ProfileID: gofakeit.UUID(), FirstName: gofakeit.FirstName(), LastName: gofakeit.LastName(), OtherName: gofakeit.BeerName(), diff --git a/input.go b/input.go index 083d680..b895165 100644 --- a/input.go +++ b/input.go @@ -81,6 +81,7 @@ type ServiceIdentifierInput struct { // ProfileInput is the host of users data or a brief description of a person type ProfileInput struct { + ProfileID string `json:"profile_id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` OtherName string `json:"other_name"` diff --git a/output.go b/output.go index afb005d..46495d4 100644 --- a/output.go +++ b/output.go @@ -100,35 +100,8 @@ type ServiceIdentifier struct { // ProfileOutput is used to display profile(s) type ProfileOutput struct { - ID string `json:"id,omitempty"` - Created string `json:"created,omitempty"` - Active bool `json:"active"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - OtherName string `json:"other_name"` - DateOfBirth string `json:"date_of_birth"` - Gender string `json:"gender"` - EnrolmentDate string `json:"enrolment_date"` - SladeCode string `json:"slade_code"` - ServiceCode string `json:"service_code"` - Contacts []*ProfileContactOutput `json:"contacts,omitempty"` - Identifiers []*ProfileIdentifierOutput `json:"identifiers,omitempty"` -} - -// ProfileContactOutput is used to show profile contacts -type ProfileContactOutput struct { - ID string `json:"id"` - ContactType string `json:"contact_type"` - ContactValue string `json:"contact_value"` - DateVerified string `json:"date_verified"` - Verified bool `json:"verifed,omitempty"` -} - -// ProfileIndentifierOutput is used to display profile identifiers -type ProfileIdentifierOutput struct { - ID string `json:"id"` - IdentifierType string `json:"identifier_type"` - IdentifierValue string `json:"identifier_value"` - ValidFrom string `json:"valid_from"` - ValidTo string `json:"valid_to"` + ID string `json:"id,omitempty"` + ProfileID string `json:"profile_id"` + HealthID string `json:"health_id"` + SladeCode string `json:"slade_code"` }