Skip to content

Commit

Permalink
Rename fee-denied -> reduced-fee-declined (#829)
Browse files Browse the repository at this point in the history
* Rename `fee-denied` -> `reduced-fee-declined`

To match [specification](https://ministryofjustice.github.io/opg-event-store/domains/POAS/events/reduced-fee-declined/).

* Fix handler name
  • Loading branch information
gregtyler authored Nov 7, 2023
1 parent 5bec3bd commit f44cdd5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ emit-evidence-received: ##@app emits an evidence-received event with the given U
emit-reduced-fee-approved: ##@app emits a reduced-fee-approved event with the given UID e.g. emit-reduced-fee-approved uid=abc-123
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"version":"0","id":"63eb7e5f-1f10-4744-bba9-e16d327c3b98","detail-type":"reduced-fee-approved","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'

emit-fee-denied: ##@app emits a fee-denied event with the given UID e.g. emit-fee-denied uid=abc-123
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"version":"0","id":"63eb7e5f-1f10-4744-bba9-e16d327c3b98","detail-type":"fee-denied","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'
emit-reduced-fee-declined: ##@app emits a reduced-fee-declined event with the given UID e.g. emit-reduced-fee-declined uid=abc-123
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"version":"0","id":"63eb7e5f-1f10-4744-bba9-e16d327c3b98","detail-type":"reduced-fee-declined","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'

emit-more-evidence-required: ##@app emits a more-evidence-required event with the given UID e.g. emit-more-evidence-required uid=abc-123
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"version":"0","id":"63eb7e5f-1f10-4744-bba9-e16d327c3b98","detail-type":"more-evidence-required","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'
Expand Down
4 changes: 2 additions & 2 deletions cmd/event-received/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func TestHandleMoreEvidenceRequiredWhenPutError(t *testing.T) {

func TestHandleFeeDenied(t *testing.T) {
event := events.CloudWatchEvent{
DetailType: "fee-denied",
DetailType: "reduced-fee-declined",
Detail: json.RawMessage(`{"uid":"M-1111-2222-3333"}`),
}

Expand Down Expand Up @@ -368,7 +368,7 @@ func TestHandleFeeDenied(t *testing.T) {

func TestHandleFeeDeniedWhenPutError(t *testing.T) {
event := events.CloudWatchEvent{
DetailType: "fee-denied",
DetailType: "reduced-fee-declined",
Detail: json.RawMessage(`{"uid":"M-1111-2222-3333"}`),
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/event-received/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func handler(ctx context.Context, event Event) error {

err = handleFeeApproved(ctx, dynamoClient, event.CloudWatchEvent, shareCodeSender, appData, now)

case "fee-denined":
case "reduced-fee-declined":
err = handleFeeDenied(ctx, dynamoClient, event.CloudWatchEvent, now)

case "move-evidence-required":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "aws_cloudwatch_event_rule" "receive_events_sirius" {

event_pattern = jsonencode({
source = ["opg.poas.sirius"],
detail-type = ["evidence-received", "reduced-fee-approved", "more-evidence-required"],
detail-type = ["evidence-received", "reduced-fee-approved", "reduced-fee-declined", "more-evidence-required"],
})
provider = aws.region
}
Expand Down

0 comments on commit f44cdd5

Please sign in to comment.