Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ WITH vars AS (
WHEN e.type LIKE '%.print.invalid.attachment.received.%' THEN 'Failed'
WHEN e.letterstatus = 'RETURNED' THEN 'Returned'
WHEN e.letterstatus = 'FAILED' THEN 'Failed'
WHEN e.letterstatus = 'DISPATCHED' THEN 'Dispatched'
WHEN e.letterstatus = 'DELIVERED' THEN 'Delivered'
WHEN e.letterstatus = 'REJECTED' THEN 'Rejected' ELSE NULL
END as status,
e.reasoncode,
Expand Down Expand Up @@ -55,7 +55,7 @@ WITH vars AS (
-- Print Priority Order
WHEN te.status = 'Returned' THEN 4
WHEN te.communicationtype = 'Print' AND te.status = 'Failed' THEN 3
WHEN te.status = 'Dispatched' THEN 2
WHEN te.status = 'Delivered' THEN 2
WHEN te.status = 'Rejected' THEN 1 ELSE 0
END DESC
) AS "row_number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ const scenarios = [
'The letter was returned',
),
new ReportScenario(
'component-test-dispatched',
'component-test-delivered',
CommunicationType.Print,
[EventStatus.Dispatched],
'Dispatched',
[EventStatus.Delivered],
'Delivered',
senderId,
),
// Scenario for new Print failure event: FileQuarantined
Expand All @@ -134,7 +134,7 @@ const scenarios = [
'DL_CLIV_002',
'Invalid attachment received',
),
// multiple events for the same message reference, should take the one with highest priority status (returned > failed > dispatched > rejected)
// multiple events for the same message reference, should take the one with highest priority status (returned > failed > delivered > rejected)
new ReportScenario(
'component-test-rejected-pending',
CommunicationType.Print,
Expand All @@ -145,27 +145,27 @@ const scenarios = [
'The letter was rejected.',
), // pending is ignored.
new ReportScenario(
'component-test-rejected-dispatched',
'component-test-rejected-delivered',
CommunicationType.Print,
[EventStatus.Rejected, EventStatus.Dispatched],
'Dispatched',
[EventStatus.Rejected, EventStatus.Delivered],
'Delivered',
senderId,
),
new ReportScenario(
'component-test-rejected-dispatched-failed',
'component-test-rejected-delivered-failed',
CommunicationType.Print,
[EventStatus.Rejected, EventStatus.Dispatched, EventStatus.Failed],
[EventStatus.Rejected, EventStatus.Delivered, EventStatus.Failed],
'Failed',
senderId,
'API_CODE_002',
'Letter processing failed',
),
new ReportScenario(
'component-test-rejected-dispatched-failed-returned',
'component-test-rejected-delivered-failed-returned',
CommunicationType.Print,
[
EventStatus.Rejected,
EventStatus.Dispatched,
EventStatus.Delivered,
EventStatus.Failed,
EventStatus.Returned,
],
Expand Down
1 change: 1 addition & 0 deletions tests/playwright/helpers/report-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export enum EventStatus {
Rejected = 'REJECTED',
Printed = 'PRINTED',
Dispatched = 'DISPATCHED',
Delivered = 'DELIVERED',
Failed = 'FAILED',
Returned = 'RETURNED',
Pending = 'PENDING',
Expand Down
Loading