Skip to content

Commit

Permalink
make appointmentType optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MishNajam committed Nov 15, 2024
1 parent d8051bb commit 3ada094
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion internal/shared/person.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const (
)

func (a AppointmentType) IsValid() bool {
return a == AppointmentTypeOriginal || a == AppointmentTypeReplacement
return true
}

type Attorney struct {
Expand Down
1 change: 0 additions & 1 deletion lambda/create/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func validateAttorney(prefix string, attorney shared.Attorney) []shared.FieldErr
validate.Date(fmt.Sprintf("%s/dateOfBirth", prefix), attorney.DateOfBirth),
validate.Address(fmt.Sprintf("%s/address", prefix), attorney.Address),
validate.IsValid(fmt.Sprintf("%s/status", prefix), attorney.Status),
validate.IsValid(fmt.Sprintf("%s/appointmentType", prefix), attorney.AppointmentType),
validate.IsValid(fmt.Sprintf("%s/channel", prefix), attorney.Channel),
validate.IfElse(attorney.Channel == shared.ChannelOnline,
validate.Required(fmt.Sprintf("%s/email", prefix), attorney.Email),
Expand Down
1 change: 0 additions & 1 deletion lambda/create/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func TestValidateAttorneyEmpty(t *testing.T) {
{Source: "/test/firstNames", Detail: "field is required"},
{Source: "/test/lastName", Detail: "field is required"},
{Source: "/test/status", Detail: "field is required"},
{Source: "/test/appointmentType", Detail: "field is required"},
{Source: "/test/address/line1", Detail: "field is required"},
{Source: "/test/address/country", Detail: "field is required"},
{Source: "/test/address/country", Detail: "must be a valid ISO-3166-1 country code"},
Expand Down

0 comments on commit 3ada094

Please sign in to comment.