Skip to content

Commit

Permalink
ICMSLST-2535 Data Migration - Correct Document Pack Revoked Statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeylockwood committed Feb 28, 2024
1 parent 3a5ad4b commit e3fb670
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data_migration/queries/export_application/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
, card.issue_datetime case_completion_datetime
, CASE
WHEN card.status = 'DRAFT' THEN 'DR'
WHEN cad.status = 'REVOKED' THEN 'RE'
WHEN card.is_last_issued = 'false' THEN 'AR'
ELSE 'AC'
END status
Expand All @@ -46,7 +47,7 @@
FROM impmgr.certificate_app_responses car
INNER JOIN impmgr.cert_app_response_details card ON card.car_id = car.id
INNER JOIN impmgr.certificate_applications ca ON ca.id = car.ca_id
INNER JOIN impmgr.certificate_app_details cad ON cad.id = card.cad_id
INNER JOIN impmgr.certificate_app_details cad ON cad.ca_id = car.ca_id AND cad.status_control = 'C'
LEFT JOIN decmgr.xview_document_packs dp ON dp.ds_id = card.document_set_id
WHERE card.status <> 'DELETED'
ORDER BY card.id
Expand Down
3 changes: 2 additions & 1 deletion data_migration/queries/import_application/licence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
, CASE xiad.print_documents_flag WHEN 'Y' THEN 1 ELSE 0 END issue_paper_licence_only
, ird.id legacy_id
, CASE
WHEN xiad.status IN ('REVOKED', 'WITHDRAWN', 'STOPPED') THEN 'AR'
WHEN ixad.status = 'REVOKED' THEN 'RE'
WHEN xiad.status IN ('WITHDRAWN', 'STOPPED') THEN 'AR'
WHEN ird.variation_no < xiad.variation_no THEN 'AR'
WHEN xiad.status IN ('PROCESSING', 'VARIATION_REQUESTED', 'SUBMITTED') THEN 'DR'
ELSE 'AC'
Expand Down
1 change: 1 addition & 0 deletions pii-ner-exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3866,3 +3866,4 @@ Published Subject
Retraction Subject
MAILSHOT_DOCUMENT
Test Mailshot 3.pdf
ON cad.ca_id

0 comments on commit e3fb670

Please sign in to comment.