feat: wire update, publish/unpublish and job status to real backends … - #13
Open
lirantul123 wants to merge 7 commits into
Open
lirantul123 wants to merge 7 commits into
lirantul123 wants to merge 7 commits into
Conversation
…(MAPCO-11833)
Replace the stub PATCH handlers and add a job-status endpoint, making the
service a real successor to 3d-gateway + store-trigger:
- PATCH /record/{id}: validate the update (record exists, not being-deleted,
v2 partial schema, footprint, classification, unique name), reject records
that exist in extractable-management (409), convert the footprint to 2D and
patch the catalog.
- PATCH /record/status/{id}: validate the record, extractable guard, then
change status in the catalog.
- GET /jobs/{jobId}: return the Jobnik job status and completion percentage.
Add CatalogCall getRecord/patchMetadata/changeStatus, an ExtractableCall client
(externalServices.extractable), JobnikClient.getJobStatus, and a job module
(model/controller/route mounted at /jobs). Unit and integration tests included.
…us and bundle (MAPCO-11833)
Bring the service closer to the 3d-gateway behaviour:
- POST /record/validate: run the full ingestion validation and return
{isValid, message} without creating a job.
- Ingestion validation also enforces modelPath under the configured base path
(validation.basePath) and productId uniqueness in the catalog.
- Ingestion converts the footprint to 2D before creating the job.
- Delete now sets the catalog record status to BEING_DELETED after the delete
job is created.
- Add an openapi:bundle script (redocly) producing bundledApi.yaml.
Skipped by design (Jobnik model, not store-trigger): PV-path rewriting,
pre-minted uuid modelId, StoreTriggerCall.
…833)
- GET /record/canDelete/{id}: dry-run delete validation returning
{isValid, message}, matching 3d-gateway's GET /models/canDelete/{recordId}.
- Rename the bundle script to bundleOpenApi and commit bundledApi.yaml
(tracked, like 3d-gateway and store-trigger; removed from .gitignore).
…a groups (MAPCO-11833)
Restructure the routes to mirror 3d-gateway + store-trigger groupings instead of
a single /record tag:
- jobOperations: POST /jobOperations/ingestion, POST /jobOperations/delete
- jobStatus: GET /jobStatus/{jobId}
- models: POST /models/validate, GET /models/canDelete/{recordId}
- metadata: PATCH /metadata/{identifier}, PATCH /metadata/status/{identifier}
Delete is now POST with a body ({id}) like store-trigger. Each group has its own
controller and router; RecordManager and JobManager remain the shared business
models. OpenAPI, generated types, bundledApi and integration tests updated.
…-11833)
Mirror 3d-gateway's models group (renamed to our domain term "record"): all
model operations live under one records tag, metadata and jobStatus stay
separate.
- records: POST /records, POST /records/validate, GET /records/canDelete/{recordId},
DELETE /records/{recordId}
- metadata: PATCH /metadata/{identifier}, PATCH /metadata/status/{identifier}
- jobStatus: GET /jobStatus/{jobId}
Delete reverts to a REST DELETE. Merge the jobOperations and models modules into
a single records module (recordManager moved under it); update routers,
serverBuilder, containerConfig, OpenAPI, bundledApi and tests.
…CO-11833) Mint a modelId (uuid) at ingestion time, pass it into the Jobnik job data so the finalizer has a stable catalog id, and tag the trace span with it. Wrap the create flow in a try/catch that passes AppError through and maps unexpected errors to a 500, mirroring 3d-gateway's createModel. productSource and PV-path rewriting are intentionally omitted: productSource does not exist in the v2 metadata schema, and path rewriting is store-trigger mount-specific (revisit only if the Jobnik worker contract requires it).
- move record/job DTO aliases into @common/interfaces, dropping the duplicate UpdatePayload and the local JobStatusResponse - consume RecordStatus/ProductType from @map-colonies/types instead of hardcoded status/productType literals (adds @map-colonies/types + mime-types) - split ValidationManager into IngestionValidator, MetadataValidator and TilesetValidator, with shared errors.ts and a classification helper - dedupe CatalogCall error handling behind a single request helper
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.
…(MAPCO-11833)
Replace the stub PATCH handlers and add a job-status endpoint, making the service a real successor to 3d-gateway + store-trigger:
Add CatalogCall getRecord/patchMetadata/changeStatus, an ExtractableCall client (externalServices.extractable), JobnikClient.getJobStatus, and a job module (model/controller/route mounted at /jobs). Unit and integration tests included.