Skip to content

Commit

Permalink
chore: create yaml schemas and types for ingestion-trigger(MAPCO-1783…
Browse files Browse the repository at this point in the history
…, MAPCO-4135) (#184)

* chore: create yaml schemas and types for ingestion-trigger

* fix: end of line

* fix: remove IPropSHPMappingoutput

* fix: remove ITsTypesMapping

* fix: remove getPyCSWMappings and pick PolygonPart

* feat: merege PolygonPart and PolygonPartRecord

* fix: pr commetns

* fix: pr commetns

* fix: pr commetns

* feat: adding yaml validateSourcesResponse and exposing raster ingestion index

* feat: change sourcesInfo response footprint field to extentPolygon

* feat: adding isCreateEssential and isUpdateEssential

* fix: pr fixes

* fix: change classification to classification number

* fix: remove stacktrace from errorMessage

* fix: fieldconfig tuning

* fix: lint errors

* fix: lint

---------

Co-authored-by: alebinson <[email protected]>
  • Loading branch information
almog8k and alebinson authored May 7, 2024
1 parent 6164660 commit 9206307
Show file tree
Hide file tree
Showing 20 changed files with 917 additions and 552 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export interface IFieldConfigInfo {
isRequired?: boolean; // is field mandatory, deprecated should be implemeted by validation type='required'
isAutoGenerated?: boolean; // is field non relevant as input field for ingestion, but should be presented as a part of the model.
isLifecycleEnvolved?: boolean; // is field might be changed during external processes, outside of the app's form.
isCreateEssential?: boolean; // is field should participate in create process
isUpdateEssential?: boolean; // is field should participate in update process
lookupTable?: string; // lookup table name where from comes allowed values (should participate in server-side validations)
autocomplete?: {
type: 'domain' | 'service';
Expand Down
1 change: 1 addition & 0 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export * from './discreteIngestion/index';
export * from './pycsw/index';
export * from './rasterCatalog/index';
export * from './3dCatalog/index';
export * from './raster/ingestion/index';
export * from './polygonParts/index';
1 change: 1 addition & 0 deletions src/models/layerMetadata/bestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ProductType } from './enums';
import { DiscreteOrder } from './discreteOrder';

export interface IBestMetadata {
srsId: string | undefined;
productVersion: string | undefined;
maxResolutionDeg: number | undefined;
rms: number | undefined;
Expand Down
1 change: 0 additions & 1 deletion src/models/layerMetadata/interfaces/metadataCommonModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export interface IMetadataCommonModel {
classification: string | undefined;
productName: string | undefined;
description: string | undefined;
srsId: string | undefined;
srsName: string | undefined;
producerName: string | undefined;
updateDate: Date | undefined;
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/layer3DMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { catalogDB, ORMColumnType } from './decorators/property/catalogDB.decora
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';

export interface ILayer3DMetadata {
srsId: string | undefined;
productVersion: number | undefined;
creationDate: Date | undefined;
minResolutionMeter: number | undefined;
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/layerDEMMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTyp
import { ProductType, RecordStatus } from './enums';

export interface ILayerMetadata {
srsId: string | undefined;
resolutionDegree: number | undefined;
resolutionMeter: number | undefined;
absoluteAccuracyLEP90: number | undefined;
Expand Down
18 changes: 12 additions & 6 deletions src/models/layerMetadata/layerMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
IPropFieldConfigInfo,
} from '../common/decorators/fieldConfig/fieldConfig.decorator';
import { RecordType } from '../pycsw/coreEnums';
import { NewRasterLayerMetadata, UpdateRasterLayerMetadata } from '../raster/ingestion';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping, IPropSHPMapping } from './decorators/property/shp.decorator';
Expand All @@ -18,6 +19,7 @@ import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTyp
import { ProductType, Transparency, TileOutputFormat } from './enums';

export interface ILayerMetadata {
srs: string | undefined;
productVersion: string | undefined;
maxResolutionDeg: number | undefined;
rms: number | undefined;
Expand Down Expand Up @@ -188,7 +190,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
//#endregion
public description: string | undefined = undefined;

//#region COMMON: srsId
//#region COMMON: srs
@pycsw({
profile: 'mc_raster',
xmlElement: 'mc:SRS',
Expand Down Expand Up @@ -221,7 +223,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
],
})
//#endregion
public srsId: string | undefined = undefined;
public srs: string | undefined = undefined;

//#region COMMON: producerName
@pycsw({
Expand Down Expand Up @@ -775,12 +777,12 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
{
errorMsgCode: 'validation-field.maxResolutionDeg.min',
valueType: 'value',
min: 0.00000009,
min: 1.67638e-7,
},
{
errorMsgCode: 'validation-field.maxResolutionDeg.max',
valueType: 'value',
max: 0.072,
max: 0.703125,
},
],
isLifecycleEnvolved: true,
Expand Down Expand Up @@ -822,12 +824,12 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
{
errorMsgCode: 'validation-field.maxResolutionMeter.min',
valueType: 'value',
min: 0.01,
min: 0.0185,
},
{
errorMsgCode: 'validation-field.maxResolutionMeter.max',
valueType: 'value',
max: 8000,
max: 78273,
},
],
isLifecycleEnvolved: true,
Expand Down Expand Up @@ -1200,13 +1202,17 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {

public static getFieldConfigs(): IPropFieldConfigInfo[] {
const ret = [];
const newLayerMetadataProps = Object.keys(new NewRasterLayerMetadata());
const updatedLayerMetadataProps = Object.keys(new UpdateRasterLayerMetadata());
const layer = new LayerMetadata();
for (const prop in layer) {
const fieldConfigMap = getFieldConfig<LayerMetadata>(layer, prop);
if (fieldConfigMap) {
ret.push({
prop: prop,
...fieldConfigMap,
isCreateEssential: newLayerMetadataProps.includes(prop),
isUpdateEssential: updatedLayerMetadataProps.includes(prop),
});
}
}
Expand Down
10 changes: 9 additions & 1 deletion src/models/layerMetadata/pycswLayerCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { graphql } from '../common/decorators/graphQL/graphql.decorator';
import { graphqlClass } from '../common/decorators/graphQL/classGraphql.decorator';
import { FieldCategory, fieldConfig, getFieldConfig, IPropFieldConfigInfo } from '../common/decorators/fieldConfig/fieldConfig.decorator';
import { getFieldConfigClassInfo } from '../common/decorators/fieldConfig/classFieldConfig.decorator';
import { NewRasterLayerMetadata, UpdateRasterLayerMetadata } from '../raster/ingestion';
import { Link } from './link';
import { catalogDB, getCatalogDBMapping } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTypes.decorator';
Expand Down Expand Up @@ -232,11 +233,18 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore

public static getFieldConfigs(): IPropFieldConfigInfo[] {
const ret = [];
const newLayerMetadataProps = Object.keys(new NewRasterLayerMetadata());
const updatedLayerMetadataProps = Object.keys(new UpdateRasterLayerMetadata());
const layer = new PycswLayerCatalogRecord();
for (const prop in layer) {
const fieldConfigMap = getFieldConfig<PycswLayerCatalogRecord>(layer, prop);
if (fieldConfigMap) {
const fieldConfig = { prop: prop, ...fieldConfigMap };
const fieldConfig = {
prop: prop,
...fieldConfigMap,
isCreateEssential: newLayerMetadataProps.includes(prop),
isUpdateEssential: updatedLayerMetadataProps.includes(prop),
};
if (fieldConfigMap.complexType) {
fieldConfig.subFields = getFieldConfigClassInfo(fieldConfigMap.complexType.value);
}
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/quantizedMeshBestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { IPropSHPMapping } from './decorators/property/shp.decorator';

export interface IQuantizedMeshBestMetadata {
// Based on 3D Entity fields
srsId: string | undefined;
productVersion: number | undefined;
creationDate: Date | undefined;
minResolutionMeter: number | undefined;
Expand Down
Loading

0 comments on commit 9206307

Please sign in to comment.