Skip to content

Commit

Permalink
INT-B-20522 sit validation (#13720)
Browse files Browse the repository at this point in the history
* cannot set SIT payment start/end dates prior to SIT Entry/Departure dates

* fixed error string

* fixed nil error

* updated error message and removed departure date check

* removed default error case

* properly checking if payment start date is at least a day after SIT entry date

* fix devseed

* updated error message to new PO specifications
  • Loading branch information
loganwc authored Sep 17, 2024
1 parent 758c4f0 commit ebf2c6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/handlers/primeapi/payment_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func (h CreatePaymentRequestHandler) Handle(params paymentrequestop.CreatePaymen
zap.Any("payload", payload))
return paymentrequestop.NewCreatePaymentRequestBadRequest().WithPayload(payload), err
default:
if e.Error() == "cannot have payment date earlier than or equal to SIT Entry date" {
if e.Error() == "cannot have payment start date for additional days SIT earlier than or equal to SIT entry date" {

payload := payloads.ClientError(handlers.ConflictErrMessage, err.Error(), h.GetTraceIDFromRequest(params.HTTPRequest))

appCtx.Logger().Error("Payment Request",
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/payment_request/payment_request_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (p *paymentRequestCreator) CreatePaymentRequest(appCtx appcontext.AppContex
}

if paymentServiceItem.MTOServiceItem.SITEntryDate != nil && !paymentDate.After(*paymentServiceItem.MTOServiceItem.SITEntryDate) {
return apperror.NewConflictError(paymentRequestArg.ID, "cannot have payment date earlier than or equal to SIT Entry date")
return apperror.NewConflictError(paymentRequestArg.ID, "cannot have payment start date for additional days SIT earlier than or equal to SIT entry date")
}
}

Expand Down

0 comments on commit ebf2c6b

Please sign in to comment.