@floristcloud/api-lib 1.2.63 → 1.2.64

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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetDeliveryRouteInvoicesContractQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const DeliveryRouteInvoiceFileSchema = zod_1.z.object({
6
+ file_key: zod_1.z.string(),
7
+ name: zod_1.z.string(),
8
+ });
9
+ const GetDeliveryRouteInvoicesResponseSchema = zod_1.z.object({
10
+ message: zod_1.z.string().optional(),
11
+ data: zod_1.z
12
+ .object({
13
+ files: zod_1.z.array(DeliveryRouteInvoiceFileSchema),
14
+ })
15
+ .nullable(),
16
+ });
17
+ var GetDeliveryRouteInvoicesContractQuery;
18
+ (function (GetDeliveryRouteInvoicesContractQuery) {
19
+ GetDeliveryRouteInvoicesContractQuery.ResponseSchema = GetDeliveryRouteInvoicesResponseSchema;
20
+ })(GetDeliveryRouteInvoicesContractQuery || (exports.GetDeliveryRouteInvoicesContractQuery = GetDeliveryRouteInvoicesContractQuery = {}));
@@ -19,5 +19,6 @@ __exportStar(require("./update-delivery-route.command"), exports);
19
19
  __exportStar(require("./delete-delivery-route.command"), exports);
20
20
  __exportStar(require("./get-delivery-route-list.query"), exports);
21
21
  __exportStar(require("./get-delivery-route.query"), exports);
22
+ __exportStar(require("./get-delivery-route-invoices.query"), exports);
22
23
  __exportStar(require("./attach-order-list-to-delivery-route.command"), exports);
23
24
  __exportStar(require("./detach-order-list-to-delivery-route.command"), exports);
@@ -960,6 +960,12 @@ exports.ERRORS = {
960
960
  DELIVERY_ROUTE_NOT_DELETED: { code: 'DLR003', message: 'Failed to delete delivery route', httpCode: 500 },
961
961
  DELIVERY_ROUTE_NOT_UPDATED: { code: 'DLR004', message: 'Failed to update delivery route', httpCode: 500 },
962
962
  DELIVERY_ROUTE_FETCH_FAILED: { code: 'DLR005', message: 'Error when retrieving delivery routes', httpCode: 500 },
963
+ DELIVERY_ROUTE_TOO_MANY_ORDERS: { code: 'DLR006', message: 'Too many orders in the delivery route to export invoices', httpCode: 400 },
964
+ DELIVERY_ROUTE_INVOICE_EXPORT_IN_PROGRESS: {
965
+ code: 'DLR007',
966
+ message: 'Invoice export for this company is already in progress',
967
+ httpCode: 409,
968
+ },
963
969
  FAILED_TO_CREATE: {
964
970
  code: 'FAILED_TO_CREATE',
965
971
  message: 'Failed to create entity',
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setEndDay = exports.setStartDay = exports.isStatementPeriodWithinLimit = exports.STATEMENT_MAX_PERIOD_DAYS = exports.dateRangeCheck = void 0;
4
+ // Allows a single-day range (startDate === endDate); callers expand bounds to start/end-of-day downstream.
4
5
  const dateRangeCheck = (startDate, endDate) => {
5
- return endDate > startDate;
6
+ return endDate >= startDate;
6
7
  };
7
8
  exports.dateRangeCheck = dateRangeCheck;
8
9
  // 1 year + 1 day to tolerate leap years.
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ const DeliveryRouteInvoiceFileSchema = z.object({
4
+ file_key: z.string(),
5
+ name: z.string(),
6
+ });
7
+
8
+ const GetDeliveryRouteInvoicesResponseSchema = z.object({
9
+ message: z.string().optional(),
10
+ data: z
11
+ .object({
12
+ files: z.array(DeliveryRouteInvoiceFileSchema),
13
+ })
14
+ .nullable(),
15
+ });
16
+
17
+ export namespace GetDeliveryRouteInvoicesContractQuery {
18
+ export const ResponseSchema = GetDeliveryRouteInvoicesResponseSchema;
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -3,5 +3,6 @@ export * from './update-delivery-route.command';
3
3
  export * from './delete-delivery-route.command';
4
4
  export * from './get-delivery-route-list.query';
5
5
  export * from './get-delivery-route.query';
6
+ export * from './get-delivery-route-invoices.query';
6
7
  export * from './attach-order-list-to-delivery-route.command';
7
8
  export * from './detach-order-list-to-delivery-route.command';
package/constant/error.ts CHANGED
@@ -1008,6 +1008,12 @@ export const ERRORS = {
1008
1008
  DELIVERY_ROUTE_NOT_DELETED: { code: 'DLR003', message: 'Failed to delete delivery route', httpCode: 500 },
1009
1009
  DELIVERY_ROUTE_NOT_UPDATED: { code: 'DLR004', message: 'Failed to update delivery route', httpCode: 500 },
1010
1010
  DELIVERY_ROUTE_FETCH_FAILED: { code: 'DLR005', message: 'Error when retrieving delivery routes', httpCode: 500 },
1011
+ DELIVERY_ROUTE_TOO_MANY_ORDERS: { code: 'DLR006', message: 'Too many orders in the delivery route to export invoices', httpCode: 400 },
1012
+ DELIVERY_ROUTE_INVOICE_EXPORT_IN_PROGRESS: {
1013
+ code: 'DLR007',
1014
+ message: 'Invoice export for this company is already in progress',
1015
+ httpCode: 409,
1016
+ },
1011
1017
 
1012
1018
  FAILED_TO_CREATE: {
1013
1019
  code: 'FAILED_TO_CREATE',
@@ -1,5 +1,6 @@
1
+ // Allows a single-day range (startDate === endDate); callers expand bounds to start/end-of-day downstream.
1
2
  export const dateRangeCheck = (startDate: Date, endDate: Date) => {
2
- return endDate > startDate;
3
+ return endDate >= startDate;
3
4
  };
4
5
 
5
6
  // 1 year + 1 day to tolerate leap years.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.63",
3
+ "version": "1.2.64",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {