Skip to content

added event seperate to additionalDocumenets#1865

Merged
fudge88 merged 71 commits into
masterfrom
HDPI-6159-upload-additional-doc-event
Jun 22, 2026
Merged

added event seperate to additionalDocumenets#1865
fudge88 merged 71 commits into
masterfrom
HDPI-6159-upload-additional-doc-event

Conversation

@fudge88

@fudge88 fudge88 commented May 21, 2026

Copy link
Copy Markdown
Contributor

Jira link

See HDPI-6159

Change description

PCS_frontend PR

  • Adds a new uploadDocuments CCD event for defendants to upload additional documents on cases in CASE_ISSUED status, with optional linking to existing general applications
    • Adds new event handler UploadDocuments.java with:
      • A start callback that reads submitted/pending general applications, sorts them newest-first, and presents them as radio options (hiding the related application page when none exist)
      • A submit callback that persists documents under the APPLICATIONS category, deduplicates against existing URLs, and tags each document with applicant party and optional GA reference
    • Adds new domain types:
      • DocumentUploadCategory enum (ADJOURN_HEARING_APPLICATION, SUSPEND_EVICTION_APPLICATION, SET_ASIDE_ORDER_APPLICATION, GENERAL_APPLICATION) implementing HasLabel
      • DocumentUploadDetails data class with showRelatedApplicationsPage, relatedApplicationOptions, selectedRelatedApplicationId
      • RelatedApplicationOption data class with genAppId, category, submittedDate
    • Extends PCSCase.java with uploadedAdditionalDocuments (list of ListValue) and documentUploadDetails, with defendant access controls
    • Adds new uploadDocuments constant to EventId.java
    • Enhances DocumentNameService.java with appendPartyPostfix() to rename uploaded files using pattern "GA{rank} - Defendant {n}.ext" when linked to a GA, or "- Defendant {n}.ext" otherwise
    • Updates DocumentService.java with document linking logic for uploaded additional documents

NOTE: implementation taken from:
HDPI-6031: Gen apps supporting document upload screen - HDPI-6031_document_upload
HDPI-6421: Legal rep upload event - HDPI-6421-upload-doc-legal-rep

with teh tight deadline - these changes have been brought into this branch as standalone and will be refactored later.

Testing done

image image

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

@github-actions

github-actions Bot commented May 21, 2026

Copy link
Copy Markdown

CCD diff summary

👉 Full report: https://github.com/hmcts/pcs-api/actions/runs/27958021518?check_suite_focus=true

CaseField.json

RegularExpressionMaxSearchableMinFieldTypeParameterHintTextLabelIDFieldType
+
+
+N
+
+RelatedApplicationOption
+
+ 
+relatedApplicationOptions
+Collection
+
+
+N
+
+
+
+ 
+selectedRelatedApplicationId
+Text
+
+
+N
+
+
+
+ 
+showRelatedApplicationsPage
+YesOrNo
+
+
+N
+
+UploadedDocument
+
+ 
+uploadedAdditionalDocuments
+Collection

AuthorisationCaseEvent/AuthorisationCaseEvent.json

UserRoleCaseEventIDCRUD
+[DEFENDANT]
+uploadDocuments
+CRU

AuthorisationCaseField/DEFENDANTSOLICITOR.json

UserRoleCaseFieldIDCRUD
+[DEFENDANTSOLICITOR]
+relatedApplicationOptions
+CRU
+[DEFENDANTSOLICITOR]
+selectedRelatedApplicationId
+CRU
+[DEFENDANTSOLICITOR]
+showRelatedApplicationsPage
+CRU
+[DEFENDANTSOLICITOR]
+uploadedAdditionalDocuments
+CRU

AuthorisationCaseField/DEFENDANT.json

UserRoleCaseFieldIDCRUD
+[DEFENDANT]
+relatedApplicationOptions
+CRU
+[DEFENDANT]
+selectedRelatedApplicationId
+CRU
+[DEFENDANT]
+showRelatedApplicationsPage
+CRU
+[DEFENDANT]
+uploadedAdditionalDocuments
+CRU

CaseEvent/uploadDocuments.json

CallBackURLAboutToStartEventDescriptionEndButtonLabelEventEnablingConditionIDNamePostConditionStatePreConditionState(s)PublishShowEventNotesShowSummary
+http://localhost:3206/callbacks/about-to-start?eventId=uploadDocuments
+Upload additional documents
+Save and continue
+[STATE]="NEVER_SHOW"
+uploadDocuments
+Upload additional documents
+CASE_ISSUED
+CASE_ISSUED
+N
+N
+N

ComplexTypes/4_RelatedApplicationOption.json

ElementLabelFieldTypeIDListElementCode
+ 
+Text
+RelatedApplicationOption
+genAppId
+ 
+FixedRadioList
+DocumentUploadCategory
+RelatedApplicationOption
+category
+ 
+DateTime
+RelatedApplicationOption
+submittedDate

FixedLists/DocumentUploadCategory.json

IDListElementListElementCode
+DocumentUploadCategory
+ADJOURN_HEARING_APPLICATION
+ADJOURN_HEARING_APPLICATION
+DocumentUploadCategory
+GENERAL_APPLICATION
+GENERAL_APPLICATION
+DocumentUploadCategory
+SET_ASIDE_ORDER_APPLICATION
+SET_ASIDE_ORDER_APPLICATION
+DocumentUploadCategory
+SUSPEND_EVICTION_APPLICATION
+SUSPEND_EVICTION_APPLICATION

Base automatically changed from HDPI-7064-document-id-null-bug to master June 12, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants