Skip to content

feat: wire update, publish/unpublish and job status to real backends … - #13

Open
lirantul123 wants to merge 7 commits into
tileset-extractionfrom
gateway-conversion
Open

lirantul123 wants to merge 7 commits into
tileset-extractionfrom
gateway-conversion

Conversation

@lirantul123

Copy link
Copy Markdown
Collaborator

…(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.

Question Answer
Bug fix ✔✖
New feature ✔
Breaking change ✖
Deprecations ✖
Documentation ✖
Tests added ✔
Chore ✖

…(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant