@floristcloud/api-lib 1.0.10 → 1.0.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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplyPrepaymentTransactionContractCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const ApplyPrepaymentTransactionRequestSchema = zod_1.z.object({
7
+ orderUUID: zod_1.z.string().uuid().optional(),
8
+ });
9
+ const ApplyPrepaymentTransactionResponseSchema = zod_1.z.object({
10
+ message: zod_1.z.string().optional(),
11
+ data: schemas_1.TransactionSchema.nullable(),
12
+ });
13
+ var ApplyPrepaymentTransactionContractCommand;
14
+ (function (ApplyPrepaymentTransactionContractCommand) {
15
+ ApplyPrepaymentTransactionContractCommand.RequestSchema = ApplyPrepaymentTransactionRequestSchema;
16
+ ApplyPrepaymentTransactionContractCommand.ResponseSchema = ApplyPrepaymentTransactionResponseSchema;
17
+ })(ApplyPrepaymentTransactionContractCommand || (exports.ApplyPrepaymentTransactionContractCommand = ApplyPrepaymentTransactionContractCommand = {}));
@@ -25,3 +25,4 @@ __exportStar(require("./generate-check-transaction.command"), exports);
25
25
  __exportStar(require("./update-transaction.command"), exports);
26
26
  __exportStar(require("./get-transaction-summary.query"), exports);
27
27
  __exportStar(require("./generate-pre-payment-check.command"), exports);
28
+ __exportStar(require("./apply-prepayment-transaction.command"), exports);
@@ -375,6 +375,7 @@ exports.ERRORS = {
375
375
  TRANSACTION_COUNT_BY_CRITERIA_FAILED: { code: 'TR008', message: 'Failed to count transactions by criteria', httpCode: 500 },
376
376
  TRANSACTION_FETCH_SUM_FAILED: { code: 'TR009', message: 'Failed get sum transaction', httpCode: 500 },
377
377
  TRANSACTION_AMOUNT_NEGATIVE: { code: 'TR010', message: 'Transaction amount is negative', httpCode: 400 },
378
+ TRANSACTION_NOT_APPLIED: { code: 'TR011', message: 'Transaction not applied', httpCode: 500 },
378
379
  // BANK PAYMENT
379
380
  BANK_EVENT_NOT_FOUND: { code: 'BP001', message: 'Bank payment event not found', httpCode: 404 },
380
381
  BANK_EVENT_LIST_FAILED: { code: 'BP002', message: 'Error when retrieving bank payment events list', httpCode: 500 },
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { TransactionSchema } from '../../schemas';
3
+
4
+ const ApplyPrepaymentTransactionRequestSchema = z.object({
5
+ orderUUID: z.string().uuid().optional(),
6
+ });
7
+
8
+ const ApplyPrepaymentTransactionResponseSchema = z.object({
9
+ message: z.string().optional(),
10
+ data: TransactionSchema.nullable(),
11
+ });
12
+
13
+ export namespace ApplyPrepaymentTransactionContractCommand {
14
+ export const RequestSchema = ApplyPrepaymentTransactionRequestSchema;
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const ResponseSchema = ApplyPrepaymentTransactionResponseSchema;
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -9,3 +9,4 @@ export * from './generate-check-transaction.command';
9
9
  export * from './update-transaction.command';
10
10
  export * from './get-transaction-summary.query';
11
11
  export * from './generate-pre-payment-check.command';
12
+ export * from './apply-prepayment-transaction.command';
package/constant/error.ts CHANGED
@@ -392,6 +392,7 @@ export const ERRORS = {
392
392
  TRANSACTION_COUNT_BY_CRITERIA_FAILED: { code: 'TR008', message: 'Failed to count transactions by criteria', httpCode: 500 },
393
393
  TRANSACTION_FETCH_SUM_FAILED: { code: 'TR009', message: 'Failed get sum transaction', httpCode: 500 },
394
394
  TRANSACTION_AMOUNT_NEGATIVE: { code: 'TR010', message: 'Transaction amount is negative', httpCode: 400 },
395
+ TRANSACTION_NOT_APPLIED: { code: 'TR011', message: 'Transaction not applied', httpCode: 500 },
395
396
  // BANK PAYMENT
396
397
  BANK_EVENT_NOT_FOUND: { code: 'BP001', message: 'Bank payment event not found', httpCode: 404 },
397
398
  BANK_EVENT_LIST_FAILED: { code: 'BP002', message: 'Error when retrieving bank payment events list', httpCode: 500 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {