@carlonicora/nestjs-neo4jsonapi 1.31.2 → 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.
- package/dist/common/helpers/define-entity.d.ts +29 -0
- package/dist/common/helpers/define-entity.d.ts.map +1 -1
- package/dist/common/helpers/define-entity.js +42 -1
- package/dist/common/helpers/define-entity.js.map +1 -1
- package/dist/common/interfaces/entity.descriptor.interface.d.ts +2 -2
- package/dist/common/interfaces/entity.descriptor.interface.d.ts.map +1 -1
- package/dist/common/interfaces/entity.descriptor.interface.js +2 -1
- package/dist/common/interfaces/entity.descriptor.interface.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +19 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/dist/core/email/templates/en/paymentFailure.hbs +56 -0
- package/dist/core/email/templates/en/paymentSuccessAdmin.hbs +31 -0
- package/dist/core/email/templates/en/paymentSuccessCustomer.hbs +51 -0
- package/dist/core/email/templates/en/subscriptionStatusChange.hbs +48 -0
- package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.d.ts.map +1 -1
- package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.js +13 -0
- package/dist/core/jsonapi/serialisers/descriptor.based.serialiser.js.map +1 -1
- package/dist/core/jsonapi/serialisers/jsonapi.paginator.d.ts +3 -0
- package/dist/core/jsonapi/serialisers/jsonapi.paginator.d.ts.map +1 -1
- package/dist/core/jsonapi/serialisers/jsonapi.paginator.js +6 -0
- package/dist/core/jsonapi/serialisers/jsonapi.paginator.js.map +1 -1
- package/dist/core/jsonapi/services/jsonapi.service.d.ts.map +1 -1
- package/dist/core/jsonapi/services/jsonapi.service.js +6 -0
- package/dist/core/jsonapi/services/jsonapi.service.js.map +1 -1
- package/dist/core/neo4j/abstracts/abstract.service.d.ts +2 -0
- package/dist/core/neo4j/abstracts/abstract.service.d.ts.map +1 -1
- package/dist/core/neo4j/abstracts/abstract.service.js +8 -4
- package/dist/core/neo4j/abstracts/abstract.service.js.map +1 -1
- package/dist/core/neo4j/services/neo4j.service.d.ts +9 -0
- package/dist/core/neo4j/services/neo4j.service.d.ts.map +1 -1
- package/dist/core/neo4j/services/neo4j.service.js +95 -1
- package/dist/core/neo4j/services/neo4j.service.js.map +1 -1
- package/dist/foundations/audit/entities/audit.entity.d.ts +1 -1
- package/dist/foundations/audit/entities/audit.entity.d.ts.map +1 -1
- package/dist/foundations/audit/serialisers/audit.serialiser.js +2 -2
- package/dist/foundations/audit/serialisers/audit.serialiser.js.map +1 -1
- package/dist/foundations/auth/entities/auth.entity.d.ts +1 -1
- package/dist/foundations/auth/entities/auth.entity.d.ts.map +1 -1
- package/dist/foundations/auth/repositories/auth.repository.d.ts +1 -1
- package/dist/foundations/auth/repositories/auth.repository.d.ts.map +1 -1
- package/dist/foundations/auth/repositories/auth.repository.js +31 -13
- package/dist/foundations/auth/repositories/auth.repository.js.map +1 -1
- package/dist/foundations/auth/serialisers/auth.serialiser.js +2 -2
- package/dist/foundations/auth/serialisers/auth.serialiser.js.map +1 -1
- package/dist/foundations/auth/services/auth.service.d.ts +1 -1
- package/dist/foundations/auth/services/auth.service.d.ts.map +1 -1
- package/dist/foundations/company/company.module.d.ts.map +1 -1
- package/dist/foundations/company/company.module.js +9 -5
- package/dist/foundations/company/company.module.js.map +1 -1
- package/dist/foundations/company/entities/company.d.ts +44 -0
- package/dist/foundations/company/entities/company.d.ts.map +1 -0
- package/dist/foundations/company/entities/company.js +47 -0
- package/dist/foundations/company/entities/company.js.map +1 -0
- package/dist/foundations/company/entities/company.meta.d.ts +1 -1
- package/dist/foundations/company/entities/company.meta.d.ts.map +1 -1
- package/dist/foundations/company/index.d.ts +1 -2
- package/dist/foundations/company/index.d.ts.map +1 -1
- package/dist/foundations/company/index.js +3 -3
- package/dist/foundations/company/index.js.map +1 -1
- package/dist/foundations/company/repositories/company.repository.d.ts +26 -1
- package/dist/foundations/company/repositories/company.repository.d.ts.map +1 -1
- package/dist/foundations/company/repositories/company.repository.js +67 -11
- package/dist/foundations/company/repositories/company.repository.js.map +1 -1
- package/dist/foundations/company/services/company.service.d.ts +4 -1
- package/dist/foundations/company/services/company.service.d.ts.map +1 -1
- package/dist/foundations/company/services/company.service.js +11 -6
- package/dist/foundations/company/services/company.service.js.map +1 -1
- package/dist/foundations/content/entities/content.entity.d.ts +1 -1
- package/dist/foundations/content/entities/content.entity.d.ts.map +1 -1
- package/dist/foundations/content/serialisers/content.serialiser.js +3 -3
- package/dist/foundations/content/serialisers/content.serialiser.js.map +1 -1
- package/dist/foundations/module/queries/feature.module.query.d.ts +3 -1
- package/dist/foundations/module/queries/feature.module.query.d.ts.map +1 -1
- package/dist/foundations/module/queries/feature.module.query.js +27 -15
- package/dist/foundations/module/queries/feature.module.query.js.map +1 -1
- package/dist/foundations/notification/entities/notification.entity.d.ts +1 -1
- package/dist/foundations/notification/entities/notification.entity.d.ts.map +1 -1
- package/dist/foundations/notification/serialisers/notifications.serialiser.js +2 -2
- package/dist/foundations/notification/serialisers/notifications.serialiser.js.map +1 -1
- package/dist/foundations/oauth/entities/oauth.client.entity.d.ts +2 -2
- package/dist/foundations/oauth/entities/oauth.client.entity.d.ts.map +1 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.d.ts.map +1 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.js +1 -1
- package/dist/foundations/relevancy/repositories/relevancy.repository.js.map +1 -1
- package/dist/foundations/relevancy/services/relevancy.service.js +1 -1
- package/dist/foundations/relevancy/services/relevancy.service.js.map +1 -1
- package/dist/foundations/role/entities/role.d.ts +28 -0
- package/dist/foundations/role/entities/role.d.ts.map +1 -0
- package/dist/foundations/role/entities/role.js +33 -0
- package/dist/foundations/role/entities/role.js.map +1 -0
- package/dist/foundations/role/entities/role.meta.d.ts +1 -1
- package/dist/foundations/role/entities/role.meta.d.ts.map +1 -1
- package/dist/foundations/role/repositories/role.repository.d.ts +1 -1
- package/dist/foundations/role/repositories/role.repository.d.ts.map +1 -1
- package/dist/foundations/role/repositories/role.repository.js +7 -7
- package/dist/foundations/role/repositories/role.repository.js.map +1 -1
- package/dist/foundations/role/role.module.d.ts.map +1 -1
- package/dist/foundations/role/role.module.js +3 -4
- package/dist/foundations/role/role.module.js.map +1 -1
- package/dist/foundations/role/services/role.service.js +5 -5
- package/dist/foundations/role/services/role.service.js.map +1 -1
- package/dist/foundations/stripe-customer/entities/stripe-customer.entity.d.ts +1 -1
- package/dist/foundations/stripe-customer/entities/stripe-customer.entity.d.ts.map +1 -1
- package/dist/foundations/stripe-price/dtos/stripe-price.dto.d.ts +12 -0
- package/dist/foundations/stripe-price/dtos/stripe-price.dto.d.ts.map +1 -1
- package/dist/foundations/stripe-price/dtos/stripe-price.dto.js +47 -1
- package/dist/foundations/stripe-price/dtos/stripe-price.dto.js.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts +2 -0
- package/dist/foundations/stripe-price/entities/stripe-price.entity.d.ts.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.map.d.ts.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.map.js +1 -0
- package/dist/foundations/stripe-price/entities/stripe-price.map.js.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.model.d.ts.map +1 -1
- package/dist/foundations/stripe-price/entities/stripe-price.model.js +2 -1
- package/dist/foundations/stripe-price/entities/stripe-price.model.js.map +1 -1
- package/dist/foundations/stripe-price/repositories/stripe-price.repository.d.ts +3 -0
- package/dist/foundations/stripe-price/repositories/stripe-price.repository.d.ts.map +1 -1
- package/dist/foundations/stripe-price/repositories/stripe-price.repository.js +64 -4
- package/dist/foundations/stripe-price/repositories/stripe-price.repository.js.map +1 -1
- package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.d.ts.map +1 -1
- package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.js +5 -0
- package/dist/foundations/stripe-price/serialisers/stripe-price.serialiser.js.map +1 -1
- package/dist/foundations/stripe-price/services/stripe-price-admin.service.d.ts.map +1 -1
- package/dist/foundations/stripe-price/services/stripe-price-admin.service.js +10 -0
- package/dist/foundations/stripe-price/services/stripe-price-admin.service.js.map +1 -1
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts +11 -0
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js +22 -0
- package/dist/foundations/stripe-subscription/repositories/stripe-subscription.repository.js.map +1 -1
- package/dist/foundations/stripe-subscription/services/feature-sync.service.d.ts +33 -0
- package/dist/foundations/stripe-subscription/services/feature-sync.service.d.ts.map +1 -0
- package/dist/foundations/stripe-subscription/services/feature-sync.service.js +155 -0
- package/dist/foundations/stripe-subscription/services/feature-sync.service.js.map +1 -0
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js +11 -0
- package/dist/foundations/stripe-subscription/services/stripe-subscription-admin.service.js.map +1 -1
- package/dist/foundations/stripe-subscription/stripe-subscription.module.d.ts.map +1 -1
- package/dist/foundations/stripe-subscription/stripe-subscription.module.js +3 -0
- package/dist/foundations/stripe-subscription/stripe-subscription.module.js.map +1 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts +3 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.d.ts.map +1 -1
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js +79 -9
- package/dist/foundations/stripe-webhook/processors/stripe-webhook.processor.js.map +1 -1
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts +26 -1
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.d.ts.map +1 -1
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js +124 -2
- package/dist/foundations/stripe-webhook/services/stripe-webhook-notification.service.js.map +1 -1
- package/dist/foundations/stripe-webhook/stripe-webhook.module.d.ts.map +1 -1
- package/dist/foundations/stripe-webhook/stripe-webhook.module.js +2 -0
- package/dist/foundations/stripe-webhook/stripe-webhook.module.js.map +1 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts +1 -1
- package/dist/foundations/tokenusage/entities/tokenusage.entity.d.ts.map +1 -1
- package/dist/foundations/user/controllers/user.controller.d.ts +1 -1
- package/dist/foundations/user/controllers/user.controller.d.ts.map +1 -1
- package/dist/foundations/user/entities/user.d.ts +124 -0
- package/dist/foundations/user/entities/user.d.ts.map +1 -0
- package/dist/foundations/user/entities/user.js +81 -0
- package/dist/foundations/user/entities/user.js.map +1 -0
- package/dist/foundations/user/entities/user.meta.d.ts +1 -1
- package/dist/foundations/user/entities/user.meta.d.ts.map +1 -1
- package/dist/foundations/user/index.d.ts +1 -4
- package/dist/foundations/user/index.d.ts.map +1 -1
- package/dist/foundations/user/index.js +6 -23
- package/dist/foundations/user/index.js.map +1 -1
- package/dist/foundations/user/repositories/user.repository.d.ts +13 -1
- package/dist/foundations/user/repositories/user.repository.d.ts.map +1 -1
- package/dist/foundations/user/repositories/user.repository.js +85 -21
- package/dist/foundations/user/repositories/user.repository.js.map +1 -1
- package/dist/foundations/user/services/user.service.d.ts.map +1 -1
- package/dist/foundations/user/services/user.service.js +12 -12
- package/dist/foundations/user/services/user.service.js.map +1 -1
- package/dist/foundations/user/user.module.d.ts.map +1 -1
- package/dist/foundations/user/user.module.js +7 -8
- package/dist/foundations/user/user.module.js.map +1 -1
- package/dist/openapi/factories/entity-schema.factory.js +12 -0
- package/dist/openapi/factories/entity-schema.factory.js.map +1 -1
- package/dist/openapi/schemas/jsonapi-base.schemas.d.ts +1 -0
- package/dist/openapi/schemas/jsonapi-base.schemas.d.ts.map +1 -1
- package/dist/openapi/schemas/jsonapi-base.schemas.js.map +1 -1
- package/dist/tools/migrate-entity/__tests__/ast-parser.spec.js +331 -0
- package/dist/tools/migrate-entity/__tests__/descriptor-generator.spec.js +482 -0
- package/dist/tools/migrate-entity/__tests__/file-discovery.spec.js +190 -0
- package/dist/tools/migrate-entity/__tests__/integration.spec.js +261 -0
- package/dist/tools/migrate-entity/index.js +2 -2
- package/dist/tools/migrate-entity/lib/ast-parser.js +255 -10
- package/dist/tools/migrate-entity/lib/descriptor-generator.js +384 -55
- package/dist/tools/migrate-entity/lib/entity-migrator.js +112 -9
- package/dist/tools/migrate-entity/lib/module-updater.js +25 -9
- package/dist/tools/migrate-entity/lib/reference-updater.js +110 -24
- package/package.json +2 -2
- package/dist/foundations/company/entities/company.entity.d.ts +0 -18
- package/dist/foundations/company/entities/company.entity.d.ts.map +0 -1
- package/dist/foundations/company/entities/company.entity.js +0 -3
- package/dist/foundations/company/entities/company.entity.js.map +0 -1
- package/dist/foundations/company/entities/company.map.d.ts +0 -8
- package/dist/foundations/company/entities/company.map.d.ts.map +0 -1
- package/dist/foundations/company/entities/company.map.js +0 -23
- package/dist/foundations/company/entities/company.map.js.map +0 -1
- package/dist/foundations/company/entities/company.model.d.ts +0 -4
- package/dist/foundations/company/entities/company.model.d.ts.map +0 -1
- package/dist/foundations/company/entities/company.model.js +0 -17
- package/dist/foundations/company/entities/company.model.js.map +0 -1
- package/dist/foundations/company/serialisers/company.serialiser.d.ts +0 -14
- package/dist/foundations/company/serialisers/company.serialiser.d.ts.map +0 -1
- package/dist/foundations/company/serialisers/company.serialiser.js +0 -76
- package/dist/foundations/company/serialisers/company.serialiser.js.map +0 -1
- package/dist/foundations/role/entities/role.entity.d.ts +0 -9
- package/dist/foundations/role/entities/role.entity.d.ts.map +0 -1
- package/dist/foundations/role/entities/role.entity.js +0 -3
- package/dist/foundations/role/entities/role.entity.js.map +0 -1
- package/dist/foundations/role/entities/role.map.d.ts +0 -8
- package/dist/foundations/role/entities/role.map.d.ts.map +0 -1
- package/dist/foundations/role/entities/role.map.js +0 -15
- package/dist/foundations/role/entities/role.map.js.map +0 -1
- package/dist/foundations/role/entities/role.model.d.ts +0 -4
- package/dist/foundations/role/entities/role.model.d.ts.map +0 -1
- package/dist/foundations/role/entities/role.model.js +0 -15
- package/dist/foundations/role/entities/role.model.js.map +0 -1
- package/dist/foundations/role/serialisers/role.serialiser.d.ts +0 -12
- package/dist/foundations/role/serialisers/role.serialiser.d.ts.map +0 -1
- package/dist/foundations/role/serialisers/role.serialiser.js +0 -46
- package/dist/foundations/role/serialisers/role.serialiser.js.map +0 -1
- package/dist/foundations/user/entities/user.entity.d.ts +0 -26
- package/dist/foundations/user/entities/user.entity.d.ts.map +0 -1
- package/dist/foundations/user/entities/user.entity.js +0 -3
- package/dist/foundations/user/entities/user.entity.js.map +0 -1
- package/dist/foundations/user/entities/user.map.d.ts +0 -8
- package/dist/foundations/user/entities/user.map.d.ts.map +0 -1
- package/dist/foundations/user/entities/user.map.js +0 -27
- package/dist/foundations/user/entities/user.map.js.map +0 -1
- package/dist/foundations/user/entities/user.model.d.ts +0 -7
- package/dist/foundations/user/entities/user.model.d.ts.map +0 -1
- package/dist/foundations/user/entities/user.model.js +0 -30
- package/dist/foundations/user/entities/user.model.js.map +0 -1
- package/dist/foundations/user/serialisers/user.serialiser.d.ts +0 -14
- package/dist/foundations/user/serialisers/user.serialiser.d.ts.map +0 -1
- package/dist/foundations/user/serialisers/user.serialiser.js +0 -80
- package/dist/foundations/user/serialisers/user.serialiser.js.map +0 -1
|
@@ -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,
|
|
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
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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,mDAA0D;AAC1D,qEAAiE;AAG1D,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YACmB,OAAuB,EACvB,cAA8B;QAD9B,YAAO,GAAP,OAAO,CAAgB;QACvB,mBAAc,GAAd,cAAc,CAAgB;IAC9C,CAAC;IAEJ,KAAK,CAAC,eAAe,CAAC,MAAwB;QAC5C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAEzE,IAAI,IAAI;YAAE,MAAM,IAAI,sBAAa,CAAC,2CAA2C,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AC;IACnD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA0B;QACrC,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AA5FY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAGiB,gCAAc;QACP,gCAAc;GAHtC,WAAW,CA4FvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity } from "../../../common/abstracts/entity";
|
|
2
|
-
import { Company } from "../../company/entities/company
|
|
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,
|
|
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":"
|
|
1
|
+
{"version":3,"file":"stripe-price.dto.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/dtos/stripe-price.dto.ts"],"names":[],"mappings":"AAoBA,qBAAa,cAAc;IAEzB,IAAI,EAAE,MAAM,CAAC;IAGb,EAAE,EAAE,MAAM,CAAC;CAC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CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,qBAAa,8BAA8B;IAKzC,QAAQ,CAAC,EAAE,0BAA0B,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,
|
|
1
|
+
{"version":3,"file":"stripe-price.dto.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/dtos/stripe-price.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAeyB;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;IACX,IAAA,0BAAQ,GAAE;;+DACO;AAIlB;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,uBAAK,GAAE;;gEACW;AAKnB;IAHC,IAAA,2BAAS,GAAE;IACX,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,CAAC,CAAC;;8DACI;AAKjB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;8DACG;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,2BAAS,EAAC,GAAG,CAAC;;+DACI;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA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B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,8BAA8B,CAAC;8BAC3B,8BAA8B;4DAAC;AAGjD,MAAa,iBAAiB;CAQ7B;AARD,8CAQC;AAJC;IAHC,IAAA,gCAAc,GAAE;IAChB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC;8BAC5B,qBAAqB;+CAAC;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;
|
|
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,O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,KAAG,
|
|
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,EAAE,CAAC;QACrC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa;QACxC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI;QACnC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ;QAC9B,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;QAC/E,SAAS,EAAE,MAAM,CAAC,IAAI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SAAS;QAC/E,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;QAChC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB;QAChD,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,SAAS;QACnH,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB;QAClD,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ;QAC9B,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;QAChC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ;QAC9B,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW;QACpC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ;QAC9B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QAChE,aAAa,EAAE,SAAS;QACxB,OAAO,EAAE,EAAE,EAAE,iEAAiE;KAC/E,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;
|
|
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;
|
|
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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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;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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-price.repository.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/repositories/stripe-price.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,mCAAoC;AACpC,+CAAmD;AACnD,yDAAyD;
|
|
1
|
+
{"version":3,"file":"stripe-price.repository.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/repositories/stripe-price.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA0D;AAC1D,mCAAoC;AACpC,+CAAmD;AACnD,wCAAwD;AACxD,yDAAyD;AACzD,sEAAkE;AAOlE,q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AAC,QAAQ,iBAAiB,CAAC,CAAC;QAC/D,CAAC;QAED,KAAK,CAAC,WAAW,GAAG;YAClB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;eACH,mCAAe,CAAC,QAAQ,IAAI,mCAAe,CAAC,SAAS,qDAAqD,kCAAiB,CAAC,QAAQ,IAAI,kCAAiB,CAAC,SAAS;YACtK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;eACjB,mCAAe,CAAC,QAAQ,KAAK,kCAAiB,CAAC,QAAQ;KACjE,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA1YY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAEyB,oBAAY;GADrC,qBAAqB,CA0YjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-price.serialiser.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/serialisers/stripe-price.serialiser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"stripe-price.serialiser.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/serialisers/stripe-price.serialiser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAM/B,qBACa,qBAAsB,SAAQ,yBAA0B,YAAW,uBAAuB;gBACzF,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC;IAI/F,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,MAAM,IAAI,oBAAoB;CAwC/B"}
|
|
@@ -14,6 +14,7 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const config_1 = require("@nestjs/config");
|
|
15
15
|
const jsonapi_1 = require("../../../core/jsonapi");
|
|
16
16
|
const stripe_product_model_1 = require("../../stripe-product/entities/stripe-product.model");
|
|
17
|
+
const feature_model_1 = require("../../feature/entities/feature.model");
|
|
17
18
|
const stripe_price_model_1 = require("../entities/stripe-price.model");
|
|
18
19
|
let StripePriceSerialiser = class StripePriceSerialiser extends jsonapi_1.AbstractJsonApiSerialiser {
|
|
19
20
|
constructor(serialiserFactory, config) {
|
|
@@ -54,6 +55,10 @@ let StripePriceSerialiser = class StripePriceSerialiser extends jsonapi_1.Abstra
|
|
|
54
55
|
name: "product",
|
|
55
56
|
data: this.serialiserFactory.create(stripe_product_model_1.StripeProductModel),
|
|
56
57
|
},
|
|
58
|
+
feature: {
|
|
59
|
+
name: "features", // JSON:API key (matches frontend expectations)
|
|
60
|
+
data: this.serialiserFactory.create(feature_model_1.FeatureModel),
|
|
61
|
+
},
|
|
57
62
|
};
|
|
58
63
|
return super.create();
|
|
59
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-price.serialiser.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/serialisers/stripe-price.serialiser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAE/C,mDAK+B;AAC/B,6FAAwF;
|
|
1
|
+
{"version":3,"file":"stripe-price.serialiser.js","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/serialisers/stripe-price.serialiser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAA+C;AAE/C,mDAK+B;AAC/B,6FAAwF;AACxF,wEAAoE;AAEpE,uEAAkE;AAG3D,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,mCAAyB;IAClE,YAAY,iBAA2C,EAAE,MAAsC;QAC7F,KAAK,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,qCAAgB,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,UAAU,GAAG;YAChB,aAAa,EAAE,eAAe;YAC9B,SAAS,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;YACxD,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1F,SAAS,EAAE,WAAW;YACtB,iBAAiB,EAAE,mBAAmB;YACtC,sBAAsB,EAAE,CAAC,IAAiB,EAAE,EAAE,CAC5C,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,SAAS;YAC/E,kBAAkB,EAAE,oBAAoB;YACxC,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,WAAW;YACtB,QAAQ,EAAE,CAAC,IAAiB,EAAE,EAAE;gBAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ;oBAAE,OAAO,SAAS,CAAC;gBACrC,IAAI,CAAC;oBACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACnC,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,IAAI,CAAC,QAAQ,CAAC;gBACvB,CAAC;YACH,CAAC;YACD,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,CAAC,IAAiB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SAC1F,CAAC;QAEF,IAAI,CAAC,aAAa,GAAG;YACnB,aAAa,EAAE;gBACb,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,yCAAkB,CAAC;aACxD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,UAAU,EAAE,+CAA+C;gBACjE,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,4BAAY,CAAC;aAClD;SACF,CAAC;QAEF,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CACF,CAAA;AAjDY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAEoB,kCAAwB,EAAU,sBAAa;GADnE,qBAAqB,CAiDjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-price-admin.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/services/stripe-price-admin.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAoB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6DAA6D,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF;;;;;;;;;;;;;;;GAeG;AACH,qBACa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAJd,qBAAqB,EAAE,qBAAqB,EAC5C,uBAAuB,EAAE,uBAAuB,EAChD,uBAAuB,EAAE,uBAAuB,EAChD,yBAAyB,EAAE,yBAAyB,EACpD,cAAc,EAAE,cAAc;IAGjD;;;;;;;;;;;;;;;;;OAiBG;IACG,UAAU,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAW7G;;;;;;;OAOG;IACG,QAAQ,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAUrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACG,WAAW,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,sBAAsB,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"stripe-price-admin.service.d.ts","sourceRoot":"","sources":["../../../../src/foundations/stripe-price/services/stripe-price-admin.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAoB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC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B,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgCzF;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAezD;;;;;;;;;;OAUG;IACG,eAAe,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5D;;;;;;;;;;OAUG;IACG,mBAAmB,CAAC,MAAM,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAiD5E"}
|
|
@@ -127,6 +127,9 @@ let StripePriceAdminService = class StripePriceAdminService {
|
|
|
127
127
|
if (!product) {
|
|
128
128
|
throw new common_1.HttpException("Product not found", common_1.HttpStatus.NOT_FOUND);
|
|
129
129
|
}
|
|
130
|
+
// Extract featureIds from relationships only for recurring prices (Neo4j only, NOT sent to Stripe)
|
|
131
|
+
const isRecurring = !!params.data.attributes.recurring;
|
|
132
|
+
const featureIds = isRecurring ? params.data.relationships?.features?.map((f) => f.id) : undefined;
|
|
130
133
|
const stripePrice = await this.stripeProductApiService.createPrice({
|
|
131
134
|
productId: product.stripeProductId,
|
|
132
135
|
unitAmount: params.data.attributes.unitAmount,
|
|
@@ -135,6 +138,7 @@ let StripePriceAdminService = class StripePriceAdminService {
|
|
|
135
138
|
lookupKey: params.data.attributes.lookupKey,
|
|
136
139
|
recurring: params.data.attributes.recurring,
|
|
137
140
|
metadata: params.data.attributes.metadata,
|
|
141
|
+
// NOTE: featureIds NOT sent to Stripe - they are Neo4j-only
|
|
138
142
|
});
|
|
139
143
|
const price = await this.stripePriceRepository.create({
|
|
140
144
|
productId: params.data.attributes.productId,
|
|
@@ -152,6 +156,7 @@ let StripePriceAdminService = class StripePriceAdminService {
|
|
|
152
156
|
description: params.data.attributes.description,
|
|
153
157
|
features: params.data.attributes.features,
|
|
154
158
|
token: params.data.attributes.token,
|
|
159
|
+
featureIds, // Pass featureIds to repository for Neo4j relationship creation
|
|
155
160
|
});
|
|
156
161
|
return this.jsonApiService.buildSingle(stripe_price_model_1.StripePriceModel, price);
|
|
157
162
|
}
|
|
@@ -174,10 +179,13 @@ let StripePriceAdminService = class StripePriceAdminService {
|
|
|
174
179
|
if (!existingPrice) {
|
|
175
180
|
throw new common_1.HttpException("Price not found", common_1.HttpStatus.NOT_FOUND);
|
|
176
181
|
}
|
|
182
|
+
// Extract featureIds from relationships only for recurring prices (Neo4j only, NOT sent to Stripe)
|
|
183
|
+
const featureIds = existingPrice.priceType === "recurring" ? params.data.relationships?.features?.map((f) => f.id) : undefined;
|
|
177
184
|
await this.stripeProductApiService.updatePrice({
|
|
178
185
|
priceId: existingPrice.stripePriceId,
|
|
179
186
|
nickname: params.data.attributes?.nickname,
|
|
180
187
|
metadata: params.data.attributes?.metadata,
|
|
188
|
+
// NOTE: featureIds NOT sent to Stripe - they are Neo4j-only
|
|
181
189
|
});
|
|
182
190
|
const price = await this.stripePriceRepository.update({
|
|
183
191
|
id: params.data.id,
|
|
@@ -186,6 +194,8 @@ let StripePriceAdminService = class StripePriceAdminService {
|
|
|
186
194
|
description: params.data.attributes?.description,
|
|
187
195
|
features: params.data.attributes?.features,
|
|
188
196
|
token: params.data.attributes?.token,
|
|
197
|
+
featureIds, // Pass featureIds to repository for Neo4j relationship update (already filtered for recurring)
|
|
198
|
+
priceType: existingPrice.priceType, // Pass priceType for repository validation
|
|
189
199
|
});
|
|
190
200
|
return this.jsonApiService.buildSingle(stripe_price_model_1.StripePriceModel, price);
|
|
191
201
|
}
|