Skip to content

Commit 2a92c2f

Browse files
committed
store changes and source, subject, billingref
1 parent 9ec5d83 commit 2a92c2f

File tree

23 files changed

+64
-11
lines changed

23 files changed

+64
-11
lines changed

internal/datastore/src/__test__/letter-repository.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function createLetter(
2727
updatedAt: now,
2828
source: "/data-plane/letter-rendering/pdf",
2929
subject: `client/1/letter-request/${letterId}`,
30+
billingRef: "specification1",
3031
};
3132
}
3233

@@ -112,6 +113,7 @@ describe("LetterRepository", () => {
112113
expect(letter.reasonCode).toBeUndefined();
113114
expect(letter.reasonText).toBeUndefined();
114115
expect(letter.subject).toBe(`client/1/letter-request/${letterId}`);
116+
expect(letter.billingRef).toBe("specification1");
115117
assertTtl(letter.ttl, before, after);
116118
});
117119

internal/datastore/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const LetterSchema = LetterSchemaBase.extend({
5050
ttl: z.int(),
5151
source: z.string(),
5252
subject: z.string(),
53+
billingRef: z.string(),
5354
}).describe("Letter");
5455

5556
/**

internal/events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@
5050
"typecheck": "tsc --noEmit"
5151
},
5252
"types": "dist/index.d.ts",
53-
"version": "1.0.5"
53+
"version": "1.0.6"
5454
}

internal/events/schemas/examples/letter.ACCEPTED.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"billingRef": "1y3q9v1zzzz",
34
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
45
"groupId": "client_template",
56
"origin": {

internal/events/schemas/examples/letter.FORWARDED.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"billingRef": "1y3q9v1zzzz",
34
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
45
"groupId": "client_template",
56
"origin": {

internal/events/schemas/examples/letter.RETURNED.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"billingRef": "1y3q9v1zzzz",
34
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
45
"groupId": "client_template",
56
"origin": {

internal/events/src/domain/letter.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ The identifier will be included as the origin domain in the subject of any corre
7676
examples: ["1y3q9v1zzzz"],
7777
}),
7878

79+
billingRef: z.string().meta({
80+
title: "Billing Reference",
81+
description:
82+
"A billing reference determined for this letter based on its specification",
83+
examples: ["1y3q9v1zzzz"],
84+
}),
85+
7986
supplierId: z.string().meta({
8087
title: "Supplier ID",
8188
description: "Supplier ID allocated to the letter during creation.",

internal/events/src/events/__tests__/letter-status-change-events.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe("LetterStatus event validations", () => {
3737
}),
3838
domainId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
3939
specificationId: "1y3q9v1zzzz",
40+
billingRef: "1y3q9v1zzzz",
4041
groupId: "client_template",
4142
status,
4243
}),

internal/events/src/events/__tests__/testData/letter.ACCEPTED-with-invalid-major-version.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"billingRef": "1y3q9v1zzzz",
34
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
45
"groupId": "client_template",
56
"origin": {

internal/events/src/events/__tests__/testData/letter.ACCEPTED-with-missing-fields.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"data": {
3+
"billingRef": "1y3q9v1zzzz",
34
"domainId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
45
"groupId": "client_template",
56
"origin": {

0 commit comments

Comments
 (0)