diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index 4164fb9..4f0b87a 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -1147,11 +1147,9 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }, }) @tsTypes({ - mappingType: TsTypes.STRING, - }) - @graphql({ - nullable: true, + mappingType: TsTypes.RECORD_STATUS, }) + @graphql() @fieldConfig({ category: FieldCategory.GENERAL, isManuallyEditable: true, diff --git a/src/models/layerMetadata/quantizedMeshBestMetadata.ts b/src/models/layerMetadata/quantizedMeshBestMetadata.ts index 8e6be01..02e5d42 100644 --- a/src/models/layerMetadata/quantizedMeshBestMetadata.ts +++ b/src/models/layerMetadata/quantizedMeshBestMetadata.ts @@ -10,33 +10,32 @@ import { } from '../common/decorators/fieldConfig/fieldConfig.decorator'; import { RecordType } from '../pycsw/coreEnums'; import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator'; -import { catalogDB, getCatalogDBMapping, ICatalogDBMapping } from './decorators/property/catalogDB.decorator'; +import { catalogDB, getCatalogDBMapping, ICatalogDBMapping, ORMColumnType } from './decorators/property/catalogDB.decorator'; import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator'; import { IMetadataCommonModel } from './interfaces/metadataCommonModel'; -import { ProductType } from './enums'; +import { ProductType, RecordStatus } from './enums'; export interface IQuantizedMeshBestMetadata { // Based on 3D Entity fields - productVersion: string | undefined; + productVersion: number | undefined; creationDate: Date | undefined; minResolutionMeter: number | undefined; maxResolutionMeter: number | undefined; - // nominalResolution: number | undefined; maxAccuracyCE90: number | undefined; - // absoluteAccuracyLEP90: number | undefined; + // absoluteAccuracyLE90: number | undefined; // accuracySE90: number | undefined; - // relativeAccuracyLEP90: number | undefined; + // relativeAccuracySE90: number | undefined; // visualAccuracy: number | undefined; heightRangeFrom: number | undefined; heightRangeTo: number | undefined; - // srsOrigin: string | undefined; productionSystem: string | undefined; productionSystemVer: string | undefined; - productionMethod: string | undefined; // minFlightAlt: number | undefined; // maxFlightAlt: number | undefined; geographicArea: string | undefined; productBoundingBox: string | undefined; + productSource: string | undefined; + productStatus: RecordStatus | undefined; // Description field must include info: // undulationModel: UndulationModel | undefined; @@ -51,6 +50,7 @@ export interface IPropPYCSWMapping extends IPYCSWMapping { export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IMetadataCommonModel { //#region QUANTIZED_MESH_BEST SPECIFIC FIELDS + //#region QUANTIZED_MESH_BEST: type @pycsw({ profile: 'mc_quantized_mesh_best', @@ -99,7 +99,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM isAutoGenerated: true, }) //#endregion - public productId: string | undefined = 'UNKNOWN'; + public productId: string | undefined = undefined; //#region QUANTIZED_MESH_BEST: productName @pycsw({ @@ -112,7 +112,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM column: { name: 'product_name', type: 'text', - nullable: true, + nullable: false, }, }) @tsTypes({ @@ -143,12 +143,12 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM @catalogDB({ column: { name: 'product_version', - type: 'text', + type: 'int', nullable: false, }, }) @tsTypes({ - mappingType: TsTypes.STRING, + mappingType: TsTypes.NUMBER, }) @graphql({ nullable: true, @@ -158,7 +158,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM isAutoGenerated: true, }) //#endregion - public productVersion: string | undefined = undefined; + public productVersion: number | undefined = undefined; //#region QUANTIZED_MESH_BEST: productType @pycsw({ @@ -171,7 +171,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM column: { name: 'product_type', type: 'text', - nullable: true, + nullable: false, }, }) @tsTypes({ @@ -248,15 +248,17 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM //#region COMMON: updateDate @pycsw({ - profile: 'mc_raster', + profile: 'mc_quantized_mesh_best', xmlElement: 'mc:updateDateUTC', queryableField: 'mc:updateDateUTC', - pycswField: 'pycsw:UpdateDate', + pycswField: 'pycsw:updateDate', }) @catalogDB({ + columnType: ORMColumnType.UPDATE_DATE_COLUMN, column: { name: 'update_date', type: 'timestamp without time zone', + nullable: true, }, }) @tsTypes({ @@ -366,6 +368,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.MAIN, + isManuallyEditable: true, infoMsgCode: ['info-field-tooltip.meter.tooltip', 'info-field-tooltip.minResolutionMeter.min', 'info-field-tooltip.minResolutionMeter.max'], validation: [ { @@ -405,6 +408,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.MAIN, + isManuallyEditable: true, infoMsgCode: ['info-field-tooltip.meter.tooltip', 'info-field-tooltip.maxResolutionMeter.min', 'info-field-tooltip.maxResolutionMeter.max'], validation: [ { @@ -444,6 +448,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isManuallyEditable: true, infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.maxAccuracyCE90.min', 'info-field-tooltip.maxAccuracyCE90.max'], validation: [ { @@ -476,6 +481,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM column: { name: 'sensor_type', type: 'text', + nullable: false, }, field: { overrideType: TsTypes.STRING, @@ -489,6 +495,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GENERAL, + isManuallyEditable: true, infoMsgCode: ['info-field-tooltip.sensors.tooltip', 'info-general-tooltip.required'], validation: [ { @@ -555,6 +562,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isManuallyEditable: true, infoMsgCode: ['info-field-tooltip.meter.tooltip'], }) //#endregion @@ -582,6 +590,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GEO_INFO, + isManuallyEditable: true, infoMsgCode: ['info-field-tooltip.meter.tooltip'], }) //#endregion @@ -668,7 +677,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM column: { name: 'region', type: 'text', - nullable: true, + nullable: false, }, field: { overrideType: TsTypes.STRING, @@ -691,7 +700,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM ], }) //#endregion - public region: string[] | undefined = ['UNKNOWN']; + public region: string[] | undefined = undefined; //#region QUANTIZED_MESH_BEST: classification @pycsw({ @@ -715,7 +724,6 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GENERAL, - isManuallyEditable: true, infoMsgCode: ['info-general-tooltip.required'], validation: [ { @@ -805,7 +813,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM name: 'producer_name', type: 'text', default: 'IDFMU', - nullable: true, + nullable: false, }, }) @tsTypes({ @@ -816,7 +824,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM }) @fieldConfig({ category: FieldCategory.GENERAL, - isAutoGenerated: true, + isManuallyEditable: true, infoMsgCode: ['info-general-tooltip.required'], validation: [ { @@ -828,18 +836,17 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM //#endregion public producerName: string | undefined = undefined; - //#region QUANTIZED_MESH_BEST: productionMethod + //#region QUANTIZED_MESH_BEST: geographicArea @pycsw({ profile: 'mc_quantized_mesh_best', - xmlElement: 'mc:productionMethod', - queryableField: 'mc:productionMethod', - pycswField: 'pycsw:productionMethod', + xmlElement: 'mc:geographicArea', + queryableField: 'mc:geographicArea', + pycswField: 'pycsw:geographicArea', }) @catalogDB({ column: { - name: 'production_method', + name: 'geographic_area', type: 'text', - default: 'photogrammetric', nullable: true, }, }) @@ -854,20 +861,20 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM isManuallyEditable: true, }) //#endregion - public productionMethod: string | undefined = undefined; + public geographicArea: string | undefined = undefined; - //#region QUANTIZED_MESH_BEST: geographicArea + //#region QUANTIZED_MESH_BEST: productBoundingBox @pycsw({ profile: 'mc_quantized_mesh_best', - xmlElement: 'mc:geographicArea', - queryableField: 'mc:geographicArea', - pycswField: 'pycsw:geographicArea', + xmlElement: 'mc:productBBox', + queryableField: 'mc:productBBox', + pycswField: 'pycsw:productBBox', }) @catalogDB({ column: { - name: 'geographic_area', + name: 'product_bbox', type: 'text', - nullable: true, + nullable: false, }, }) @tsTypes({ @@ -877,22 +884,23 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM nullable: true, }) @fieldConfig({ - category: FieldCategory.GENERAL, - isManuallyEditable: true, + category: FieldCategory.GEO_INFO, + isAutoGenerated: true, }) //#endregion - public geographicArea: string | undefined = undefined; + public productBoundingBox: string | undefined = undefined; + //#endregion - //#region QUANTIZED_MESH_BEST: productBoundingBox + //#region QUANTIZED_MESH_BEST: productSource @pycsw({ profile: 'mc_quantized_mesh_best', - xmlElement: 'mc:productBBox', - queryableField: 'mc:productBBox', - pycswField: 'pycsw:productBBox', + xmlElement: 'mc:productSource', + queryableField: 'mc:productSource', + pycswField: 'pycsw:productSource', }) @catalogDB({ column: { - name: 'product_bbox', + name: 'product_source', type: 'text', nullable: false, }, @@ -904,11 +912,38 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM nullable: true, }) @fieldConfig({ - category: FieldCategory.GEO_INFO, + category: FieldCategory.GENERAL, isAutoGenerated: true, }) //#endregion - public productBoundingBox: string | undefined = undefined; + public productSource: string | undefined = undefined; + //#endregion + + //#region QUANTIZED_MESH_BEST: productStatus + @pycsw({ + profile: 'mc_quantized_mesh_best', + xmlElement: 'mc:productStatus', + queryableField: 'mc:productStatus', + pycswField: 'pycsw:productStatus', + }) + @catalogDB({ + column: { + name: 'product_status', + type: 'text', + default: RecordStatus.UNPUBLISHED, + nullable: false, + }, + }) + @tsTypes({ + mappingType: TsTypes.RECORD_STATUS, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GENERAL, + isManuallyEditable: true, + }) + //#endregion + public productStatus: RecordStatus | undefined = RecordStatus.UNPUBLISHED; //#endregion public static getPyCSWMapping(prop: string): IPYCSWMapping | undefined {