@forklaunch/implementation-billing-base 0.8.10 → 0.8.11

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.
@@ -172,19 +172,13 @@ export class BasePaymentLinkService<
172
172
  }
173
173
  const cacheKey = this.createCacheKey(id);
174
174
  const paymentLink =
175
- await this.cache.readRecord<MapperEntities['PaymentLinkMapper']>(
176
- cacheKey
177
- );
175
+ await this.cache.readRecord<MapperDomains['PaymentLinkMapper']>(cacheKey);
178
176
  if (!paymentLink) {
179
177
  throw new Error('Payment link not found');
180
178
  }
181
179
 
182
- return this.mappers.PaymentLinkMapper.toDto(
183
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
184
- paymentLink.value,
185
- this.em
186
- )
187
- );
180
+ // Return cached DTO directly - no need to convert to entity and back
181
+ return paymentLink.value;
188
182
  }
189
183
 
190
184
  async expirePaymentLink({ id }: IdDto): Promise<void> {
@@ -232,18 +226,12 @@ export class BasePaymentLinkService<
232
226
  ? idsDto?.ids.map((id) => this.createCacheKey(id))
233
227
  : await this.cache.listKeys(this.cacheKeyPrefix);
234
228
 
235
- console.log('keys', keys);
229
+ // Read cached DTOs directly - no need to convert to entity and back
236
230
  return Promise.all(
237
231
  keys.map(async (key) => {
238
232
  const paymentLink =
239
- await this.cache.readRecord<MapperEntities['PaymentLinkMapper']>(key);
240
- const paymentLinkDto = this.mappers.PaymentLinkMapper.toDto(
241
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
242
- paymentLink.value,
243
- this.em
244
- )
245
- );
246
- return paymentLinkDto;
233
+ await this.cache.readRecord<MapperDomains['PaymentLinkMapper']>(key);
234
+ return paymentLink.value;
247
235
  })
248
236
  );
249
237
  }
@@ -331,18 +331,11 @@ var BasePaymentLinkService = class {
331
331
  this.openTelemetryCollector.info("Getting payment link", { id });
332
332
  }
333
333
  const cacheKey = this.createCacheKey(id);
334
- const paymentLink = await this.cache.readRecord(
335
- cacheKey
336
- );
334
+ const paymentLink = await this.cache.readRecord(cacheKey);
337
335
  if (!paymentLink) {
338
336
  throw new Error("Payment link not found");
339
337
  }
340
- return this.mappers.PaymentLinkMapper.toDto(
341
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
342
- paymentLink.value,
343
- this.em
344
- )
345
- );
338
+ return paymentLink.value;
346
339
  }
347
340
  async expirePaymentLink({ id }) {
348
341
  this.openTelemetryCollector.info("Payment link expired", { id });
@@ -379,17 +372,10 @@ var BasePaymentLinkService = class {
379
372
  }
380
373
  async listPaymentLinks(idsDto) {
381
374
  const keys = idsDto?.ids && idsDto.ids.length > 0 ? idsDto?.ids.map((id) => this.createCacheKey(id)) : await this.cache.listKeys(this.cacheKeyPrefix);
382
- console.log("keys", keys);
383
375
  return Promise.all(
384
376
  keys.map(async (key) => {
385
377
  const paymentLink = await this.cache.readRecord(key);
386
- const paymentLinkDto = this.mappers.PaymentLinkMapper.toDto(
387
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
388
- paymentLink.value,
389
- this.em
390
- )
391
- );
392
- return paymentLinkDto;
378
+ return paymentLink.value;
393
379
  })
394
380
  );
395
381
  }
@@ -306,18 +306,11 @@ var BasePaymentLinkService = class {
306
306
  this.openTelemetryCollector.info("Getting payment link", { id });
307
307
  }
308
308
  const cacheKey = this.createCacheKey(id);
309
- const paymentLink = await this.cache.readRecord(
310
- cacheKey
311
- );
309
+ const paymentLink = await this.cache.readRecord(cacheKey);
312
310
  if (!paymentLink) {
313
311
  throw new Error("Payment link not found");
314
312
  }
315
- return this.mappers.PaymentLinkMapper.toDto(
316
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
317
- paymentLink.value,
318
- this.em
319
- )
320
- );
313
+ return paymentLink.value;
321
314
  }
322
315
  async expirePaymentLink({ id }) {
323
316
  this.openTelemetryCollector.info("Payment link expired", { id });
@@ -354,17 +347,10 @@ var BasePaymentLinkService = class {
354
347
  }
355
348
  async listPaymentLinks(idsDto) {
356
349
  const keys = idsDto?.ids && idsDto.ids.length > 0 ? idsDto?.ids.map((id) => this.createCacheKey(id)) : await this.cache.listKeys(this.cacheKeyPrefix);
357
- console.log("keys", keys);
358
350
  return Promise.all(
359
351
  keys.map(async (key) => {
360
352
  const paymentLink = await this.cache.readRecord(key);
361
- const paymentLinkDto = this.mappers.PaymentLinkMapper.toDto(
362
- await this.mappers.UpdatePaymentLinkMapper.toEntity(
363
- paymentLink.value,
364
- this.em
365
- )
366
- );
367
- return paymentLinkDto;
353
+ return paymentLink.value;
368
354
  })
369
355
  );
370
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/implementation-billing-base",
3
- "version": "0.8.10",
3
+ "version": "0.8.11",
4
4
  "description": "Billing basic implementation for forklaunch",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -36,18 +36,18 @@
36
36
  "lib/**"
37
37
  ],
38
38
  "dependencies": {
39
- "@forklaunch/common": "^0.6.27",
40
- "@forklaunch/core": "^0.17.3",
41
- "@forklaunch/internal": "^0.3.27",
42
- "@forklaunch/validator": "^0.10.27",
43
- "@mikro-orm/core": "^6.6.5",
44
- "@sinclair/typebox": "^0.34.47",
39
+ "@forklaunch/common": "^0.6.28",
40
+ "@forklaunch/core": "^0.18.1",
41
+ "@forklaunch/internal": "^0.3.28",
42
+ "@forklaunch/validator": "^0.10.28",
43
+ "@mikro-orm/core": "^6.6.6",
44
+ "@sinclair/typebox": "^0.34.48",
45
45
  "ajv": "^8.17.1",
46
46
  "zod": "^4.3.6",
47
- "@forklaunch/interfaces-billing": "0.8.10"
47
+ "@forklaunch/interfaces-billing": "0.8.11"
48
48
  },
49
49
  "devDependencies": {
50
- "@typescript/native-preview": "7.0.0-dev.20260122.4",
50
+ "@typescript/native-preview": "7.0.0-dev.20260204.1",
51
51
  "depcheck": "^1.4.7",
52
52
  "prettier": "^3.8.1",
53
53
  "typedoc": "^0.28.16"