move create document to documents hex#1609
Merged
whutchinson98 merged 11 commits intomainfrom Feb 23, 2026
Merged
Conversation
Add DocumentRepo::create_document, update_upload_job, delete_document_by_id. Add PresignedUploadUrlPort and TaskPropertiesPort traits. Add DocumentService::create_document with full orchestration logic. Add CreateDocumentRepoArgs domain model and new DocumentError variants.
…Repo Add create_document with full transactional SQL: insert Document, document_sub_type, DocumentBom/DocumentInstance, SharePermission, DocumentPermission, UserHistory, ItemLastAccessed, UserItemAccess, and document_email. Add update_upload_job and delete_document_by_id. Add macro_uuid dependency for UUID v7 generation.
Add POST / handler with file type parsing, internal-only email validation, and ProjectBodyAccessLevelExtractor for access checks. Restructure router to separate document-exists middleware from create route. Add Conflict and BadRequest DocumentError variants.
Apply cargo fmt, fix clippy collapsible_if, update SQLX offline cache for new queries, add NoOp port impls to documents_toolset example, and add macro_project_utils + entity_access to justfile setup_test_envs.
Remove create_document handler, business logic, and utils from document_storage_service. The documents hex crate now serves the POST /documents route via its axum router (both public and internal). - Add S3UploadUrlAdapter and TaskPropertiesAdapter in DSS context to bridge DSS concrete types to the documents hex port traits - Update DocumentServiceImpl construction in main.rs with adapters - Update create_task.rs to call hex service directly - Update internal router to use hex handler with full generic params - Update swagger to reference hex handler - Remove unused handle_document_creation_error_cleanup utility
7b93ebc to
c33c125
Compare
seanaye
approved these changes
Feb 23, 2026
Contributor
seanaye
left a comment
There was a problem hiding this comment.
Just a few comments mostly looks good
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.
No description provided.