Skip to content

Commit

Permalink
Validate witnessed at times on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
hawx committed Oct 8, 2024
1 parent d2cf075 commit 747c7a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/schemas/2024-10/donor-details.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"donor",
"attorneys",
"certificateProvider",
"signedAt"
"signedAt",
"witnessedByCertificateProviderAt"
],
"properties": {
"lpaType": {
Expand Down
4 changes: 2 additions & 2 deletions lambda/create/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func Validate(lpa shared.LpaInit) []shared.FieldError {
validate.IsValid("/whenTheLpaCanBeUsed", lpa.WhenTheLpaCanBeUsed),
validate.Unset("/lifeSustainingTreatmentOption", lpa.LifeSustainingTreatmentOption))),
validate.Time("/signedAt", lpa.SignedAt),
// validate.Time("/witnessedByCertificateProviderAt", lpa.WitnessedByCertificateProviderAt),
// validate.OptionalTime("/witnessedByIndependentWitnessAt", lpa.WitnessedByIndependentWitnessAt),
validate.Time("/witnessedByCertificateProviderAt", lpa.WitnessedByCertificateProviderAt),
validate.OptionalTime("/witnessedByIndependentWitnessAt", lpa.WitnessedByIndependentWitnessAt),
validate.OptionalTime("/certificateProviderNotRelatedConfirmedAt", lpa.CertificateProviderNotRelatedConfirmedAt),
)
}
Expand Down
2 changes: 1 addition & 1 deletion lambda/create/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestValidateLpaInvalid(t *testing.T) {
{Source: "/certificateProvider/phone", Detail: "field is required"},
{Source: "/attorneys", Detail: "at least one attorney is required"},
{Source: "/signedAt", Detail: "field is required"},
// {Source: "/witnessedByCertificateProviderAt", Detail: "field is required"},
{Source: "/witnessedByCertificateProviderAt", Detail: "field is required"},
},
},
"online certificate provider missing email": {
Expand Down

0 comments on commit 747c7a4

Please sign in to comment.