diff --git a/docs/spec/components/schemas/Form.yaml b/docs/spec/components/schemas/Form.yaml index 6e5d9f4..72d40e0 100644 --- a/docs/spec/components/schemas/Form.yaml +++ b/docs/spec/components/schemas/Form.yaml @@ -35,7 +35,6 @@ allOf: type: string id_num: type: string - pattern: '[0-9]+' birthday: type: string description: DD-MM-YYYY format @@ -53,7 +52,6 @@ allOf: type: string postal: type: string - pattern: '[0-9]{5}' phone: type: string email: diff --git a/docs/spec/components/schemas/SubmitForm.yaml b/docs/spec/components/schemas/SubmitForm.yaml index 9141571..afe45db 100644 --- a/docs/spec/components/schemas/SubmitForm.yaml +++ b/docs/spec/components/schemas/SubmitForm.yaml @@ -31,7 +31,6 @@ allOf: type: string birthday: type: string - description: DD-MM-YYYY format citizen: type: string visited: @@ -46,7 +45,6 @@ allOf: type: string postal: type: string - pattern: '[0-9]{5}' phone: type: string email: diff --git a/internal/service/requests/submit_form.go b/internal/service/requests/submit_form.go index af388df..409aef3 100644 --- a/internal/service/requests/submit_form.go +++ b/internal/service/requests/submit_form.go @@ -23,15 +23,15 @@ func NewSubmitForm(r *http.Request) (req resources.SubmitFormRequest, err error) "data/type": validation.Validate(req.Data.Type, validation.Required, validation.In(resources.SUBMIT_FORM)), "data/attributes/name": validation.Validate(req.Data.Attributes.Name, validation.Required), "data/attributes/surname": validation.Validate(req.Data.Attributes.Surname, validation.Required), - "data/attributes/id_num": validation.Validate(req.Data.Attributes.IdNum, validation.Required, is.Digit), - "data/attributes/birthday": validation.Validate(req.Data.Attributes.Birthday, validation.Required, validation.Date("01-02-2006")), + "data/attributes/id_num": validation.Validate(req.Data.Attributes.IdNum, validation.Required), + "data/attributes/birthday": validation.Validate(req.Data.Attributes.Birthday, validation.Required), "data/attributes/citizen": validation.Validate(req.Data.Attributes.Citizen, validation.Required), "data/attributes/visited": validation.Validate(req.Data.Attributes.Visited, validation.Required), "data/attributes/purpose": validation.Validate(req.Data.Attributes.Purpose, validation.Required), "data/attributes/country": validation.Validate(req.Data.Attributes.Country, validation.Required), "data/attributes/city": validation.Validate(req.Data.Attributes.City, validation.Required), "data/attributes/address": validation.Validate(req.Data.Attributes.Address, validation.Required), - "data/attributes/postal": validation.Validate(req.Data.Attributes.Postal, validation.Required, is.Digit, validation.Length(5, 5)), + "data/attributes/postal": validation.Validate(req.Data.Attributes.Postal, validation.Required), "data/attributes/phone": validation.Validate(req.Data.Attributes.Phone, validation.Required), "data/attributes/email": validation.Validate(req.Data.Attributes.Email, validation.Required, is.Email), "data/attributes/image": validation.Validate(req.Data.Attributes.Image, validation.Required, is.Base64, validation.Length(0, maxImageSize)),