@api-client/core 0.18.21 → 0.18.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
  2. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  3. package/build/src/modeling/helpers/Intelisense.js +1 -0
  4. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  5. package/build/src/modeling/templates/index.d.ts +1 -0
  6. package/build/src/modeling/templates/index.d.ts.map +1 -1
  7. package/build/src/modeling/templates/index.js +2 -0
  8. package/build/src/modeling/templates/index.js.map +1 -1
  9. package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
  10. package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
  11. package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
  12. package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  13. package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
  14. package/build/src/modeling/templates/meta/index.d.ts +2 -2
  15. package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
  16. package/build/src/modeling/templates/meta/index.js +31 -1
  17. package/build/src/modeling/templates/meta/index.js.map +1 -1
  18. package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  19. package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
  20. package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  21. package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
  22. package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  23. package/build/src/modeling/templates/template-registry.d.ts +14 -0
  24. package/build/src/modeling/templates/template-registry.d.ts.map +1 -1
  25. package/build/src/modeling/templates/template-registry.js +63 -0
  26. package/build/src/modeling/templates/template-registry.js.map +1 -1
  27. package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
  28. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
  29. package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
  30. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
  31. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
  32. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
  33. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
  34. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
  35. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
  36. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
  37. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
  38. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
  39. package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
  40. package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
  41. package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
  42. package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
  43. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
  44. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
  45. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
  46. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
  47. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
  48. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
  49. package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
  50. package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
  51. package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
  52. package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
  53. package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
  54. package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
  55. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
  56. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
  57. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
  58. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
  59. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
  60. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
  61. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
  62. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
  63. package/build/src/modeling/templates/verticals/index.d.ts +79 -0
  64. package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
  65. package/build/src/modeling/templates/verticals/index.js +186 -0
  66. package/build/src/modeling/templates/verticals/index.js.map +1 -0
  67. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
  68. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
  69. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
  70. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
  71. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
  72. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
  73. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
  74. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
  75. package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
  76. package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
  77. package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
  78. package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
  79. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
  80. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
  81. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
  82. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
  83. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
  84. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
  85. package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
  86. package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
  87. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
  88. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
  89. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
  90. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
  91. package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
  92. package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
  93. package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
  94. package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
  95. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
  96. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
  97. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
  98. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
  99. package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
  100. package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
  101. package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
  102. package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
  103. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
  104. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
  105. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
  106. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
  107. package/build/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +1 -1
  109. package/src/modeling/helpers/Intelisense.ts +1 -0
  110. package/src/modeling/templates/meta/education-management-platform.json +1 -0
  111. package/src/modeling/templates/meta/financial-services-platform.json +1 -0
  112. package/src/modeling/templates/meta/gaming-platform.json +1 -0
  113. package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  114. package/src/modeling/templates/meta/hospitality-platform.json +1 -0
  115. package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  116. package/src/modeling/templates/meta/legal-services-platform.json +1 -0
  117. package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  118. package/src/modeling/templates/meta/non-profit-platform.json +1 -0
  119. package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  120. package/src/modeling/templates/readme.md +14 -0
  121. package/src/modeling/templates/template-registry.ts +73 -0
  122. package/src/modeling/templates/verticals/README.md +122 -0
  123. package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
  124. package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
  125. package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
  126. package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
  127. package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
  128. package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
  129. package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
  130. package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
  131. package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
  132. package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
  133. package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
  134. package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
  135. package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
  136. package/build/src/modeling/templates/blog-domain.js.map +0 -1
  137. package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
  138. package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
@@ -384,6 +384,7 @@ export declare function addWeightField(entity: DomainEntity, info?: Partial<IThi
384
384
  export declare function addImagesField(entity: DomainEntity, info?: Partial<IThing>): DomainProperty;
385
385
  /**
386
386
  * Adds a status field with custom enum values to the specified entity.
387
+ * This is not a regular enum field, it should represent a record status.
387
388
  * If a status field already exists, it returns the existing field.
388
389
  * Otherwise, it creates a new status field with provided enum values.
389
390
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Intelisense.d.ts","sourceRoot":"","sources":["../../../../src/modeling/helpers/Intelisense.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAWnD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa,CAyDnF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,aAAa,CAiB1F;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,Y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O,CAAC,MAAM,CAAM,GAAG,cAAc,CAY/F;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,EAAE,EACpB,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GACzB,cAAc,CAmBhB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,SAAU,EACtB,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GACzB,cAAc,CAiBhB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,cAAc,CAUlG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,cAAc,CAUlG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,cAAc,CAmBlG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE,OAAO,CAAC,MAAM,CAAM,GACzB,cAAc,CAkBhB;AA0LD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,EAAE,CA4B1E"}
@@ -813,6 +813,7 @@ export function addImagesField(entity, info = {}) {
813
813
  }
814
814
  /**
815
815
  * Adds a status field with custom enum values to the specified entity.
816
+ * This is not a regular enum field, it should represent a record status.
816
817
  * If a status field already exists, it returns the existing field.
817
818
  * Otherwise, it creates a new status field with provided enum values.
818
819
  *
@@ -1 +1 @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CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAC5F,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAoB,EAAE,SAAiB,EAAE,MAAM,GAAG,KAAK;IAC/E,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAC7E,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,MAAM,CAAC,CAAA;AAC5F,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAC/F,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAChF,MAAM,CACP,CAAA;AACH,CAAC","sourcesContent":["import type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainElement } from '../DomainElement.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { IThing } from '../../models/Thing.js'\nimport { SemanticType } from '../Semantics.js'\nimport { createEmailSemantic } from '../definitions/Email.js'\nimport { createPasswordSemantic } from '../definitions/Password.js'\nimport { createPhoneSemantic } from '../definitions/Phone.js'\nimport { createPublicUniqueNameSemantic, DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG } from '../definitions/PublicUniqueName.js'\nimport { createDescriptionSemantic } from '../definitions/Description.js'\nimport { createCurrencySemantic } from '../definitions/Currency.js'\nimport { createStatusSemantic } from '../definitions/Status.js'\nimport { SKU_PRESETS } from '../definitions/SKU.js'\n\n/**\n * Adds a field to the given entity that is automatically generated by the system.\n *\n * @param entity The entity to which the auto field will be added.\n * @param autoField The name of the auto field to add.\n * @returns The added DomainElement representing the auto field.\n * @throws Error if the auto field is not supported.\n */\nexport function addAutoField(entity: DomainEntity, autoField: string): DomainElement {\n switch (autoField) {\n case 'id':\n return addIdField(entity)\n case 'email':\n return addEmailField(entity)\n case 'name':\n return addNameField(entity)\n case 'description':\n return addDescriptionField(entity)\n case 'status':\n return addStatusField(entity)\n case 'version':\n return addVersionField(entity)\n case 'owner':\n return addOwnerField(entity)\n case 'created':\n return addCreatedAtField(entity)\n // case 'created-by':\n // return addCreatedByField(entity)\n case 'updated':\n return addUpdatedAtField(entity)\n case 'updated-by':\n return addUpdatedByField(entity)\n case 'is-deleted':\n return addIsDeletedField(entity)\n case 'deleted':\n return addDeletedAtField(entity)\n case 'first-name':\n return addFirstNameField(entity)\n case 'last-name':\n return addLastNameField(entity)\n case 'phone':\n return addPhoneField(entity)\n case 'avatar-url':\n return addAvatarUrlField(entity)\n case 'public-unique-name':\n return addPublicUniqueNameField(entity)\n case 'price':\n return addPriceField(entity)\n case 'sku':\n return addSkuField(entity)\n case 'quantity':\n return addQuantityField(entity)\n case 'weight':\n return addWeightField(entity)\n case 'images':\n return addImagesField(entity)\n case 'session-id':\n return addSessionIdField(entity)\n case 'expires-at':\n return addExpiresAtField(entity)\n case 'unit-price':\n return addUnitPriceField(entity)\n default:\n throw new Error(`Unsupported auto field: ${autoField}`)\n }\n}\n\n/**\n * Adds the primary field (ID) to the given entity.\n * If the ID field already exists, it returns the existing field.\n * Otherwise, it creates a new ID field with a name based on the entity's name.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'id'\n * - primary: true\n * - readOnly: true\n * - schema.defaultValue: { type: 'function', value: 'uuid-v4' }\n *\n * @param entity The entity to which the ID field will be added.\n * @returns The added primary field property.\n */\nexport function addIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findIdField(entity, true)\n if (existing) {\n // If the ID field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: `id`, ...info },\n primary: true,\n readOnly: true,\n // I don't think we need to index the ID field..\n // index: true,\n type: 'string',\n // @TODO: We should experiment with the random ID generation using the nano library.\n schema: { defaultValue: { type: 'function', value: 'uuid-v4' } },\n })\n return prop\n}\n\n/**\n * Adds an email field to the given entity.\n * If the email field already exists, it returns the existing field.\n * Otherwise, it creates a new email field with a semantic annotation.\n * @param entity The entity to which the email field will be added.\n * @returns The added email field property.\n */\nexport function addEmailField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findEmailField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'email', displayName: 'Email Address', ...info },\n type: 'string',\n required: true,\n index: true,\n semantics: [\n createEmailSemantic({\n requireVerification: true,\n verificationMethod: 'email',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a password field to the given entity.\n * If the password field already exists, it returns the existing field.\n * Otherwise, it creates a new password field with a semantic annotation.\n * @param entity The entity to which the password field will be added.\n * @param info Additional information for the password field.\n * @returns The added password field property.\n */\nexport function addPasswordField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findPasswordField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'password', displayName: 'Password', ...info },\n type: 'string',\n required: true,\n semantics: [\n createPasswordSemantic({\n requireSpecialChars: true,\n requireNumbers: true,\n requireUppercase: true,\n requireLowercase: true,\n minLength: 8,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a version field to the given entity.\n * @param entity The entity to which the version field will be added.\n * The version field is used to track the version of the entity.\n * @returns The added version field property.\n */\nexport function addVersionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findVersionField(entity, true)\n if (existing) {\n // If the version field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'version', displayName: 'Version', ...info },\n readOnly: true,\n index: true,\n type: 'number',\n schema: { defaultValue: { type: 'function', value: 'incremental' }, minimum: 0 },\n })\n prop.addSemantic({\n id: SemanticType.Version,\n })\n return prop\n}\n\nexport function addNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'name', displayName: 'Name', ...info },\n type: 'string',\n })\n prop.addSemantic({\n id: SemanticType.Title,\n })\n return prop\n}\n\n/**\n * Adds a description field to the specified entity.\n * If a description field already exists, it returns the existing field.\n * Otherwise, it creates a new description field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'description'\n * - info.displayName: 'Description'\n *\n * Set semantics:\n * - `SemanticType.Description`\n *\n * @param entity The entity to which the description field will be added.\n * @returns The added description field property.\n */\nexport function addDescriptionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findDescriptionField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'description', displayName: 'Description', ...info },\n type: 'string',\n semantics: [createDescriptionSemantic()],\n })\n return prop\n}\n\n/**\n * Adds a status field to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - schema.enum: ['Active', 'Draft', 'Archived']\n * - schema.defaultValue: { type: 'literal', value: 'Draft' }\n *\n * Set semantics:\n * - `SemanticType.Status`\n *\n * @param entity The entity to which the status field will be added.\n * @param info Additional information about the field.\n * @returns The added status field property.\n */\nexport function addStatusField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n schema: {\n enum: ['Active', 'Draft', 'Archived'],\n defaultValue: { type: 'literal', value: 'Draft' },\n },\n })\n prop.addSemantic({\n id: SemanticType.Status,\n })\n return prop\n}\n\n/**\n * Adds an owner field to the specified entity.\n * If an owner field already exists, it returns the existing field.\n * Otherwise, it creates a new owner field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'owner'\n * - info.displayName: 'Owner'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the owner field will be added.\n * @param info Additional information about the field.\n * @returns The added owner field property.\n */\nexport function addOwnerField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findOwnerField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'owner', displayName: 'Owner', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n// This is owner with different name. Use that one instead.\n// function addCreatedByField(entity: DomainEntity): DomainElement {\n// const existing = findCreatedByField(entity, true)\n// if (existing) {\n// return existing\n// }\n// const prop = entity.addProperty({\n// info: { name: 'created_by', displayName: 'Created By' },\n// type: 'string',\n// readOnly: true,\n// index: true,\n// })\n// prop.addSemantic({\n// id: SemanticType.CreatedTimestamp,\n// })\n// return prop\n// }\n\n/**\n * Adds an updated by field to the specified entity as an association to the User entity.\n * If an updated by field already exists, it returns the existing field.\n * Otherwise, it creates a new updated by field with the specified information.\n *\n * Set properties:\n * - info.name: 'updated_by'\n * - info.displayName: 'Updated By'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the updated by field will be added.\n * @param info Additional information about the field.\n * @returns The added updated by field property.\n */\nexport function addUpdatedByField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findUpdatedByField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'updated_by', displayName: 'Updated By', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n/**\n * Adds a created at field to the specified entity.\n * If a created at field already exists, it returns the existing field.\n * Otherwise, it creates a new created at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'created_at'\n * - info.displayName: 'Created At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `CreatedTimestamp`\n *\n * @param entity The entity to which the created at field will be added.\n * @param info Additional information about the field.\n * @returns The created created at field.\n */\nexport function addCreatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findCreatedAtField(entity, true)\n if (existing) {\n // If the created_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'created_at', displayName: 'Created At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.CreatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an updated at field to the specified entity.\n * If an updated at field already exists, it returns the existing field.\n * Otherwise, it creates a new updated at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'updated_at'\n * - info.displayName: 'Updated At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `UpdatedTimestamp`\n *\n * @param entity The entity to which the updated at field will be added.\n * @param info Additional information about the field.\n * @returns The created updated at field.\n */\nexport function addUpdatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUpdatedAtField(entity, true)\n if (existing) {\n // If the updated_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'updated_at', displayName: 'Updated At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.UpdatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds a deleted at field to the specified entity.\n * If a deleted at field already exists, it returns the existing field.\n * Otherwise, it creates a new deleted at field with the specified information.\n *\n * Set properties:\n * - required: true\n * - type: 'datetime'\n * - info.name: 'deleted_at'\n * - info.displayName: 'Deleted At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `SemanticType.DeletedTimestamp`\n *\n * @param entity The entity to which the deleted_at field will be added.\n * @param info Additional information about the field.\n * @returns The added deleted at field property.\n */\nexport function addDeletedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findDeletedAtField(entity, true)\n if (existing) {\n // If the deleted_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'deleted_at', displayName: 'Deleted At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an is_deleted field to the specified entity.\n * If an is_deleted field already exists, it returns the existing field.\n * Otherwise, it creates a new is_deleted field with the specified information.\n *\n * Set properties:\n * - type: 'boolean'\n * - info.name: 'is_deleted'\n * - info.displayName: 'Is Deleted'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'literal', value: 'false' }\n *\n * Set semantics:\n * - `SemanticType.DeletedFlag`\n *\n * @param entity The entity to which the is_deleted field will be added.\n * @param info Additional information about the field.\n * @returns The added is_deleted field property.\n */\nexport function addIsDeletedField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findIsDeletedField(entity, true)\n if (existing) {\n // If the is_deleted field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'is_deleted', displayName: 'Is Deleted', ...info },\n readOnly: true,\n index: true,\n type: 'boolean',\n schema: { defaultValue: { type: 'literal', value: 'false' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedFlag,\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addFirstNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findFirstNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'first_name', displayName: 'First Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addLastNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findLastNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'last_name', displayName: 'Last Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a phone field to the specified entity.\n * If a phone field already exists, it returns the existing field.\n * Otherwise, it creates a new phone field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'phone'\n * - info.displayName: 'Phone Number'\n * - index: true (to search by phone number)\n *\n * Set semantics:\n * - id: SemanticType.Phone\n *\n * @param entity The entity to which the phone field will be added.\n * @param info Additional information about the field.\n * @returns The created phone field.\n */\nexport function addPhoneField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPhoneField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'phone', displayName: 'Phone Number', ...info },\n type: 'string',\n index: true,\n semantics: [\n createPhoneSemantic({\n format: 'international',\n requireCountryCode: true,\n requireVerification: true,\n verificationMethod: 'sms',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds an avatar URL field to the specified entity.\n * If an avatar URL field already exists, it returns the existing field.\n * Otherwise, it creates a new avatar URL field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'avatar_url'\n * - info.displayName: 'Avatar URL'\n *\n * Set semantics:\n * - id: SemanticType.ImageURL\n *\n * @param entity The entity to which the avatar URL field will be added.\n * @param info Additional information about the field.\n * @returns The created avatar URL field.\n */\nexport function addAvatarUrlField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findAvatarUrlField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'avatar_url', displayName: 'Avatar URL', ...info },\n type: 'string',\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a public unique name (slug) field to the specified entity.\n * If a public unique name field already exists, it returns the existing field.\n * Otherwise, it creates a new public unique name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'slug'\n * - info.displayName: 'Public Unique Name'\n * - index: true\n * - required: true\n * - unique: true\n *\n * Set semantics:\n * - id: SemanticType.PublicUniqueName\n *\n * @param entity The entity to which the public unique name field will be added.\n * @param info Additional information about the field.\n * @returns The created public unique name field.\n */\nexport function addPublicUniqueNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPublicUniqueNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'slug', displayName: 'Public Unique Name', ...info },\n type: 'string',\n index: true,\n required: true,\n unique: true,\n semantics: [createPublicUniqueNameSemantic(DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG)],\n })\n return prop\n}\n\n/**\n * Adds a SKU field to the specified entity.\n * If a SKU field already exists, it returns the existing field.\n * Otherwise, it creates a new SKU field with semantic annotation.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sku'\n * - info.displayName: 'SKU'\n * - required: true\n * - unique: true\n *\n * @param entity The entity to which the SKU field will be added.\n * @param info Additional information about the field.\n * @returns The created SKU field.\n */\nexport function addSkuField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSkuField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sku', displayName: 'SKU', ...info },\n type: 'string',\n required: true,\n unique: true,\n semantics: [{ ...SKU_PRESETS.PRODUCT_STANDARD }],\n })\n return prop\n}\n\n/**\n * Adds a price field to the specified entity with currency semantic.\n * If a price field already exists, it returns the existing field.\n * Otherwise, it creates a new price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'price'\n * - info.displayName: 'Price'\n * - required: true\n * - schema.maximum: 0\n *\n * @param entity The entity to which the price field will be added.\n * @param info Additional information about the field.\n * @returns The created price field.\n */\nexport function addPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'price', displayName: 'Price', ...info },\n type: 'number',\n required: true,\n schema: {\n maximum: 0,\n },\n bindings: [\n {\n type: 'web',\n schema: {\n dataType: 'float',\n },\n },\n ],\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n validateCurrencyCode: true,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a quantity field to the specified entity.\n * If a quantity field already exists, it returns the existing field.\n * Otherwise, it creates a new quantity field with validation.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'quantity'\n * - info.displayName: 'Quantity'\n * - required: true\n * - schema.minimum: 0\n *\n * @param entity The entity to which the quantity field will be added.\n * @param info Additional information about the field.\n * @returns The created quantity field.\n */\nexport function addQuantityField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findQuantityField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'quantity', displayName: 'Quantity', ...info },\n type: 'number',\n required: true,\n schema: {\n minimum: 0,\n },\n })\n return prop\n}\n\n/**\n * Adds a weight field to the specified entity.\n * If a weight field already exists, it returns the existing field.\n * Otherwise, it creates a new weight field.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'weight'\n * - info.displayName: 'Weight'\n *\n * @param entity The entity to which the weight field will be added.\n * @param info Additional information about the field.\n * @returns The created weight field.\n */\nexport function addWeightField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findWeightField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'weight', displayName: 'Weight', ...info },\n type: 'number',\n })\n return prop\n}\n\n/**\n * Adds an images field to the specified entity for multiple image URLs.\n * If an images field already exists, it returns the existing field.\n * Otherwise, it creates a new images field with ImageURL semantic.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'images'\n * - info.displayName: 'Images'\n * - multiple: true\n *\n * @param entity The entity to which the images field will be added.\n * @param info Additional information about the field.\n * @returns The created images field.\n */\nexport function addImagesField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findImagesField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'images', displayName: 'Images', ...info },\n type: 'string',\n multiple: true,\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a status field with custom enum values to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with provided enum values.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - required: true\n * - schema.enum: provided enum values\n * - schema.defaultValue: first enum value\n *\n * @param entity The entity to which the status field will be added.\n * @param enumValues Array of status values.\n * @param info Additional information about the field.\n * @returns The created status field.\n */\nexport function addCustomStatusField(\n entity: DomainEntity,\n enumValues: string[],\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n required: true,\n semantics: [createStatusSemantic()],\n schema: {\n enum: enumValues,\n defaultValue: {\n type: 'literal',\n value: enumValues[0],\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a boolean field to the specified entity.\n * If the field already exists, it returns the existing field.\n * Otherwise, it creates a new boolean field with default value.\n *\n * Set properties:\n * - type: 'boolean'\n * - required: true\n * - schema.defaultValue: provided default or 'false'\n *\n * @param entity The entity to which the boolean field will be added.\n * @param fieldName Name of the boolean field.\n * @param defaultValue Default boolean value.\n * @param info Additional information about the field.\n * @returns The created boolean field.\n */\nexport function addBooleanField(\n entity: DomainEntity,\n fieldName: string,\n defaultValue = 'false',\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findBooleanField(entity, fieldName, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: fieldName, ...info },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: defaultValue,\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a session ID field to the specified entity.\n * If a session ID field already exists, it returns the existing field.\n * Otherwise, it creates a new session ID field.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sessionId'\n * - info.displayName: 'Session ID'\n *\n * @param entity The entity to which the session ID field will be added.\n * @param info Additional information about the field.\n * @returns The created session ID field.\n */\nexport function addSessionIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSessionIdField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sessionId', displayName: 'Session ID', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds an expiration datetime field to the specified entity.\n * If an expiration field already exists, it returns the existing field.\n * Otherwise, it creates a new expiration field.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'expiresAt'\n * - info.displayName: 'Expires At'\n *\n * @param entity The entity to which the expiration field will be added.\n * @param info Additional information about the field.\n * @returns The created expiration field.\n */\nexport function addExpiresAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findExpiresAtField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'expiresAt', displayName: 'Expires At', ...info },\n type: 'datetime',\n })\n return prop\n}\n\n/**\n * Adds a unit price field to the specified entity with currency semantic.\n * If a unit price field already exists, it returns the existing field.\n * Otherwise, it creates a new unit price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'unitPrice'\n * - info.displayName: 'Unit Price'\n * - required: true\n *\n * @param entity The entity to which the unit price field will be added.\n * @param info Additional information about the field.\n * @returns The created unit price field.\n */\nexport function addUnitPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUnitPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'unitPrice', displayName: 'Unit Price', ...info },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a currency amount field (subtotal, tax, shipping, etc.).\n */\nexport function addCurrencyAmountField(\n entity: DomainEntity,\n fieldName: string,\n displayName: string,\n info: Partial<IThing> = {}\n): DomainProperty {\n return entity.addProperty({\n info: {\n name: fieldName,\n displayName,\n ...info,\n },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n ],\n })\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field property or undefined.\n */\nfunction findPropertyField(\n entity: DomainEntity,\n predicate: (property: DomainProperty) => boolean,\n direct = false\n): DomainProperty | undefined {\n for (const property of entity.properties) {\n if (predicate(property)) {\n return property\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const property of parent.properties) {\n if (predicate(property)) {\n return property\n }\n }\n }\n return undefined\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field association or undefined.\n */\nfunction findAssociationField(\n entity: DomainEntity,\n predicate: (property: DomainAssociation) => boolean,\n direct = false\n): DomainAssociation | undefined {\n for (const assoc of entity.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const assoc of parent.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n }\n return undefined\n}\n\n/**\n * Searches for the ID field in the given entity.\n * @param entity The entity to search for the ID field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found ID field property or undefined.\n */\nfunction findIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n if (!direct) {\n // Find the primary key property in the entity, which can be inherited or defined on the entity itself.\n return entity.primaryKey()\n }\n for (const property of entity.properties) {\n if (property.primary) {\n return property\n }\n }\n}\n\n/**\n * Searches for the email field in the given entity.\n * @param entity The entity to search for the email field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found email field property or undefined.\n */\nfunction findEmailField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Email), direct)\n}\n\n/**\n * Searches for the password field in the given entity.\n * @param entity The entity to search for the password field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found password field property or undefined.\n */\nfunction findPasswordField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Password), direct)\n}\n\nfunction findVersionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.Version)\n },\n direct\n )\n}\n\nfunction findNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Title), direct)\n}\n\nfunction findDescriptionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Description), direct)\n}\n\nfunction findStatusField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Status), direct)\n}\n\nfunction findOwnerField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['owner', 'author'].includes(association.info.name || ''),\n direct\n )\n}\n\n// function findCreatedByField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n// return findField(entity, (property) => property.hasSemantic(SemanticType.CreatedTimestamp), direct)\n// }\n\nfunction findUpdatedByField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['updated_by', 'updatedBy'].includes(association.info.name || ''),\n direct\n )\n}\n\nfunction findCreatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.CreatedTimestamp)\n },\n direct\n )\n}\n\nfunction findUpdatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.UpdatedTimestamp)\n },\n direct\n )\n}\n\nfunction findDeletedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.DeletedTimestamp)\n },\n direct\n )\n}\n\nfunction findIsDeletedField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.DeletedFlag), direct)\n}\n\nexport function addRecommendedFields(entity: DomainEntity): DomainElement[] {\n const fields: DomainElement[] = []\n if (!findIdField(entity)) {\n fields.push(addIdField(entity))\n }\n // The version field is not always recommended, so we don't add it by default.\n // if (!findVersionField(entity)) {\n // fields.push(addVersionField(entity))\n // }\n if (!findCreatedAtField(entity)) {\n fields.push(addCreatedAtField(entity))\n }\n // if (!findCreatedByField(entity)) {\n // fields.push(addCreatedByField(entity))\n // }\n if (!findUpdatedAtField(entity)) {\n fields.push(addUpdatedAtField(entity))\n }\n if (!findUpdatedByField(entity)) {\n fields.push(addUpdatedByField(entity))\n }\n if (!findDeletedAtField(entity)) {\n fields.push(addDeletedAtField(entity))\n }\n if (!findIsDeletedField(entity)) {\n fields.push(addIsDeletedField(entity))\n }\n return fields\n}\n\nfunction findFirstNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['first_name', 'firstName'].includes(property.info.name || ''), direct)\n}\n\nfunction findLastNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['last_name', 'lastName'].includes(property.info.name || ''), direct)\n}\n\n// Avatar URL has the `SemanticType.ImageURL` semantic, but it can be used for any image URL.\n// It is not a specific semantic, but it is a common field in many entities.\nfunction findAvatarUrlField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['avatar_url', 'avatarUrl'].includes(property.info.name || ''), direct)\n}\n\nfunction findPhoneField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Phone), direct)\n}\n\nfunction findPublicUniqueNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.PublicUniqueName), direct)\n}\n\nfunction findSkuField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.SKU), direct)\n}\n\nfunction findPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) =>\n ['price', 'unitPrice', 'totalPrice'].includes(property.info.name || '') &&\n property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findQuantityField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => ['quantity', 'stock', 'amount'].includes(property.info.name || '') && property.type === 'number',\n direct\n )\n}\n\nfunction findWeightField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'weight' && property.type === 'number', direct)\n}\n\nfunction findImagesField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'images' && property.hasSemantic(SemanticType.ImageURL),\n direct\n )\n}\n\nfunction findBooleanField(entity: DomainEntity, fieldName: string, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === fieldName && property.type === 'boolean',\n direct\n )\n}\n\nfunction findSessionIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'sessionId', direct)\n}\n\nfunction findUnitPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'unitPrice' && property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findExpiresAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'expiresAt' && property.type === 'datetime',\n direct\n )\n}\n"]}
1
+ {"version":3,"file":"Intelisense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,CAAC,QAAQ,CAAC,EAC5F,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAoB,EAAE,SAAiB,EAAE,MAAM,GAAG,KAAK;IAC/E,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAC7E,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,MAAM,CAAC,CAAA;AAC5F,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,CAAC,EAC/F,MAAM,CACP,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAoB,EAAE,MAAM,GAAG,KAAK;IAC9D,OAAO,iBAAiB,CACtB,MAAM,EACN,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU,EAChF,MAAM,CACP,CAAA;AACH,CAAC","sourcesContent":["import type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainElement } from '../DomainElement.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { IThing } from '../../models/Thing.js'\nimport { SemanticType } from '../Semantics.js'\nimport { createEmailSemantic } from '../definitions/Email.js'\nimport { createPasswordSemantic } from '../definitions/Password.js'\nimport { createPhoneSemantic } from '../definitions/Phone.js'\nimport { createPublicUniqueNameSemantic, DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG } from '../definitions/PublicUniqueName.js'\nimport { createDescriptionSemantic } from '../definitions/Description.js'\nimport { createCurrencySemantic } from '../definitions/Currency.js'\nimport { createStatusSemantic } from '../definitions/Status.js'\nimport { SKU_PRESETS } from '../definitions/SKU.js'\n\n/**\n * Adds a field to the given entity that is automatically generated by the system.\n *\n * @param entity The entity to which the auto field will be added.\n * @param autoField The name of the auto field to add.\n * @returns The added DomainElement representing the auto field.\n * @throws Error if the auto field is not supported.\n */\nexport function addAutoField(entity: DomainEntity, autoField: string): DomainElement {\n switch (autoField) {\n case 'id':\n return addIdField(entity)\n case 'email':\n return addEmailField(entity)\n case 'name':\n return addNameField(entity)\n case 'description':\n return addDescriptionField(entity)\n case 'status':\n return addStatusField(entity)\n case 'version':\n return addVersionField(entity)\n case 'owner':\n return addOwnerField(entity)\n case 'created':\n return addCreatedAtField(entity)\n // case 'created-by':\n // return addCreatedByField(entity)\n case 'updated':\n return addUpdatedAtField(entity)\n case 'updated-by':\n return addUpdatedByField(entity)\n case 'is-deleted':\n return addIsDeletedField(entity)\n case 'deleted':\n return addDeletedAtField(entity)\n case 'first-name':\n return addFirstNameField(entity)\n case 'last-name':\n return addLastNameField(entity)\n case 'phone':\n return addPhoneField(entity)\n case 'avatar-url':\n return addAvatarUrlField(entity)\n case 'public-unique-name':\n return addPublicUniqueNameField(entity)\n case 'price':\n return addPriceField(entity)\n case 'sku':\n return addSkuField(entity)\n case 'quantity':\n return addQuantityField(entity)\n case 'weight':\n return addWeightField(entity)\n case 'images':\n return addImagesField(entity)\n case 'session-id':\n return addSessionIdField(entity)\n case 'expires-at':\n return addExpiresAtField(entity)\n case 'unit-price':\n return addUnitPriceField(entity)\n default:\n throw new Error(`Unsupported auto field: ${autoField}`)\n }\n}\n\n/**\n * Adds the primary field (ID) to the given entity.\n * If the ID field already exists, it returns the existing field.\n * Otherwise, it creates a new ID field with a name based on the entity's name.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'id'\n * - primary: true\n * - readOnly: true\n * - schema.defaultValue: { type: 'function', value: 'uuid-v4' }\n *\n * @param entity The entity to which the ID field will be added.\n * @returns The added primary field property.\n */\nexport function addIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findIdField(entity, true)\n if (existing) {\n // If the ID field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: `id`, ...info },\n primary: true,\n readOnly: true,\n // I don't think we need to index the ID field..\n // index: true,\n type: 'string',\n // @TODO: We should experiment with the random ID generation using the nano library.\n schema: { defaultValue: { type: 'function', value: 'uuid-v4' } },\n })\n return prop\n}\n\n/**\n * Adds an email field to the given entity.\n * If the email field already exists, it returns the existing field.\n * Otherwise, it creates a new email field with a semantic annotation.\n * @param entity The entity to which the email field will be added.\n * @returns The added email field property.\n */\nexport function addEmailField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findEmailField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'email', displayName: 'Email Address', ...info },\n type: 'string',\n required: true,\n index: true,\n semantics: [\n createEmailSemantic({\n requireVerification: true,\n verificationMethod: 'email',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a password field to the given entity.\n * If the password field already exists, it returns the existing field.\n * Otherwise, it creates a new password field with a semantic annotation.\n * @param entity The entity to which the password field will be added.\n * @param info Additional information for the password field.\n * @returns The added password field property.\n */\nexport function addPasswordField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findPasswordField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'password', displayName: 'Password', ...info },\n type: 'string',\n required: true,\n semantics: [\n createPasswordSemantic({\n requireSpecialChars: true,\n requireNumbers: true,\n requireUppercase: true,\n requireLowercase: true,\n minLength: 8,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a version field to the given entity.\n * @param entity The entity to which the version field will be added.\n * The version field is used to track the version of the entity.\n * @returns The added version field property.\n */\nexport function addVersionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findVersionField(entity, true)\n if (existing) {\n // If the version field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'version', displayName: 'Version', ...info },\n readOnly: true,\n index: true,\n type: 'number',\n schema: { defaultValue: { type: 'function', value: 'incremental' }, minimum: 0 },\n })\n prop.addSemantic({\n id: SemanticType.Version,\n })\n return prop\n}\n\nexport function addNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'name', displayName: 'Name', ...info },\n type: 'string',\n })\n prop.addSemantic({\n id: SemanticType.Title,\n })\n return prop\n}\n\n/**\n * Adds a description field to the specified entity.\n * If a description field already exists, it returns the existing field.\n * Otherwise, it creates a new description field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'description'\n * - info.displayName: 'Description'\n *\n * Set semantics:\n * - `SemanticType.Description`\n *\n * @param entity The entity to which the description field will be added.\n * @returns The added description field property.\n */\nexport function addDescriptionField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findDescriptionField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'description', displayName: 'Description', ...info },\n type: 'string',\n semantics: [createDescriptionSemantic()],\n })\n return prop\n}\n\n/**\n * Adds a status field to the specified entity.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - schema.enum: ['Active', 'Draft', 'Archived']\n * - schema.defaultValue: { type: 'literal', value: 'Draft' }\n *\n * Set semantics:\n * - `SemanticType.Status`\n *\n * @param entity The entity to which the status field will be added.\n * @param info Additional information about the field.\n * @returns The added status field property.\n */\nexport function addStatusField(entity: DomainEntity, info: Partial<IThing> = {}): DomainElement {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n schema: {\n enum: ['Active', 'Draft', 'Archived'],\n defaultValue: { type: 'literal', value: 'Draft' },\n },\n })\n prop.addSemantic({\n id: SemanticType.Status,\n })\n return prop\n}\n\n/**\n * Adds an owner field to the specified entity.\n * If an owner field already exists, it returns the existing field.\n * Otherwise, it creates a new owner field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'owner'\n * - info.displayName: 'Owner'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the owner field will be added.\n * @param info Additional information about the field.\n * @returns The added owner field property.\n */\nexport function addOwnerField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findOwnerField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'owner', displayName: 'Owner', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n// This is owner with different name. Use that one instead.\n// function addCreatedByField(entity: DomainEntity): DomainElement {\n// const existing = findCreatedByField(entity, true)\n// if (existing) {\n// return existing\n// }\n// const prop = entity.addProperty({\n// info: { name: 'created_by', displayName: 'Created By' },\n// type: 'string',\n// readOnly: true,\n// index: true,\n// })\n// prop.addSemantic({\n// id: SemanticType.CreatedTimestamp,\n// })\n// return prop\n// }\n\n/**\n * Adds an updated by field to the specified entity as an association to the User entity.\n * If an updated by field already exists, it returns the existing field.\n * Otherwise, it creates a new updated by field with the specified information.\n *\n * Set properties:\n * - info.name: 'updated_by'\n * - info.displayName: 'Updated By'\n * - required: true\n *\n * Set semantics:\n * - `SemanticType.ResourceOwnerIdentifier`\n *\n * @param entity The entity to which the updated by field will be added.\n * @param info Additional information about the field.\n * @returns The added updated by field property.\n */\nexport function addUpdatedByField(entity: DomainEntity, info: Partial<IThing> = {}): DomainAssociation {\n const existing = findUpdatedByField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addAssociation(\n {},\n {\n info: { name: 'updated_by', displayName: 'Updated By', ...info },\n required: true,\n }\n )\n prop.addSemantic({\n id: SemanticType.ResourceOwnerIdentifier,\n })\n return prop\n}\n\n/**\n * Adds a created at field to the specified entity.\n * If a created at field already exists, it returns the existing field.\n * Otherwise, it creates a new created at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'created_at'\n * - info.displayName: 'Created At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `CreatedTimestamp`\n *\n * @param entity The entity to which the created at field will be added.\n * @param info Additional information about the field.\n * @returns The created created at field.\n */\nexport function addCreatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findCreatedAtField(entity, true)\n if (existing) {\n // If the created_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'created_at', displayName: 'Created At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.CreatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an updated at field to the specified entity.\n * If an updated at field already exists, it returns the existing field.\n * Otherwise, it creates a new updated at field with the specified information.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'updated_at'\n * - info.displayName: 'Updated At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `UpdatedTimestamp`\n *\n * @param entity The entity to which the updated at field will be added.\n * @param info Additional information about the field.\n * @returns The created updated at field.\n */\nexport function addUpdatedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUpdatedAtField(entity, true)\n if (existing) {\n // If the updated_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'updated_at', displayName: 'Updated At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.UpdatedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds a deleted at field to the specified entity.\n * If a deleted at field already exists, it returns the existing field.\n * Otherwise, it creates a new deleted at field with the specified information.\n *\n * Set properties:\n * - required: true\n * - type: 'datetime'\n * - info.name: 'deleted_at'\n * - info.displayName: 'Deleted At'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'function', value: 'now' }\n *\n * Set semantics:\n * - `SemanticType.DeletedTimestamp`\n *\n * @param entity The entity to which the deleted_at field will be added.\n * @param info Additional information about the field.\n * @returns The added deleted at field property.\n */\nexport function addDeletedAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findDeletedAtField(entity, true)\n if (existing) {\n // If the deleted_at field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'deleted_at', displayName: 'Deleted At', ...info },\n readOnly: true,\n index: true,\n type: 'datetime',\n schema: { defaultValue: { type: 'function', value: 'now' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedTimestamp,\n })\n return prop\n}\n\n/**\n * Adds an is_deleted field to the specified entity.\n * If an is_deleted field already exists, it returns the existing field.\n * Otherwise, it creates a new is_deleted field with the specified information.\n *\n * Set properties:\n * - type: 'boolean'\n * - info.name: 'is_deleted'\n * - info.displayName: 'Is Deleted'\n * - readOnly: true\n * - index: true\n * - schema.defaultValue: { type: 'literal', value: 'false' }\n *\n * Set semantics:\n * - `SemanticType.DeletedFlag`\n *\n * @param entity The entity to which the is_deleted field will be added.\n * @param info Additional information about the field.\n * @returns The added is_deleted field property.\n */\nexport function addIsDeletedField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findIsDeletedField(entity, true)\n if (existing) {\n // If the is_deleted field already exists, return it.\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'is_deleted', displayName: 'Is Deleted', ...info },\n readOnly: true,\n index: true,\n type: 'boolean',\n schema: { defaultValue: { type: 'literal', value: 'false' } },\n })\n prop.addSemantic({\n id: SemanticType.DeletedFlag,\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addFirstNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findFirstNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'first_name', displayName: 'First Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a first name field to the specified entity.\n * If a first name field already exists, it returns the existing field.\n * Otherwise, it creates a new first name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'first_name'\n * - info.displayName: 'First Name'\n *\n * @param entity The entity to which the first name field will be added.\n * @param info Additional information about the field.\n * @returns The created first name field.\n */\nexport function addLastNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findLastNameField(entity)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'last_name', displayName: 'Last Name', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds a phone field to the specified entity.\n * If a phone field already exists, it returns the existing field.\n * Otherwise, it creates a new phone field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'phone'\n * - info.displayName: 'Phone Number'\n * - index: true (to search by phone number)\n *\n * Set semantics:\n * - id: SemanticType.Phone\n *\n * @param entity The entity to which the phone field will be added.\n * @param info Additional information about the field.\n * @returns The created phone field.\n */\nexport function addPhoneField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPhoneField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'phone', displayName: 'Phone Number', ...info },\n type: 'string',\n index: true,\n semantics: [\n createPhoneSemantic({\n format: 'international',\n requireCountryCode: true,\n requireVerification: true,\n verificationMethod: 'sms',\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds an avatar URL field to the specified entity.\n * If an avatar URL field already exists, it returns the existing field.\n * Otherwise, it creates a new avatar URL field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'avatar_url'\n * - info.displayName: 'Avatar URL'\n *\n * Set semantics:\n * - id: SemanticType.ImageURL\n *\n * @param entity The entity to which the avatar URL field will be added.\n * @param info Additional information about the field.\n * @returns The created avatar URL field.\n */\nexport function addAvatarUrlField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findAvatarUrlField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'avatar_url', displayName: 'Avatar URL', ...info },\n type: 'string',\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a public unique name (slug) field to the specified entity.\n * If a public unique name field already exists, it returns the existing field.\n * Otherwise, it creates a new public unique name field with the specified information.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'slug'\n * - info.displayName: 'Public Unique Name'\n * - index: true\n * - required: true\n * - unique: true\n *\n * Set semantics:\n * - id: SemanticType.PublicUniqueName\n *\n * @param entity The entity to which the public unique name field will be added.\n * @param info Additional information about the field.\n * @returns The created public unique name field.\n */\nexport function addPublicUniqueNameField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPublicUniqueNameField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'slug', displayName: 'Public Unique Name', ...info },\n type: 'string',\n index: true,\n required: true,\n unique: true,\n semantics: [createPublicUniqueNameSemantic(DEFAULT_PUBLIC_UNIQUE_NAME_CONFIG)],\n })\n return prop\n}\n\n/**\n * Adds a SKU field to the specified entity.\n * If a SKU field already exists, it returns the existing field.\n * Otherwise, it creates a new SKU field with semantic annotation.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sku'\n * - info.displayName: 'SKU'\n * - required: true\n * - unique: true\n *\n * @param entity The entity to which the SKU field will be added.\n * @param info Additional information about the field.\n * @returns The created SKU field.\n */\nexport function addSkuField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSkuField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sku', displayName: 'SKU', ...info },\n type: 'string',\n required: true,\n unique: true,\n semantics: [{ ...SKU_PRESETS.PRODUCT_STANDARD }],\n })\n return prop\n}\n\n/**\n * Adds a price field to the specified entity with currency semantic.\n * If a price field already exists, it returns the existing field.\n * Otherwise, it creates a new price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'price'\n * - info.displayName: 'Price'\n * - required: true\n * - schema.maximum: 0\n *\n * @param entity The entity to which the price field will be added.\n * @param info Additional information about the field.\n * @returns The created price field.\n */\nexport function addPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'price', displayName: 'Price', ...info },\n type: 'number',\n required: true,\n schema: {\n maximum: 0,\n },\n bindings: [\n {\n type: 'web',\n schema: {\n dataType: 'float',\n },\n },\n ],\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n validateCurrencyCode: true,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a quantity field to the specified entity.\n * If a quantity field already exists, it returns the existing field.\n * Otherwise, it creates a new quantity field with validation.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'quantity'\n * - info.displayName: 'Quantity'\n * - required: true\n * - schema.minimum: 0\n *\n * @param entity The entity to which the quantity field will be added.\n * @param info Additional information about the field.\n * @returns The created quantity field.\n */\nexport function addQuantityField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findQuantityField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'quantity', displayName: 'Quantity', ...info },\n type: 'number',\n required: true,\n schema: {\n minimum: 0,\n },\n })\n return prop\n}\n\n/**\n * Adds a weight field to the specified entity.\n * If a weight field already exists, it returns the existing field.\n * Otherwise, it creates a new weight field.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'weight'\n * - info.displayName: 'Weight'\n *\n * @param entity The entity to which the weight field will be added.\n * @param info Additional information about the field.\n * @returns The created weight field.\n */\nexport function addWeightField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findWeightField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'weight', displayName: 'Weight', ...info },\n type: 'number',\n })\n return prop\n}\n\n/**\n * Adds an images field to the specified entity for multiple image URLs.\n * If an images field already exists, it returns the existing field.\n * Otherwise, it creates a new images field with ImageURL semantic.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'images'\n * - info.displayName: 'Images'\n * - multiple: true\n *\n * @param entity The entity to which the images field will be added.\n * @param info Additional information about the field.\n * @returns The created images field.\n */\nexport function addImagesField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findImagesField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'images', displayName: 'Images', ...info },\n type: 'string',\n multiple: true,\n semantics: [{ id: SemanticType.ImageURL }],\n })\n return prop\n}\n\n/**\n * Adds a status field with custom enum values to the specified entity.\n * This is not a regular enum field, it should represent a record status.\n * If a status field already exists, it returns the existing field.\n * Otherwise, it creates a new status field with provided enum values.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'status'\n * - info.displayName: 'Status'\n * - required: true\n * - schema.enum: provided enum values\n * - schema.defaultValue: first enum value\n *\n * @param entity The entity to which the status field will be added.\n * @param enumValues Array of status values.\n * @param info Additional information about the field.\n * @returns The created status field.\n */\nexport function addCustomStatusField(\n entity: DomainEntity,\n enumValues: string[],\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findStatusField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'status', displayName: 'Status', ...info },\n type: 'string',\n required: true,\n semantics: [createStatusSemantic()],\n schema: {\n enum: enumValues,\n defaultValue: {\n type: 'literal',\n value: enumValues[0],\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a boolean field to the specified entity.\n * If the field already exists, it returns the existing field.\n * Otherwise, it creates a new boolean field with default value.\n *\n * Set properties:\n * - type: 'boolean'\n * - required: true\n * - schema.defaultValue: provided default or 'false'\n *\n * @param entity The entity to which the boolean field will be added.\n * @param fieldName Name of the boolean field.\n * @param defaultValue Default boolean value.\n * @param info Additional information about the field.\n * @returns The created boolean field.\n */\nexport function addBooleanField(\n entity: DomainEntity,\n fieldName: string,\n defaultValue = 'false',\n info: Partial<IThing> = {}\n): DomainProperty {\n const existing = findBooleanField(entity, fieldName, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: fieldName, ...info },\n type: 'boolean',\n required: true,\n schema: {\n defaultValue: {\n type: 'literal',\n value: defaultValue,\n },\n },\n })\n return prop\n}\n\n/**\n * Adds a session ID field to the specified entity.\n * If a session ID field already exists, it returns the existing field.\n * Otherwise, it creates a new session ID field.\n *\n * Set properties:\n * - type: 'string'\n * - info.name: 'sessionId'\n * - info.displayName: 'Session ID'\n *\n * @param entity The entity to which the session ID field will be added.\n * @param info Additional information about the field.\n * @returns The created session ID field.\n */\nexport function addSessionIdField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findSessionIdField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'sessionId', displayName: 'Session ID', ...info },\n type: 'string',\n })\n return prop\n}\n\n/**\n * Adds an expiration datetime field to the specified entity.\n * If an expiration field already exists, it returns the existing field.\n * Otherwise, it creates a new expiration field.\n *\n * Set properties:\n * - type: 'datetime'\n * - info.name: 'expiresAt'\n * - info.displayName: 'Expires At'\n *\n * @param entity The entity to which the expiration field will be added.\n * @param info Additional information about the field.\n * @returns The created expiration field.\n */\nexport function addExpiresAtField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findExpiresAtField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'expiresAt', displayName: 'Expires At', ...info },\n type: 'datetime',\n })\n return prop\n}\n\n/**\n * Adds a unit price field to the specified entity with currency semantic.\n * If a unit price field already exists, it returns the existing field.\n * Otherwise, it creates a new unit price field with proper currency handling.\n *\n * Set properties:\n * - type: 'number'\n * - info.name: 'unitPrice'\n * - info.displayName: 'Unit Price'\n * - required: true\n *\n * @param entity The entity to which the unit price field will be added.\n * @param info Additional information about the field.\n * @returns The created unit price field.\n */\nexport function addUnitPriceField(entity: DomainEntity, info: Partial<IThing> = {}): DomainProperty {\n const existing = findUnitPriceField(entity, true)\n if (existing) {\n return existing\n }\n const prop = entity.addProperty({\n info: { name: 'unitPrice', displayName: 'Unit Price', ...info },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n ],\n })\n return prop\n}\n\n/**\n * Adds a currency amount field (subtotal, tax, shipping, etc.).\n */\nexport function addCurrencyAmountField(\n entity: DomainEntity,\n fieldName: string,\n displayName: string,\n info: Partial<IThing> = {}\n): DomainProperty {\n return entity.addProperty({\n info: {\n name: fieldName,\n displayName,\n ...info,\n },\n type: 'number',\n required: true,\n semantics: [\n createCurrencySemantic({\n storageFormat: 'integer_cents',\n defaultCurrency: 'USD',\n decimalPlaces: 2,\n allowNegative: false,\n }),\n ],\n })\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field property or undefined.\n */\nfunction findPropertyField(\n entity: DomainEntity,\n predicate: (property: DomainProperty) => boolean,\n direct = false\n): DomainProperty | undefined {\n for (const property of entity.properties) {\n if (predicate(property)) {\n return property\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const property of parent.properties) {\n if (predicate(property)) {\n return property\n }\n }\n }\n return undefined\n}\n\n/**\n * Finds a field in the given entity that matches the specified predicate.\n * @param entity The entity to search within.\n * @param predicate A function that defines the search criteria.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found field association or undefined.\n */\nfunction findAssociationField(\n entity: DomainEntity,\n predicate: (property: DomainAssociation) => boolean,\n direct = false\n): DomainAssociation | undefined {\n for (const assoc of entity.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n if (direct) {\n return undefined\n }\n for (const parent of entity.listParents()) {\n // we can't call a recursive function here because it would scan vertically through the hierarchy\n // and not horizontally through all parents. We need to check each **direct** parent separately,\n // and then move up.\n for (const assoc of parent.associations) {\n if (predicate(assoc)) {\n return assoc\n }\n }\n }\n return undefined\n}\n\n/**\n * Searches for the ID field in the given entity.\n * @param entity The entity to search for the ID field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found ID field property or undefined.\n */\nfunction findIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n if (!direct) {\n // Find the primary key property in the entity, which can be inherited or defined on the entity itself.\n return entity.primaryKey()\n }\n for (const property of entity.properties) {\n if (property.primary) {\n return property\n }\n }\n}\n\n/**\n * Searches for the email field in the given entity.\n * @param entity The entity to search for the email field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found email field property or undefined.\n */\nfunction findEmailField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Email), direct)\n}\n\n/**\n * Searches for the password field in the given entity.\n * @param entity The entity to search for the password field.\n * @param direct Whether to search only the direct properties of the entity.\n * @returns The found password field property or undefined.\n */\nfunction findPasswordField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Password), direct)\n}\n\nfunction findVersionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.Version)\n },\n direct\n )\n}\n\nfunction findNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Title), direct)\n}\n\nfunction findDescriptionField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Description), direct)\n}\n\nfunction findStatusField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Status), direct)\n}\n\nfunction findOwnerField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['owner', 'author'].includes(association.info.name || ''),\n direct\n )\n}\n\n// function findCreatedByField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n// return findField(entity, (property) => property.hasSemantic(SemanticType.CreatedTimestamp), direct)\n// }\n\nfunction findUpdatedByField(entity: DomainEntity, direct = false): DomainAssociation | undefined {\n return findAssociationField(\n entity,\n (association) =>\n association.hasSemantic(SemanticType.ResourceOwnerIdentifier) &&\n ['updated_by', 'updatedBy'].includes(association.info.name || ''),\n direct\n )\n}\n\nfunction findCreatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.CreatedTimestamp)\n },\n direct\n )\n}\n\nfunction findUpdatedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.UpdatedTimestamp)\n },\n direct\n )\n}\n\nfunction findDeletedAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => {\n return property.hasSemantic(SemanticType.DeletedTimestamp)\n },\n direct\n )\n}\n\nfunction findIsDeletedField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.DeletedFlag), direct)\n}\n\nexport function addRecommendedFields(entity: DomainEntity): DomainElement[] {\n const fields: DomainElement[] = []\n if (!findIdField(entity)) {\n fields.push(addIdField(entity))\n }\n // The version field is not always recommended, so we don't add it by default.\n // if (!findVersionField(entity)) {\n // fields.push(addVersionField(entity))\n // }\n if (!findCreatedAtField(entity)) {\n fields.push(addCreatedAtField(entity))\n }\n // if (!findCreatedByField(entity)) {\n // fields.push(addCreatedByField(entity))\n // }\n if (!findUpdatedAtField(entity)) {\n fields.push(addUpdatedAtField(entity))\n }\n if (!findUpdatedByField(entity)) {\n fields.push(addUpdatedByField(entity))\n }\n if (!findDeletedAtField(entity)) {\n fields.push(addDeletedAtField(entity))\n }\n if (!findIsDeletedField(entity)) {\n fields.push(addIsDeletedField(entity))\n }\n return fields\n}\n\nfunction findFirstNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['first_name', 'firstName'].includes(property.info.name || ''), direct)\n}\n\nfunction findLastNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['last_name', 'lastName'].includes(property.info.name || ''), direct)\n}\n\n// Avatar URL has the `SemanticType.ImageURL` semantic, but it can be used for any image URL.\n// It is not a specific semantic, but it is a common field in many entities.\nfunction findAvatarUrlField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => ['avatar_url', 'avatarUrl'].includes(property.info.name || ''), direct)\n}\n\nfunction findPhoneField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.Phone), direct)\n}\n\nfunction findPublicUniqueNameField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.PublicUniqueName), direct)\n}\n\nfunction findSkuField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.hasSemantic(SemanticType.SKU), direct)\n}\n\nfunction findPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) =>\n ['price', 'unitPrice', 'totalPrice'].includes(property.info.name || '') &&\n property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findQuantityField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => ['quantity', 'stock', 'amount'].includes(property.info.name || '') && property.type === 'number',\n direct\n )\n}\n\nfunction findWeightField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'weight' && property.type === 'number', direct)\n}\n\nfunction findImagesField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'images' && property.hasSemantic(SemanticType.ImageURL),\n direct\n )\n}\n\nfunction findBooleanField(entity: DomainEntity, fieldName: string, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === fieldName && property.type === 'boolean',\n direct\n )\n}\n\nfunction findSessionIdField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(entity, (property) => property.info.name === 'sessionId', direct)\n}\n\nfunction findUnitPriceField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'unitPrice' && property.hasSemantic(SemanticType.Currency),\n direct\n )\n}\n\nfunction findExpiresAtField(entity: DomainEntity, direct = false): DomainProperty | undefined {\n return findPropertyField(\n entity,\n (property) => property.info.name === 'expiresAt' && property.type === 'datetime',\n direct\n )\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import type { DataDomain } from '../DataDomain.js';
2
2
  import type { DomainTemplate, DomainTemplateStructure } from './types.js';
3
+ export * from './verticals/index.js';
3
4
  /**
4
5
  * Creates template metadata from a DataDomain instance for UI presentation
5
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD,OAAO,KAAK,EAEV,cAAc,EACd,uBAAuB,EAKxB,MAAM,YAAY,CAAA;AAEnB;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,GACA,cAAc,CAchB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,uBAAuB,CAgClF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAMlD,OAAO,KAAK,EAEV,cAAc,EACd,uBAAuB,EAKxB,MAAM,YAAY,CAAA;AAGnB,cAAc,sBAAsB,CAAA;AAEpC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,GACA,cAAc,CAchB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,uBAAuB,CAgClF"}
@@ -1,3 +1,5 @@
1
+ // Import vertical organization
2
+ export * from './verticals/index.js';
1
3
  /**
2
4
  * Creates template metadata from a DataDomain instance for UI presentation
3
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAkB,EAClB,YASC;IAED,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAA;IAEhD,OAAO;QACL,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,WAAW,EAAE,YAAY,CAAC,WAAW;QACrC,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,IAAI,EAAE,YAAY,CAAC,IAAI,IAAI,EAAE;QAC7B,SAAS;KACV,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAkB;IACvD,MAAM,UAAU,GAAoB,EAAE,CAAA;IACtC,IAAI,aAAa,GAAG,CAAC,CAAA;IACrB,IAAI,eAAe,GAAG,CAAC,CAAA;IACvB,IAAI,iBAAiB,GAAG,CAAC,CAAA;IAEzB,yBAAyB;IACzB,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC;QAChD,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAA;QACjD,UAA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AW,CAAC,IAAI,CAAC,WAAW;QACzC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,cAAc;QACd,SAAS;QACT,WAAW;KACZ,CAAA;AACH,CAAC","sourcesContent":["import type { DataDomain } from '../DataDomain.js'\nimport type { DomainNamespace } from '../DomainNamespace.js'\nimport type { DomainModel } from '../DomainModel.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type {\n AssociationInfo,\n DomainTemplate,\n DomainTemplateStructure,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from './types.js'\n\n/**\n * Creates template metadata from a DataDomain instance for UI presentation\n */\nexport function createTemplateMetadata(\n domain: DataDomain,\n templateInfo: {\n id: string\n name: string\n description: string\n version: string\n author: string\n tags?: string[]\n createdAt: string\n updatedAt: string\n }\n): DomainTemplate {\n const structure = analyzeDomainStructure(domain)\n\n return {\n id: templateInfo.id,\n name: templateInfo.name,\n description: templateInfo.description,\n createdAt: templateInfo.createdAt,\n updatedAt: templateInfo.updatedAt,\n version: templateInfo.version,\n author: templateInfo.author,\n tags: templateInfo.tags || [],\n structure,\n }\n}\n\n/**\n * Analyzes a DataDomain to extract structural information for UI presentation\n */\nexport function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure {\n const namespaces: NamespaceInfo[] = []\n let totalEntities = 0\n let totalProperties = 0\n let totalAssociations = 0\n\n // Analyze each namespace\n for (const namespace of domain.listNamespaces()) {\n const namespaceInfo = analyzeNamespace(namespace)\n namespaces.push(namespaceInfo)\n\n totalEntities += namespaceInfo.entityCount\n totalProperties += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0),\n 0\n )\n totalAssociations += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0),\n 0\n )\n }\n\n return {\n domain: {\n name: domain.info.name || 'Unnamed Domain',\n description: domain.info.description,\n totalEntities,\n totalProperties,\n totalAssociations,\n },\n namespaces,\n }\n}\n\n/**\n * Analyzes a DomainNamespace to extract information for UI presentation\n */\nfunction analyzeNamespace(namespace: DomainNamespace): NamespaceInfo {\n const models: ModelInfo[] = []\n let entityCount = 0\n\n // Analyze each model in the namespace\n for (const model of namespace.listModels()) {\n const modelInfo = analyzeModel(model)\n models.push(modelInfo)\n entityCount += modelInfo.entityCount\n }\n\n return {\n name: namespace.info.name || 'Unnamed Namespace',\n displayName: namespace.info.displayName,\n description: namespace.info.description,\n modelCount: models.length,\n entityCount,\n models,\n }\n}\n\n/**\n * Analyzes a DomainModel to extract information for UI presentation\n */\nfunction analyzeModel(model: DomainModel): ModelInfo {\n const entities: EntityInfo[] = []\n\n // Analyze each entity in the model\n for (const entity of model.listEntities()) {\n const entityInfo = analyzeEntity(entity)\n entities.push(entityInfo)\n }\n\n return {\n name: model.info.name || 'Unnamed Model',\n displayName: model.info.displayName,\n description: model.info.description,\n entityCount: entities.length,\n entities,\n }\n}\n\n/**\n * Analyzes a DomainEntity to extract information for UI presentation\n */\nfunction analyzeEntity(entity: DomainEntity): EntityInfo {\n const properties: PropertyInfo[] = []\n const associations: AssociationInfo[] = []\n\n // Analyze properties\n for (const property of entity.listProperties()) {\n properties.push(analyzeProperty(property))\n }\n\n // Analyze associations\n for (const association of entity.listAssociations()) {\n associations.push(analyzeAssociation(association))\n }\n\n return {\n name: entity.info.name || 'Unnamed Entity',\n displayName: entity.info.displayName,\n description: entity.info.description,\n propertyCount: properties.length,\n associationCount: associations.length,\n deprecated: entity.deprecated,\n properties,\n associations,\n semantics: entity.semantics?.map((s) => s.id) || [],\n }\n}\n\n/**\n * Analyzes a DomainProperty to extract information for UI presentation\n */\nfunction analyzeProperty(property: DomainProperty): PropertyInfo {\n const semantics = property.semantics?.map((s) => s.id) || []\n\n // Extract enum values if present\n let enumValues: string[] | undefined\n if (property.schema?.enum && Array.isArray(property.schema.enum)) {\n enumValues = property.schema.enum.map((v) => String(v))\n }\n\n // Extract default value\n let defaultValue: string | undefined\n if (property.schema?.defaultValue) {\n if (property.schema.defaultValue.type === 'literal') {\n defaultValue = String(property.schema.defaultValue.value)\n }\n }\n\n return {\n name: property.info.name || 'Unnamed Property',\n displayName: property.info.displayName,\n description: property.info.description,\n type: property.type || 'string',\n required: property.required,\n multiple: property.multiple,\n primary: property.primary,\n unique: property.unique,\n readOnly: property.readOnly,\n writeOnly: property.writeOnly,\n deprecated: property.deprecated,\n semantics,\n enumValues,\n defaultValue,\n }\n}\n\n/**\n * Analyzes a DomainAssociation to extract information for UI presentation\n */\nfunction analyzeAssociation(association: DomainAssociation): AssociationInfo {\n const semantics = association.semantics?.map((s) => s.id) || []\n\n // Get target entity names\n const targetEntities =\n association.targets?.map((target) => {\n // Try to resolve the target entity to get its name\n const targetEntity = association.domain.findEntity(target.key)\n return targetEntity?.info.name || target.key\n }) || []\n\n // Determine cardinality description\n let cardinality = 'One-to-One'\n if (association.multiple) {\n cardinality = 'One-to-Many'\n }\n // Note: Many-to-Many would typically be determined by looking at the reverse association\n // but for simplicity in UI presentation, we'll use the current association's multiplicity\n\n return {\n name: association.info.name || 'Unnamed Association',\n displayName: association.info.displayName,\n description: association.info.description,\n required: association.required,\n multiple: association.multiple,\n readOnly: association.readOnly,\n targetEntities,\n semantics,\n cardinality,\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/templates/index.ts"],"names":[],"mappings":"AAgBA,+BAA+B;AAC/B,cAAc,sBAAsB,CAAA;AAEpC;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAkB,EAClB,YASC;IAED,MAAM,SAAS,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAA;IA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S,GAAG,WAAW,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAE/D,0BAA0B;IAC1B,MAAM,cAAc,GAClB,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAClC,mDAAmD;QACnD,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC9D,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAA;IAC9C,CAAC,CAAC,IAAI,EAAE,CAAA;IAEV,oCAAoC;IACpC,IAAI,WAAW,GAAG,YAAY,CAAA;IAC9B,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QACzB,WAAW,GAAG,aAAa,CAAA;IAC7B,CAAC;IACD,yFAAyF;IACzF,0FAA0F;IAE1F,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,qBAAqB;QACpD,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,WAAW;QACzC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,cAAc;QACd,SAAS;QACT,WAAW;KACZ,CAAA;AACH,CAAC","sourcesContent":["import type { DataDomain } from '../DataDomain.js'\nimport type { DomainNamespace } from '../DomainNamespace.js'\nimport type { DomainModel } from '../DomainModel.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type {\n AssociationInfo,\n DomainTemplate,\n DomainTemplateStructure,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from './types.js'\n\n// Import vertical organization\nexport * from './verticals/index.js'\n\n/**\n * Creates template metadata from a DataDomain instance for UI presentation\n */\nexport function createTemplateMetadata(\n domain: DataDomain,\n templateInfo: {\n id: string\n name: string\n description: string\n version: string\n author: string\n tags?: string[]\n createdAt: string\n updatedAt: string\n }\n): DomainTemplate {\n const structure = analyzeDomainStructure(domain)\n\n return {\n id: templateInfo.id,\n name: templateInfo.name,\n description: templateInfo.description,\n createdAt: templateInfo.createdAt,\n updatedAt: templateInfo.updatedAt,\n version: templateInfo.version,\n author: templateInfo.author,\n tags: templateInfo.tags || [],\n structure,\n }\n}\n\n/**\n * Analyzes a DataDomain to extract structural information for UI presentation\n */\nexport function analyzeDomainStructure(domain: DataDomain): DomainTemplateStructure {\n const namespaces: NamespaceInfo[] = []\n let totalEntities = 0\n let totalProperties = 0\n let totalAssociations = 0\n\n // Analyze each namespace\n for (const namespace of domain.listNamespaces()) {\n const namespaceInfo = analyzeNamespace(namespace)\n namespaces.push(namespaceInfo)\n\n totalEntities += namespaceInfo.entityCount\n totalProperties += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.propertyCount, 0),\n 0\n )\n totalAssociations += namespaceInfo.models.reduce(\n (sum, model) => sum + model.entities.reduce((entitySum, entity) => entitySum + entity.associationCount, 0),\n 0\n )\n }\n\n return {\n domain: {\n name: domain.info.name || 'Unnamed Domain',\n description: domain.info.description,\n totalEntities,\n totalProperties,\n totalAssociations,\n },\n namespaces,\n }\n}\n\n/**\n * Analyzes a DomainNamespace to extract information for UI presentation\n */\nfunction analyzeNamespace(namespace: DomainNamespace): NamespaceInfo {\n const models: ModelInfo[] = []\n let entityCount = 0\n\n // Analyze each model in the namespace\n for (const model of namespace.listModels()) {\n const modelInfo = analyzeModel(model)\n models.push(modelInfo)\n entityCount += modelInfo.entityCount\n }\n\n return {\n name: namespace.info.name || 'Unnamed Namespace',\n displayName: namespace.info.displayName,\n description: namespace.info.description,\n modelCount: models.length,\n entityCount,\n models,\n }\n}\n\n/**\n * Analyzes a DomainModel to extract information for UI presentation\n */\nfunction analyzeModel(model: DomainModel): ModelInfo {\n const entities: EntityInfo[] = []\n\n // Analyze each entity in the model\n for (const entity of model.listEntities()) {\n const entityInfo = analyzeEntity(entity)\n entities.push(entityInfo)\n }\n\n return {\n name: model.info.name || 'Unnamed Model',\n displayName: model.info.displayName,\n description: model.info.description,\n entityCount: entities.length,\n entities,\n }\n}\n\n/**\n * Analyzes a DomainEntity to extract information for UI presentation\n */\nfunction analyzeEntity(entity: DomainEntity): EntityInfo {\n const properties: PropertyInfo[] = []\n const associations: AssociationInfo[] = []\n\n // Analyze properties\n for (const property of entity.listProperties()) {\n properties.push(analyzeProperty(property))\n }\n\n // Analyze associations\n for (const association of entity.listAssociations()) {\n associations.push(analyzeAssociation(association))\n }\n\n return {\n name: entity.info.name || 'Unnamed Entity',\n displayName: entity.info.displayName,\n description: entity.info.description,\n propertyCount: properties.length,\n associationCount: associations.length,\n deprecated: entity.deprecated,\n properties,\n associations,\n semantics: entity.semantics?.map((s) => s.id) || [],\n }\n}\n\n/**\n * Analyzes a DomainProperty to extract information for UI presentation\n */\nfunction analyzeProperty(property: DomainProperty): PropertyInfo {\n const semantics = property.semantics?.map((s) => s.id) || []\n\n // Extract enum values if present\n let enumValues: string[] | undefined\n if (property.schema?.enum && Array.isArray(property.schema.enum)) {\n enumValues = property.schema.enum.map((v) => String(v))\n }\n\n // Extract default value\n let defaultValue: string | undefined\n if (property.schema?.defaultValue) {\n if (property.schema.defaultValue.type === 'literal') {\n defaultValue = String(property.schema.defaultValue.value)\n }\n }\n\n return {\n name: property.info.name || 'Unnamed Property',\n displayName: property.info.displayName,\n description: property.info.description,\n type: property.type || 'string',\n required: property.required,\n multiple: property.multiple,\n primary: property.primary,\n unique: property.unique,\n readOnly: property.readOnly,\n writeOnly: property.writeOnly,\n deprecated: property.deprecated,\n semantics,\n enumValues,\n defaultValue,\n }\n}\n\n/**\n * Analyzes a DomainAssociation to extract information for UI presentation\n */\nfunction analyzeAssociation(association: DomainAssociation): AssociationInfo {\n const semantics = association.semantics?.map((s) => s.id) || []\n\n // Get target entity names\n const targetEntities =\n association.targets?.map((target) => {\n // Try to resolve the target entity to get its name\n const targetEntity = association.domain.findEntity(target.key)\n return targetEntity?.info.name || target.key\n }) || []\n\n // Determine cardinality description\n let cardinality = 'One-to-One'\n if (association.multiple) {\n cardinality = 'One-to-Many'\n }\n // Note: Many-to-Many would typically be determined by looking at the reverse association\n // but for simplicity in UI presentation, we'll use the current association's multiplicity\n\n return {\n name: association.info.name || 'Unnamed Association',\n displayName: association.info.displayName,\n description: association.info.description,\n required: association.required,\n multiple: association.multiple,\n readOnly: association.readOnly,\n targetEntities,\n semantics,\n cardinality,\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ { "id": "education-management-platform", "name": "Education Management Platform", "description": "A comprehensive education management platform with student management, course management, faculty management, campus operations, and learning analytics. Perfect for schools, universities, and educational institutions.", "createdAt": "2025-01-27T00:00:00.000Z", "updatedAt": "2025-01-27T00:00:00.000Z", "version": "1.0.0", "author": "API Now! Core Team", "tags": ["education", "academic", "student-management", "course-management", "learning-analytics"], "structure": { "domain": { "name": "Education Management Platform", "description": "A comprehensive education management platform with student management, course management, faculty management, campus operations, and learning analytics", "totalEntities": 15, "totalProperties": 99, "totalAssociations": 15 }, "namespaces": [{ "name": "StudentManagement", "displayName": "Student Management", "description": "Student records, enrollment, and academic history", "modelCount": 1, "entityCount": 3, "models": [{ "name": "Students", "displayName": "Student Management", "description": "Student records and information", "entityCount": 3, "entities": [{ "name": "student", "displayName": "Student", "description": "Student record with academic information", "propertyCount": 13, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Student ID", "description": "Unique identifier for the student", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "student_number", "displayName": "Student Number", "description": "Student identification number", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "first_name", "displayName": "First Name", "description": "Student first name", "type": "string", "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "Student last name", "type": "string", "semantics": [] }, { "name": "date_of_birth", "displayName": "Date of Birth", "description": "Student date of birth", "type": "date", "required": true, "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "Student email address", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "phone", "displayName": "Phone Number", "description": "Student phone number", "type": "string", "semantics": ["Semantic#Phone"] }, { "name": "address", "displayName": "Address", "description": "Student residential address", "type": "string", "required": true, "semantics": [] }, { "name": "emergency_contact_name", "displayName": "Emergency Contact Name", "description": "Emergency contact name", "type": "string", "semantics": [] }, { "name": "status", "displayName": "Student Status", "description": "Current status of the student", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "inactive", "graduated", "withdrawn", "suspended"], "defaultValue": "active" }, { "name": "academic_level", "displayName": "Academic Level", "description": "Current academic level of the student", "type": "string", "required": true, "semantics": [], "enumValues": ["freshman", "sophomore", "junior", "senior", "graduate"] }, { "name": "created_at", "displayName": "Created At", "description": "When the student record was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the student record was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [], "semantics": [] }, { "name": "enrollment", "displayName": "Enrollment", "description": "Student course enrollment records", "propertyCount": 4, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Enrollment ID", "description": "Unique identifier for the enrollment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "enrollment_date", "displayName": "Enrollment Date", "description": "Date when student enrolled", "type": "date", "required": true, "semantics": [] }, { "name": "status", "displayName": "Enrollment Status", "description": "Current status of the enrollment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["enrolled", "dropped", "completed", "incomplete"], "defaultValue": "enrolled" }, { "name": "created_at", "displayName": "Created At", "description": "When the enrollment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this enrollment", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }, { "name": "course_section", "displayName": "Course Section", "description": "Course section for this enrollment", "required": true, "multiple": false, "targetEntities": ["course_section"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "academic_history", "displayName": "Academic History", "description": "Student academic history and records", "propertyCount": 6, "associationCount": 1, "properties": [{ "name": "id", "displayName": "History ID", "description": "Unique identifier for the academic history", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "gpa", "displayName": "GPA", "description": "Grade Point Average", "type": "number", "required": true, "semantics": [] }, { "name": "credits_earned", "displayName": "Credits Earned", "description": "Total credits earned", "type": "number", "required": true, "semantics": [] }, { "name": "academic_year", "displayName": "Academic Year", "description": "Academic year", "type": "string", "required": true, "semantics": [] }, { "name": "description", "displayName": "Description", "description": "Academic history notes and achievements", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "created_at", "displayName": "Created At", "description": "When the academic history was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this academic history", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "CourseManagement", "displayName": "Course Management", "description": "Courses, curriculum, assignments, and grades", "modelCount": 1, "entityCount": 4, "models": [{ "name": "Courses", "displayName": "Course Management", "description": "Course information and curriculum", "entityCount": 4, "entities": [{ "name": "course", "displayName": "Course", "description": "Academic course information", "propertyCount": 8, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Course ID", "description": "Unique identifier for the course", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "course_code", "displayName": "Course Code", "description": "Course identification code", "type": "string", "required": true, "unique": true, "semantics": [] }, { "name": "name", "displayName": "Course Name", "description": "Name of the course", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Course description and objectives", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "credits", "displayName": "Credits", "description": "Number of credits for the course", "type": "number", "required": true, "semantics": [] }, { "name": "status", "displayName": "Course Status", "description": "Current status of the course", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "inactive", "archived"], "defaultValue": "active" }, { "name": "created_at", "displayName": "Created At", "description": "When the course was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the course was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [], "semantics": [] }, { "name": "course_section", "displayName": "Course Section", "description": "Specific section of a course", "propertyCount": 6, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Section ID", "description": "Unique identifier for the section", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "section_number", "displayName": "Section Number", "description": "Section number", "type": "string", "required": true, "semantics": [] }, { "name": "capacity", "displayName": "Capacity", "description": "Maximum number of students", "type": "number", "required": true, "semantics": [] }, { "name": "enrolled_count", "displayName": "Enrolled Count", "description": "Number of enrolled students", "type": "number", "required": true, "semantics": [] }, { "name": "status", "displayName": "Section Status", "description": "Current status of the section", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["open", "full", "closed", "cancelled"], "defaultValue": "open" }, { "name": "created_at", "displayName": "Created At", "description": "When the section was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "course", "displayName": "Course", "description": "Course for this section", "required": true, "multiple": false, "targetEntities": ["course"], "semantics": [], "cardinality": "One-to-One" }, { "name": "instructor", "displayName": "Instructor", "description": "Faculty instructor for this section", "required": true, "multiple": false, "targetEntities": ["faculty"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "assignment", "displayName": "Assignment", "description": "Course assignments and assessments", "propertyCount": 7, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Assignment ID", "description": "Unique identifier for the assignment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Assignment Name", "description": "Name of the assignment", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Assignment description and requirements", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "due_date", "displayName": "Due Date", "description": "Assignment due date", "type": "date", "required": true, "semantics": [] }, { "name": "total_points", "displayName": "Total Points", "description": "Total possible points", "type": "number", "required": true, "semantics": [] }, { "name": "status", "displayName": "Assignment Status", "description": "Current status of the assignment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["draft", "published", "submitted", "graded"], "defaultValue": "draft" }, { "name": "created_at", "displayName": "Created At", "description": "When the assignment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "course_section", "displayName": "Course Section", "description": "Course section for this assignment", "required": true, "multiple": false, "targetEntities": ["course_section"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "grade", "displayName": "Grade", "description": "Student grades and assessments", "propertyCount": 5, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Grade ID", "description": "Unique identifier for the grade", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "score", "displayName": "Score", "description": "Numerical score earned", "type": "number", "required": true, "semantics": [] }, { "name": "letter_grade", "displayName": "Letter Grade", "description": "Letter grade (A, B, C, D, F)", "type": "string", "required": true, "semantics": [], "enumValues": ["A", "A-", "B+", "B", "B-", "C+", "C", "C-", "D+", "D", "F"] }, { "name": "description", "displayName": "Description", "description": "Grade comments and feedback", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "created_at", "displayName": "Created At", "description": "When the grade was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this grade", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }, { "name": "assignment", "displayName": "Assignment", "description": "Assignment for this grade", "required": true, "multiple": false, "targetEntities": ["assignment"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "FacultyManagement", "displayName": "Faculty Management", "description": "Teachers, staff, departments, and roles", "modelCount": 1, "entityCount": 2, "models": [{ "name": "Faculty", "displayName": "Faculty Management", "description": "Faculty and staff information", "entityCount": 2, "entities": [{ "name": "faculty", "displayName": "Faculty Member", "description": "Faculty member or staff", "propertyCount": 9, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Faculty ID", "description": "Unique identifier for the faculty member", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "first_name", "displayName": "First Name", "description": "Faculty first name", "type": "string", "semantics": [] }, { "name": "last_name", "displayName": "Last Name", "description": "Faculty last name", "type": "string", "semantics": [] }, { "name": "email", "displayName": "Email Address", "description": "Faculty email address", "type": "string", "required": true, "semantics": ["Semantic#Email"] }, { "name": "phone", "displayName": "Phone Number", "description": "Faculty phone number", "type": "string", "semantics": ["Semantic#Phone"] }, { "name": "status", "displayName": "Faculty Status", "description": "Current status of the faculty member", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "inactive", "on_leave", "retired"], "defaultValue": "active" }, { "name": "faculty_rank", "displayName": "Faculty Rank", "description": "Academic rank of the faculty member", "type": "string", "required": true, "semantics": [], "enumValues": ["professor", "associate_professor", "assistant_professor", "lecturer", "instructor"] }, { "name": "created_at", "displayName": "Created At", "description": "When the faculty record was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }, { "name": "updated_at", "displayName": "Updated At", "description": "When the faculty record was last updated", "type": "datetime", "readOnly": true, "semantics": ["Semantic#UpdatedTimestamp"] }], "associations": [{ "name": "department", "displayName": "Department", "description": "Department for this faculty member", "required": true, "multiple": false, "targetEntities": ["department"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "department", "displayName": "Department", "description": "Academic department", "propertyCount": 5, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Department ID", "description": "Unique identifier for the department", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Department Name", "description": "Name of the department", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Department description and mission", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "status", "displayName": "Department Status", "description": "Current status of the department", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "inactive", "merged"], "defaultValue": "active" }, { "name": "created_at", "displayName": "Created At", "description": "When the department was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }] }] }, { "name": "CampusOperations", "displayName": "Campus Operations", "description": "Facilities, events, and resources", "modelCount": 1, "entityCount": 2, "models": [{ "name": "Campus", "displayName": "Campus Management", "description": "Campus facilities and operations", "entityCount": 2, "entities": [{ "name": "facility", "displayName": "Facility", "description": "Campus facilities and buildings", "propertyCount": 6, "associationCount": 0, "properties": [{ "name": "id", "displayName": "Facility ID", "description": "Unique identifier for the facility", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Facility Name", "description": "Name of the facility", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Facility description and features", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "facility_type", "displayName": "Facility Type", "description": "Type of campus facility", "type": "string", "required": true, "semantics": [], "enumValues": ["classroom", "laboratory", "office", "library", "gymnasium", "auditorium"] }, { "name": "status", "displayName": "Facility Status", "description": "Current status of the facility", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["active", "maintenance", "closed"], "defaultValue": "active" }, { "name": "created_at", "displayName": "Created At", "description": "When the facility was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [], "semantics": [] }, { "name": "event", "displayName": "Event", "description": "Campus events and activities", "propertyCount": 7, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Event ID", "description": "Unique identifier for the event", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Event Name", "description": "Name of the event", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Event description and details", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "start_date", "displayName": "Start Date", "description": "Event start date and time", "type": "datetime", "required": true, "semantics": [] }, { "name": "end_date", "displayName": "End Date", "description": "Event end date and time", "type": "datetime", "required": true, "semantics": [] }, { "name": "status", "displayName": "Event Status", "description": "Current status of the event", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["scheduled", "in_progress", "completed", "cancelled"], "defaultValue": "scheduled" }, { "name": "created_at", "displayName": "Created At", "description": "When the event was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "facility", "displayName": "Facility", "description": "Facility for this event", "required": true, "multiple": false, "targetEntities": ["facility"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "LearningAnalytics", "displayName": "Learning Analytics", "description": "Progress tracking, assessments, and performance", "modelCount": 1, "entityCount": 2, "models": [{ "name": "Analytics", "displayName": "Learning Analytics", "description": "Student performance and learning analytics", "entityCount": 2, "entities": [{ "name": "assessment", "displayName": "Assessment", "description": "Student assessments and evaluations", "propertyCount": 7, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Assessment ID", "description": "Unique identifier for the assessment", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "name", "displayName": "Assessment Name", "description": "Name of the assessment", "type": "string", "semantics": ["Semantic#Title"] }, { "name": "description", "displayName": "Description", "description": "Assessment description and criteria", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "assessment_date", "displayName": "Assessment Date", "description": "Date when assessment was conducted", "type": "date", "required": true, "semantics": [] }, { "name": "score", "displayName": "Score", "description": "Assessment score", "type": "number", "required": true, "semantics": [] }, { "name": "status", "displayName": "Assessment Level", "description": "Performance level of the assessment", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["excellent", "good", "satisfactory", "needs_improvement", "unsatisfactory"], "defaultValue": "excellent" }, { "name": "created_at", "displayName": "Created At", "description": "When the assessment was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this assessment", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "progress_tracking", "displayName": "Progress Tracking", "description": "Student progress tracking and milestones", "propertyCount": 6, "associationCount": 2, "properties": [{ "name": "id", "displayName": "Progress ID", "description": "Unique identifier for the progress record", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "tracking_date", "displayName": "Tracking Date", "description": "Date of progress tracking", "type": "date", "required": true, "semantics": [] }, { "name": "completion_percentage", "displayName": "Completion Percentage", "description": "Percentage of course completed", "type": "number", "required": true, "semantics": [] }, { "name": "status", "displayName": "Progress Status", "description": "Current progress status", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["on_track", "ahead", "behind", "at_risk"], "defaultValue": "on_track" }, { "name": "description", "displayName": "Description", "description": "Progress notes and observations", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "created_at", "displayName": "Created At", "description": "When the progress record was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this progress tracking", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }, { "name": "course_section", "displayName": "Course Section", "description": "Course section for this progress", "required": true, "multiple": false, "targetEntities": ["course_section"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }, { "name": "Administrative", "displayName": "Administrative", "description": "Admissions, financial aid, and scheduling", "modelCount": 1, "entityCount": 2, "models": [{ "name": "Administrative", "displayName": "Administrative Management", "description": "Administrative processes and records", "entityCount": 2, "entities": [{ "name": "admission", "displayName": "Admission", "description": "Student admission records", "propertyCount": 5, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Admission ID", "description": "Unique identifier for the admission", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "application_date", "displayName": "Application Date", "description": "Date when application was submitted", "type": "date", "required": true, "semantics": [] }, { "name": "status", "displayName": "Admission Status", "description": "Current status of the admission", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "under_review", "accepted", "rejected", "waitlisted"], "defaultValue": "pending" }, { "name": "description", "displayName": "Description", "description": "Admission notes and decisions", "type": "string", "semantics": ["Semantic#Description"] }, { "name": "created_at", "displayName": "Created At", "description": "When the admission was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this admission", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }, { "name": "financial_aid", "displayName": "Financial Aid", "description": "Student financial aid and scholarships", "propertyCount": 5, "associationCount": 1, "properties": [{ "name": "id", "displayName": "Financial Aid ID", "description": "Unique identifier for the financial aid", "type": "string", "primary": true, "readOnly": true, "semantics": [] }, { "name": "aid_type", "displayName": "Aid Type", "description": "Type of financial aid", "type": "string", "required": true, "semantics": [], "enumValues": ["scholarship", "grant", "loan", "work_study"] }, { "name": "amount", "displayName": "Aid Amount", "description": "Amount of financial aid awarded", "type": "number", "required": true, "semantics": ["Semantic#Currency"] }, { "name": "status", "displayName": "Aid Status", "description": "Current status of the financial aid", "type": "string", "required": true, "semantics": ["Semantic#Status"], "enumValues": ["pending", "approved", "disbursed", "cancelled"], "defaultValue": "pending" }, { "name": "created_at", "displayName": "Created At", "description": "When the financial aid was created", "type": "datetime", "readOnly": true, "semantics": ["Semantic#CreatedTimestamp"] }], "associations": [{ "name": "student", "displayName": "Student", "description": "Student for this financial aid", "required": true, "multiple": false, "targetEntities": ["student"], "semantics": [], "cardinality": "One-to-One" }], "semantics": [] }] }] }] } }