File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
digital-letters-component-tests Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -86,20 +86,26 @@ const scenarios = [
8686 [ EventStatus . Rejected ] ,
8787 'Rejected' ,
8888 senderId ,
89+ 'API_CODE_001' ,
90+ 'The letter was rejected.' ,
8991 ) ,
9092 new ReportScenario (
9193 'component-test-failed' ,
9294 CommunicationType . Print ,
9395 [ EventStatus . Failed ] ,
9496 'Failed' ,
9597 senderId ,
98+ 'API_CODE_002' ,
99+ 'Letter processing failed' ,
96100 ) ,
97101 new ReportScenario (
98102 'component-test-returned' ,
99103 CommunicationType . Print ,
100104 [ EventStatus . Returned ] ,
101105 'Returned' ,
102106 senderId ,
107+ 'API_CODE_003' ,
108+ 'The letter was returned' ,
103109 ) ,
104110 new ReportScenario (
105111 'component-test-dispatched' ,
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ export function buildPrintLetterTransitionedEvent(
7070 messageReference : string ,
7171 status : string ,
7272 senderId : string ,
73+ reasonCode : string ,
74+ reasonText : string ,
7375) : PrintLetterTransitioned {
7476 const baseEvent = buildBaseEvent ( 'print' , time ) ;
7577 return {
@@ -84,6 +86,8 @@ export function buildPrintLetterTransitionedEvent(
8486 status,
8587 supplierId : 'supplier-1' ,
8688 time,
89+ reasonCode,
90+ reasonText,
8791 } ,
8892 } as PrintLetterTransitioned ;
8993}
Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ export function publishEventForScenario(scenario: ReportScenario) {
228228 scenario . messageReference ,
229229 status ,
230230 scenario . senderId ,
231+ scenario . expectedReasonCode ,
232+ scenario . expectedReason ,
231233 ) ,
232234 ] ,
233235 printLetterTransitionedValidator ,
You can’t perform that action at this time.
0 commit comments