diff --git a/internal/models/consent.go b/internal/models/consent.go index 704abdd175bc7a700c59968c99e81efc5c6b9638..6a79ba09751d117a8421d4b14ab9155e21a3ea4b 100644 --- a/internal/models/consent.go +++ b/internal/models/consent.go @@ -16,7 +16,7 @@ type Consent struct { Firstname string `json:"firstname"` Lastname string `json:"lastname"` Address string `json:"address"` - PointID int `json:"pointID"` + PointID string `json:"pointID"` PostalCode string `json:"postalCode"` City string `json:"city"` SafetyBoarding bool `json:"safetyOnBoarding"` diff --git a/internal/rootmux/rootmux_test.go b/internal/rootmux/rootmux_test.go index 4df2c3cd619c89aacb271e73201bddcd3df9894c..4b0c1344bedbf05fc51dbe8c96599518c24e778f 100644 --- a/internal/rootmux/rootmux_test.go +++ b/internal/rootmux/rootmux_test.go @@ -30,9 +30,9 @@ var ( partnersInfoStr string customPopupInfo = models.CustomPopup{ID: 1, PopupEnabled: false, Title: "Alerte personnalisée", Description: "Ecolyo 4ever"} customPopupStr string - consent = models.Consent{Firstname: "Foo", Lastname: "Bar", PointID: 123456} + consent = models.Consent{Firstname: "Foo", Lastname: "Bar", PointID: "12345671234567"} consentStr string - otherConsent = models.Consent{Firstname: "John", Lastname: "Doe", PointID: 123789} + otherConsent = models.Consent{Firstname: "John", Lastname: "Doe", PointID: "01234560123456"} otherConsentStr string noH map[string]string ) @@ -272,11 +272,11 @@ func sgeTests(t *testing.T) { // Try to get first 50 consents (must pass) do("GET", "/api/admin/consent?limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`) // Try to search for both consent (must pass) - do("GET", "/api/admin/consent?search=123&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`) + do("GET", "/api/admin/consent?search=123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":2,"rows":[{"ID":2`) // Try to search for first point id (must pass) - do("GET", "/api/admin/consent?search=123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":1`) + do("GET", "/api/admin/consent?search=12345671234567&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":1`) // Try to search for second point id (must pass) - do("GET", "/api/admin/consent?search=123789&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":2`) + do("GET", "/api/admin/consent?search=01234560123456&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":1,"rows":[{"ID":2`) // Try to search for unknown point id (must pass empty) do("GET", "/api/admin/consent?search=000000&limit=50&page=0", xsrfHeader, "", http.StatusOK, `{"totalRows":0,"rows":[]`) // Try to delete a consent (must pass)