@labdigital/commercetools-mock 2.17.1 → 2.18.1

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 (180) hide show
  1. package/dist/index.cjs +4351 -4099
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +266 -413
  4. package/dist/index.d.ts +266 -413
  5. package/dist/index.js +4351 -4099
  6. package/dist/index.js.map +1 -1
  7. package/package.json +47 -47
  8. package/src/constants.ts +2 -2
  9. package/src/ctMock.test.ts +11 -11
  10. package/src/ctMock.ts +141 -127
  11. package/src/deprecation.ts +8 -0
  12. package/src/exceptions.ts +17 -15
  13. package/src/helpers.ts +32 -32
  14. package/src/index.test.ts +128 -128
  15. package/src/index.ts +3 -3
  16. package/src/lib/expandParser.ts +13 -13
  17. package/src/lib/haversine.test.ts +9 -9
  18. package/src/lib/haversine.ts +11 -11
  19. package/src/lib/masking.ts +11 -11
  20. package/src/lib/parser.ts +2 -2
  21. package/src/lib/password.ts +23 -3
  22. package/src/lib/predicateParser.test.ts +185 -183
  23. package/src/lib/predicateParser.ts +234 -234
  24. package/src/lib/projectionSearchFilter.test.ts +103 -101
  25. package/src/lib/projectionSearchFilter.ts +152 -150
  26. package/src/lib/proxy.ts +5 -5
  27. package/src/oauth/errors.ts +4 -4
  28. package/src/oauth/helpers.ts +6 -6
  29. package/src/oauth/server.test.ts +86 -86
  30. package/src/oauth/server.ts +158 -144
  31. package/src/oauth/store.ts +44 -43
  32. package/src/priceSelector.test.ts +35 -35
  33. package/src/priceSelector.ts +30 -30
  34. package/src/product-projection-search.ts +136 -134
  35. package/src/projectAPI.test.ts +7 -7
  36. package/src/projectAPI.ts +24 -22
  37. package/src/repositories/abstract.ts +168 -116
  38. package/src/repositories/associate-role.ts +90 -77
  39. package/src/repositories/attribute-group.ts +51 -40
  40. package/src/repositories/business-unit.ts +168 -148
  41. package/src/repositories/cart/actions.ts +489 -0
  42. package/src/repositories/cart/helpers.ts +30 -0
  43. package/src/repositories/cart/index.ts +180 -0
  44. package/src/repositories/cart-discount/actions.ts +148 -0
  45. package/src/repositories/cart-discount/index.ts +86 -0
  46. package/src/repositories/category/actions.ts +231 -0
  47. package/src/repositories/category/index.ts +52 -0
  48. package/src/repositories/channel.ts +88 -90
  49. package/src/repositories/custom-object.ts +46 -45
  50. package/src/repositories/customer/actions.ts +165 -0
  51. package/src/repositories/customer/index.ts +79 -0
  52. package/src/repositories/customer-group.ts +66 -55
  53. package/src/repositories/discount-code/actions.ts +149 -0
  54. package/src/repositories/discount-code/index.ts +50 -0
  55. package/src/repositories/errors.ts +10 -10
  56. package/src/repositories/extension.ts +64 -62
  57. package/src/repositories/helpers.ts +117 -118
  58. package/src/repositories/index.ts +80 -79
  59. package/src/repositories/inventory-entry/actions.ts +84 -0
  60. package/src/repositories/inventory-entry/index.ts +44 -0
  61. package/src/repositories/my-customer.ts +114 -0
  62. package/src/repositories/my-order.ts +8 -8
  63. package/src/repositories/order/actions.ts +281 -0
  64. package/src/repositories/{order.test.ts → order/index.test.ts} +77 -77
  65. package/src/repositories/order/index.ts +260 -0
  66. package/src/repositories/order-edit.ts +10 -23
  67. package/src/repositories/payment/actions.ts +305 -0
  68. package/src/repositories/payment/helpers.ts +17 -0
  69. package/src/repositories/payment/index.ts +56 -0
  70. package/src/repositories/product/actions.ts +943 -0
  71. package/src/repositories/product/helpers.ts +98 -0
  72. package/src/repositories/product/index.ts +130 -0
  73. package/src/repositories/product-discount.ts +127 -117
  74. package/src/repositories/product-projection.ts +56 -62
  75. package/src/repositories/product-selection.ts +31 -28
  76. package/src/repositories/product-type.ts +136 -134
  77. package/src/repositories/project.ts +133 -118
  78. package/src/repositories/quote-request.ts +7 -19
  79. package/src/repositories/quote.ts +7 -22
  80. package/src/repositories/review.ts +13 -26
  81. package/src/repositories/shipping-method/actions.ts +198 -0
  82. package/src/repositories/shipping-method/helpers.ts +10 -0
  83. package/src/repositories/shipping-method/index.ts +138 -0
  84. package/src/repositories/shopping-list/actions.ts +295 -0
  85. package/src/repositories/shopping-list/index.ts +122 -0
  86. package/src/repositories/staged-quote.ts +7 -20
  87. package/src/repositories/standalone-price.ts +57 -44
  88. package/src/repositories/state.ts +113 -68
  89. package/src/repositories/store.ts +106 -94
  90. package/src/repositories/subscription.ts +46 -22
  91. package/src/repositories/tax-category/actions.ts +94 -0
  92. package/src/repositories/tax-category/helpers.ts +8 -0
  93. package/src/repositories/tax-category/index.ts +25 -0
  94. package/src/repositories/type/actions.ts +162 -0
  95. package/src/repositories/type/index.ts +24 -0
  96. package/src/repositories/zone.ts +62 -58
  97. package/src/schemas/update-request.ts +12 -0
  98. package/src/server.ts +9 -9
  99. package/src/services/abstract.ts +85 -72
  100. package/src/services/associate-roles.test.ts +27 -27
  101. package/src/services/associate-roles.ts +7 -7
  102. package/src/services/attribute-group.ts +7 -7
  103. package/src/services/business-units.test.ts +28 -28
  104. package/src/services/business-units.ts +7 -7
  105. package/src/services/cart-discount.test.ts +199 -199
  106. package/src/services/cart-discount.ts +7 -7
  107. package/src/services/cart.test.ts +261 -261
  108. package/src/services/cart.ts +22 -21
  109. package/src/services/category.test.ts +121 -121
  110. package/src/services/category.ts +7 -7
  111. package/src/services/channel.ts +7 -7
  112. package/src/services/custom-object.test.ts +130 -130
  113. package/src/services/custom-object.ts +34 -31
  114. package/src/services/customer-group.ts +7 -7
  115. package/src/services/customer.test.ts +205 -205
  116. package/src/services/customer.ts +23 -36
  117. package/src/services/discount-code.ts +7 -7
  118. package/src/services/extension.ts +7 -7
  119. package/src/services/index.ts +85 -81
  120. package/src/services/inventory-entry.test.ts +106 -106
  121. package/src/services/inventory-entry.ts +7 -7
  122. package/src/services/my-cart.test.ts +56 -56
  123. package/src/services/my-cart.ts +20 -20
  124. package/src/services/my-customer.test.ts +155 -104
  125. package/src/services/my-customer.ts +66 -75
  126. package/src/services/my-order.ts +16 -16
  127. package/src/services/my-payment.test.ts +40 -40
  128. package/src/services/my-payment.ts +7 -7
  129. package/src/services/my-shopping-list.ts +7 -7
  130. package/src/services/order.test.ts +243 -243
  131. package/src/services/order.ts +23 -18
  132. package/src/services/payment.test.ts +40 -40
  133. package/src/services/payment.ts +7 -7
  134. package/src/services/product-discount.ts +7 -7
  135. package/src/services/product-projection.test.ts +190 -190
  136. package/src/services/product-projection.ts +34 -32
  137. package/src/services/product-selection.test.ts +19 -19
  138. package/src/services/product-selection.ts +7 -7
  139. package/src/services/product-type.test.ts +38 -38
  140. package/src/services/product-type.ts +7 -7
  141. package/src/services/product.test.ts +658 -656
  142. package/src/services/product.ts +7 -7
  143. package/src/services/project.test.ts +29 -24
  144. package/src/services/project.ts +22 -17
  145. package/src/services/reviews.ts +7 -7
  146. package/src/services/shipping-method.test.ts +78 -78
  147. package/src/services/shipping-method.ts +16 -16
  148. package/src/services/shopping-list.test.ts +170 -170
  149. package/src/services/shopping-list.ts +7 -7
  150. package/src/services/standalone-price.test.ts +112 -112
  151. package/src/services/standalone-price.ts +7 -7
  152. package/src/services/state.test.ts +30 -30
  153. package/src/services/state.ts +7 -7
  154. package/src/services/store.test.ts +40 -40
  155. package/src/services/store.ts +7 -7
  156. package/src/services/subscription.ts +7 -7
  157. package/src/services/tax-category.test.ts +43 -43
  158. package/src/services/tax-category.ts +7 -7
  159. package/src/services/type.ts +7 -7
  160. package/src/services/zone.ts +7 -7
  161. package/src/shippingCalculator.test.ts +43 -43
  162. package/src/shippingCalculator.ts +23 -23
  163. package/src/storage/abstract.ts +36 -34
  164. package/src/storage/in-memory.ts +237 -233
  165. package/src/storage/index.ts +2 -2
  166. package/src/types.ts +91 -91
  167. package/src/validate.ts +18 -0
  168. package/src/repositories/cart-discount.ts +0 -219
  169. package/src/repositories/cart.ts +0 -659
  170. package/src/repositories/category.ts +0 -256
  171. package/src/repositories/customer.ts +0 -228
  172. package/src/repositories/discount-code.ts +0 -181
  173. package/src/repositories/inventory-entry.ts +0 -109
  174. package/src/repositories/order.ts +0 -514
  175. package/src/repositories/payment.ts +0 -342
  176. package/src/repositories/product.ts +0 -1106
  177. package/src/repositories/shipping-method.ts +0 -312
  178. package/src/repositories/shopping-list.ts +0 -392
  179. package/src/repositories/tax-category.ts +0 -111
  180. package/src/repositories/type.ts +0 -172
@@ -1,139 +1,130 @@
1
- import { Request, Response, Router } from 'express'
2
- import { CustomerRepository } from '../repositories/customer.js'
3
- import { getRepositoryContext } from '../repositories/helpers.js'
4
- import AbstractService from './abstract.js'
5
- import { hashPassword } from '../lib/password.js'
6
- import {
7
- Customer,
8
- Update,
9
- InvalidCurrentPasswordError,
10
- } from '@commercetools/platform-sdk'
1
+ import { Update } from "@commercetools/platform-sdk";
2
+ import { Request, Response, Router } from "express";
3
+ import { updateRequestSchema } from "~src/schemas/update-request";
4
+ import { validateData } from "~src/validate";
5
+ import { hashPassword } from "../lib/password";
6
+ import { getRepositoryContext } from "../repositories/helpers";
7
+ import { MyCustomerRepository } from "../repositories/my-customer";
8
+ import AbstractService from "./abstract";
11
9
 
12
10
  export class MyCustomerService extends AbstractService {
13
- public repository: CustomerRepository
11
+ public repository: MyCustomerRepository;
14
12
 
15
- constructor(parent: Router, repository: CustomerRepository) {
16
- super(parent)
17
- this.repository = repository
13
+ constructor(parent: Router, repository: MyCustomerRepository) {
14
+ super(parent);
15
+ this.repository = repository;
18
16
  }
19
17
 
20
18
  getBasePath() {
21
- return 'me'
19
+ return "me";
22
20
  }
23
21
 
24
22
  registerRoutes(parent: Router) {
25
23
  // Overwrite this function to be able to handle /me path.
26
- const basePath = this.getBasePath()
27
- const router = Router({ mergeParams: true })
24
+ const basePath = this.getBasePath();
25
+ const router = Router({ mergeParams: true });
28
26
 
29
- this.extraRoutes(router)
27
+ this.extraRoutes(router);
30
28
 
31
- router.get('', this.getMe.bind(this))
32
- router.post('', this.updateMe.bind(this))
33
- router.delete('', this.deleteMe.bind(this))
29
+ router.get("", this.getMe.bind(this));
30
+ router.post("", this.updateMe.bind(this));
31
+ router.delete("", this.deleteMe.bind(this));
34
32
 
35
- router.post('/signup', this.signUp.bind(this))
33
+ router.post("/signup", this.signUp.bind(this));
36
34
 
37
- router.post('/login', this.signIn.bind(this))
38
- router.post('/password', this.changePassword.bind(this))
35
+ router.post("/login", this.signIn.bind(this));
36
+ router.post("/password", this.changePassword.bind(this));
37
+ router.post("/password/reset", this.resetPassword.bind(this));
39
38
 
40
- parent.use(`/${basePath}`, router)
39
+ parent.use(`/${basePath}`, router);
41
40
  }
42
41
 
43
42
  getMe(request: Request, response: Response) {
44
- const resource = this.repository.getMe(getRepositoryContext(request))
43
+ const resource = this.repository.getMe(getRepositoryContext(request));
45
44
  if (!resource) {
46
- return response.status(404).send('Not found')
45
+ return response.status(404).send("Not found");
47
46
  }
48
- return response.status(200).send(resource)
47
+ return response.status(200).send(resource);
49
48
  }
50
49
 
51
50
  updateMe(request: Request, response: Response) {
52
- const resource = this.repository.getMe(getRepositoryContext(request))
51
+ const resource = this.repository.getMe(getRepositoryContext(request));
53
52
 
54
53
  if (!resource) {
55
- return response.status(404).send('Not found')
54
+ return response.status(404).send("Not found");
56
55
  }
57
- const updateRequest: Update = request.body
56
+ const updateRequest = validateData<Update>(
57
+ request.body,
58
+ updateRequestSchema,
59
+ );
58
60
  const updatedResource = this.repository.processUpdateActions(
59
61
  getRepositoryContext(request),
60
62
  resource,
61
63
  updateRequest.version,
62
- updateRequest.actions
63
- )
64
+ updateRequest.actions,
65
+ );
64
66
 
65
- const result = this._expandWithId(request, updatedResource.id)
66
- return response.status(200).send(result)
67
+ const result = this._expandWithId(request, updatedResource.id);
68
+ return response.status(200).send(result);
67
69
  }
70
+
68
71
  deleteMe(request: Request, response: Response) {
69
- const resource = this.repository.deleteMe(getRepositoryContext(request))
72
+ const resource = this.repository.deleteMe(getRepositoryContext(request));
70
73
  if (!resource) {
71
- return response.status(404).send('Not found')
74
+ return response.status(404).send("Not found");
72
75
  }
73
76
 
74
- return response.status(200).send(resource)
77
+ return response.status(200).send(resource);
75
78
  }
76
79
 
77
80
  signUp(request: Request, response: Response) {
78
- const draft = request.body
81
+ const draft = request.body;
79
82
  const resource = this.repository.create(
80
83
  getRepositoryContext(request),
81
- draft
82
- )
83
- const result = this._expandWithId(request, resource.id)
84
- return response.status(this.createStatusCode).send({ customer: result })
84
+ draft,
85
+ );
86
+ const result = this._expandWithId(request, resource.id);
87
+ return response.status(this.createStatusCode).send({ customer: result });
85
88
  }
86
89
 
87
90
  changePassword(request: Request, response: Response) {
88
- const { currentPassword, newPassword } = request.body
89
- const encodedPassword = hashPassword(currentPassword)
90
-
91
- const result = this.repository.query(getRepositoryContext(request), {
92
- where: [`password = "${encodedPassword}"`],
93
- })
94
-
95
- if (result.count === 0) {
96
- return response.status(404).send({
97
- message: 'Account with the given credentials not found.',
98
- errors: [
99
- {
100
- code: 'InvalidCurrentPassword',
101
- message: 'Account with the given credentials not found.',
102
- } as InvalidCurrentPasswordError,
103
- ],
104
- })
105
- }
91
+ const customer = this.repository.changePassword(
92
+ getRepositoryContext(request),
93
+ request.body,
94
+ );
106
95
 
107
- const newCustomer: Customer = {
108
- ...result.results[0],
109
- password: hashPassword(newPassword),
110
- }
96
+ return response.status(200).send(customer);
97
+ }
111
98
 
112
- this.repository.saveNew(getRepositoryContext(request), newCustomer)
99
+ resetPassword(request: Request, response: Response) {
100
+ const customer = this.repository.resetPassword(
101
+ getRepositoryContext(request),
102
+ request.body,
103
+ );
113
104
 
114
- return response.status(200).send(newCustomer)
105
+ return response.status(200).send(customer);
115
106
  }
116
107
 
117
108
  signIn(request: Request, response: Response) {
118
- const { email, password } = request.body
119
- const encodedPassword = hashPassword(password)
109
+ const { email, password } = request.body;
110
+ const encodedPassword = hashPassword(password);
120
111
 
121
112
  const result = this.repository.query(getRepositoryContext(request), {
122
113
  where: [`email = "${email}"`, `password = "${encodedPassword}"`],
123
- })
114
+ });
124
115
 
125
116
  if (result.count === 0) {
126
117
  return response.status(400).send({
127
- message: 'Account with the given credentials not found.',
118
+ message: "Account with the given credentials not found.",
128
119
  errors: [
129
120
  {
130
- code: 'InvalidCredentials',
131
- message: 'Account with the given credentials not found.',
121
+ code: "InvalidCredentials",
122
+ message: "Account with the given credentials not found.",
132
123
  },
133
124
  ],
134
- })
125
+ });
135
126
  }
136
127
 
137
- return response.status(200).send({ customer: result.results[0] })
128
+ return response.status(200).send({ customer: result.results[0] });
138
129
  }
139
130
  }
@@ -1,34 +1,34 @@
1
- import { Router } from 'express'
2
- import { MyOrderRepository } from '../repositories/my-order.js'
3
- import AbstractService from './abstract.js'
1
+ import { Router } from "express";
2
+ import { MyOrderRepository } from "../repositories/my-order";
3
+ import AbstractService from "./abstract";
4
4
 
5
5
  export class MyOrderService extends AbstractService {
6
- public repository: MyOrderRepository
6
+ public repository: MyOrderRepository;
7
7
 
8
8
  constructor(parent: Router, repository: MyOrderRepository) {
9
- super(parent)
10
- this.repository = repository
9
+ super(parent);
10
+ this.repository = repository;
11
11
  }
12
12
 
13
13
  getBasePath() {
14
- return 'me'
14
+ return "me";
15
15
  }
16
16
 
17
17
  registerRoutes(parent: Router) {
18
18
  // Overwrite this function to be able to handle /me/active-cart path.
19
- const basePath = this.getBasePath()
20
- const router = Router({ mergeParams: true })
19
+ const basePath = this.getBasePath();
20
+ const router = Router({ mergeParams: true });
21
21
 
22
- this.extraRoutes(router)
22
+ this.extraRoutes(router);
23
23
 
24
- router.get('/orders/', this.get.bind(this))
25
- router.get('/orders/:id', this.getWithId.bind(this))
24
+ router.get("/orders/", this.get.bind(this));
25
+ router.get("/orders/:id", this.getWithId.bind(this));
26
26
 
27
- router.delete('/orders/:id', this.deleteWithId.bind(this))
27
+ router.delete("/orders/:id", this.deleteWithId.bind(this));
28
28
 
29
- router.post('/orders/', this.post.bind(this))
30
- router.post('/orders/:id', this.postWithId.bind(this))
29
+ router.post("/orders/", this.post.bind(this));
30
+ router.post("/orders/:id", this.postWithId.bind(this));
31
31
 
32
- parent.use(`/${basePath}`, router)
32
+ parent.use(`/${basePath}`, router);
33
33
  }
34
34
  }
@@ -1,78 +1,78 @@
1
- import type { MyPaymentDraft } from '@commercetools/platform-sdk'
2
- import supertest from 'supertest'
3
- import { beforeEach, describe, expect, test } from 'vitest'
4
- import { CommercetoolsMock } from '../index.js'
1
+ import type { MyPaymentDraft } from "@commercetools/platform-sdk";
2
+ import supertest from "supertest";
3
+ import { beforeEach, describe, expect, test } from "vitest";
4
+ import { CommercetoolsMock } from "../index";
5
5
 
6
- const ctMock = new CommercetoolsMock()
6
+ const ctMock = new CommercetoolsMock();
7
7
 
8
- describe('MyPayment', () => {
8
+ describe("MyPayment", () => {
9
9
  beforeEach(async () => {
10
10
  const response = await supertest(ctMock.app)
11
- .post('/dummy/types')
11
+ .post("/dummy/types")
12
12
  .send({
13
- key: 'custom-payment',
13
+ key: "custom-payment",
14
14
  name: {
15
- 'nl-NL': 'custom-payment',
15
+ "nl-NL": "custom-payment",
16
16
  },
17
- resourceTypeIds: ['payment'],
18
- })
19
- expect(response.status).toBe(201)
20
- })
17
+ resourceTypeIds: ["payment"],
18
+ });
19
+ expect(response.status).toBe(201);
20
+ });
21
21
 
22
- test('Create payment', async () => {
22
+ test("Create payment", async () => {
23
23
  const draft: MyPaymentDraft = {
24
- amountPlanned: { currencyCode: 'EUR', centAmount: 1337 },
24
+ amountPlanned: { currencyCode: "EUR", centAmount: 1337 },
25
25
  custom: {
26
- type: { typeId: 'type', key: 'custom-payment' },
26
+ type: { typeId: "type", key: "custom-payment" },
27
27
  fields: {
28
- foo: 'bar',
28
+ foo: "bar",
29
29
  },
30
30
  },
31
- }
31
+ };
32
32
  const response = await supertest(ctMock.app)
33
- .post('/dummy/me/payments')
34
- .send(draft)
33
+ .post("/dummy/me/payments")
34
+ .send(draft);
35
35
 
36
- expect(response.status).toBe(201)
36
+ expect(response.status).toBe(201);
37
37
  expect(response.body).toEqual({
38
38
  id: expect.anything(),
39
39
  createdAt: expect.anything(),
40
40
  lastModifiedAt: expect.anything(),
41
41
  version: 1,
42
42
  amountPlanned: {
43
- type: 'centPrecision',
43
+ type: "centPrecision",
44
44
  fractionDigits: 2,
45
- currencyCode: 'EUR',
45
+ currencyCode: "EUR",
46
46
  centAmount: 1337,
47
47
  },
48
48
  paymentStatus: {},
49
49
  transactions: [],
50
50
  interfaceInteractions: [],
51
51
  custom: {
52
- type: { typeId: 'type', id: expect.anything() },
53
- fields: { foo: 'bar' },
52
+ type: { typeId: "type", id: expect.anything() },
53
+ fields: { foo: "bar" },
54
54
  },
55
- })
56
- })
57
- test('Get payment', async () => {
55
+ });
56
+ });
57
+ test("Get payment", async () => {
58
58
  const draft: MyPaymentDraft = {
59
- amountPlanned: { currencyCode: 'EUR', centAmount: 1337 },
59
+ amountPlanned: { currencyCode: "EUR", centAmount: 1337 },
60
60
  custom: {
61
- type: { typeId: 'type', key: 'custom-payment' },
61
+ type: { typeId: "type", key: "custom-payment" },
62
62
  fields: {
63
- foo: 'bar',
63
+ foo: "bar",
64
64
  },
65
65
  },
66
- }
66
+ };
67
67
  const createResponse = await supertest(ctMock.app)
68
- .post('/dummy/me/payments')
69
- .send(draft)
68
+ .post("/dummy/me/payments")
69
+ .send(draft);
70
70
 
71
71
  const response = await supertest(ctMock.app).get(
72
- `/dummy/me/payments/${createResponse.body.id}`
73
- )
72
+ `/dummy/me/payments/${createResponse.body.id}`,
73
+ );
74
74
 
75
- expect(response.status).toBe(200)
76
- expect(response.body).toEqual(createResponse.body)
77
- })
78
- })
75
+ expect(response.status).toBe(200);
76
+ expect(response.body).toEqual(createResponse.body);
77
+ });
78
+ });
@@ -1,16 +1,16 @@
1
- import { Router } from 'express'
2
- import { PaymentRepository } from '../repositories/payment.js'
3
- import AbstractService from './abstract.js'
1
+ import { Router } from "express";
2
+ import { PaymentRepository } from "../repositories/payment";
3
+ import AbstractService from "./abstract";
4
4
 
5
5
  export class MyPaymentService extends AbstractService {
6
- public repository: PaymentRepository
6
+ public repository: PaymentRepository;
7
7
 
8
8
  constructor(parent: Router, repository: PaymentRepository) {
9
- super(parent)
10
- this.repository = repository
9
+ super(parent);
10
+ this.repository = repository;
11
11
  }
12
12
 
13
13
  getBasePath() {
14
- return 'me/payments'
14
+ return "me/payments";
15
15
  }
16
16
  }
@@ -1,16 +1,16 @@
1
- import { Router } from 'express'
2
- import { ShoppingListRepository } from '../repositories/shopping-list.js'
3
- import AbstractService from './abstract.js'
1
+ import { Router } from "express";
2
+ import { ShoppingListRepository } from "../repositories/shopping-list";
3
+ import AbstractService from "./abstract";
4
4
 
5
5
  export class MyShoppingListService extends AbstractService {
6
- public repository: ShoppingListRepository
6
+ public repository: ShoppingListRepository;
7
7
 
8
8
  constructor(parent: Router, repository: ShoppingListRepository) {
9
- super(parent)
10
- this.repository = repository
9
+ super(parent);
10
+ this.repository = repository;
11
11
  }
12
12
 
13
13
  getBasePath() {
14
- return 'me/shopping-lists'
14
+ return "me/shopping-lists";
15
15
  }
16
16
  }