Fix obligation validations
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Bryan Frimin
parent
2dade8236b
commit
bd36ed6bb9
@@ -66,8 +66,8 @@ func (cor *CreateObligationRequest) Validate() error {
|
||||
v.Check(cor.OrganizationID, "organization_id", validator.Required(), validator.GID(coredata.OrganizationEntityType))
|
||||
v.Check(cor.Area, "area", validator.SafeText(TitleMaxLength))
|
||||
v.Check(cor.Source, "source", validator.SafeText(TitleMaxLength))
|
||||
v.Check(cor.Requirement, "requirement", validator.SafeText(TitleMaxLength))
|
||||
v.Check(cor.ActionsToBeImplemented, "actions_to_be_implemented", validator.SafeText(TitleMaxLength))
|
||||
v.Check(cor.Requirement, "requirement", validator.SafeText(ContentMaxLength))
|
||||
v.Check(cor.ActionsToBeImplemented, "actions_to_be_implemented", validator.SafeText(ContentMaxLength))
|
||||
v.Check(cor.Regulator, "regulator", validator.SafeText(TitleMaxLength))
|
||||
v.Check(cor.OwnerID, "owner_id", validator.Required(), validator.GID(coredata.PeopleEntityType))
|
||||
v.Check(cor.Status, "status", validator.OneOfSlice(coredata.ObligationStatuses()))
|
||||
@@ -82,8 +82,8 @@ func (uor *UpdateObligationRequest) Validate() error {
|
||||
v.Check(uor.ID, "id", validator.Required(), validator.GID(coredata.ObligationEntityType))
|
||||
v.Check(uor.Area, "area", validator.SafeText(NameMaxLength))
|
||||
v.Check(uor.Source, "source", validator.SafeText(NameMaxLength))
|
||||
v.Check(uor.Requirement, "requirement", validator.SafeText(NameMaxLength))
|
||||
v.Check(uor.ActionsToBeImplemented, "actions_to_be_implemented", validator.SafeText(NameMaxLength))
|
||||
v.Check(uor.Requirement, "requirement", validator.SafeText(ContentMaxLength))
|
||||
v.Check(uor.ActionsToBeImplemented, "actions_to_be_implemented", validator.SafeText(ContentMaxLength))
|
||||
v.Check(uor.Regulator, "regulator", validator.SafeText(NameMaxLength))
|
||||
v.Check(uor.OwnerID, "owner_id", validator.GID(coredata.PeopleEntityType))
|
||||
v.Check(uor.Status, "status", validator.OneOfSlice(coredata.ObligationStatuses()))
|
||||
|
||||
Reference in New Issue
Block a user