Closed jcoyne closed 2 months ago
I'd suggest that:
You are right that we have not been consistent. This is how file identifiers are constructed in SDR-API https://github.com/sul-dlss/sdr-api/blob/3a0eca315b950e31cc93fd303588da95936bb9bc/app/controllers/resources_controller.rb#L143-L145
Here is a way we do it in pre-assembly: https://github.com/sul-dlss/pre-assembly/blob/952882872743d12991f8e7f93b9dcad9a4ac7b45/app/lib/pre_assembly/file_identifier_generator.rb#L9
And yet another way in DSA: https://github.com/sul-dlss/dor-services-app/blob/main/app/services/cocina/id_generator.rb#L27-L29
When you upload a file, the cocina should be written with the correct file identifiers.
Currently the published cocina constructs a file externalIdentifier by appending the filename to the fileSets externalIdentifier (and
sub(/\/fileSet\/, 'file')
):