@labdigital/commercetools-mock 1.5.0 → 1.6.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 (129) hide show
  1. package/README.md +5 -4
  2. package/dist/index.cjs +105 -17
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +29 -7
  5. package/dist/index.d.ts +29 -7
  6. package/dist/index.js +105 -17
  7. package/dist/index.js.map +1 -1
  8. package/package.json +4 -3
  9. package/src/constants.ts +2 -2
  10. package/src/ctMock.ts +176 -176
  11. package/src/exceptions.ts +10 -10
  12. package/src/helpers.ts +26 -26
  13. package/src/index.test.ts +173 -173
  14. package/src/index.ts +3 -3
  15. package/src/lib/expandParser.ts +19 -19
  16. package/src/lib/haversine.test.ts +13 -13
  17. package/src/lib/haversine.ts +14 -14
  18. package/src/lib/masking.ts +15 -15
  19. package/src/lib/parser.ts +2 -2
  20. package/src/lib/predicateParser.test.ts +204 -204
  21. package/src/lib/predicateParser.ts +398 -398
  22. package/src/lib/projectionSearchFilter.test.ts +168 -168
  23. package/src/lib/projectionSearchFilter.ts +272 -269
  24. package/src/lib/proxy.ts +8 -8
  25. package/src/oauth/errors.ts +4 -4
  26. package/src/oauth/helpers.ts +6 -6
  27. package/src/oauth/server.ts +103 -101
  28. package/src/oauth/store.ts +27 -27
  29. package/src/priceSelector.test.ts +68 -68
  30. package/src/priceSelector.ts +70 -70
  31. package/src/product-projection-search.ts +296 -296
  32. package/src/projectAPI.test.ts +3 -3
  33. package/src/projectAPI.ts +46 -46
  34. package/src/repositories/abstract.ts +190 -190
  35. package/src/repositories/associate-role.ts +10 -7
  36. package/src/repositories/attribute-group.ts +63 -8
  37. package/src/repositories/business-unit.ts +10 -7
  38. package/src/repositories/cart-discount.ts +134 -134
  39. package/src/repositories/cart.ts +517 -514
  40. package/src/repositories/category.ts +170 -167
  41. package/src/repositories/channel.ts +114 -111
  42. package/src/repositories/custom-object.ts +66 -63
  43. package/src/repositories/customer-group.ts +72 -69
  44. package/src/repositories/customer.ts +90 -90
  45. package/src/repositories/discount-code.ts +171 -168
  46. package/src/repositories/errors.ts +15 -15
  47. package/src/repositories/extension.ts +79 -76
  48. package/src/repositories/helpers.ts +180 -180
  49. package/src/repositories/index.ts +39 -39
  50. package/src/repositories/inventory-entry.ts +98 -95
  51. package/src/repositories/my-order.ts +11 -11
  52. package/src/repositories/order-edit.ts +29 -29
  53. package/src/repositories/order.test.ts +191 -191
  54. package/src/repositories/order.ts +393 -393
  55. package/src/repositories/payment.ts +155 -155
  56. package/src/repositories/product-discount.ts +149 -149
  57. package/src/repositories/product-projection.ts +116 -52
  58. package/src/repositories/product-selection.ts +31 -31
  59. package/src/repositories/product-type.ts +156 -156
  60. package/src/repositories/product.ts +600 -597
  61. package/src/repositories/project.ts +136 -135
  62. package/src/repositories/quote-request.ts +19 -19
  63. package/src/repositories/quote.ts +19 -19
  64. package/src/repositories/review.ts +24 -24
  65. package/src/repositories/shipping-method.ts +217 -217
  66. package/src/repositories/shopping-list.ts +49 -49
  67. package/src/repositories/staged-quote.ts +20 -20
  68. package/src/repositories/standalone-price.ts +72 -61
  69. package/src/repositories/state.ts +84 -84
  70. package/src/repositories/store.ts +114 -114
  71. package/src/repositories/subscription.ts +40 -40
  72. package/src/repositories/tax-category.ts +98 -98
  73. package/src/repositories/type.ts +157 -157
  74. package/src/repositories/zone.ts +71 -71
  75. package/src/server.ts +2 -2
  76. package/src/services/abstract.ts +173 -173
  77. package/src/services/attribute-group.ts +16 -0
  78. package/src/services/cart-discount.ts +8 -8
  79. package/src/services/cart.test.ts +409 -409
  80. package/src/services/cart.ts +50 -50
  81. package/src/services/category.test.ts +25 -25
  82. package/src/services/category.ts +8 -8
  83. package/src/services/channel.ts +8 -8
  84. package/src/services/custom-object.test.ts +184 -184
  85. package/src/services/custom-object.ts +48 -48
  86. package/src/services/customer-group.ts +8 -8
  87. package/src/services/customer.test.ts +151 -151
  88. package/src/services/customer.ts +27 -27
  89. package/src/services/discount-code.ts +8 -8
  90. package/src/services/extension.ts +8 -8
  91. package/src/services/index.ts +52 -44
  92. package/src/services/inventory-entry.test.ts +162 -162
  93. package/src/services/inventory-entry.ts +8 -8
  94. package/src/services/my-cart.test.ts +78 -78
  95. package/src/services/my-cart.ts +28 -28
  96. package/src/services/my-customer.test.ts +44 -44
  97. package/src/services/my-customer.ts +53 -53
  98. package/src/services/my-order.ts +20 -20
  99. package/src/services/my-payment.test.ts +65 -65
  100. package/src/services/my-payment.ts +8 -8
  101. package/src/services/order.test.ts +527 -527
  102. package/src/services/order.ts +31 -31
  103. package/src/services/payment.test.ts +65 -65
  104. package/src/services/payment.ts +8 -8
  105. package/src/services/product-discount.ts +8 -8
  106. package/src/services/product-projection.test.ts +492 -428
  107. package/src/services/product-projection.ts +32 -18
  108. package/src/services/product-type.test.ts +56 -56
  109. package/src/services/product-type.ts +8 -8
  110. package/src/services/product.test.ts +510 -510
  111. package/src/services/product.ts +8 -8
  112. package/src/services/project.ts +34 -34
  113. package/src/services/shipping-method.test.ts +81 -81
  114. package/src/services/shipping-method.ts +12 -12
  115. package/src/services/shopping-list.ts +8 -8
  116. package/src/services/standalone-price.test.ts +256 -256
  117. package/src/services/standalone-price.ts +8 -8
  118. package/src/services/state.test.ts +42 -42
  119. package/src/services/state.ts +8 -8
  120. package/src/services/store.test.ts +57 -57
  121. package/src/services/store.ts +8 -8
  122. package/src/services/subscription.ts +8 -8
  123. package/src/services/tax-category.test.ts +61 -61
  124. package/src/services/tax-category.ts +8 -8
  125. package/src/services/type.ts +8 -8
  126. package/src/services/zone.ts +8 -8
  127. package/src/storage/abstract.ts +58 -58
  128. package/src/storage/in-memory.ts +419 -419
  129. package/src/types.ts +82 -82
@@ -1,117 +1,119 @@
1
1
  import auth from 'basic-auth'
2
2
  import bodyParser from 'body-parser'
3
- import express, { type NextFunction, type Request, type Response } from 'express'
4
- import {
5
- InvalidTokenError,
6
- } from '@commercetools/platform-sdk'
3
+ import express, {
4
+ type NextFunction,
5
+ type Request,
6
+ type Response,
7
+ } from 'express'
8
+ import { InvalidTokenError } from '@commercetools/platform-sdk'
7
9
  import { CommercetoolsError, InvalidRequestError } from '../exceptions.js'
8
10
  import { InvalidClientError, UnsupportedGrantType } from './errors.js'
9
11
  import { OAuth2Store } from './store.js'
10
12
  import { getBearerToken } from './helpers.js'
11
13
 
12
14
  export class OAuth2Server {
13
- store: OAuth2Store
15
+ store: OAuth2Store
14
16
 
15
- constructor(options: { enabled: boolean; validate: boolean }) {
16
- this.store = new OAuth2Store(options.validate)
17
- }
17
+ constructor(options: { enabled: boolean; validate: boolean }) {
18
+ this.store = new OAuth2Store(options.validate)
19
+ }
18
20
 
19
- createRouter() {
20
- const router = express.Router()
21
- router.use(bodyParser.urlencoded({ extended: true }))
22
- router.post('/token', this.tokenHandler.bind(this))
23
- return router
24
- }
21
+ createRouter() {
22
+ const router = express.Router()
23
+ router.use(bodyParser.urlencoded({ extended: true }))
24
+ router.post('/token', this.tokenHandler.bind(this))
25
+ return router
26
+ }
25
27
 
26
- createMiddleware() {
27
- return async (request: Request, response: Response, next: NextFunction) => {
28
- const token = getBearerToken(request)
29
- if (!token) {
30
- next(
31
- new CommercetoolsError<InvalidTokenError>(
32
- {
33
- code: 'invalid_token',
34
- message:
35
- 'This endpoint requires an access token. You can get one from the authorization server.',
36
- },
37
- 401
38
- )
39
- )
40
- }
28
+ createMiddleware() {
29
+ return async (request: Request, response: Response, next: NextFunction) => {
30
+ const token = getBearerToken(request)
31
+ if (!token) {
32
+ next(
33
+ new CommercetoolsError<InvalidTokenError>(
34
+ {
35
+ code: 'invalid_token',
36
+ message:
37
+ 'This endpoint requires an access token. You can get one from the authorization server.',
38
+ },
39
+ 401
40
+ )
41
+ )
42
+ }
41
43
 
42
- if (!token || !this.store.validateToken(token)) {
43
- next(
44
- new CommercetoolsError<InvalidTokenError>(
45
- {
46
- code: 'invalid_token',
47
- message: 'invalid_token',
48
- },
49
- 401
50
- )
51
- )
52
- }
44
+ if (!token || !this.store.validateToken(token)) {
45
+ next(
46
+ new CommercetoolsError<InvalidTokenError>(
47
+ {
48
+ code: 'invalid_token',
49
+ message: 'invalid_token',
50
+ },
51
+ 401
52
+ )
53
+ )
54
+ }
53
55
 
54
- next()
55
- }
56
- }
57
- async tokenHandler(request: Request, response: Response, next: NextFunction) {
58
- const authHeader = request.header('Authorization')
59
- if (!authHeader) {
60
- return next(
61
- new CommercetoolsError<InvalidClientError>(
62
- {
63
- code: 'invalid_client',
64
- message:
65
- 'Please provide valid client credentials using HTTP Basic Authentication.',
66
- },
67
- 401
68
- )
69
- )
70
- }
71
- const credentials = auth.parse(authHeader)
72
- if (!credentials) {
73
- return next(
74
- new CommercetoolsError<InvalidClientError>(
75
- {
76
- code: 'invalid_client',
77
- message:
78
- 'Please provide valid client credentials using HTTP Basic Authentication.',
79
- },
80
- 400
81
- )
82
- )
83
- }
56
+ next()
57
+ }
58
+ }
59
+ async tokenHandler(request: Request, response: Response, next: NextFunction) {
60
+ const authHeader = request.header('Authorization')
61
+ if (!authHeader) {
62
+ return next(
63
+ new CommercetoolsError<InvalidClientError>(
64
+ {
65
+ code: 'invalid_client',
66
+ message:
67
+ 'Please provide valid client credentials using HTTP Basic Authentication.',
68
+ },
69
+ 401
70
+ )
71
+ )
72
+ }
73
+ const credentials = auth.parse(authHeader)
74
+ if (!credentials) {
75
+ return next(
76
+ new CommercetoolsError<InvalidClientError>(
77
+ {
78
+ code: 'invalid_client',
79
+ message:
80
+ 'Please provide valid client credentials using HTTP Basic Authentication.',
81
+ },
82
+ 400
83
+ )
84
+ )
85
+ }
84
86
 
85
- const grantType = request.query.grant_type || request.body.grant_type
86
- if (!grantType) {
87
- return next(
88
- new CommercetoolsError<InvalidRequestError>(
89
- {
90
- code: 'invalid_request',
91
- message: 'Missing required parameter: grant_type.',
92
- },
93
- 400
94
- )
95
- )
96
- }
87
+ const grantType = request.query.grant_type || request.body.grant_type
88
+ if (!grantType) {
89
+ return next(
90
+ new CommercetoolsError<InvalidRequestError>(
91
+ {
92
+ code: 'invalid_request',
93
+ message: 'Missing required parameter: grant_type.',
94
+ },
95
+ 400
96
+ )
97
+ )
98
+ }
97
99
 
98
- if (grantType === 'client_credentials') {
99
- const token = this.store.getClientToken(
100
- credentials.name,
101
- credentials.pass,
102
- request.query.scope?.toString()
103
- )
104
- return response.status(200).send(token)
105
- } else {
106
- return next(
107
- new CommercetoolsError<UnsupportedGrantType>(
108
- {
109
- code: 'unsupported_grant_type',
110
- message: `Invalid parameter: grant_type: Invalid grant type: ${grantType}`,
111
- },
112
- 400
113
- )
114
- )
115
- }
116
- }
100
+ if (grantType === 'client_credentials') {
101
+ const token = this.store.getClientToken(
102
+ credentials.name,
103
+ credentials.pass,
104
+ request.query.scope?.toString()
105
+ )
106
+ return response.status(200).send(token)
107
+ } else {
108
+ return next(
109
+ new CommercetoolsError<UnsupportedGrantType>(
110
+ {
111
+ code: 'unsupported_grant_type',
112
+ message: `Invalid parameter: grant_type: Invalid grant type: ${grantType}`,
113
+ },
114
+ 400
115
+ )
116
+ )
117
+ }
118
+ }
117
119
  }
@@ -1,38 +1,38 @@
1
1
  import { randomBytes } from 'crypto'
2
2
 
3
3
  type Token = {
4
- access_token: string
5
- token_type: 'Bearer'
6
- expires_in: number
7
- scope: string
4
+ access_token: string
5
+ token_type: 'Bearer'
6
+ expires_in: number
7
+ scope: string
8
8
  }
9
9
 
10
10
  export class OAuth2Store {
11
- tokens: Token[] = []
12
- validate = true
11
+ tokens: Token[] = []
12
+ validate = true
13
13
 
14
- constructor(validate = true) {
15
- this.validate = validate
16
- }
14
+ constructor(validate = true) {
15
+ this.validate = validate
16
+ }
17
17
 
18
- getClientToken(clientId: string, clientSecret: string, scope?: string) {
19
- const token: Token = {
20
- access_token: randomBytes(16).toString('base64'),
21
- token_type: 'Bearer',
22
- expires_in: 172800,
23
- scope: scope || 'todo',
24
- }
25
- this.tokens.push(token)
26
- return token
27
- }
18
+ getClientToken(clientId: string, clientSecret: string, scope?: string) {
19
+ const token: Token = {
20
+ access_token: randomBytes(16).toString('base64'),
21
+ token_type: 'Bearer',
22
+ expires_in: 172800,
23
+ scope: scope || 'todo',
24
+ }
25
+ this.tokens.push(token)
26
+ return token
27
+ }
28
28
 
29
- validateToken(token: string) {
30
- if (!this.validate) return true
29
+ validateToken(token: string) {
30
+ if (!this.validate) return true
31
31
 
32
- const foundToken = this.tokens.find((t) => t.access_token === token)
33
- if (foundToken) {
34
- return true
35
- }
36
- return false
37
- }
32
+ const foundToken = this.tokens.find((t) => t.access_token === token)
33
+ if (foundToken) {
34
+ return true
35
+ }
36
+ return false
37
+ }
38
38
  }
@@ -3,76 +3,76 @@ import { beforeEach, describe, expect, test } from 'vitest'
3
3
  import { applyPriceSelector } from './priceSelector.js'
4
4
 
5
5
  describe('priceSelector', () => {
6
- let product: ProductProjection
6
+ let product: ProductProjection
7
7
 
8
- beforeEach(() => {
9
- product = {
10
- id: '7401d82f-1378-47ba-996a-85beeb87ac87',
11
- version: 2,
12
- createdAt: '2022-07-22T10:02:40.851Z',
13
- lastModifiedAt: '2022-07-22T10:02:44.427Z',
14
- productType: {
15
- typeId: 'product-type',
16
- id: 'b9b4b426-938b-4ccb-9f36-c6f933e8446e',
17
- },
18
- name: {
19
- 'nl-NL': 'test',
20
- },
21
- slug: {
22
- 'nl-NL': 'test',
23
- },
24
- variants: [],
25
- searchKeywords: {},
26
- categories: [],
27
- masterVariant: {
28
- id: 1,
29
- sku: 'MYSKU',
30
- attributes: [
31
- {
32
- name: 'Country',
33
- value: {
34
- key: 'NL',
35
- label: {
36
- de: 'niederlande',
37
- en: 'netherlands',
38
- nl: 'nederland',
39
- },
40
- },
41
- },
42
- {
43
- name: 'number',
44
- value: 4,
45
- },
46
- ],
47
- prices: [
48
- {
49
- id: 'dummy-uuid',
50
- value: {
51
- type: 'centPrecision',
52
- currencyCode: 'EUR',
53
- centAmount: 1789,
54
- fractionDigits: 2,
55
- },
56
- },
57
- ],
58
- },
59
- }
60
- })
8
+ beforeEach(() => {
9
+ product = {
10
+ id: '7401d82f-1378-47ba-996a-85beeb87ac87',
11
+ version: 2,
12
+ createdAt: '2022-07-22T10:02:40.851Z',
13
+ lastModifiedAt: '2022-07-22T10:02:44.427Z',
14
+ productType: {
15
+ typeId: 'product-type',
16
+ id: 'b9b4b426-938b-4ccb-9f36-c6f933e8446e',
17
+ },
18
+ name: {
19
+ 'nl-NL': 'test',
20
+ },
21
+ slug: {
22
+ 'nl-NL': 'test',
23
+ },
24
+ variants: [],
25
+ searchKeywords: {},
26
+ categories: [],
27
+ masterVariant: {
28
+ id: 1,
29
+ sku: 'MYSKU',
30
+ attributes: [
31
+ {
32
+ name: 'Country',
33
+ value: {
34
+ key: 'NL',
35
+ label: {
36
+ de: 'niederlande',
37
+ en: 'netherlands',
38
+ nl: 'nederland',
39
+ },
40
+ },
41
+ },
42
+ {
43
+ name: 'number',
44
+ value: 4,
45
+ },
46
+ ],
47
+ prices: [
48
+ {
49
+ id: 'dummy-uuid',
50
+ value: {
51
+ type: 'centPrecision',
52
+ currencyCode: 'EUR',
53
+ centAmount: 1789,
54
+ fractionDigits: 2,
55
+ },
56
+ },
57
+ ],
58
+ },
59
+ }
60
+ })
61
61
 
62
- test('currency (match)', async () => {
63
- applyPriceSelector([product], { currency: 'EUR' })
62
+ test('currency (match)', async () => {
63
+ applyPriceSelector([product], { currency: 'EUR' })
64
64
 
65
- expect(product).toMatchObject({
66
- masterVariant: {
67
- sku: 'MYSKU',
68
- scopedPrice: { value: { centAmount: 1789 } },
69
- },
70
- })
71
- })
65
+ expect(product).toMatchObject({
66
+ masterVariant: {
67
+ sku: 'MYSKU',
68
+ scopedPrice: { value: { centAmount: 1789 } },
69
+ },
70
+ })
71
+ })
72
72
 
73
- test('currency, country (no match)', async () => {
74
- applyPriceSelector([product], { currency: 'EUR', country: 'US' })
75
- expect(product.masterVariant.scopedPrice).toBeUndefined()
76
- expect(product.masterVariant.scopedPrice).toBeUndefined()
77
- })
73
+ test('currency, country (no match)', async () => {
74
+ applyPriceSelector([product], { currency: 'EUR', country: 'US' })
75
+ expect(product.masterVariant.scopedPrice).toBeUndefined()
76
+ expect(product.masterVariant.scopedPrice).toBeUndefined()
77
+ })
78
78
  })
@@ -1,17 +1,17 @@
1
1
  import type {
2
- InvalidInputError,
3
- Price,
4
- ProductProjection,
5
- ProductVariant,
2
+ InvalidInputError,
3
+ Price,
4
+ ProductProjection,
5
+ ProductVariant,
6
6
  } from '@commercetools/platform-sdk'
7
7
  import { CommercetoolsError } from './exceptions.js'
8
8
  import type { Writable } from './types.js'
9
9
 
10
10
  export type PriceSelector = {
11
- currency?: string
12
- country?: string
13
- customerGroup?: string
14
- channel?: string
11
+ currency?: string
12
+ country?: string
13
+ customerGroup?: string
14
+ channel?: string
15
15
  }
16
16
 
17
17
  /**
@@ -20,49 +20,49 @@ export type PriceSelector = {
20
20
  * the scopedPrice attribute
21
21
  */
22
22
  export const applyPriceSelector = (
23
- products: ProductProjection[],
24
- selector: PriceSelector
23
+ products: ProductProjection[],
24
+ selector: PriceSelector
25
25
  ) => {
26
- validatePriceSelector(selector)
26
+ validatePriceSelector(selector)
27
27
 
28
- for (const product of products) {
29
- const variants: Writable<ProductVariant>[] = [
30
- product.masterVariant,
31
- ...(product.variants ?? []),
32
- ].filter((x) => x != undefined)
28
+ for (const product of products) {
29
+ const variants: Writable<ProductVariant>[] = [
30
+ product.masterVariant,
31
+ ...(product.variants ?? []),
32
+ ].filter((x) => x != undefined)
33
33
 
34
- for (const variant of variants) {
35
- const scopedPrices =
36
- variant.prices?.filter((p) => priceSelectorFilter(p, selector)) ?? []
34
+ for (const variant of variants) {
35
+ const scopedPrices =
36
+ variant.prices?.filter((p) => priceSelectorFilter(p, selector)) ?? []
37
37
 
38
- if (scopedPrices.length > 0) {
39
- const price = scopedPrices[0]
38
+ if (scopedPrices.length > 0) {
39
+ const price = scopedPrices[0]
40
40
 
41
- variant.scopedPriceDiscounted = false
42
- variant.scopedPrice = {
43
- ...price,
44
- currentValue: price.value,
45
- }
46
- }
47
- }
48
- }
41
+ variant.scopedPriceDiscounted = false
42
+ variant.scopedPrice = {
43
+ ...price,
44
+ currentValue: price.value,
45
+ }
46
+ }
47
+ }
48
+ }
49
49
  }
50
50
 
51
51
  const validatePriceSelector = (selector: PriceSelector) => {
52
- if (
53
- (selector.country || selector.channel || selector.customerGroup) &&
54
- !selector.currency
55
- ) {
56
- throw new CommercetoolsError<InvalidInputError>(
57
- {
58
- code: 'InvalidInput',
59
- message:
60
- 'The price selecting parameters country, channel and customerGroup ' +
61
- 'cannot be used without the currency.',
62
- },
63
- 400
64
- )
65
- }
52
+ if (
53
+ (selector.country || selector.channel || selector.customerGroup) &&
54
+ !selector.currency
55
+ ) {
56
+ throw new CommercetoolsError<InvalidInputError>(
57
+ {
58
+ code: 'InvalidInput',
59
+ message:
60
+ 'The price selecting parameters country, channel and customerGroup ' +
61
+ 'cannot be used without the currency.',
62
+ },
63
+ 400
64
+ )
65
+ }
66
66
  }
67
67
 
68
68
  /**
@@ -71,36 +71,36 @@ const validatePriceSelector = (selector: PriceSelector) => {
71
71
  * then it should match.
72
72
  */
73
73
  export const priceSelectorFilter = (
74
- price: Price,
75
- selector: PriceSelector
74
+ price: Price,
75
+ selector: PriceSelector
76
76
  ): boolean => {
77
- if (
78
- (selector.country || price.country) &&
79
- selector.country !== price.country
80
- ) {
81
- return false
82
- }
77
+ if (
78
+ (selector.country || price.country) &&
79
+ selector.country !== price.country
80
+ ) {
81
+ return false
82
+ }
83
83
 
84
- if (
85
- (selector.currency || price.value.currencyCode) &&
86
- selector.currency !== price.value.currencyCode
87
- ) {
88
- return false
89
- }
84
+ if (
85
+ (selector.currency || price.value.currencyCode) &&
86
+ selector.currency !== price.value.currencyCode
87
+ ) {
88
+ return false
89
+ }
90
90
 
91
- if (
92
- (selector.channel || price.channel?.id) &&
93
- selector.channel !== price.channel?.id
94
- ) {
95
- return false
96
- }
91
+ if (
92
+ (selector.channel || price.channel?.id) &&
93
+ selector.channel !== price.channel?.id
94
+ ) {
95
+ return false
96
+ }
97
97
 
98
- if (
99
- (selector.customerGroup || price.customerGroup?.id) &&
100
- selector.customerGroup !== price.customerGroup?.id
101
- ) {
102
- return false
103
- }
98
+ if (
99
+ (selector.customerGroup || price.customerGroup?.id) &&
100
+ selector.customerGroup !== price.customerGroup?.id
101
+ ) {
102
+ return false
103
+ }
104
104
 
105
- return true
105
+ return true
106
106
  }