Repository navigation
refactor: define every metadata field once and build the schemas from named groups (MAPCO-11579) - #41
Open
lirantul123 wants to merge 7 commits into
Open
lirantul123 wants to merge 7 commits into
lirantul123 wants to merge 7 commits into
Conversation
…amed groups (MAPCO-11579) fields/fields.schema.ts holds each field rule once; fields/groups.schema.ts names where the fields come from (payload, product shapefile, metadata shapefile, catalog). The payload, the job record metadata and the catalog response are spreads of those groups, and the ShapeMetadata row pipes each column into the same field rule. SEP90 limits now match the ShapeMetadata (250/100).
|
🎫 Related Jira Issue: MAPCO-11579 |
…nies file names (MAPCO-11579) core/metadata.schema.ts holds every field and the groups (payload, product shapefile, ShapeMetadata product, parts summary, part, catalog). The ShapeMetadata row is built from SHAPE_METADATA_COLUMNS and the groups, returns ISO dates, and reports errors by column name. Files follow raster-shared: job/task/payload .schema.ts and *.type.ts; ingestion constants are merged into constants.ts. pickFields copies a group from an object.
…1579) productName, srsId, srsName and producerName are client fields (payload); productName max 50. classification is Unclassified/Restricted/Confidential/Secret. productType adds 3DPointCloudBest. SEP90 accuracies are 0-999 like the other accuracies; description has no limit. Footprint coordinates must be within lon -180..180 and lat -90..90. The ShapeMetadata row drops srsId, srsName and desc, which the parts table does not store.
…es in place (MAPCO-11579) No *Rule constants; range errors no longer name another field, so the ShapeMetadata errors need no text rewriting; the v1 record type file is metadataV1.type.ts, apart from the v2 metadata schema.
…CO-11579) The lookup-tables value is a code and the UI shows its translation, as in 3d-gateway and store-trigger, so classification is required text checked against the lookup table. 3DPointCloudBest is not in @map-colonies/types, so it is not accepted.
…ummary (MAPCO-11579)
asafmas-rnd
requested changes
Dec 3, 2026
| @@ -25,7 +31,6 @@ components: | |||
| description: | |||
Contributor
There was a problem hiding this comment.
Check what the product is the limit
| example: sample, city | ||
| classification: | ||
| type: string | ||
| pattern: ^[a-zA-Z0-9]+$ |
| srsId: | ||
| type: string | ||
| minLength: 1 | ||
| maxLength: 120 |
| format: date-time | ||
| description: Newest imaging date of the parts | ||
| example: 2025-02-01T00:00:00.000Z | ||
| minResolutionMeter: |
This branch has not been deployed
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.
Why
The same field was defined in up to four places (
core/product.schema.ts,catalog/fields.schema.ts,ingestion/common.schema.ts, and twice insideshapeMetadata.schema.ts: once to validate the column and once to rename it). Composite schemas were chains ofomit/extend/innerType. The copies had already drifted: the ShapeMetadata limited SEP90 to 250 (absolute) and 100 (relative), while the catalog allowed 999, which is what the CSW page says.What
One metadata file.
schemas/core/metadata.schema.tsdefines every field once (validation, limit fromINGESTION_VALIDATIONS, message, description, openapi example) and groups them by where they come from:payloadFieldsproductShapefileFieldsfootprint)shapeMetadataProductFieldspartsSummaryFieldspartFieldscatalogFieldsComposites are spreads:
shapeMetadataFields,jobRecordMetadataFields,catalogRecordResponseFields.ShapeMetadata from one column map.
SHAPE_METADATA_COLUMNSmaps each field to its column and cell type (text/number/list/date). The row schema is built from that map andshapeMetadataFields; the compiler fails if a group field has no column or a column has no field. Errors are still reported by column name (minResM must not be greater than maxResM), the same texts as before.pickFields(source, group)copies a group out of an object, so consumers stop re-listing fields (the trigger builds the job record metadata with it).File names follow raster-shared:
job.schema.ts,task.schema.ts,payload.schema.ts,*.type.ts; the ingestion constants and messages are oneconstants.ts.Removed:
core/product.schema.ts,ingestion/common.schema.ts,catalog/fields.schema.ts, the unusedingestion3DDeleteJobParamsSchemaalias, the commented-out code, and the identity mapSHAPE_METADATA_FIELDS(replaced bySHAPE_METADATA_COLUMNS).Behavior changes
Aligned with the Confluence pages (3D Record CSW Data, 3D Record Parts WFS Data, v1 vs v2 Comparison); where the Parts page disagrees, the CSW page wins.
productName,srsId,srsNameandproducerNamemove to the ingestion payload ("Inserted by client");productNamemax 50.descriptionhas no length limit; footprint coordinates must be within lon -180..180 and lat -90..90.prodNameandproducerfor the parts table, no longer readssrsId,srsNameordesc(not on the Parts page).imagingTimeBeginUTC/imagingTimeEndUTCas ISO strings, like every other date.Tests: 435 pass; tsc, eslint and build are clean. Checked against #40 merged on top: 449 pass, and the trigger (193) and the workers pass against that build.