refactor(import): replace importSingleDocument boolean return with ImportResult enum #620
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
importSingleDocumentcurrently returnsboolean:falsewhen the document already exists and is not a PLACEHOLDER (intentional skip)falsewhen the S3 upload fails (error)truewhen the document was successfully importedA caller reading
if (imported)cannot distinguish between these two very different failure modes. This makes adding per-category counting (processed / skipped / failed) error-prone.Proposed change
Replace the
booleanreturn with a package-private enum:Update
processRowsto switch on the result and route each case to the appropriate counter/list.Acceptance criteria
MassImportServiceTesttests pass unchanged (behaviour is identical)ProcessResult—processed,skippedFiles, and (future)failedFiles— are populated from distinctImportResultvalues with no ambiguityRelated
Surfaced during review of #618. The S3 failure surfacing work (#[s3 issue]) depends on this enum being in place first.