@acorex-platform/module-person-core-server 0.0.15 → 2.0.0-next.42

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 (246) hide show
  1. package/contracts/src/contact-assignment.actions.js.map +1 -1
  2. package/contracts/src/contact-assignment.utils.js +3 -2
  3. package/contracts/src/contact-assignment.utils.js.map +1 -1
  4. package/contracts/src/entities/contact-assignment/contact-assignment.entity.js +13 -0
  5. package/contracts/src/entities/contact-assignment/contact-assignment.entity.js.map +1 -1
  6. package/contracts/src/entities/contact-assignment/contact-assignment.types.js.map +1 -1
  7. package/contracts/src/entities/contact-assignment/index.d.ts +0 -1
  8. package/contracts/src/entities/contact-assignment/index.js +0 -1
  9. package/contracts/src/entities/contact-assignment/index.js.map +1 -1
  10. package/contracts/src/entities/contact-role/contact-role.entity.js +44 -40
  11. package/contracts/src/entities/contact-role/contact-role.entity.js.map +1 -1
  12. package/contracts/src/entities/contact-role/contact-role.types.d.ts +7 -1
  13. package/contracts/src/entities/contact-role/contact-role.types.js.map +1 -1
  14. package/contracts/src/entities/contact-role/index.d.ts +0 -1
  15. package/contracts/src/entities/contact-role/index.js +0 -1
  16. package/contracts/src/entities/contact-role/index.js.map +1 -1
  17. package/contracts/src/entities/education-level/education-level.entity.js +12 -0
  18. package/contracts/src/entities/education-level/education-level.entity.js.map +1 -1
  19. package/contracts/src/entities/education-level/education-level.types.js.map +1 -1
  20. package/contracts/src/entities/education-level/index.d.ts +0 -1
  21. package/contracts/src/entities/education-level/index.js +0 -1
  22. package/contracts/src/entities/education-level/index.js.map +1 -1
  23. package/contracts/src/entities/gender/gender.entity.js +12 -0
  24. package/contracts/src/entities/gender/gender.entity.js.map +1 -1
  25. package/contracts/src/entities/gender/gender.types.js.map +1 -1
  26. package/contracts/src/entities/gender/index.d.ts +0 -1
  27. package/contracts/src/entities/gender/index.js +0 -1
  28. package/contracts/src/entities/gender/index.js.map +1 -1
  29. package/contracts/src/entities/index.js.map +1 -1
  30. package/contracts/src/entities/marital-status/index.d.ts +0 -1
  31. package/contracts/src/entities/marital-status/index.js +0 -1
  32. package/contracts/src/entities/marital-status/index.js.map +1 -1
  33. package/contracts/src/entities/marital-status/marital-status.entity.js +12 -0
  34. package/contracts/src/entities/marital-status/marital-status.entity.js.map +1 -1
  35. package/contracts/src/entities/marital-status/marital-status.types.js.map +1 -1
  36. package/contracts/src/entities/person/index.d.ts +0 -1
  37. package/contracts/src/entities/person/index.js +0 -1
  38. package/contracts/src/entities/person/index.js.map +1 -1
  39. package/contracts/src/entities/person/person.entity.js +53 -1
  40. package/contracts/src/entities/person/person.entity.js.map +1 -1
  41. package/contracts/src/entities/person/person.types.d.ts +4 -2
  42. package/contracts/src/entities/person/person.types.js.map +1 -1
  43. package/contracts/src/entities/person-identifier-type/index.d.ts +0 -1
  44. package/contracts/src/entities/person-identifier-type/index.js +0 -1
  45. package/contracts/src/entities/person-identifier-type/index.js.map +1 -1
  46. package/contracts/src/entities/person-identifier-type/person-identifier-type.entity.js +13 -1
  47. package/contracts/src/entities/person-identifier-type/person-identifier-type.entity.js.map +1 -1
  48. package/contracts/src/entities/person-identifier-type/person-identifier-type.types.js.map +1 -1
  49. package/contracts/src/entities/person-relationship/index.d.ts +0 -1
  50. package/contracts/src/entities/person-relationship/index.js +0 -1
  51. package/contracts/src/entities/person-relationship/index.js.map +1 -1
  52. package/contracts/src/entities/person-relationship/person-relationship.entity.js +16 -1
  53. package/contracts/src/entities/person-relationship/person-relationship.entity.js.map +1 -1
  54. package/contracts/src/entities/person-relationship/person-relationship.types.js.map +1 -1
  55. package/contracts/src/entities/person-title/index.d.ts +0 -1
  56. package/contracts/src/entities/person-title/index.js +0 -1
  57. package/contracts/src/entities/person-title/index.js.map +1 -1
  58. package/contracts/src/entities/person-title/person-title.entity.js +13 -0
  59. package/contracts/src/entities/person-title/person-title.entity.js.map +1 -1
  60. package/contracts/src/entities/person-title/person-title.types.js.map +1 -1
  61. package/contracts/src/entities/religion/index.d.ts +0 -1
  62. package/contracts/src/entities/religion/index.js +0 -1
  63. package/contracts/src/entities/religion/index.js.map +1 -1
  64. package/contracts/src/entities/religion/religion.entity.js +12 -0
  65. package/contracts/src/entities/religion/religion.entity.js.map +1 -1
  66. package/contracts/src/entities/religion/religion.types.js.map +1 -1
  67. package/contracts/src/entity-catalog.d.ts +7 -0
  68. package/contracts/src/entity-catalog.js +29 -0
  69. package/contracts/src/entity-catalog.js.map +1 -0
  70. package/contracts/src/entity-entry.contact-assignment.d.ts +1 -0
  71. package/contracts/src/entity-entry.contact-assignment.js +6 -0
  72. package/contracts/src/entity-entry.contact-assignment.js.map +1 -0
  73. package/contracts/src/entity-entry.contact-role.d.ts +1 -0
  74. package/contracts/src/entity-entry.contact-role.js +6 -0
  75. package/contracts/src/entity-entry.contact-role.js.map +1 -0
  76. package/contracts/src/entity-entry.education-level.d.ts +1 -0
  77. package/contracts/src/entity-entry.education-level.js +6 -0
  78. package/contracts/src/entity-entry.education-level.js.map +1 -0
  79. package/contracts/src/entity-entry.gender.d.ts +1 -0
  80. package/contracts/src/entity-entry.gender.js +6 -0
  81. package/contracts/src/entity-entry.gender.js.map +1 -0
  82. package/contracts/src/entity-entry.marital-status.d.ts +1 -0
  83. package/contracts/src/entity-entry.marital-status.js +6 -0
  84. package/contracts/src/entity-entry.marital-status.js.map +1 -0
  85. package/contracts/src/entity-entry.person-identifier-type.d.ts +1 -0
  86. package/contracts/src/entity-entry.person-identifier-type.js +6 -0
  87. package/contracts/src/entity-entry.person-identifier-type.js.map +1 -0
  88. package/contracts/src/entity-entry.person-relationship.d.ts +1 -0
  89. package/contracts/src/entity-entry.person-relationship.js +6 -0
  90. package/contracts/src/entity-entry.person-relationship.js.map +1 -0
  91. package/contracts/src/entity-entry.person-title.d.ts +1 -0
  92. package/contracts/src/entity-entry.person-title.js +6 -0
  93. package/contracts/src/entity-entry.person-title.js.map +1 -0
  94. package/contracts/src/entity-entry.person.d.ts +1 -0
  95. package/contracts/src/entity-entry.person.js +6 -0
  96. package/contracts/src/entity-entry.person.js.map +1 -0
  97. package/contracts/src/entity-entry.religion.d.ts +1 -0
  98. package/contracts/src/entity-entry.religion.js +6 -0
  99. package/contracts/src/entity-entry.religion.js.map +1 -0
  100. package/contracts/src/index.d.ts +2 -0
  101. package/contracts/src/index.js +2 -0
  102. package/contracts/src/index.js.map +1 -1
  103. package/contracts/src/manifest.d.ts +6 -0
  104. package/contracts/src/manifest.js +24 -0
  105. package/contracts/src/manifest.js.map +1 -0
  106. package/contracts/src/menu.keys.js.map +1 -1
  107. package/contracts/src/permission.keys.d.ts +30 -9
  108. package/contracts/src/permission.keys.js +31 -10
  109. package/contracts/src/permission.keys.js.map +1 -1
  110. package/contracts/src/person-full-name.util.d.ts +9 -0
  111. package/contracts/src/person-full-name.util.js +38 -0
  112. package/contracts/src/person-full-name.util.js.map +1 -0
  113. package/contracts/src/person-relationship.actions.js.map +1 -1
  114. package/contracts/src/root-config.js.map +1 -1
  115. package/package.json +10 -11
  116. package/server/src/index.d.ts +2 -0
  117. package/server/src/index.js +8 -0
  118. package/server/src/index.js.map +1 -0
  119. package/server/src/lib/entities/index.d.ts +1 -0
  120. package/server/src/lib/entities/index.js +5 -0
  121. package/server/src/lib/entities/index.js.map +1 -0
  122. package/server/src/lib/entities/person-core.entity-catalog.d.ts +1 -0
  123. package/server/src/lib/entities/person-core.entity-catalog.js +12 -0
  124. package/server/src/lib/entities/person-core.entity-catalog.js.map +1 -0
  125. package/server/src/lib/middlewares/person-full-name.middleware.d.ts +12 -0
  126. package/server/src/lib/middlewares/person-full-name.middleware.js +57 -0
  127. package/server/src/lib/middlewares/person-full-name.middleware.js.map +1 -0
  128. package/server/src/lib/middlewares/person-relationship-mirror.middleware.d.ts +30 -0
  129. package/server/src/lib/middlewares/person-relationship-mirror.middleware.js +249 -0
  130. package/server/src/lib/middlewares/person-relationship-mirror.middleware.js.map +1 -0
  131. package/server/src/lib/person-core-entity-storage.bootstrap.d.ts +12 -0
  132. package/server/src/lib/person-core-entity-storage.bootstrap.js +32 -0
  133. package/server/src/lib/person-core-entity-storage.bootstrap.js.map +1 -0
  134. package/server/src/lib/person-core-server.module.js +43 -0
  135. package/server/src/lib/person-core-server.module.js.map +1 -0
  136. package/src/index.d.ts +0 -5
  137. package/src/index.js +0 -13
  138. package/src/index.js.map +0 -1
  139. package/src/lib/person-core-server.module.js +0 -27
  140. package/src/lib/person-core-server.module.js.map +0 -1
  141. package/src/lib/seed/contact-assignment/contact-assignment.mock.d.ts +0 -8
  142. package/src/lib/seed/contact-assignment/contact-assignment.mock.js +0 -51
  143. package/src/lib/seed/contact-assignment/contact-assignment.mock.js.map +0 -1
  144. package/src/lib/seed/contact-assignment/contact-assignment.seed.d.ts +0 -5
  145. package/src/lib/seed/contact-assignment/contact-assignment.seed.js +0 -32
  146. package/src/lib/seed/contact-assignment/contact-assignment.seed.js.map +0 -1
  147. package/src/lib/seed/contact-assignment/index.d.ts +0 -2
  148. package/src/lib/seed/contact-assignment/index.js +0 -6
  149. package/src/lib/seed/contact-assignment/index.js.map +0 -1
  150. package/src/lib/seed/contact-role/contact-role.mock.d.ts +0 -40
  151. package/src/lib/seed/contact-role/contact-role.mock.js +0 -258
  152. package/src/lib/seed/contact-role/contact-role.mock.js.map +0 -1
  153. package/src/lib/seed/contact-role/contact-role.seed.d.ts +0 -5
  154. package/src/lib/seed/contact-role/contact-role.seed.js +0 -31
  155. package/src/lib/seed/contact-role/contact-role.seed.js.map +0 -1
  156. package/src/lib/seed/contact-role/index.d.ts +0 -2
  157. package/src/lib/seed/contact-role/index.js +0 -6
  158. package/src/lib/seed/contact-role/index.js.map +0 -1
  159. package/src/lib/seed/education-level/education-level.mock.d.ts +0 -14
  160. package/src/lib/seed/education-level/education-level.mock.js +0 -52
  161. package/src/lib/seed/education-level/education-level.mock.js.map +0 -1
  162. package/src/lib/seed/education-level/education-level.seed.d.ts +0 -5
  163. package/src/lib/seed/education-level/education-level.seed.js +0 -31
  164. package/src/lib/seed/education-level/education-level.seed.js.map +0 -1
  165. package/src/lib/seed/education-level/index.d.ts +0 -2
  166. package/src/lib/seed/education-level/index.js +0 -6
  167. package/src/lib/seed/education-level/index.js.map +0 -1
  168. package/src/lib/seed/gender/gender.mock.d.ts +0 -28
  169. package/src/lib/seed/gender/gender.mock.js +0 -40
  170. package/src/lib/seed/gender/gender.mock.js.map +0 -1
  171. package/src/lib/seed/gender/gender.seed.d.ts +0 -5
  172. package/src/lib/seed/gender/gender.seed.js +0 -31
  173. package/src/lib/seed/gender/gender.seed.js.map +0 -1
  174. package/src/lib/seed/gender/index.d.ts +0 -2
  175. package/src/lib/seed/gender/index.js +0 -6
  176. package/src/lib/seed/gender/index.js.map +0 -1
  177. package/src/lib/seed/index.d.ts +0 -28
  178. package/src/lib/seed/index.js +0 -30
  179. package/src/lib/seed/index.js.map +0 -1
  180. package/src/lib/seed/marital-status/index.d.ts +0 -2
  181. package/src/lib/seed/marital-status/index.js +0 -6
  182. package/src/lib/seed/marital-status/index.js.map +0 -1
  183. package/src/lib/seed/marital-status/marital-status.mock.d.ts +0 -33
  184. package/src/lib/seed/marital-status/marital-status.mock.js +0 -46
  185. package/src/lib/seed/marital-status/marital-status.mock.js.map +0 -1
  186. package/src/lib/seed/marital-status/marital-status.seed.d.ts +0 -5
  187. package/src/lib/seed/marital-status/marital-status.seed.js +0 -31
  188. package/src/lib/seed/marital-status/marital-status.seed.js.map +0 -1
  189. package/src/lib/seed/person/index.d.ts +0 -3
  190. package/src/lib/seed/person/index.js +0 -7
  191. package/src/lib/seed/person/index.js.map +0 -1
  192. package/src/lib/seed/person/person-natural-ids.constants.d.ts +0 -76
  193. package/src/lib/seed/person/person-natural-ids.constants.js +0 -82
  194. package/src/lib/seed/person/person-natural-ids.constants.js.map +0 -1
  195. package/src/lib/seed/person/person.mock.d.ts +0 -5
  196. package/src/lib/seed/person/person.mock.js +0 -372
  197. package/src/lib/seed/person/person.mock.js.map +0 -1
  198. package/src/lib/seed/person/person.seed.d.ts +0 -5
  199. package/src/lib/seed/person/person.seed.js +0 -31
  200. package/src/lib/seed/person/person.seed.js.map +0 -1
  201. package/src/lib/seed/person-core-seed.provider.d.ts +0 -4
  202. package/src/lib/seed/person-core-seed.provider.js +0 -18
  203. package/src/lib/seed/person-core-seed.provider.js.map +0 -1
  204. package/src/lib/seed/person-core-seed.tokens.d.ts +0 -1
  205. package/src/lib/seed/person-core-seed.tokens.js +0 -7
  206. package/src/lib/seed/person-core-seed.tokens.js.map +0 -1
  207. package/src/lib/seed/person-core.seed-catalog.d.ts +0 -2
  208. package/src/lib/seed/person-core.seed-catalog.js +0 -31
  209. package/src/lib/seed/person-core.seed-catalog.js.map +0 -1
  210. package/src/lib/seed/person-identifier-type/index.d.ts +0 -2
  211. package/src/lib/seed/person-identifier-type/index.js +0 -6
  212. package/src/lib/seed/person-identifier-type/index.js.map +0 -1
  213. package/src/lib/seed/person-identifier-type/person-identifier-type.mock.d.ts +0 -4
  214. package/src/lib/seed/person-identifier-type/person-identifier-type.mock.js +0 -68
  215. package/src/lib/seed/person-identifier-type/person-identifier-type.mock.js.map +0 -1
  216. package/src/lib/seed/person-identifier-type/person-identifier-type.seed.d.ts +0 -5
  217. package/src/lib/seed/person-identifier-type/person-identifier-type.seed.js +0 -31
  218. package/src/lib/seed/person-identifier-type/person-identifier-type.seed.js.map +0 -1
  219. package/src/lib/seed/person-relationship/index.d.ts +0 -2
  220. package/src/lib/seed/person-relationship/index.js +0 -6
  221. package/src/lib/seed/person-relationship/index.js.map +0 -1
  222. package/src/lib/seed/person-relationship/person-relationship.mock.d.ts +0 -30
  223. package/src/lib/seed/person-relationship/person-relationship.mock.js +0 -156
  224. package/src/lib/seed/person-relationship/person-relationship.mock.js.map +0 -1
  225. package/src/lib/seed/person-relationship/person-relationship.seed.d.ts +0 -5
  226. package/src/lib/seed/person-relationship/person-relationship.seed.js +0 -31
  227. package/src/lib/seed/person-relationship/person-relationship.seed.js.map +0 -1
  228. package/src/lib/seed/person-title/index.d.ts +0 -2
  229. package/src/lib/seed/person-title/index.js +0 -6
  230. package/src/lib/seed/person-title/index.js.map +0 -1
  231. package/src/lib/seed/person-title/person-title.mock.d.ts +0 -43
  232. package/src/lib/seed/person-title/person-title.mock.js +0 -58
  233. package/src/lib/seed/person-title/person-title.mock.js.map +0 -1
  234. package/src/lib/seed/person-title/person-title.seed.d.ts +0 -5
  235. package/src/lib/seed/person-title/person-title.seed.js +0 -31
  236. package/src/lib/seed/person-title/person-title.seed.js.map +0 -1
  237. package/src/lib/seed/religion/index.d.ts +0 -2
  238. package/src/lib/seed/religion/index.js +0 -6
  239. package/src/lib/seed/religion/index.js.map +0 -1
  240. package/src/lib/seed/religion/religion.mock.d.ts +0 -5
  241. package/src/lib/seed/religion/religion.mock.js +0 -48
  242. package/src/lib/seed/religion/religion.mock.js.map +0 -1
  243. package/src/lib/seed/religion/religion.seed.d.ts +0 -5
  244. package/src/lib/seed/religion/religion.seed.js +0 -31
  245. package/src/lib/seed/religion/religion.seed.js.map +0 -1
  246. /package/{src → server/src}/lib/person-core-server.module.d.ts +0 -0
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ //#region ---- Imports ----
3
+ var PersonRelationshipMirrorMiddleware_1;
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PersonRelationshipMirrorMiddleware = void 0;
6
+ const tslib_1 = require("tslib");
7
+ const core_1 = require("@acorex-platform/framework-server/core");
8
+ const common_1 = require("@nestjs/common");
9
+ const module_person_core_contracts_1 = require("@acorex-platform/module-person-core-client/contracts");
10
+ //#endregion
11
+ //#region ---- Constants ----
12
+ const PERSON_RELATIONSHIP_ENTITY = `${module_person_core_contracts_1.RootConfig.module.name}.${module_person_core_contracts_1.RootConfig.entities.personRelationship.name}`;
13
+ const CONTACT_ROLE_ENTITY = `${module_person_core_contracts_1.RootConfig.module.name}.${module_person_core_contracts_1.RootConfig.entities.contactRole.name}`;
14
+ //#endregion
15
+ //#region ---- PersonRelationship mirror middleware ----
16
+ /**
17
+ * Keeps PersonRelationship edges bidirectional:
18
+ * after create/update of A→B (type T), ensures B→A exists with T.inverseTypeId;
19
+ * after delete, removes the matching reverse edge.
20
+ *
21
+ * Recursion is prevented with an in-flight edge-key set (nested insertOne/deleteOne
22
+ * create fresh locals, so a locals flag cannot span the nested call).
23
+ */
24
+ let PersonRelationshipMirrorMiddleware = PersonRelationshipMirrorMiddleware_1 = class PersonRelationshipMirrorMiddleware {
25
+ //#endregion
26
+ constructor(entityStorage) {
27
+ this.entityStorage = entityStorage;
28
+ //#region ---- Services & Dependencies ----
29
+ this.logger = new common_1.Logger(PersonRelationshipMirrorMiddleware_1.name);
30
+ this.inFlightMirrorKeys = new Set();
31
+ //#endregion
32
+ //#region ---- Middleware target ----
33
+ this.target = {
34
+ entity: PERSON_RELATIONSHIP_ENTITY,
35
+ ops: ['create', 'update', 'delete'],
36
+ order: 60,
37
+ };
38
+ }
39
+ //#region ---- Execute ----
40
+ execute(ctx, next) {
41
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
+ var _a;
43
+ // Nested mirror insert/delete marks the edge key before calling entityStorage.*;
44
+ // skip re-mirroring that nested op so symmetric roles cannot recurse.
45
+ const nestedCreateKey = ctx.op === 'create' ? this.edgeKey(((_a = ctx.data) !== null && _a !== void 0 ? _a : {})) : undefined;
46
+ if (nestedCreateKey && this.inFlightMirrorKeys.has(nestedCreateKey)) {
47
+ yield next();
48
+ return;
49
+ }
50
+ if (ctx.op === 'delete') {
51
+ const id = this.asId(ctx.id);
52
+ if (id && this.inFlightMirrorKeys.has(`delete:${id}`)) {
53
+ yield next();
54
+ return;
55
+ }
56
+ }
57
+ let previous;
58
+ if (ctx.op === 'update' || ctx.op === 'delete') {
59
+ previous = yield this.loadRow(ctx);
60
+ }
61
+ yield next();
62
+ try {
63
+ if (ctx.op === 'create') {
64
+ yield this.ensureMirror(ctx, this.readCreatedRow(ctx));
65
+ return;
66
+ }
67
+ if (ctx.op === 'delete') {
68
+ yield this.removeMirror(previous);
69
+ return;
70
+ }
71
+ if (ctx.op === 'update') {
72
+ const current = yield this.loadRowById(ctx);
73
+ if (!current) {
74
+ return;
75
+ }
76
+ if (this.edgeKey(previous) !== this.edgeKey(current)) {
77
+ yield this.removeMirror(previous);
78
+ }
79
+ yield this.ensureMirror(ctx, current);
80
+ }
81
+ }
82
+ catch (error) {
83
+ const message = error instanceof Error ? error.message : String(error);
84
+ this.logger.error(`PersonRelationship mirror failed: ${message}`);
85
+ }
86
+ });
87
+ }
88
+ //#endregion
89
+ //#region ---- Mirror create / delete ----
90
+ ensureMirror(ctx, row) {
91
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
+ var _a;
93
+ const fromPersonId = this.asId(row === null || row === void 0 ? void 0 : row.fromPersonId);
94
+ const toPersonId = this.asId(row === null || row === void 0 ? void 0 : row.toPersonId);
95
+ const typeId = this.asId(row === null || row === void 0 ? void 0 : row.typeId);
96
+ if (!fromPersonId || !toPersonId || !typeId || fromPersonId === toPersonId) {
97
+ return;
98
+ }
99
+ // Prefer ContactRole.inverseTypeId; fall back to the same type (self-mirror)
100
+ // so catalog roles like Partner still create a reverse linked-contact row.
101
+ const inverseTypeId = (_a = (yield this.resolveInverseTypeId(ctx, typeId))) !== null && _a !== void 0 ? _a : typeId;
102
+ const reverseKey = this.edgeKey({
103
+ fromPersonId: toPersonId,
104
+ toPersonId: fromPersonId,
105
+ typeId: inverseTypeId,
106
+ });
107
+ if (!reverseKey || this.inFlightMirrorKeys.has(reverseKey)) {
108
+ return;
109
+ }
110
+ const existing = yield this.findEdge(toPersonId, fromPersonId, inverseTypeId);
111
+ if (existing === null || existing === void 0 ? void 0 : existing.id) {
112
+ return;
113
+ }
114
+ this.inFlightMirrorKeys.add(reverseKey);
115
+ try {
116
+ yield this.entityStorage.insertOne(PERSON_RELATIONSHIP_ENTITY, Object.assign({ fromPersonId: toPersonId, toPersonId: fromPersonId, typeId: inverseTypeId }, (typeof (row === null || row === void 0 ? void 0 : row.notes) === 'string' && row.notes ? { notes: row.notes } : {})));
117
+ }
118
+ finally {
119
+ this.inFlightMirrorKeys.delete(reverseKey);
120
+ }
121
+ });
122
+ }
123
+ removeMirror(row) {
124
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
125
+ var _a;
126
+ const fromPersonId = this.asId(row === null || row === void 0 ? void 0 : row.fromPersonId);
127
+ const toPersonId = this.asId(row === null || row === void 0 ? void 0 : row.toPersonId);
128
+ const typeId = this.asId(row === null || row === void 0 ? void 0 : row.typeId);
129
+ if (!fromPersonId || !toPersonId || !typeId) {
130
+ return;
131
+ }
132
+ const inverseTypeId = (_a = (yield this.resolveInverseTypeId(undefined, typeId))) !== null && _a !== void 0 ? _a : typeId;
133
+ const reverse = yield this.findEdge(toPersonId, fromPersonId, inverseTypeId);
134
+ const reverseId = this.asId(reverse === null || reverse === void 0 ? void 0 : reverse.id);
135
+ if (!reverseId) {
136
+ return;
137
+ }
138
+ const deleteKey = `delete:${reverseId}`;
139
+ if (this.inFlightMirrorKeys.has(deleteKey)) {
140
+ return;
141
+ }
142
+ this.inFlightMirrorKeys.add(deleteKey);
143
+ try {
144
+ yield this.entityStorage.deleteOne(PERSON_RELATIONSHIP_ENTITY, reverseId);
145
+ }
146
+ finally {
147
+ this.inFlightMirrorKeys.delete(deleteKey);
148
+ }
149
+ });
150
+ }
151
+ //#endregion
152
+ //#region ---- Lookups ----
153
+ resolveInverseTypeId(ctx, typeId) {
154
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
155
+ try {
156
+ const role = (ctx
157
+ ? yield ctx.backend.getOne(CONTACT_ROLE_ENTITY, typeId)
158
+ : yield this.entityStorage.getOne(CONTACT_ROLE_ENTITY, typeId));
159
+ return this.asId(role === null || role === void 0 ? void 0 : role.inverseTypeId);
160
+ }
161
+ catch (_a) {
162
+ return undefined;
163
+ }
164
+ });
165
+ }
166
+ findEdge(fromPersonId, toPersonId, typeId) {
167
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
168
+ var _a;
169
+ const result = yield this.entityStorage.query(PERSON_RELATIONSHIP_ENTITY, {
170
+ skip: 0,
171
+ take: 1,
172
+ filter: {
173
+ logic: 'and',
174
+ filters: [
175
+ { field: 'fromPersonId', operator: { type: 'equal' }, value: fromPersonId },
176
+ { field: 'toPersonId', operator: { type: 'equal' }, value: toPersonId },
177
+ { field: 'typeId', operator: { type: 'equal' }, value: typeId },
178
+ ],
179
+ },
180
+ });
181
+ return (_a = result.items) === null || _a === void 0 ? void 0 : _a[0];
182
+ });
183
+ }
184
+ loadRow(ctx) {
185
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
186
+ if (ctx.previous && typeof ctx.previous === 'object') {
187
+ return ctx.previous;
188
+ }
189
+ return this.loadRowById(ctx);
190
+ });
191
+ }
192
+ loadRowById(ctx) {
193
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
194
+ const id = this.asId(ctx.id);
195
+ if (!id) {
196
+ return undefined;
197
+ }
198
+ try {
199
+ return (yield ctx.backend.getOne(ctx.entityName, id));
200
+ }
201
+ catch (_a) {
202
+ return undefined;
203
+ }
204
+ });
205
+ }
206
+ readCreatedRow(ctx) {
207
+ var _a, _b;
208
+ const data = ((_a = ctx.data) !== null && _a !== void 0 ? _a : {});
209
+ const result = ctx.result;
210
+ const id = typeof result === 'string'
211
+ ? result
212
+ : (_b = this.asId(result === null || result === void 0 ? void 0 : result.id)) !== null && _b !== void 0 ? _b : this.asId(data.id);
213
+ return {
214
+ id,
215
+ fromPersonId: this.asId(data.fromPersonId),
216
+ toPersonId: this.asId(data.toPersonId),
217
+ typeId: this.asId(data.typeId),
218
+ notes: data.notes,
219
+ };
220
+ }
221
+ edgeKey(row) {
222
+ const fromPersonId = this.asId(row === null || row === void 0 ? void 0 : row.fromPersonId);
223
+ const toPersonId = this.asId(row === null || row === void 0 ? void 0 : row.toPersonId);
224
+ const typeId = this.asId(row === null || row === void 0 ? void 0 : row.typeId);
225
+ if (!fromPersonId || !toPersonId || !typeId) {
226
+ return undefined;
227
+ }
228
+ return `${fromPersonId}>${toPersonId}:${typeId}`;
229
+ }
230
+ asId(value) {
231
+ if (typeof value === 'string' && value.trim()) {
232
+ return value.trim();
233
+ }
234
+ if (value && typeof value === 'object' && 'id' in value) {
235
+ const id = value.id;
236
+ if (typeof id === 'string' && id.trim()) {
237
+ return id.trim();
238
+ }
239
+ }
240
+ return undefined;
241
+ }
242
+ };
243
+ exports.PersonRelationshipMirrorMiddleware = PersonRelationshipMirrorMiddleware;
244
+ exports.PersonRelationshipMirrorMiddleware = PersonRelationshipMirrorMiddleware = PersonRelationshipMirrorMiddleware_1 = tslib_1.__decorate([
245
+ (0, common_1.Injectable)(),
246
+ tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService])
247
+ ], PersonRelationshipMirrorMiddleware);
248
+ //#endregion
249
+ //# sourceMappingURL=person-relationship-mirror.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-relationship-mirror.middleware.js","sourceRoot":"","sources":["../../../../../../../libs/modules/person-core/server/src/lib/middlewares/person-relationship-mirror.middleware.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;;;AAE3B,iEAKgD;AAChD,2CAAoD;AAEpD,gGAA2E;AAE3E,YAAY;AAEZ,6BAA6B;AAE7B,MAAM,0BAA0B,GAAG,GAAG,yCAAU,CAAC,MAAM,CAAC,IAAI,IAAI,yCAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;AAC9G,MAAM,mBAAmB,GAAG,GAAG,yCAAU,CAAC,MAAM,CAAC,IAAI,IAAI,yCAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;AAchG,YAAY;AAEZ,wDAAwD;AAExD;;;;;;;GAOG;AAEI,IAAM,kCAAkC,0CAAxC,MAAM,kCAAkC;IAgB7C,YAAY;IAEZ,YAA6B,aAA6C;QAA7C,kBAAa,GAAb,aAAa,CAAgC;QAjB1E,2CAA2C;QAE1B,WAAM,GAAG,IAAI,eAAM,C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A;AAvPY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;6CAmBiC,qCAA8B;GAlB/D,kCAAkC,CAuP9C;AAED,YAAY"}
@@ -0,0 +1,12 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
3
+ import { PersonFullNameMiddleware } from './middlewares/person-full-name.middleware';
4
+ import { PersonRelationshipMirrorMiddleware } from './middlewares/person-relationship-mirror.middleware';
5
+ /** Ensures PersonRelationship mirror middleware joins the server pipeline (webpack-safe). */
6
+ export declare class PersonCoreEntityStorageBootstrap implements OnModuleInit {
7
+ private readonly storage;
8
+ private readonly personRelationshipMirrorMiddleware;
9
+ private readonly personFullNameMiddleware;
10
+ constructor(storage: EntityStorageMiddlewareService, personRelationshipMirrorMiddleware: PersonRelationshipMirrorMiddleware, personFullNameMiddleware: PersonFullNameMiddleware);
11
+ onModuleInit(): void;
12
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ //#region ---- Imports ----
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PersonCoreEntityStorageBootstrap = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const common_1 = require("@nestjs/common");
7
+ const core_1 = require("@acorex-platform/framework-server/core");
8
+ const person_full_name_middleware_1 = require("./middlewares/person-full-name.middleware");
9
+ const person_relationship_mirror_middleware_1 = require("./middlewares/person-relationship-mirror.middleware");
10
+ //#endregion
11
+ //#region ---- Entity storage middleware bootstrap ----
12
+ /** Ensures PersonRelationship mirror middleware joins the server pipeline (webpack-safe). */
13
+ let PersonCoreEntityStorageBootstrap = class PersonCoreEntityStorageBootstrap {
14
+ constructor(storage, personRelationshipMirrorMiddleware, personFullNameMiddleware) {
15
+ this.storage = storage;
16
+ this.personRelationshipMirrorMiddleware = personRelationshipMirrorMiddleware;
17
+ this.personFullNameMiddleware = personFullNameMiddleware;
18
+ }
19
+ onModuleInit() {
20
+ this.storage.registerLateMiddleware(this.personRelationshipMirrorMiddleware);
21
+ this.storage.registerLateMiddleware(this.personFullNameMiddleware);
22
+ }
23
+ };
24
+ exports.PersonCoreEntityStorageBootstrap = PersonCoreEntityStorageBootstrap;
25
+ exports.PersonCoreEntityStorageBootstrap = PersonCoreEntityStorageBootstrap = tslib_1.__decorate([
26
+ (0, common_1.Injectable)(),
27
+ tslib_1.__metadata("design:paramtypes", [core_1.EntityStorageMiddlewareService,
28
+ person_relationship_mirror_middleware_1.PersonRelationshipMirrorMiddleware,
29
+ person_full_name_middleware_1.PersonFullNameMiddleware])
30
+ ], PersonCoreEntityStorageBootstrap);
31
+ //#endregion
32
+ //# sourceMappingURL=person-core-entity-storage.bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-core-entity-storage.bootstrap.js","sourceRoot":"","sources":["../../../../../../libs/modules/person-core/server/src/lib/person-core-entity-storage.bootstrap.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;;AAE3B,2CAA0D;AAC1D,iEAAwF;AAExF,2FAAqF;AACrF,+GAAyG;AAEzG,YAAY;AAEZ,uDAAuD;AAEvD,6FAA6F;AAEtF,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC3C,YACmB,OAAuC,EACvC,kCAAsE,EACtE,wBAAkD;QAFlD,YAAO,GAAP,OAAO,CAAgC;QACvC,uCAAkC,GAAlC,kCAAkC,CAAoC;QACtE,6BAAwB,GAAxB,wBAAwB,CAA0B;IAClE,CAAC;IAEJ,YAAY;QACV,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QAC7E,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AAXY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,mBAAU,GAAE;6CAGiB,qCAA8B;QACH,0EAAkC;QAC5C,sDAAwB;GAJ1D,gCAAgC,CAW5C;AAED,YAAY"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ //#region ---- Imports ----
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PersonCoreServerModule = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const common_1 = require("@nestjs/common");
7
+ const seed_1 = require("@acorex-platform/framework-server/domain/seed");
8
+ const core_1 = require("@acorex-platform/framework-server/core");
9
+ const person_core_entity_catalog_1 = require("./entities/person-core.entity-catalog");
10
+ const person_core_entity_storage_bootstrap_1 = require("./person-core-entity-storage.bootstrap");
11
+ const person_full_name_middleware_1 = require("./middlewares/person-full-name.middleware");
12
+ const person_relationship_mirror_middleware_1 = require("./middlewares/person-relationship-mirror.middleware");
13
+ //#endregion
14
+ //#region ---- Middleware providers ----
15
+ const personCoreMiddlewareProviders = [
16
+ person_relationship_mirror_middleware_1.PersonRelationshipMirrorMiddleware,
17
+ person_full_name_middleware_1.PersonFullNameMiddleware,
18
+ person_core_entity_storage_bootstrap_1.PersonCoreEntityStorageBootstrap,
19
+ {
20
+ provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
21
+ useExisting: person_relationship_mirror_middleware_1.PersonRelationshipMirrorMiddleware,
22
+ multi: true,
23
+ },
24
+ {
25
+ provide: core_1.ENTITY_STORAGE_MIDDLEWARE,
26
+ useExisting: person_full_name_middleware_1.PersonFullNameMiddleware,
27
+ multi: true,
28
+ },
29
+ ];
30
+ //#endregion
31
+ //#region ---- Person core server module ----
32
+ let PersonCoreServerModule = class PersonCoreServerModule {
33
+ };
34
+ exports.PersonCoreServerModule = PersonCoreServerModule;
35
+ exports.PersonCoreServerModule = PersonCoreServerModule = tslib_1.__decorate([
36
+ (0, common_1.Module)({
37
+ imports: [seed_1.DomainEntityModule.forFeature(person_core_entity_catalog_1.personCoreEntityCatalog), core_1.EntityStorageModule],
38
+ providers: [...personCoreMiddlewareProviders],
39
+ exports: [person_relationship_mirror_middleware_1.PersonRelationshipMirrorMiddleware, person_full_name_middleware_1.PersonFullNameMiddleware, core_1.ENTITY_STORAGE_MIDDLEWARE],
40
+ })
41
+ ], PersonCoreServerModule);
42
+ //#endregion
43
+ //# sourceMappingURL=person-core-server.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person-core-server.module.js","sourceRoot":"","sources":["../../../../../../libs/modules/person-core/server/src/lib/person-core-server.module.ts"],"names":[],"mappings":";AAAA,2BAA2B;;;;AAE3B,2CAAuD;AACvD,wEAAmF;AACnF,iEAAwG;AAExG,sFAAgF;AAChF,iGAA0F;AAC1F,2FAAqF;AACrF,+GAAyG;AAEzG,YAAY;AAEZ,wCAAwC;AAExC,MAAM,6BAA6B,GAAe;IAChD,0EAAkC;IAClC,sDAAwB;IACxB,uEAAgC;IAChC;QACE,OAAO,EAAE,gCAAyB;QAClC,WAAW,EAAE,0EAAkC;QAC/C,KAAK,EAAE,IAAI;KACA;IACb;QACE,OAAO,EAAE,gCAAyB;QAClC,WAAW,EAAE,sDAAwB;QACrC,KAAK,EAAE,IAAI;KACA;CACd,CAAC;AAEF,YAAY;AAEZ,6CAA6C;AAOtC,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wDAAsB;iCAAtB,sBAAsB;IALlC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAkB,CAAC,UAAU,CAAC,oDAAuB,CAAC,EAAE,0BAAmB,CAAC;QACtF,SAAS,EAAE,CAAC,GAAG,6BAA6B,CAAC;QAC7C,OAAO,EAAE,CAAC,0EAAkC,EAAE,sDAAwB,EAAE,gCAAyB,CAAC;KACnG,CAAC;GACW,sBAAsB,CAAG;AAEtC,YAAY"}
package/src/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './lib/person-core-server.module';
2
- export { personcoreSeedCatalog } from './lib/seed/person-core.seed-catalog';
3
- export { PERSON_CORE_MODULE_SEED } from './lib/seed/person-core-seed.tokens';
4
- export { PersonCoreSeedCatalogProvider } from './lib/seed/person-core-seed.provider';
5
- export * from './lib/seed';
package/src/index.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PersonCoreSeedCatalogProvider = exports.PERSON_CORE_MODULE_SEED = exports.personcoreSeedCatalog = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./lib/person-core-server.module"), exports);
6
- var person_core_seed_catalog_1 = require("./lib/seed/person-core.seed-catalog");
7
- Object.defineProperty(exports, "personcoreSeedCatalog", { enumerable: true, get: function () { return person_core_seed_catalog_1.personcoreSeedCatalog; } });
8
- var person_core_seed_tokens_1 = require("./lib/seed/person-core-seed.tokens");
9
- Object.defineProperty(exports, "PERSON_CORE_MODULE_SEED", { enumerable: true, get: function () { return person_core_seed_tokens_1.PERSON_CORE_MODULE_SEED; } });
10
- var person_core_seed_provider_1 = require("./lib/seed/person-core-seed.provider");
11
- Object.defineProperty(exports, "PersonCoreSeedCatalogProvider", { enumerable: true, get: function () { return person_core_seed_provider_1.PersonCoreSeedCatalogProvider; } });
12
- tslib_1.__exportStar(require("./lib/seed"), exports);
13
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/modules/person-core/server/src/index.ts"],"names":[],"mappings":";;;;AAAA,0EAAgD;AAChD,gFAA4E;AAAnE,iIAAA,qBAAqB,OAAA;AAC9B,8EAA6E;AAApE,kIAAA,uBAAuB,OAAA;AAChC,kFAAqF;AAA5E,0IAAA,6BAA6B,OAAA;AACtC,qDAA2B"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PersonCoreServerModule = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@nestjs/common");
6
- const person_core_seed_catalog_1 = require("./seed/person-core.seed-catalog");
7
- const person_core_seed_tokens_1 = require("./seed/person-core-seed.tokens");
8
- const person_core_seed_provider_1 = require("./seed/person-core-seed.provider");
9
- let PersonCoreServerModule = class PersonCoreServerModule {
10
- };
11
- exports.PersonCoreServerModule = PersonCoreServerModule;
12
- exports.PersonCoreServerModule = PersonCoreServerModule = tslib_1.__decorate([
13
- (0, common_1.Module)({
14
- providers: [
15
- person_core_seed_provider_1.PersonCoreSeedCatalogProvider,
16
- {
17
- provide: person_core_seed_tokens_1.PERSON_CORE_MODULE_SEED,
18
- useValue: person_core_seed_catalog_1.personcoreSeedCatalog,
19
- },
20
- ],
21
- exports: [
22
- person_core_seed_tokens_1.PERSON_CORE_MODULE_SEED,
23
- person_core_seed_provider_1.PersonCoreSeedCatalogProvider
24
- ],
25
- })
26
- ], PersonCoreServerModule);
27
- //# sourceMappingURL=person-core-server.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"person-core-server.module.js","sourceRoot":"","sources":["../../../../../libs/modules/person-core/server/src/lib/person-core-server.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,8EAAwE;AACxE,4EAAyE;AACzE,gFAAiF;AAe1E,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAAG,CAAA;AAAzB,wDAAsB;iCAAtB,sBAAsB;IAblC,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,yDAA6B;YAC7B;gBACE,OAAO,EAAE,iDAAuB;gBAChC,QAAQ,EAAE,gDAAqB;aAChC;SACF;QAED,OAAO,EAAE;YACP,iDAAuB;YACvB,yDAA6B;SAAC;KACjC,CAAC;GACW,sBAAsB,CAAG"}
@@ -1,8 +0,0 @@
1
- import { AXMPersonCoreContactAssignmentEntityModel } from '@acorex-platform/module-person-core-contracts';
2
- export interface AXMPersonCoreContactAssignmentMockModel extends AXMPersonCoreContactAssignmentEntityModel {
3
- }
4
- export declare const CONTACT_ASSIGNMENTS_MOCK: AXMPersonCoreContactAssignmentMockModel[];
5
- export declare const contactAssignmentIds: {
6
- techSolutionsPrimary: string;
7
- techSolutionsAccountManager: string;
8
- };
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var _a, _b;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.contactAssignmentIds = exports.CONTACT_ASSIGNMENTS_MOCK = void 0;
5
- const seed_1 = require("@acorex-platform/module-common-server/seed");
6
- const module_business_core_server_1 = require("@acorex-platform/module-business-core-server");
7
- const contact_role_mock_1 = require("../contact-role/contact-role.mock");
8
- const person_mock_1 = require("../person/person.mock");
9
- const M = seed_1.createMultiLanguageString;
10
- const CONTACT_ASSIGNMENT_ROLES = [
11
- contact_role_mock_1.contactRoleIds.primaryContact,
12
- contact_role_mock_1.contactRoleIds.accountManager,
13
- contact_role_mock_1.contactRoleIds.billingContact,
14
- contact_role_mock_1.contactRoleIds.technicalContact,
15
- contact_role_mock_1.contactRoleIds.salesContact,
16
- ];
17
- const getRoleTitle = (roleId) => { var _a, _b; return (_b = (_a = contact_role_mock_1.contactRoleMocks.find((r) => r.id === roleId)) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : M('Other', 'سایر'); };
18
- const naturalPersonIds = Object.values(person_mock_1.personNaturalIds);
19
- const createContactAssignmentMock = () => {
20
- const mock = [];
21
- const partiesToUse = module_business_core_server_1.PARTIES_MOCK.slice(0, 5);
22
- const personsToUse = person_mock_1.personMock.filter((p) => naturalPersonIds.includes(p.id)).slice(0, 10);
23
- partiesToUse.forEach((party, partyIndex) => {
24
- const personsForParty = personsToUse.slice(partyIndex * 2, (partyIndex + 1) * 2 + 1);
25
- personsForParty.forEach((person, personIndex) => {
26
- var _a;
27
- const roleId = (_a = CONTACT_ASSIGNMENT_ROLES[personIndex % CONTACT_ASSIGNMENT_ROLES.length]) !== null && _a !== void 0 ? _a : contact_role_mock_1.contactRoleIds.primaryContact;
28
- mock.push({
29
- id: seed_1.AXPDataGenerator.uuid(),
30
- partyId: party.id,
31
- personId: person.id,
32
- roleId,
33
- party: { id: party.id, title: party.title },
34
- person: {
35
- id: person.id,
36
- fullName: person.fullName,
37
- phones: person.phones,
38
- emails: person.emails,
39
- },
40
- role: { id: roleId, title: getRoleTitle(roleId) },
41
- });
42
- });
43
- });
44
- return mock;
45
- };
46
- exports.CONTACT_ASSIGNMENTS_MOCK = createContactAssignmentMock();
47
- exports.contactAssignmentIds = {
48
- techSolutionsPrimary: (_a = exports.CONTACT_ASSIGNMENTS_MOCK[0]) === null || _a === void 0 ? void 0 : _a.id,
49
- techSolutionsAccountManager: (_b = exports.CONTACT_ASSIGNMENTS_MOCK[1]) === null || _b === void 0 ? void 0 : _b.id,
50
- };
51
- //# sourceMappingURL=contact-assignment.mock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contact-assignment.mock.js","sourceRoot":"","sources":["../../../../../../../libs/modules/person-core/server/src/lib/seed/contact-assignment/contact-assignment.mock.ts"],"names":[],"mappings":";;;;AACA,qEAAuG;AAIvG,8FAA4E;AAC5E,yEAAqF;AACrF,uDAAqE;AAIrE,MAAM,CAAC,GAAG,gCAAyB,CAAC;AAEpC,MAAM,wBAAwB,GAAG;IAC/B,kCAAc,CAAC,cAAc;IAC7B,kCAAc,CAAC,cAAc;IAC7B,kCAAc,CAAC,cAAc;IAC7B,kCAAc,CAAC,gBAAgB;IAC/B,kCAAc,CAAC,YAAY;CAC5B,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAAc,EAA0B,EAAE,eAC9D,OAAA,MAAA,MAAA,oCAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,0CAAE,KAAK,mCAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA,EAAA,CAAC;AAE7E,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,8BAAgB,CAAa,CAAC;AAErE,MAAM,2BAA2B,GAAG,GAA8C,EAAE;IAClF,MAAM,IAAI,GAA8C,EAAE,CAAC;IAC3D,MAAM,YAAY,GAAG,0CAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC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AwB,GAAG,2BAA2B,EAAE,CAAC;AAEzD,QAAA,oBAAoB,GAAG;IAClC,oBAAoB,EAAE,MAAA,gCAAwB,CAAC,CAAC,CAAC,0CAAE,EAAE;IACrD,2BAA2B,EAAE,MAAA,gCAAwB,CAAC,CAAC,CAAC,0CAAE,EAAE;CAC7D,CAAC"}
@@ -1,5 +0,0 @@
1
- import { AXPDataSeeder, AXPEntitySeedDefinition, AXPEntitySeedStorage } from '@acorex-platform/module-common-server/seed';
2
- export declare const CONTACT_ASSIGNMENT_ENTITY_NAME: string;
3
- export declare function seedContactAssignmentData(storage: AXPEntitySeedStorage): Promise<void>;
4
- export declare function createContactAssignmentDataSeeder(storage: AXPEntitySeedStorage): AXPDataSeeder;
5
- export declare const contactAssignmentSeedDefinition: AXPEntitySeedDefinition;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.contactAssignmentSeedDefinition = exports.CONTACT_ASSIGNMENT_ENTITY_NAME = void 0;
4
- exports.seedContactAssignmentData = seedContactAssignmentData;
5
- exports.createContactAssignmentDataSeeder = createContactAssignmentDataSeeder;
6
- const tslib_1 = require("tslib");
7
- const seed_1 = require("@acorex-platform/module-common-server/seed");
8
- const module_person_core_contracts_1 = require("@acorex-platform/module-person-core-contracts");
9
- const contact_assignment_mock_1 = require("./contact-assignment.mock");
10
- //#region ---- Constants ----
11
- exports.CONTACT_ASSIGNMENT_ENTITY_NAME = `${module_person_core_contracts_1.RootConfig.module.name}.${module_person_core_contracts_1.RootConfig.entities.contactAssignment.name}`;
12
- //#endregion
13
- //#region ---- Pure seed logic ----
14
- function seedContactAssignmentData(storage) {
15
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
- yield storage.initial(exports.CONTACT_ASSIGNMENT_ENTITY_NAME, contact_assignment_mock_1.CONTACT_ASSIGNMENTS_MOCK, { uniqueKeys: ['id'] });
17
- });
18
- }
19
- function createContactAssignmentDataSeeder(storage) {
20
- return {
21
- name: 'ContactAssignmentDataSeeder',
22
- seed: () => seedContactAssignmentData(storage),
23
- };
24
- }
25
- exports.contactAssignmentSeedDefinition = (0, seed_1.defineEntitySeed)({
26
- name: 'ContactAssignmentDataSeeder',
27
- entityName: exports.CONTACT_ASSIGNMENT_ENTITY_NAME,
28
- rows: contact_assignment_mock_1.CONTACT_ASSIGNMENTS_MOCK,
29
- seed: seedContactAssignmentData,
30
- });
31
- //#endregion
32
- //# sourceMappingURL=contact-assignment.seed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contact-assignment.seed.js","sourceRoot":"","sources":["../../../../../../../libs/modules/person-core/server/src/lib/seed/contact-assignment/contact-assignment.seed.ts"],"names":[],"mappings":";;;AAkBA,8DAEC;AAED,8EAKC;;AA3BD,qEAKoD;AACpD,gGAA2E;AAE3E,uEAAqE;AAErE,6BAA6B;AAEhB,QAAA,8BAA8B,GAAG,GAAG,yCAAU,CAAC,MAAM,CAAC,IAAI,IAAI,yCAAU,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;AAExH,YAAY;AAEZ,mCAAmC;AAEnC,SAAsB,yBAAyB,CAAC,OAA6B;;QAC3E,MAAM,OAAO,CAAC,OAAO,CAAC,sCAA8B,EAAE,kDAAwB,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1G,CAAC;CAAA;AAED,SAAgB,iCAAiC,CAAC,OAA6B;IAC7E,OAAO;QACL,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,OAAO,CAAC;KAC/C,CAAC;AACJ,CAAC;AAEY,QAAA,+BAA+B,GAA4B,IAAA,uBAAgB,EAAC;IACvF,IAAI,EAAE,6BAA6B;IACnC,UAAU,EAAE,sCAA8B;IAC1C,IAAI,EAAE,kDAAwB;IAC9B,IAAI,EAAE,yBAAyB;CAChC,CAAC,CAAC;AAEH,YAAY"}
@@ -1,2 +0,0 @@
1
- export * from './contact-assignment.mock';
2
- export * from './contact-assignment.seed';
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./contact-assignment.mock"), exports);
5
- tslib_1.__exportStar(require("./contact-assignment.seed"), exports);
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../libs/modules/person-core/server/src/lib/seed/contact-assignment/index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,oEAA0C"}
@@ -1,40 +0,0 @@
1
- import { AXMPersonCoreContactRoleEntityModel } from '@acorex-platform/module-person-core-contracts';
2
- type ContactRoleMockDto = AXMPersonCoreContactRoleEntityModel;
3
- export declare const contactRoleIds: {
4
- readonly customer: string;
5
- readonly vendor: string;
6
- readonly subcontractor: string;
7
- readonly client: string;
8
- readonly employee: string;
9
- readonly partner: string;
10
- readonly supplier: string;
11
- readonly member: string;
12
- readonly other: string;
13
- readonly siteManager: string;
14
- readonly facilityContact: string;
15
- readonly emergencyContact: string;
16
- readonly maintenanceContact: string;
17
- readonly securityContact: string;
18
- readonly receptionist: string;
19
- readonly decisionMaker: string;
20
- readonly influencer: string;
21
- readonly economicBuyer: string;
22
- readonly user: string;
23
- readonly primaryContact: string;
24
- readonly accountManager: string;
25
- readonly billingContact: string;
26
- readonly technicalContact: string;
27
- readonly salesContact: string;
28
- readonly employs: string;
29
- readonly clientOf: string;
30
- readonly vendorOf: string;
31
- readonly partnerOf: string;
32
- readonly mother: string;
33
- readonly father: string;
34
- readonly sibling: string;
35
- readonly spouse: string;
36
- readonly child: string;
37
- readonly guardian: string;
38
- };
39
- export declare const contactRoleMocks: ContactRoleMockDto[];
40
- export {};