Skip to content

Commit

Permalink
feat: isRequired + isAutoGenerated (#83)
Browse files Browse the repository at this point in the history
* feat: isRequired + isAutoGenerated

isRequired + isAutoGenerated

* fix: lint

lint

* fix: lint

lint

* feat: excel must fields

excel must fields

* fix: typo

typo
  • Loading branch information
EllaMartirosyan authored Jul 13, 2021
1 parent 35c35a5 commit f98c629
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"clean": "rimraf *.tgz Schema",
"release": "standard-version -t mc-model-types@",
"build": "tsc --project tsconfig.build.json",
"build": "tsc --project tsconfig.build.json",
"copy:yaml": "copyfiles -u 1 \"./src/yaml/**/*.yaml\" ./Schema",
"copy": "npm run copy:yaml",
"prepack": "npm run build && npm run copy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface IFieldConfigInfo {
isManuallyEditable?: boolean; // is field might be edited after creation
isFilterable?: boolean; // is field might participate in filter/search params
isSortable?: boolean; // is field might participate in sorting
isRequired?: boolean; // is field mandatory
isAutoGenerated?: boolean; // is field auto-generated
}

export interface IPropFieldConfigInfo extends IFieldConfigInfo {
Expand Down
12 changes: 12 additions & 0 deletions src/models/layerMetadata/layer3DMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
isRequired: true,
})
//#endregion
public classification: string | undefined = undefined;
Expand All @@ -112,6 +113,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
@fieldConfig({
category: FieldCategory.MAIN,
isManuallyEditable: true,
isRequired: true,
})
//#endregion
public productName: string | undefined = undefined;
Expand Down Expand Up @@ -165,6 +167,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isRequired: true,
})
//#endregion
public srsId: string | undefined = undefined;
Expand Down Expand Up @@ -192,6 +195,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GENERAL,
isRequired: true,
})
//#endregion
public producerName: string | undefined = undefined;
Expand Down Expand Up @@ -292,6 +296,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GENERAL,
isRequired: true,
})
//#endregion
public sourceDateStart: Date | undefined = undefined;
Expand All @@ -317,6 +322,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GENERAL,
isRequired: true,
})
//#endregion
public sourceDateEnd: Date | undefined = undefined;
Expand All @@ -342,6 +348,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isRequired: true,
})
//#endregion
public accuracyCE90: number | undefined = undefined;
Expand Down Expand Up @@ -371,6 +378,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
isRequired: true,
})
//#endregion
public sensorType: SensorType[] | undefined = undefined;
Expand All @@ -397,6 +405,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GENERAL,
isRequired: true,
})
//#endregion
public region: string | undefined = undefined;
Expand Down Expand Up @@ -477,6 +486,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.MAIN,
isRequired: true,
})
//#endregion
public version: string | undefined = undefined;
Expand Down Expand Up @@ -653,9 +663,11 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isRequired: true,
})
//#endregion
public accuracyLE90: number | undefined = undefined;
//#endregion

// //#region 3D: accuracySE90
// @pycsw({
Expand Down
1 change: 1 addition & 0 deletions src/models/layerMetadata/layerMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel {
@fieldConfig({
category: FieldCategory.MAIN,
isManuallyEditable: true,
isRequired: true,
})
//#endregion
public productName: string | undefined = undefined;
Expand Down
8 changes: 7 additions & 1 deletion src/models/layerMetadata/pycsw3DCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { IOrmCatalog } from '../common/interfaces/ormCatalog.interface';
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 { Link } from './link';
import { catalogDB, getCatalogDBMapping } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTypes.decorator';
import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator';
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { Layer3DMetadata, IPropPYCSWMapping } from './layer3DMetadata';
import { Link } from './link';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -37,6 +37,7 @@ export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreM
@graphql()
@fieldConfig({
category: FieldCategory.MAIN,
isAutoGenerated: true,
})
//#endregion
public id: string | undefined = 'UNKNOWN';
Expand Down Expand Up @@ -227,6 +228,11 @@ export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreM
@graphql({
nullable: true,
})
@fieldConfig({
category: FieldCategory.GENERAL,
complexType: TsTypes.LINKS,
isAutoGenerated: true,
})
//#endregion
public links: Link[] | undefined = undefined;

Expand Down
2 changes: 2 additions & 0 deletions src/models/layerMetadata/pycswLayerCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore
@graphql()
@fieldConfig({
category: FieldCategory.MAIN,
isAutoGenerated: true,
})
//#endregion
public id: string | undefined = undefined;
Expand Down Expand Up @@ -220,6 +221,7 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore
@fieldConfig({
category: FieldCategory.GENERAL,
complexType: TsTypes.LINKS,
isAutoGenerated: true,
})
//#endregion
public links: Link[] | undefined = undefined;
Expand Down

0 comments on commit f98c629

Please sign in to comment.