@carlonicora/nestjs-neo4jsonapi 1.31.1 → 1.32.0

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 (244) hide show
  1. package/dist/common/helpers/define-entity.d.ts +29 -0
  2. package/dist/common/helpers/define-entity.d.ts.map +1 -1
  3. package/dist/common/helpers/define-entity.js +42 -1
  4. package/dist/common/helpers/define-entity.js.map +1 -1
  5. package/dist/common/interfaces/entity.descriptor.interface.d.ts +2 -2
  6. package/dist/common/interfaces/entity.descriptor.interface.d.ts.map +1 -1
  7. package/dist/common/interfaces/entity.descriptor.interface.js +2 -1
  8. package/dist/common/interfaces/entity.descriptor.interface.js.map +1 -1
  9. package/dist/common/interfaces/entity.schema.interface.d.ts +19 -1
  10. package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
  11. package/dist/config/base.config.js +2 -2
  12. package/dist/config/base.config.js.map +1 -1
  13. package/dist/core/email/templates/en/paymentFailure.hbs +56 -0
  14. package/dist/core/email/templates/en/paymentSuccessAdmin.hbs +31 -0
  15. package/dist/core/email/templates/en/paymentSuccessCustomer.hbs +51 -0
  16. package/dist/core/email/templates/en/subscriptionStatusChange.hbs +48 -0
  17. package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.d.ts.map +1 -1
  18. package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.js +13 -0
  19. package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.js.map +1 -1
  20. package/dist/core/jsonapi/serialisers/jsonapi.paginator.d.ts +3 -0
  21. package/dist/core/jsonapi/serialisers/jsonapi.paginator.d.ts.map +1 -1
  22. package/dist/core/jsonapi/serialisers/jsonapi.paginator.js +6 -0
  23. package/dist/core/jsonapi/serialisers/jsonapi.paginator.js.map +1 -1
  24. package/dist/core/jsonapi/services/jsonapi.service.d.ts.map +1 -1
  25. package/dist/core/jsonapi/services/jsonapi.service.js +6 -0
  26. package/dist/core/jsonapi/services/jsonapi.service.js.map +1 -1
  27. package/dist/core/neo4j/abstracts/abstract.service.d.ts +2 -0
  28. package/dist/core/neo4j/abstracts/abstract.service.d.ts.map +1 -1
  29. package/dist/core/neo4j/abstracts/abstract.service.js +8 -4
  30. package/dist/core/neo4j/abstracts/abstract.service.js.map +1 -1
  31. package/dist/core/neo4j/services/neo4j.service.d.ts +9 -0
  32. package/dist/core/neo4j/services/neo4j.service.d.ts.map +1 -1
  33. package/dist/core/neo4j/services/neo4j.service.js +95 -1
  34. package/dist/core/neo4j/services/neo4j.service.js.map +1 -1
  35. package/dist/foundations/audit/entities/audit.entity.d.ts +1 -1
  36. package/dist/foundations/audit/entities/audit.entity.d.ts.map +1 -1
  37. package/dist/foundations/audit/serialisers/audit.serialiser.js +2 -2
  38. package/dist/foundations/audit/serialisers/audit.serialiser.js.map +1 -1
  39. package/dist/foundations/auth/controllers/auth.discord.controller.d.ts +5 -1
  40. package/dist/foundations/auth/controllers/auth.discord.controller.d.ts.map +1 -1
  41. package/dist/foundations/auth/controllers/auth.discord.controller.js +9 -11
  42. package/dist/foundations/auth/controllers/auth.discord.controller.js.map +1 -1
  43. package/dist/foundations/auth/entities/auth.entity.d.ts +1 -1
  44. package/dist/foundations/auth/entities/auth.entity.d.ts.map +1 -1
  45. package/dist/foundations/auth/repositories/auth.repository.d.ts +1 -1
  46. package/dist/foundations/auth/repositories/auth.repository.d.ts.map +1 -1
  47. package/dist/foundations/auth/repositories/auth.repository.js +31 -13
  48. package/dist/foundations/auth/repositories/auth.repository.js.map +1 -1
  49. package/dist/foundations/auth/serialisers/auth.serialiser.js +2 -2
  50. package/dist/foundations/auth/serialisers/auth.serialiser.js.map +1 -1
  51. package/dist/foundations/auth/services/auth.service.d.ts +1 -1
  52. package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
  53. package/dist/foundations/company/company.module.d.ts.map +1 -1
  54. package/dist/foundations/company/company.module.js +9 -5
  55. package/dist/foundations/company/company.module.js.map +1 -1
  56. package/dist/foundations/company/entities/company.d.ts +44 -0
  57. package/dist/foundations/company/entities/company.d.ts.map +1 -0
  58. package/dist/foundations/company/entities/company.js +47 -0
  59. package/dist/foundations/company/entities/company.js.map +1 -0
  60. package/dist/foundations/company/entities/company.meta.d.ts +1 -1
  61. package/dist/foundations/company/entities/company.meta.d.ts.map +1 -1
  62. package/dist/foundations/company/index.d.ts +1 -2
  63. package/dist/foundations/company/index.d.ts.map +1 -1
  64. package/dist/foundations/company/index.js +3 -3
  65. package/dist/foundations/company/index.js.map +1 -1
  66. package/dist/foundations/company/repositories/company.repository.d.ts +26 -1
  67. package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
  68. package/dist/foundations/company/repositories/company.repository.js +67 -11
  69. package/dist/foundations/company/repositories/company.repository.js.map +1 -1
  70. package/dist/foundations/company/services/company.service.d.ts +4 -1
  71. package/dist/foundations/company/services/company.service.d.ts.map +1 -1
  72. package/dist/foundations/company/services/company.service.js +11 -6
  73. package/dist/foundations/company/services/company.service.js.map +1 -1
  74. package/dist/foundations/content/entities/content.entity.d.ts +1 -1
  75. package/dist/foundations/content/entities/content.entity.d.ts.map +1 -1
  76. package/dist/foundations/content/serialisers/content.serialiser.js +3 -3
  77. package/dist/foundations/content/serialisers/content.serialiser.js.map +1 -1
  78. package/dist/foundations/module/queries/feature.module.query.d.ts +3 -1
  79. package/dist/foundations/module/queries/feature.module.query.d.ts.map +1 -1
  80. package/dist/foundations/module/queries/feature.module.query.js +27 -15
  81. package/dist/foundations/module/queries/feature.module.query.js.map +1 -1
  82. package/dist/foundations/notification/entities/notification.entity.d.ts +1 -1
  83. package/dist/foundations/notification/entities/notification.entity.d.ts.map +1 -1
  84. package/dist/foundations/notification/serialisers/notifications.serialiser.js +2 -2
  85. package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +1 -1
  86. package/dist/foundations/oauth/entities/oauth.client.entity.d.ts +2 -2
  87. package/dist/foundations/oauth/entities/oauth.client.entity.d.ts.map +1 -1
  88. package/dist/foundations/relevancy/repositories/relevancy.repository.d.ts.map +1 -1
  89. package/dist/foundations/relevancy/repositories/relevancy.repository.js +1 -1
  90. package/dist/foundations/relevancy/repositories/relevancy.repository.js.map +1 -1
  91. package/dist/foundations/relevancy/services/relevancy.service.js +1 -1
  92. package/dist/foundations/relevancy/services/relevancy.service.js.map +1 -1
  93. package/dist/foundations/role/entities/role.d.ts +28 -0
  94. package/dist/foundations/role/entities/role.d.ts.map +1 -0
  95. package/dist/foundations/role/entities/role.js +33 -0
  96. package/dist/foundations/role/entities/role.js.map +1 -0
  97. package/dist/foundations/role/entities/role.meta.d.ts +1 -1
  98. package/dist/foundations/role/entities/role.meta.d.ts.map +1 -1
  99. package/dist/foundations/role/repositories/role.repository.d.ts +1 -1
  100. package/dist/foundations/role/repositories/role.repository.d.ts.map +1 -1
  101. package/dist/foundations/role/repositories/role.repository.js +7 -7
  102. package/dist/foundations/role/repositories/role.repository.js.map +1 -1
  103. package/dist/foundations/role/role.module.d.ts.map +1 -1
  104. package/dist/foundations/role/role.module.js +3 -4
  105. package/dist/foundations/role/role.module.js.map +1 -1
  106. package/dist/foundations/role/services/role.service.js +5 -5
  107. package/dist/foundations/role/services/role.service.js.map +1 -1
  108. package/dist/foundations/stripe-customer/entities/stripe-customer.entity.d.ts +1 -1
  109. package/dist/foundations/stripe-customer/entities/stripe-customer.entity.d.ts.map +1 -1
  110. package/dist/foundations/stripe-price/dtos/stripe-price.dto.d.ts +12 -0
  111. package/dist/foundations/stripe-price/dtos/stripe-price.dto.d.ts.map +1 -1
  112. package/dist/foundations/stripe-price/dtos/stripe-price.dto.js +47 -1
  113. package/dist/foundations/stripe-price/dtos/stripe-price.dto.js.map +1 -1
  114. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts +2 -0
  115. package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts.map +1 -1
  116. package/dist/foundations/stripe-price/entities/stripe-price.map.d.ts.map +1 -1
  117. package/dist/foundations/stripe-price/entities/stripe-price.map.js +1 -0
  118. package/dist/foundations/stripe-price/entities/stripe-price.map.js.map +1 -1
  119. package/dist/foundations/stripe-price/entities/stripe-price.model.d.ts.map +1 -1
  120. package/dist/foundations/stripe-price/entities/stripe-price.model.js +2 -1
  121. package/dist/foundations/stripe-price/entities/stripe-price.model.js.map +1 -1
  122. package/dist/foundations/stripe-price/repositories/stripe-price.repository.d.ts +3 -0
  123. package/dist/foundations/stripe-price/repositories/stripe-price.repository.d.ts.map +1 -1
  124. package/dist/foundations/stripe-price/repositories/stripe-price.repository.js +64 -4
  125. package/dist/foundations/stripe-price/repositories/stripe-price.repository.js.map +1 -1
  126. package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.d.ts.map +1 -1
  127. package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.js +5 -0
  128. package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.js.map +1 -1
  129. package/dist/foundations/stripe-price/services/stripe-price-admin.service.d.ts.map +1 -1
  130. package/dist/foundations/stripe-price/services/stripe-price-admin.service.js +10 -0
  131. package/dist/foundations/stripe-price/services/stripe-price-admin.service.js.map +1 -1
  132. package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts +11 -0
  133. package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts.map +1 -1
  134. package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js +22 -0
  135. package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js.map +1 -1
  136. package/dist/foundations/stripe-subscription/services/feature-sync.service.d.ts +33 -0
  137. package/dist/foundations/stripe-subscription/services/feature-sync.service.d.ts.map +1 -0
  138. package/dist/foundations/stripe-subscription/services/feature-sync.service.js +155 -0
  139. package/dist/foundations/stripe-subscription/services/feature-sync.service.js.map +1 -0
  140. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts.map +1 -1
  141. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js +11 -0
  142. package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js.map +1 -1
  143. package/dist/foundations/stripe-subscription/stripe-subscription.module.d.ts.map +1 -1
  144. package/dist/foundations/stripe-subscription/stripe-subscription.module.js +3 -0
  145. package/dist/foundations/stripe-subscription/stripe-subscription.module.js.map +1 -1
  146. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts +3 -1
  147. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts.map +1 -1
  148. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js +79 -9
  149. package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js.map +1 -1
  150. package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts +26 -1
  151. package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts.map +1 -1
  152. package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js +124 -2
  153. package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js.map +1 -1
  154. package/dist/foundations/stripe-webhook/stripe-webhook.module.d.ts.map +1 -1
  155. package/dist/foundations/stripe-webhook/stripe-webhook.module.js +2 -0
  156. package/dist/foundations/stripe-webhook/stripe-webhook.module.js.map +1 -1
  157. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +1 -1
  158. package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +1 -1
  159. package/dist/foundations/user/controllers/user.controller.d.ts +1 -1
  160. package/dist/foundations/user/controllers/user.controller.d.ts.map +1 -1
  161. package/dist/foundations/user/entities/user.d.ts +124 -0
  162. package/dist/foundations/user/entities/user.d.ts.map +1 -0
  163. package/dist/foundations/user/entities/user.js +81 -0
  164. package/dist/foundations/user/entities/user.js.map +1 -0
  165. package/dist/foundations/user/entities/user.meta.d.ts +1 -1
  166. package/dist/foundations/user/entities/user.meta.d.ts.map +1 -1
  167. package/dist/foundations/user/index.d.ts +1 -4
  168. package/dist/foundations/user/index.d.ts.map +1 -1
  169. package/dist/foundations/user/index.js +6 -23
  170. package/dist/foundations/user/index.js.map +1 -1
  171. package/dist/foundations/user/repositories/user.repository.d.ts +13 -1
  172. package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
  173. package/dist/foundations/user/repositories/user.repository.js +85 -21
  174. package/dist/foundations/user/repositories/user.repository.js.map +1 -1
  175. package/dist/foundations/user/services/user.service.d.ts.map +1 -1
  176. package/dist/foundations/user/services/user.service.js +12 -12
  177. package/dist/foundations/user/services/user.service.js.map +1 -1
  178. package/dist/foundations/user/user.module.d.ts.map +1 -1
  179. package/dist/foundations/user/user.module.js +7 -8
  180. package/dist/foundations/user/user.module.js.map +1 -1
  181. package/dist/openapi/factories/entity-schema.factory.js +12 -0
  182. package/dist/openapi/factories/entity-schema.factory.js.map +1 -1
  183. package/dist/openapi/schemas/jsonapi-base.schemas.d.ts +1 -0
  184. package/dist/openapi/schemas/jsonapi-base.schemas.d.ts.map +1 -1
  185. package/dist/openapi/schemas/jsonapi-base.schemas.js.map +1 -1
  186. package/dist/tools/migrate-entity/__tests__/ast-parser.spec.js +331 -0
  187. package/dist/tools/migrate-entity/__tests__/descriptor-generator.spec.js +482 -0
  188. package/dist/tools/migrate-entity/__tests__/file-discovery.spec.js +190 -0
  189. package/dist/tools/migrate-entity/__tests__/integration.spec.js +261 -0
  190. package/dist/tools/migrate-entity/index.js +2 -2
  191. package/dist/tools/migrate-entity/lib/ast-parser.js +255 -10
  192. package/dist/tools/migrate-entity/lib/descriptor-generator.js +384 -55
  193. package/dist/tools/migrate-entity/lib/entity-migrator.js +112 -9
  194. package/dist/tools/migrate-entity/lib/module-updater.js +25 -9
  195. package/dist/tools/migrate-entity/lib/reference-updater.js +110 -24
  196. package/package.json +2 -2
  197. package/dist/foundations/company/entities/company.entity.d.ts +0 -18
  198. package/dist/foundations/company/entities/company.entity.d.ts.map +0 -1
  199. package/dist/foundations/company/entities/company.entity.js +0 -3
  200. package/dist/foundations/company/entities/company.entity.js.map +0 -1
  201. package/dist/foundations/company/entities/company.map.d.ts +0 -8
  202. package/dist/foundations/company/entities/company.map.d.ts.map +0 -1
  203. package/dist/foundations/company/entities/company.map.js +0 -23
  204. package/dist/foundations/company/entities/company.map.js.map +0 -1
  205. package/dist/foundations/company/entities/company.model.d.ts +0 -4
  206. package/dist/foundations/company/entities/company.model.d.ts.map +0 -1
  207. package/dist/foundations/company/entities/company.model.js +0 -17
  208. package/dist/foundations/company/entities/company.model.js.map +0 -1
  209. package/dist/foundations/company/serialisers/company.serialiser.d.ts +0 -14
  210. package/dist/foundations/company/serialisers/company.serialiser.d.ts.map +0 -1
  211. package/dist/foundations/company/serialisers/company.serialiser.js +0 -76
  212. package/dist/foundations/company/serialisers/company.serialiser.js.map +0 -1
  213. package/dist/foundations/role/entities/role.entity.d.ts +0 -9
  214. package/dist/foundations/role/entities/role.entity.d.ts.map +0 -1
  215. package/dist/foundations/role/entities/role.entity.js +0 -3
  216. package/dist/foundations/role/entities/role.entity.js.map +0 -1
  217. package/dist/foundations/role/entities/role.map.d.ts +0 -8
  218. package/dist/foundations/role/entities/role.map.d.ts.map +0 -1
  219. package/dist/foundations/role/entities/role.map.js +0 -15
  220. package/dist/foundations/role/entities/role.map.js.map +0 -1
  221. package/dist/foundations/role/entities/role.model.d.ts +0 -4
  222. package/dist/foundations/role/entities/role.model.d.ts.map +0 -1
  223. package/dist/foundations/role/entities/role.model.js +0 -15
  224. package/dist/foundations/role/entities/role.model.js.map +0 -1
  225. package/dist/foundations/role/serialisers/role.serialiser.d.ts +0 -12
  226. package/dist/foundations/role/serialisers/role.serialiser.d.ts.map +0 -1
  227. package/dist/foundations/role/serialisers/role.serialiser.js +0 -46
  228. package/dist/foundations/role/serialisers/role.serialiser.js.map +0 -1
  229. package/dist/foundations/user/entities/user.entity.d.ts +0 -26
  230. package/dist/foundations/user/entities/user.entity.d.ts.map +0 -1
  231. package/dist/foundations/user/entities/user.entity.js +0 -3
  232. package/dist/foundations/user/entities/user.entity.js.map +0 -1
  233. package/dist/foundations/user/entities/user.map.d.ts +0 -8
  234. package/dist/foundations/user/entities/user.map.d.ts.map +0 -1
  235. package/dist/foundations/user/entities/user.map.js +0 -27
  236. package/dist/foundations/user/entities/user.map.js.map +0 -1
  237. package/dist/foundations/user/entities/user.model.d.ts +0 -7
  238. package/dist/foundations/user/entities/user.model.d.ts.map +0 -1
  239. package/dist/foundations/user/entities/user.model.js +0 -30
  240. package/dist/foundations/user/entities/user.model.js.map +0 -1
  241. package/dist/foundations/user/serialisers/user.serialiser.d.ts +0 -14
  242. package/dist/foundations/user/serialisers/user.serialiser.d.ts.map +0 -1
  243. package/dist/foundations/user/serialisers/user.serialiser.js +0 -80
  244. package/dist/foundations/user/serialisers/user.serialiser.js.map +0 -1
@@ -13,7 +13,7 @@ exports.RoleRepository = void 0;
13
13
  const system_roles_1 = require("../../../common/constants/system.roles");
14
14
  const common_1 = require("@nestjs/common");
15
15
  const neo4j_service_1 = require("../../../core/neo4j/services/neo4j.service");
16
- const role_model_1 = require("../../role/entities/role.model");
16
+ const role_1 = require("../../role/entities/role");
17
17
  let RoleRepository = class RoleRepository {
18
18
  constructor(neo4j) {
19
19
  this.neo4j = neo4j;
@@ -24,7 +24,7 @@ let RoleRepository = class RoleRepository {
24
24
  });
25
25
  }
26
26
  async findByNameNotId(params) {
27
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel });
27
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model });
28
28
  query.queryParams = {
29
29
  roleId: params.roleId,
30
30
  name: params.name,
@@ -37,7 +37,7 @@ let RoleRepository = class RoleRepository {
37
37
  return this.neo4j.readOne(query);
38
38
  }
39
39
  async findByName(params) {
40
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel });
40
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model });
41
41
  query.queryParams = {
42
42
  name: params.name,
43
43
  };
@@ -48,7 +48,7 @@ let RoleRepository = class RoleRepository {
48
48
  return this.neo4j.readOne(query);
49
49
  }
50
50
  async findById(params) {
51
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel });
51
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model });
52
52
  query.queryParams = {
53
53
  roleId: params.roleId,
54
54
  };
@@ -59,7 +59,7 @@ let RoleRepository = class RoleRepository {
59
59
  return this.neo4j.readOne(query);
60
60
  }
61
61
  async find(params) {
62
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel, cursor: params.cursor });
62
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model, cursor: params.cursor });
63
63
  query.queryParams = {
64
64
  term: params.term,
65
65
  administratorsId: system_roles_1.RoleId.Administrator,
@@ -78,7 +78,7 @@ let RoleRepository = class RoleRepository {
78
78
  return this.neo4j.readMany(query);
79
79
  }
80
80
  async findForUser(params) {
81
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel, cursor: params.cursor });
81
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model, cursor: params.cursor });
82
82
  query.queryParams = {
83
83
  ...query.queryParams,
84
84
  userId: params.userId,
@@ -100,7 +100,7 @@ let RoleRepository = class RoleRepository {
100
100
  return this.neo4j.readMany(query);
101
101
  }
102
102
  async findNotInUser(params) {
103
- const query = this.neo4j.initQuery({ serialiser: role_model_1.RoleModel, cursor: params.cursor, fetchAll: true });
103
+ const query = this.neo4j.initQuery({ serialiser: role_1.RoleDescriptor.model, cursor: params.cursor, fetchAll: true });
104
104
  query.queryParams = {
105
105
  ...query.queryParams,
106
106
  userId: params.userId,
@@ -1 +1 @@
1
- {"version":3,"file":"role.repository.js","sourceRoot":"","sources":["../../../../src/foundations/role/repositories/role.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAgE;AAChE,2CAA0D;AAE1D,8EAA0E;AAE1E,+DAA2D;AAGpD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,KAAmB;QAAnB,UAAK,GAAL,KAAK,CAAc;IAAG,CAAC;IAEpD,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAA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,CAAC;QAErC,KAAK,CAAC,WAAW,GAAG;YAClB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;;;KAGb,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AA1LY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEyB,4BAAY;GADrC,cAAc,CA0L1B"}
1
+ {"version":3,"file":"role.repository.js","sourceRoot":"","sources":["../../../../src/foundations/role/repositories/role.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAgE;AAChE,2CAA0D;AAE1D,8EAA0E;AAC1E,mDAAgE;AAGzD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YAA6B,KAAmB;QAAnB,UAAK,GAAL,KAAK,CAAc;IAAG,CAAC;IAEpD,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YACxB,KAAK,EAAE,mFAAmF;SAC3F,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAwC;QAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,qBAAc,CAAC,KAAK,EAAE,CAAC,CAAC;QAEzE,KAAK,CAAC,WAAW,GAAG;YAClB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;;;;KAIb,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,qBAAc,CAAC,KAAK,EAAE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C,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;;;;;;;KAOb,CAAC;QAEF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA0D;QACrE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAErC,KAAK,CAAC,WAAW,GAAG;YAClB,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;;;;;KAKb,CAAC;QAEF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA0B;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAErC,KAAK,CAAC,WAAW,GAAG;YAClB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;;;KAGb,CAAC;QACF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AA1LY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEyB,4BAAY;GADrC,cAAc,CA0L1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"role.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/role/role.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAUtD,qBAMa,UAAW,YAAW,YAAY;IAC7C,YAAY;CAGb"}
1
+ {"version":3,"file":"role.module.d.ts","sourceRoot":"","sources":["../../../src/foundations/role/role.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAStD,qBAMa,UAAW,YAAW,YAAY;IAC7C,YAAY;CAGb"}
@@ -10,21 +10,20 @@ exports.RoleModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const registry_1 = require("../../common/registries/registry");
12
12
  const role_user_controller_1 = require("./controllers/role.user.controller");
13
- const role_model_1 = require("./entities/role.model");
14
- const role_serialiser_1 = require("./serialisers/role.serialiser");
13
+ const role_1 = require("./entities/role");
15
14
  const role_controller_1 = require("./controllers/role.controller");
16
15
  const role_repository_1 = require("./repositories/role.repository");
17
16
  const role_service_1 = require("./services/role.service");
18
17
  let RoleModule = class RoleModule {
19
18
  onModuleInit() {
20
- registry_1.modelRegistry.register(role_model_1.RoleModel);
19
+ registry_1.modelRegistry.register(role_1.RoleDescriptor.model);
21
20
  }
22
21
  };
23
22
  exports.RoleModule = RoleModule;
24
23
  exports.RoleModule = RoleModule = __decorate([
25
24
  (0, common_1.Module)({
26
25
  controllers: [role_controller_1.RoleController, role_user_controller_1.RoleUserController],
27
- providers: [role_repository_1.RoleRepository, role_service_1.RoleService, role_serialiser_1.RoleSerialiser],
26
+ providers: [role_repository_1.RoleRepository, role_service_1.RoleService, role_1.RoleDescriptor.model.serialiser],
28
27
  exports: [role_repository_1.RoleRepository],
29
28
  imports: [],
30
29
  })
@@ -1 +1 @@
1
- {"version":3,"file":"role.module.js","sourceRoot":"","sources":["../../../src/foundations/role/role.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,6EAAwE;AACxE,sDAAkD;AAClD,mEAA+D;AAC/D,mEAA+D;AAC/D,oEAAgE;AAChE,0DAAsD;AAQ/C,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,sBAAS,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IANtB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,gCAAc,EAAE,yCAAkB,CAAC;QACjD,SAAS,EAAE,CAAC,gCAAc,EAAE,0BAAW,EAAE,gCAAc,CAAC;QACxD,OAAO,EAAE,CAAC,gCAAc,CAAC;QACzB,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,UAAU,CAItB"}
1
+ {"version":3,"file":"role.module.js","sourceRoot":"","sources":["../../../src/foundations/role/role.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsD;AAEtD,+DAAiE;AACjE,6EAAwE;AACxE,0CAAiD;AACjD,mEAA+D;AAC/D,oEAAgE;AAChE,0DAAsD;AAQ/C,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,YAAY;QACV,wBAAa,CAAC,QAAQ,CAAC,qBAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IANtB,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,CAAC,gCAAc,EAAE,yCAAkB,CAAC;QACjD,SAAS,EAAE,CAAC,gCAAc,EAAE,0BAAW,EAAE,qBAAc,CAAC,KAAK,CAAC,UAAU,CAAC;QACzE,OAAO,EAAE,CAAC,gCAAc,CAAC;QACzB,OAAO,EAAE,EAAE;KACZ,CAAC;GACW,UAAU,CAItB"}
@@ -13,7 +13,7 @@ exports.RoleService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const jsonapi_paginator_1 = require("../../../core/jsonapi/serialisers/jsonapi.paginator");
15
15
  const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
16
- const role_model_1 = require("../../role/entities/role.model");
16
+ const role_1 = require("../../role/entities/role");
17
17
  const role_repository_1 = require("../repositories/role.repository");
18
18
  let RoleService = class RoleService {
19
19
  constructor(builder, roleRepository) {
@@ -26,20 +26,20 @@ let RoleService = class RoleService {
26
26
  throw new common_1.HttpException("A role with the given name already exists", common_1.HttpStatus.CONFLICT);
27
27
  }
28
28
  async findById(params) {
29
- return this.builder.buildSingle(role_model_1.RoleModel, await this.roleRepository.findById({
29
+ return this.builder.buildSingle(role_1.RoleDescriptor.model, await this.roleRepository.findById({
30
30
  roleId: params.roleId,
31
31
  }));
32
32
  }
33
33
  async find(params) {
34
34
  const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
35
- return this.builder.buildList(role_model_1.RoleModel, await this.roleRepository.find({
35
+ return this.builder.buildList(role_1.RoleDescriptor.model, await this.roleRepository.find({
36
36
  term: params.term,
37
37
  cursor: paginator.generateCursor(),
38
38
  }), paginator);
39
39
  }
40
40
  async findForUser(params) {
41
41
  const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
42
- return this.builder.buildList(role_model_1.RoleModel, await this.roleRepository.findForUser({
42
+ return this.builder.buildList(role_1.RoleDescriptor.model, await this.roleRepository.findForUser({
43
43
  userId: params.userId,
44
44
  term: params.term,
45
45
  cursor: paginator.generateCursor(),
@@ -47,7 +47,7 @@ let RoleService = class RoleService {
47
47
  }
48
48
  async findNotInUser(params) {
49
49
  const paginator = new jsonapi_paginator_1.JsonApiPaginator(params.query);
50
- return this.builder.buildList(role_model_1.RoleModel, await this.roleRepository.findNotInUser({
50
+ return this.builder.buildList(role_1.RoleDescriptor.model, await this.roleRepository.findNotInUser({
51
51
  userId: params.userId,
52
52
  term: params.term,
53
53
  cursor: paginator.generateCursor(),
@@ -1 +1 @@
1
- {"version":3,"file":"role.service.js","sourceRoot":"","sources":["../../../../src/foundations/role/services/role.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAuE;AAGvE,2FAAuF;AACvF,oFAAgF;AAEhF,+DAA2D;AAC3D,qEAAiE;AAG1D,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YACmB,OAAuB,EACvB,cAA8B;QAD9B,YAAO,GAAP,OAAO,CAAgB;QACvB,mBAAc,GAAd,cAAc,CAAgB;IAC9C,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CAAc;QACP,gCAAc;GAHtC,WAAW,CA4FvB"}
@@ -1,5 +1,5 @@
1
1
  import { Entity } from "../../../common/abstracts/entity";
2
- import { Company } from "../../company/entities/company.entity";
2
+ import { Company } from "../../company/entities/company";
3
3
  export type StripeCustomer = Entity & {
4
4
  stripeCustomerId: string;
5
5
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-customer.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-customer/entities/stripe-customer.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
1
+ {"version":3,"file":"stripe-customer.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-customer/entities/stripe-customer.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -19,10 +19,18 @@ export declare class StripePricePostAttributesDTO {
19
19
  features?: string;
20
20
  token?: number;
21
21
  }
22
+ export declare class StripePriceFeaturesItemDTO {
23
+ type: string;
24
+ id: string;
25
+ }
26
+ export declare class StripePricePostRelationshipsDTO {
27
+ features?: StripePriceFeaturesItemDTO[];
28
+ }
22
29
  export declare class StripePricePostDataDTO {
23
30
  type: string;
24
31
  id: string;
25
32
  attributes: StripePricePostAttributesDTO;
33
+ relationships?: StripePricePostRelationshipsDTO;
26
34
  }
27
35
  export declare class StripePricePostDTO {
28
36
  data: StripePricePostDataDTO;
@@ -35,10 +43,14 @@ export declare class StripePricePutAttributesDTO {
35
43
  features?: string;
36
44
  token?: number;
37
45
  }
46
+ export declare class StripePricePutRelationshipsDTO {
47
+ features?: StripePriceFeaturesItemDTO[];
48
+ }
38
49
  export declare class StripePricePutDataDTO {
39
50
  type: string;
40
51
  id: string;
41
52
  attributes?: StripePricePutAttributesDTO;
53
+ relationships?: StripePricePutRelationshipsDTO;
42
54
  }
43
55
  export declare class StripePricePutDTO {
44
56
  data: StripePricePutDataDTO;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.dto.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/dtos/stripe-price.dto.ts"],"names":[],"mappings":"AAmBA,qBAAa,cAAc;IAEzB,IAAI,EAAE,MAAM,CAAC;IAGb,EAAE,EAAE,MAAM,CAAC;CACZ;AAGD,cAAM,YAAY;IAEhB,QAAQ,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAK5C,aAAa,CAAC,EAAE,MAAM,CAAC;IAIvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,qBAAa,4BAA4B;IAGvC,SAAS,EAAE,MAAM,CAAC;IAIlB,UAAU,EAAE,MAAM,CAAC;IAKnB,QAAQ,EAAE,MAAM,CAAC;IAKjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKl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AA0B,EAAE,CAAC;CACzC;AAED,qBAAa,qBAAqB;IAEhC,IAAI,EAAE,MAAM,CAAC;IAGb,EAAE,EAAE,MAAM,CAAC;IAKX,UAAU,CAAC,EAAE,2BAA2B,CAAC;IAKzC,aAAa,CAAC,EAAE,8BAA8B,CAAC;CAChD;AAED,qBAAa,iBAAiB;IAI5B,IAAI,EAAE,qBAAqB,CAAC;IAG5B,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;CAClB"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StripePricePutDTO = exports.StripePricePutDataDTO = exports.StripePricePutAttributesDTO = exports.StripePricePostDTO = exports.StripePricePostDataDTO = exports.StripePricePostAttributesDTO = exports.StripePriceDTO = void 0;
12
+ exports.StripePricePutDTO = exports.StripePricePutDataDTO = exports.StripePricePutRelationshipsDTO = exports.StripePricePutAttributesDTO = exports.StripePricePostDTO = exports.StripePricePostDataDTO = exports.StripePricePostRelationshipsDTO = exports.StripePriceFeaturesItemDTO = exports.StripePricePostAttributesDTO = exports.StripePriceDTO = void 0;
13
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const stripe_price_meta_1 = require("../entities/stripe-price.meta");
@@ -102,6 +102,29 @@ __decorate([
102
102
  (0, class_validator_1.Min)(0),
103
103
  __metadata("design:type", Number)
104
104
  ], StripePricePostAttributesDTO.prototype, "token", void 0);
105
+ // Feature relationship item DTO (for JSON:API relationships)
106
+ class StripePriceFeaturesItemDTO {
107
+ }
108
+ exports.StripePriceFeaturesItemDTO = StripePriceFeaturesItemDTO;
109
+ __decorate([
110
+ (0, class_validator_1.Equals)("features"),
111
+ __metadata("design:type", String)
112
+ ], StripePriceFeaturesItemDTO.prototype, "type", void 0);
113
+ __decorate([
114
+ (0, class_validator_1.IsUUID)(),
115
+ __metadata("design:type", String)
116
+ ], StripePriceFeaturesItemDTO.prototype, "id", void 0);
117
+ // Relationships DTO for POST requests
118
+ class StripePricePostRelationshipsDTO {
119
+ }
120
+ exports.StripePricePostRelationshipsDTO = StripePricePostRelationshipsDTO;
121
+ __decorate([
122
+ (0, class_validator_1.IsOptional)(),
123
+ (0, class_validator_1.IsArray)(),
124
+ (0, class_validator_1.ValidateNested)({ each: true }),
125
+ (0, class_transformer_1.Type)(() => StripePriceFeaturesItemDTO),
126
+ __metadata("design:type", Array)
127
+ ], StripePricePostRelationshipsDTO.prototype, "features", void 0);
105
128
  class StripePricePostDataDTO {
106
129
  }
107
130
  exports.StripePricePostDataDTO = StripePricePostDataDTO;
@@ -119,6 +142,12 @@ __decorate([
119
142
  (0, class_transformer_1.Type)(() => StripePricePostAttributesDTO),
120
143
  __metadata("design:type", StripePricePostAttributesDTO)
121
144
  ], StripePricePostDataDTO.prototype, "attributes", void 0);
145
+ __decorate([
146
+ (0, class_validator_1.IsOptional)(),
147
+ (0, class_validator_1.ValidateNested)(),
148
+ (0, class_transformer_1.Type)(() => StripePricePostRelationshipsDTO),
149
+ __metadata("design:type", StripePricePostRelationshipsDTO)
150
+ ], StripePricePostDataDTO.prototype, "relationships", void 0);
122
151
  class StripePricePostDTO {
123
152
  }
124
153
  exports.StripePricePostDTO = StripePricePostDTO;
@@ -163,6 +192,17 @@ __decorate([
163
192
  (0, class_validator_1.Min)(0),
164
193
  __metadata("design:type", Number)
165
194
  ], StripePricePutAttributesDTO.prototype, "token", void 0);
195
+ // Relationships DTO for PUT requests
196
+ class StripePricePutRelationshipsDTO {
197
+ }
198
+ exports.StripePricePutRelationshipsDTO = StripePricePutRelationshipsDTO;
199
+ __decorate([
200
+ (0, class_validator_1.IsOptional)(),
201
+ (0, class_validator_1.IsArray)(),
202
+ (0, class_validator_1.ValidateNested)({ each: true }),
203
+ (0, class_transformer_1.Type)(() => StripePriceFeaturesItemDTO),
204
+ __metadata("design:type", Array)
205
+ ], StripePricePutRelationshipsDTO.prototype, "features", void 0);
166
206
  class StripePricePutDataDTO {
167
207
  }
168
208
  exports.StripePricePutDataDTO = StripePricePutDataDTO;
@@ -180,6 +220,12 @@ __decorate([
180
220
  (0, class_transformer_1.Type)(() => StripePricePutAttributesDTO),
181
221
  __metadata("design:type", StripePricePutAttributesDTO)
182
222
  ], StripePricePutDataDTO.prototype, "attributes", void 0);
223
+ __decorate([
224
+ (0, class_validator_1.IsOptional)(),
225
+ (0, class_validator_1.ValidateNested)(),
226
+ (0, class_transformer_1.Type)(() => StripePricePutRelationshipsDTO),
227
+ __metadata("design:type", StripePricePutRelationshipsDTO)
228
+ ], StripePricePutDataDTO.prototype, "relationships", void 0);
183
229
  class StripePricePutDTO {
184
230
  }
185
231
  exports.StripePricePutDTO = StripePricePutDTO;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.dto.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/dtos/stripe-price.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAcyB;AACzB,qEAAgE;AAEhE,qDAAqD;AACrD,MAAa,cAAc;CAM1B;AAND,wCAMC;AAJC;IADC,IAAA,wBAAM,EAAC,mCAAe,CAAC,QAAQ,CAAC;;4CACpB;AAGb;IADC,IAAA,wBAAM,GAAE;;0CACE;AAGb,kDAAkD;AAClD,MAAM,YAAY;CAYjB;AAVC;IADC,IAAA,wBAAM,EAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;;8CACG;AAK5C;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,4BAAU,GAAE;;mDACU;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;2CACI;AAGjB,kCAAkC;AAClC,MAAa,4BAA4B;CA6CxC;AA7CD,oEA6CC;AA1CC;IAFC,IAAA,2BAAS,GAAE;IAC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AAC;AAG5B;IADC,IAAA,4BAAU,GAAE;;mDACI"}
@@ -1,5 +1,6 @@
1
1
  import { Entity } from "../../../common/abstracts/entity";
2
2
  import { StripeProduct } from "../../stripe-product/entities/stripe-product.entity";
3
+ import { Feature } from "../../feature/entities/feature.entity";
3
4
  export type StripePriceType = "one_time" | "recurring";
4
5
  export type StripePriceRecurringInterval = "day" | "week" | "month" | "year";
5
6
  export type StripePriceRecurringUsageType = "licensed" | "metered";
@@ -19,5 +20,6 @@ export type StripePrice = Entity & {
19
20
  features?: string;
20
21
  token?: number;
21
22
  stripeProduct: StripeProduct;
23
+ feature?: Feature[];
22
24
  };
23
25
  //# sourceMappingURL=stripe-price.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEpF,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,4BAA4B,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,6BAA6B,GAAG,UAAU,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;IAEnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"stripe-price.entity.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,CAAC;AACvD,MAAM,MAAM,4BAA4B,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,6BAA6B,GAAG,UAAU,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;IACjD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;IAEnD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.map.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,eAAO,MAAM,cAAc,GAAI,QAAQ;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,KAAG,WAmBjG,CAAC"}
1
+ {"version":3,"file":"stripe-price.map.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,eAAO,MAAM,cAAc,GAAI,QAAQ;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,KAAG,WAoBjG,CAAC"}
@@ -20,6 +20,7 @@ const mapStripePrice = (params) => {
20
20
  features: params.data.features,
21
21
  token: params.data.token ? Number(params.data.token) : undefined,
22
22
  stripeProduct: undefined,
23
+ feature: [], // Initialize relationship array (naming follows Company pattern)
23
24
  };
24
25
  };
25
26
  exports.mapStripePrice = mapStripePrice;
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.map.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.map.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAItD,MAAM,cAAc,GAAG,CAAC,MAAgE,EAAe,EAAE;IAC9G,OAAO;QACL,GAAG,IAAA,kBAAS,EAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EA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1
- {"version":3,"file":"stripe-price.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAM9D,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAAC,WAAW,CAO5D,CAAC"}
1
+ {"version":3,"file":"stripe-price.model.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAO9D,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,CAAC,WAAW,CAO5D,CAAC"}
@@ -5,12 +5,13 @@ const stripe_price_map_1 = require("../entities/stripe-price.map");
5
5
  const stripe_price_meta_1 = require("../entities/stripe-price.meta");
6
6
  const stripe_product_meta_1 = require("../../stripe-product/entities/stripe-product.meta");
7
7
  const stripe_price_serialiser_1 = require("../serialisers/stripe-price.serialiser");
8
+ const feature_meta_1 = require("../../feature/entities/feature.meta");
8
9
  exports.StripePriceModel = {
9
10
  ...stripe_price_meta_1.stripePriceMeta,
10
11
  entity: undefined,
11
12
  mapper: stripe_price_map_1.mapStripePrice,
12
13
  serialiser: stripe_price_serialiser_1.StripePriceSerialiser,
13
14
  singleChildrenTokens: [stripe_product_meta_1.stripeProductMeta.nodeName],
14
- childrenTokens: [],
15
+ childrenTokens: [feature_meta_1.featureMeta.nodeName],
15
16
  };
16
17
  //# sourceMappingURL=stripe-price.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.model.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.model.ts"],"names":[],"mappings":";;;AAEA,mEAA8D;AAC9D,qEAAgE;AAChE,2FAAsF;AACtF,oFAA+E;AAElE,QAAA,gBAAgB,GAAoC;IAC/D,GAAG,mCAAe;IAClB,MAAM,EAAE,SAAmC;IAC3C,MAAM,EAAE,iCAAc;IACtB,UAAU,EAAE,+CAAqB;IACjC,oBAAoB,EAAE,CAAC,uCAAiB,CAAC,QAAQ,CAAC;IAClD,cAAc,EAAE,EAAE;CACnB,CAAC"}
1
+ {"version":3,"file":"stripe-price.model.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/entities/stripe-price.model.ts"],"names":[],"mappings":";;;AAEA,mEAA8D;AAC9D,qEAAgE;AAChE,2FAAsF;AACtF,oFAA+E;AAC/E,sEAAkE;AAErD,QAAA,gBAAgB,GAAoC;IAC/D,GAAG,mCAAe;IAClB,MAAM,EAAE,SAAmC;IAC3C,MAAM,EAAE,iCAAc;IACtB,UAAU,EAAE,+CAAqB;IACjC,oBAAoB,EAAE,CAAC,uCAAiB,CAAC,QAAQ,CAAC;IAClD,cAAc,EAAE,CAAC,0BAAW,CAAC,QAAQ,CAAC;CACvC,CAAC"}
@@ -110,6 +110,7 @@ export declare class StripePriceRepository implements OnModuleInit {
110
110
  description?: string;
111
111
  features?: string;
112
112
  token?: number;
113
+ featureIds?: string[];
113
114
  }): Promise<StripePrice>;
114
115
  /**
115
116
  * Update price by internal ID
@@ -133,6 +134,8 @@ export declare class StripePriceRepository implements OnModuleInit {
133
134
  description?: string;
134
135
  features?: string;
135
136
  token?: number;
137
+ featureIds?: string[];
138
+ priceType?: StripePriceType;
136
139
  }): Promise<StripePrice>;
137
140
  /**
138
141
  * Update price by Stripe price ID
@@ -1 +1 @@
1
- {"version":3,"file":"stripe-price.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/repositories/stripe-price.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,4BAA4B,EAC5B,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M,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;IAoDxB;;;;;;;;;;;;;OAaG;IACG,MAAM,CAAC,MAAM,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;IA4CxB;;;;;;;;;;;;;OAaG;IACG,qBAAqB,CAAC,MAAM,EAAE;QAClC,aAAa,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;CA2CzB"}
1
+ {"version":3,"file":"stripe-price.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/repositories/stripe-price.repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,OAAO,EACL,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,EAC7B,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAIzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACa,qBAAsB,YAAW,YAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,YAAY;IAEhD;;;;OAIG;IACG,YAAY;IAUlB;;;;;;;OAOG;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AAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B,GAAG,OAAO,CAAC,WAAW,CAAC;IA4ExB;;;;;;;;;;;;;OAaG;IACG,qBAAqB,CAAC,MAAM,EAAE;QAClC,aAAa,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,WAAW,CAAC;CA2CzB"}
@@ -13,7 +13,9 @@ exports.StripePriceRepository = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const crypto_1 = require("crypto");
15
15
  const neo4j_1 = require("../../../core/neo4j");
16
+ const core_1 = require("../../../core");
16
17
  const stripe_product_1 = require("../../stripe-product");
18
+ const feature_meta_1 = require("../../feature/entities/feature.meta");
17
19
  const stripe_price_meta_1 = require("../entities/stripe-price.meta");
18
20
  const stripe_price_model_1 = require("../entities/stripe-price.model");
19
21
  /**
@@ -84,7 +86,8 @@ let StripePriceRepository = class StripePriceRepository {
84
86
  query.query = `
85
87
  MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName}:${stripe_price_meta_1.stripePriceMeta.labelName})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName} {id: $productId})
86
88
  ${where}
87
- RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
89
+ OPTIONAL MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:HAS_FEATURE]->(${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
90
+ RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}, ${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}
88
91
  ORDER BY ${stripe_price_meta_1.stripePriceMeta.nodeName}.createdAt DESC
89
92
  `;
90
93
  }
@@ -92,7 +95,8 @@ let StripePriceRepository = class StripePriceRepository {
92
95
  query.query = `
93
96
  MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName}:${stripe_price_meta_1.stripePriceMeta.labelName})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
94
97
  ${where}
95
- RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
98
+ OPTIONAL MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:HAS_FEATURE]->(${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
99
+ RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}, ${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}
96
100
  ORDER BY ${stripe_price_meta_1.stripePriceMeta.nodeName}.createdAt DESC
97
101
  `;
98
102
  }
@@ -112,7 +116,8 @@ let StripePriceRepository = class StripePriceRepository {
112
116
  };
113
117
  query.query = `
114
118
  MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName}:${stripe_price_meta_1.stripePriceMeta.labelName} {id: $id})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
115
- RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
119
+ OPTIONAL MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:HAS_FEATURE]->(${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
120
+ RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}, ${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}
116
121
  `;
117
122
  return this.neo4j.readOne(query);
118
123
  }
@@ -130,7 +135,8 @@ let StripePriceRepository = class StripePriceRepository {
130
135
  };
131
136
  query.query = `
132
137
  MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName}:${stripe_price_meta_1.stripePriceMeta.labelName} {stripePriceId: $stripePriceId})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
133
- RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
138
+ OPTIONAL MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:HAS_FEATURE]->(${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}:${feature_meta_1.featureMeta.labelName})
139
+ RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}, ${stripe_price_meta_1.stripePriceMeta.nodeName}_${feature_meta_1.featureMeta.nodeName}
134
140
  `;
135
141
  return this.neo4j.readOne(query);
136
142
  }
@@ -158,6 +164,14 @@ let StripePriceRepository = class StripePriceRepository {
158
164
  */
159
165
  async create(params) {
160
166
  const query = this.neo4j.initQuery({ serialiser: stripe_price_model_1.StripePriceModel });
167
+ // Feature relationships only allowed for recurring prices
168
+ const isRecurring = params.priceType === "recurring";
169
+ // Validate feature nodes exist only for recurring prices (following Company pattern)
170
+ if (isRecurring && params.featureIds && params.featureIds.length > 0) {
171
+ await this.neo4j.validateExistingNodes({
172
+ nodes: params.featureIds.map((id) => ({ id, label: feature_meta_1.featureMeta.labelName })),
173
+ });
174
+ }
161
175
  const id = (0, crypto_1.randomUUID)();
162
176
  query.queryParams = {
163
177
  id,
@@ -176,6 +190,7 @@ let StripePriceRepository = class StripePriceRepository {
176
190
  description: params.description ?? null,
177
191
  features: params.features ?? null,
178
192
  token: params.token ?? null,
193
+ featureIds: params.featureIds ?? [],
179
194
  };
180
195
  query.query = `
181
196
  MATCH (${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName} {id: $productId})
@@ -199,6 +214,24 @@ let StripePriceRepository = class StripePriceRepository {
199
214
  updatedAt: datetime()
200
215
  })
201
216
  CREATE (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName})
217
+ `;
218
+ // Use updateRelationshipQuery for HAS_FEATURE only for recurring prices
219
+ if (isRecurring) {
220
+ query.query += (0, core_1.updateRelationshipQuery)({
221
+ node: stripe_price_meta_1.stripePriceMeta.nodeName,
222
+ relationshipName: "HAS_FEATURE",
223
+ relationshipToNode: true,
224
+ label: feature_meta_1.featureMeta.labelName,
225
+ param: "featureIds",
226
+ values: params.featureIds ?? [],
227
+ });
228
+ // Re-match stripeProduct after updateRelationshipQuery (WITH clauses lose the variable)
229
+ query.query += `
230
+ WITH ${stripe_price_meta_1.stripePriceMeta.nodeName}
231
+ MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
232
+ `;
233
+ }
234
+ query.query += `
202
235
  RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
203
236
  `;
204
237
  return this.neo4j.writeOne(query);
@@ -219,6 +252,14 @@ let StripePriceRepository = class StripePriceRepository {
219
252
  */
220
253
  async update(params) {
221
254
  const query = this.neo4j.initQuery({ serialiser: stripe_price_model_1.StripePriceModel });
255
+ // Feature relationships only allowed for recurring prices
256
+ const isRecurring = params.priceType === "recurring";
257
+ // Validate feature nodes exist only for recurring prices
258
+ if (isRecurring && params.featureIds && params.featureIds.length > 0) {
259
+ await this.neo4j.validateExistingNodes({
260
+ nodes: params.featureIds.map((id) => ({ id, label: feature_meta_1.featureMeta.labelName })),
261
+ });
262
+ }
222
263
  const setParams = [];
223
264
  setParams.push(`${stripe_price_meta_1.stripePriceMeta.nodeName}.updatedAt = datetime()`);
224
265
  if (params.active !== undefined) {
@@ -247,10 +288,29 @@ let StripePriceRepository = class StripePriceRepository {
247
288
  description: params.description,
248
289
  features: params.features,
249
290
  token: params.token,
291
+ featureIds: params.featureIds ?? [],
250
292
  };
251
293
  query.query = `
252
294
  MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName}:${stripe_price_meta_1.stripePriceMeta.labelName} {id: $id})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
253
295
  SET ${setParams.join(", ")}
296
+ `;
297
+ // Only update relationships if featureIds was provided AND price is recurring
298
+ if (params.featureIds !== undefined && isRecurring) {
299
+ query.query += (0, core_1.updateRelationshipQuery)({
300
+ node: stripe_price_meta_1.stripePriceMeta.nodeName,
301
+ relationshipName: "HAS_FEATURE",
302
+ relationshipToNode: true,
303
+ label: feature_meta_1.featureMeta.labelName,
304
+ param: "featureIds",
305
+ values: params.featureIds,
306
+ });
307
+ // Re-match stripeProduct after updateRelationshipQuery (WITH clauses lose the variable)
308
+ query.query += `
309
+ WITH ${stripe_price_meta_1.stripePriceMeta.nodeName}
310
+ MATCH (${stripe_price_meta_1.stripePriceMeta.nodeName})-[:BELONGS_TO]->(${stripe_product_1.stripeProductMeta.nodeName}:${stripe_product_1.stripeProductMeta.labelName})
311
+ `;
312
+ }
313
+ query.query += `
254
314
  RETURN ${stripe_price_meta_1.stripePriceMeta.nodeName}, ${stripe_product_1.stripeProductMeta.nodeName}
255
315
  `;
256
316
  return this.neo4j.writeOne(query);