Skip to content

Commit

Permalink
Rename fee-approved -> reduced-fee-approved (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtyler authored Nov 7, 2023
1 parent c286654 commit 6214b24
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ get-documents: ##@app dumps all documents in the lpas dynamodb table that are r
emit-evidence-received: ##@app emits an evidence-received event with the given UID e.g. emit-evidence-received uid=abc-123
curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"version":"0","id":"63eb7e5f-1f10-4744-bba9-e16d327c3b98","detail-type":"evidence-received","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'

emit-fee-approved: ##@app emits a fee-approved event with the given UID e.g. emit-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":"fee-approved","source":"opg.poas.sirius","account":"653761790766","time":"2023-08-30T13:40:30Z","region":"eu-west-1","resources":[],"detail":{"UID":"$(uid)"}}'
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)"}}'
Expand Down
6 changes: 3 additions & 3 deletions cmd/event-received/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestHandleEvidenceReceivedWhenClientPutError(t *testing.T) {

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

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

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

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

func TestHandleFeeApprovedWhenShareCodeSenderError(t *testing.T) {
event := events.CloudWatchEvent{
DetailType: "fee-approved",
DetailType: "reduced-fee-approved",
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 @@ -138,7 +138,7 @@ func handler(ctx context.Context, event Event) error {
case "evidence-received":
err = handleEvidenceReceived(ctx, dynamoClient, event.CloudWatchEvent)

case "fee-approved":
case "reduced-fee-approved":
bundle := localize.NewBundle("./lang/en.json", "./lang/cy.json")

//TODO do this in handleFeeApproved when/if we save lang preference in LPA
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", "fee-approved", "more-evidence-required"],
detail-type = ["evidence-received", "reduced-fee-approved", "more-evidence-required"],
})
provider = aws.region
}
Expand Down

0 comments on commit 6214b24

Please sign in to comment.