You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tapas-xq API exposes two DELETE endpoints that the Rails app does not yet call:
DELETE /tapas-xq/:project-id/:doc-id — removes a single core file's TEI, MODS, and TFE from BaseX
DELETE /tapas-xq/:project-id — removes all documents for a project from BaseX
Work required
Create:app/services/tapas_xq/deletion_service.rb
The service should accept project_id: and optional doc_id: keyword arguments and expose two methods:
#delete_core_file — calls client.delete("/#{project_id}/#{doc_id}"). Requires doc_id. Returns the 202 XML confirmation body.
#delete_project — calls client.delete("/#{project_id}"). Returns the 202 XML confirmation body.
Both methods should raise TapasXq::NotFoundError (via client.rb) when tapas-xq returns 404. Callers are responsible for deciding whether to swallow that error.
Accept an optional client: keyword for dependency injection (consistent with StorageService and RetrievalService).
Notes
This is a prerequisite for issues covering DeleteFromTapasXqJob, DeleteProjectFromTapasXqJob, and the destroy callbacks on CoreFile and Project.
Background
The tapas-xq API exposes two DELETE endpoints that the Rails app does not yet call:
DELETE /tapas-xq/:project-id/:doc-id— removes a single core file's TEI, MODS, and TFE from BaseXDELETE /tapas-xq/:project-id— removes all documents for a project from BaseXWork required
Create:
app/services/tapas_xq/deletion_service.rbThe service should accept
project_id:and optionaldoc_id:keyword arguments and expose two methods:#delete_core_file— callsclient.delete("/#{project_id}/#{doc_id}"). Requiresdoc_id. Returns the 202 XML confirmation body.#delete_project— callsclient.delete("/#{project_id}"). Returns the 202 XML confirmation body.Both methods should raise
TapasXq::NotFoundError(viaclient.rb) when tapas-xq returns 404. Callers are responsible for deciding whether to swallow that error.Accept an optional
client:keyword for dependency injection (consistent withStorageServiceandRetrievalService).Notes
DeleteFromTapasXqJob,DeleteProjectFromTapasXqJob, and the destroy callbacks onCoreFileandProject.client.rb#postand#delete) must be merged before this service can raiseNotFoundErrorcorrectly from#delete.Tests
See
spec/services/tapas_xq/deletion_service_spec.rbin the testing plan doc.