Skip to content

Commit

Permalink
introduct LEVEL constant
Browse files Browse the repository at this point in the history
  • Loading branch information
aramovic79 committed Dec 5, 2024
1 parent 96fef2a commit 6a456b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ const DESCRIPTION_PREFIX = "Description for ";

const ENTITY_RELATIONSHIP_ANNOTATION = "@EntityRelationship.entityType";

const LEVEL = Object.freeze({
aggregate: "aggregate",
rootEntity: "root-entity",
subEntity: "sub-entity",
});

const OPEN_RESOURCE_DISCOVERY_VERSION = "1.9";

const ORD_EXTENSIONS_PREFIX = "@ORD.Extensions.";
Expand Down Expand Up @@ -50,6 +56,7 @@ module.exports = {
CONTENT_MERGE_KEY,
DESCRIPTION_PREFIX,
ENTITY_RELATIONSHIP_ANNOTATION,
LEVEL,
OPEN_RESOURCE_DISCOVERY_VERSION,
ORD_EXTENSIONS_PREFIX,
ORD_ODM_ENTITY_NAME_ANNOTATION,
Expand Down
3 changes: 2 additions & 1 deletion lib/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const _ = require("lodash");
const {
DESCRIPTION_PREFIX,
ENTITY_RELATIONSHIP_ANNOTATION,
LEVEL,
ORD_EXTENSIONS_PREFIX,
ORD_ODM_ENTITY_NAME_ANNOTATION,
ORD_RESOURCE_TYPE,
Expand Down Expand Up @@ -175,7 +176,7 @@ const createEntityTypeTemplate = (appConfig, packageIds, entity) => {
visibility: RESOURCE_VISIBILITY.public,
partOfPackage: _getPackageID(appConfig.ordNamespace, packageIds, ORD_RESOURCE_TYPE.entityType),
releaseStatus: "active",
level: entity["@ObjectModel.compositionRoot"] || entity["@ODM.root"] ? "root-entity" : "sub-entity", // TODO
level: entity["@ObjectModel.compositionRoot"] || entity["@ODM.root"] ? LEVEL.rootEntity : LEVEL.subEntity,
extensible: {
supported: "no",
},
Expand Down

0 comments on commit 6a456b0

Please sign in to comment.