Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification for NetDebitCap changes - publish to notifications and send email based on the change #566

Closed
31 of 33 tasks
elnyry-sam-k opened this issue Jan 10, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@elnyry-sam-k
Copy link
Member

elnyry-sam-k commented Jan 10, 2019

Goal:
As a Switch
I would like to send email alerts for changes to NetDebitCap or Position adjustments (only adjustments based on Position resets, not changes)
so that participating FSPs and the Hub Operator can be notified of such changes

Tasks:

  • Publish a message to the notifications topic for changes in NetDebitCap from central-ledger api [@vgenev]
  • Publish a message to the notifications topic for initialization of the NetDebitCap from central-ledger api [@vgenev]
  • Update CEP to get message from notifications topic for changes in NetDebitCap limit based on the message published by before task [@vgenev]
  • Make only threshold breach event to work with "spam control oscilation" [@vgenev]
  • Update CEP to get data for Threshould breach adjustment to relay on the limit data from the message instead of making another API call [@vgenev]
  • Update kafka lib code in CEP
  • Update kafka lib code in Email Notifier
  • Update the messages in CEP, Email Notifier and Central Ledger to match the standard message format used in the central-settlement task [@vgenev @bothadeon]
    • Add limit-adjustment action to the Central Ledger topic map [@vgenev]
    • Add Enums for Hub operator as it was done in the Settlements service [@vgenev]
    • Change the code of CEP to react on limit-adjustment event action [@vgenev]
    • Change the code of CEP to produce message with event action dedicated to email notifier [@vgenev]
    • Change the code of the email notifier to react on dedicated messages [@vgenev]
  • Update central-settlements to be able to publish a message to the notifications topic [@ggrg]
  • Define and use standard message format [@ggrg]
  • Publish a message for Position Adjustments based on Settlements [@ggrg]
  • Test functionality and add unit tests for full coverage of settlement [@ggrg]
  • Update current functionality to send email alerts for changes in NetDebitCap based on settlement transfers (but only based on the update notifications published now) [@bothadeon]
  • Format percentage of position left in the email notification to have two decimal places [@vgenev]
  • Edit email text for clarity
  • Tests
  • Update flow diagrams to UML [@bothadeon @HenkKodde @vgenev ]

Acceptance Criteria:

  • An email alert (or notification) is sent to an FSP when a change is made to the Net Debit Cap
  • An email alert (or notification) is sent to an FSP when a Position adjustment (based on Position resets) is done

PRs

Dependencies:

  • [ ]

Accountability:

@elnyry-sam-k elnyry-sam-k added this to the Sprint 4.4 milestone Jan 10, 2019
@vgenev
Copy link

vgenev commented Jan 14, 2019

Publish a message to the notifications topic for Position Adjustments based on Settlements - at the moment, to solve that task we need either to connect settlements to Kafka topics or expose endpoint to the central-ledger admin services that will receive notification from the settlement and forward by publishing to the notification topic. @elnyry @RobReeve @ggrg @bothadeon we need to discuss which will be the approach for that

@ggrg
Copy link
Member

ggrg commented Jan 17, 2019

@vgenev, @bothadeon, please notice the message that gets posted to notification topic:

{
  "id": "86ce97cf-2302-4d64-8b0e-df5ae9355dd0",
  "from": "central-switch",
  "to": "dfsp2",
  "content": {
    "headers": {
      "Content-Type": "application/json",
      "Date": "2019-01-17T14:46:48.918Z",
      "FSPIOP-Source": "central-switch",
      "FSPIOP-Destination": "dfsp2"
    },
    "payload": {
      "currency": "USD",
      "value": 0,
      "changedDate": "2019-01-17T14:46:48.918Z"
    }
  },
  "type": "application/json",
  "metadata": {
    "event": {
      "id": "5c7ff308-35be-46b0-b187-0bf4bee72cf8",
      "type": "notification",
      "action": "settlement-transfer-position-change",
      "state": {
        "status": "success",
        "code": 0,
        "description": "action successful"
      }
    },
    "protocol.createdAt": 1547736408918
  }
}

@HenkKodde
Copy link

Pull request for notification diagrams.
mojaloop/central-event-processor#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants