chore: registration file upload - #4777
Merged
Merged
Conversation
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
3 times, most recently
from
June 23, 2026 17:25
41f11a7 to
f213d02
Compare
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
5 times, most recently
from
July 2, 2026 21:11
6285214 to
48eb52f
Compare
pbastia
marked this pull request as ready for review
July 2, 2026 21:11
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates registration-related file uploads from data-url-in-JSON payloads to multipart/form-data submissions, updating both the React (RJSF) widgets and the Django/Ninja endpoints, along with extensive test refactors.
Changes:
- Frontend: reworks
FileWidget/read-only rendering to store file metadata as a string value and submit actualFiles viaFormDatathrough a newuseFileUploadWidgetcontext. - Backend: updates operation/new-entrant endpoints to accept multipart uploads and introduces dataclass-based service payload types to replace previous schema-driven data-url conversion.
- Tests/docs: refactors unit/integration/performance tests and begins updating upload documentation.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/file_uploads.md | Adds placeholder note for updated file upload docs. |
| bciers/libs/components/src/form/widgets/readOnly/ReadOnlyFileWidget.tsx | Updates read-only file rendering to use new file metadata format. |
| bciers/libs/components/src/form/widgets/OldFileWidget.tsx | Adds prior widget implementation as a separate file. |
| bciers/libs/components/src/form/widgets/FileWidget.tsx | Implements multipart upload flow + new useFileUploadWidget/FileElement. |
| bciers/libs/components/src/form/MultiStepBase.tsx | Adds support for passing formContext into RJSF forms. |
| bciers/apps/registration/tests/performance/scenarios/backend/operation.js | Adjusts perf scenario payloads (partial) for new upload approach. |
| bciers/apps/registration/tests/components/operations/registration/OperationInformationForm.test.tsx | Updates component test expectations for multipart submission + file metadata strings. |
| bciers/apps/registration/tests/components/operations/registration/NewEntrantOperationForm.test.tsx | Updates new-entrant test to assert multipart payload + attached File. |
| bciers/apps/registration/app/data/jsonSchema/operationRegistration/newEntrantOperation.ts | Removes data-url format from schema for new entrant upload field. |
| bciers/apps/registration/app/components/operations/registration/OperationInformationForm.tsx | Uses useFileUploadWidget and submits via multipart proxy. |
| bciers/apps/registration/app/components/operations/registration/NewEntrantOperationForm.tsx | Uses useFileUploadWidget and submits via multipart proxy. |
| bciers/apps/administration/tests/components/operations/OperationInformationForm.test.tsx | Updates admin operation form tests for new file metadata format. |
| bciers/apps/administration/app/data/jsonSchema/operationInformation/operationInformation.ts | Removes data-url formats for operation document fields. |
| bciers/apps/administration/app/components/operations/OperationInformationPage.tsx | Minor page change (includes a debug log in current diff). |
| bciers/apps/administration/app/components/operations/OperationInformationForm.tsx | Uses useFileUploadWidget and submits via multipart proxy. |
| bc_obps/tests/test_files.py | Adds helper to create UploadedFile instances for tests. |
| bc_obps/service/tests/test_document_service.py | Updates document service tests to use UploadedFile objects. |
| bc_obps/service/tests/operation_service/test_operation_service.py | Refactors operation service tests to use new dataclass payloads + files. |
| bc_obps/service/tests/data_access_service/test_data_access_opted_in_operation_detail_service.py | Updates opted-in operation detail tests to use dataclass payload. |
| bc_obps/service/operation_service.py | Reworks service layer to accept dataclass payloads + uploaded files. |
| bc_obps/service/document_service.py | Updates document service signature to accept File objects. |
| bc_obps/service/data_types/operation_service_data_types.py | Introduces dataclasses for operation payloads and related types. |
| bc_obps/service/data_access_service/opted_in_operation_detail_service.py | Switches to dataclass-to-dict conversion via new asdict. |
| bc_obps/service/data_access_service/document_service.py | Updates data access signature to accept File. |
| bc_obps/registration/utils.py | Removes data-url-to-file conversion helper (no longer needed). |
| bc_obps/registration/tests/test_utils.py | Removes tests tied to data-url conversion behavior. |
| bc_obps/registration/tests/integration/test_operation_registration.py | Updates integration tests to post multipart payloads. |
| bc_obps/registration/tests/integration/test_changing_registration_purpose.py | Updates integration tests to post multipart payloads + files. |
| bc_obps/registration/tests/endpoints/test_operations.py | Updates endpoint tests to post multipart payloads + files. |
| bc_obps/registration/tests/endpoints/_operations/test_operation_id.py | Updates update-operation test to multipart + POST. |
| bc_obps/registration/tests/endpoints/_operations/_operation_id/_registration/test_operation.py | Updates registration-operation endpoint tests to multipart + POST. |
| bc_obps/registration/tests/endpoints/_operations/_operation_id/_registration/test_new_entrant_application.py | Updates new-entrant endpoint tests to multipart + POST. |
| bc_obps/registration/tests/constants.py | Removes large inlined mock data-url constants. |
| bc_obps/registration/schema/operation.py | Serializes documents as JSON strings (name/id/status) instead of data-urls. |
| bc_obps/registration/api/operations.py | Accepts multipart files and wraps payload into OperationData. |
| bc_obps/registration/api/_operations/operation_id.py | Changes update operation to POST + multipart file inputs. |
| bc_obps/registration/api/_operations/_operation_id/_registration/opted_in_operation.py | Wraps opted-in payload into dataclass for service layer. |
| bc_obps/registration/api/_operations/_operation_id/_registration/operation.py | Changes registration operation update to POST + multipart file inputs. |
| bc_obps/registration/api/_operations/_operation_id/_registration/operation_representative.py | Adjusts representative removal to pass scalar ID into service. |
| bc_obps/registration/api/_operations/_operation_id/_registration/new_entrant_application.py | Changes new-entrant upload to POST + multipart file input. |
| bc_obps/common/tests/lib/dataclasses/test_asdict.py | Adds unit tests for custom asdict include/exclude behavior. |
| bc_obps/common/tests/endpoints/auth/constants.py | Updates auth test matrix for POST method changes. |
| bc_obps/common/lib/dataclasses/dict_factory.py | Adds dict factory supporting include/exclude-none semantics. |
| bc_obps/common/lib/dataclasses/asdict.py | Adds asdict wrapper mirroring pydantic-style options. |
| bc_obps/common/lib/dataclasses/init.py | Exposes asdict via package init. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
2 times, most recently
from
July 8, 2026 21:36
f14b6c7 to
a8b5053
Compare
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
3 times, most recently
from
July 13, 2026 16:07
5a8df34 to
6583d8e
Compare
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
from
July 15, 2026 22:57
1ffc682 to
85ca349
Compare
Sepehr-Sobhani
requested changes
Jul 16, 2026
Sepehr-Sobhani
left a comment
Member
There was a problem hiding this comment.
Not directly related to this PR, but do we want to add some backend validation to enforce allowed file extensions? I noticed accept: ".pdf" in the new entrant schema, but that is only a frontend UI hint and users can bypass it.
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
from
July 17, 2026 23:17
85ca349 to
9dbe043
Compare
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
4 times, most recently
from
July 22, 2026 22:47
5a1cb3c to
c70f5a9
Compare
chore: updating django ninja reverting ninja update chore: removing data-url hint from schemas
chore: data types for operation information service chore: operation service refactor to use internal classes test: custom asdict method test: testing the refactored operation service test: more working tests test: API with files test: changing reg purpose test: global endpoints config test: operation update main endpoint test: removing dependency on mock data urls test: removing data url utils
chore: almost feature complete chore: refactoring tests chore: serialized file info test: frontend tests
docs: updating file upload docs test: components chore: more admin tests
chore: typing
test: updating tests chore: logs
test: fixing hook test test: fixing revalidate path
chore: forgotten only in test chore: forgotten file chore: moving files
pbastia
force-pushed
the
chore/2123-refactor-registration-file-uploads
branch
from
July 23, 2026 16:05
c70f5a9 to
a49c797
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work done
Backend
Frontend
stringtype for the file schema properties. For RJSF, any file upload will look like a stringSee updated documentation
Work left to do:
Documentmodel to store the original file name, so that we can display it without the django name disambiguation string. Registration: Tech Debt: Document should contain a field for the original file name #4932