diff --git a/internal/service/requests/submit_form.go b/internal/service/requests/submit_form.go index dfa98a4..af388df 100644 --- a/internal/service/requests/submit_form.go +++ b/internal/service/requests/submit_form.go @@ -21,17 +21,17 @@ func NewSubmitForm(r *http.Request) (req resources.SubmitFormRequest, err error) errs := validation.Errors{ "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, is.Alpha), - "data/attributes/surname": validation.Validate(req.Data.Attributes.Surname, validation.Required, is.Alpha), + "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/citizen": validation.Validate(req.Data.Attributes.Citizen, validation.Required, is.Alpha), + "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, is.Alpha), - "data/attributes/city": validation.Validate(req.Data.Attributes.City, validation.Required, is.Alpha), + "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), + "data/attributes/postal": validation.Validate(req.Data.Attributes.Postal, validation.Required, is.Digit, validation.Length(5, 5)), "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)),