Skip to content

Commit

Permalink
Merge pull request #87 from ministryofjustice/pfs-144-credit-on-account
Browse files Browse the repository at this point in the history
pfs-144: credit-on-account event from finance to supervision
  • Loading branch information
denialanderror authored Oct 9, 2024
2 parents 110d25a + 99a8d33 commit 38d0af6
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"clientId": 1,
"creditRemaining": 10000
}
31 changes: 31 additions & 0 deletions domains/Supervision/events/credit-on-account/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: credit-on-account
version: 0.0.1
summary: |
The client has credit on account that cannot be applied to any open invoice or debt
producers:
- opg.supervision.finance
consumers:
- opg.supervision.sirius
owners:
- supervision
---

## Context

When a payment or other credit is received for a client but is greater than the client's outstanding debt, that credit
is retained on their account. This may need to result in a refund to the client.

## Trigger

A client's credit balance is larger than their outstanding debt position.

## Effect

Sirius Supervision creates a Refund Review task on the client.

<NodeGraph title="Consumer / Producer Diagram" />

<EventExamples />

<Schema />
17 changes: 17 additions & 0 deletions domains/Supervision/events/credit-on-account/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$id": "https://opg.service.justice.gov.uk/opg.supervision.sirius/credit-on-account.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "opg.supervision.sirius/credit-on-account",
"type": "object",
"properties": {
"clientId": {
"type": "integer",
"description": "The client ID whose account is in credit"
},
"creditRemaining": {
"type": "integer",
"description": "The amount of unapplied credit on account (in pennies)"
}
},
"required": ["clientId", "creditRemaining"]
}

0 comments on commit 38d0af6

Please sign in to comment.