@floristcloud/api-lib 1.2.62 → 1.2.63

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.
@@ -451,6 +451,11 @@ exports.ERRORS = {
451
451
  message: 'Another bulk-move operation on this pair of orders is in progress, retry later',
452
452
  httpCode: 409,
453
453
  },
454
+ ORDER_PRODUCT_CONSIGNMENT_DRAFT: {
455
+ code: 'OP021',
456
+ message: 'Product consignment is in draft and not available for orders',
457
+ httpCode: 409,
458
+ },
454
459
  //TRANSACTION
455
460
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
456
461
  TRANSACTION_FETCH_FAILED: { code: 'TR002', message: 'Error when retrieving a transaction', httpCode: 500 },
@@ -1135,13 +1140,37 @@ exports.ERRORS = {
1135
1140
  CONSIGNMENT_TRANSFER_NOT_FOUND: { code: 'CTR002', message: 'Consignment transfer request not found', httpCode: 404 },
1136
1141
  CONSIGNMENT_TRANSFER_FETCH_FAILED: { code: 'CTR003', message: 'Failed to fetch consignment transfer requests', httpCode: 500 },
1137
1142
  CONSIGNMENT_TRANSFER_RECEIVER_NOT_FOUND: { code: 'CTR004', message: 'Receiver company not found or inactive', httpCode: 404 },
1138
- CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: { code: 'CTR005', message: 'Cannot transfer a consignment to your own company', httpCode: 400 },
1139
- CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: { code: 'CTR006', message: 'Transfer position not found in the source consignment', httpCode: 404 },
1140
- CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: { code: 'CTR007', message: 'Requested quantity exceeds the available product balance', httpCode: 400 },
1143
+ CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: {
1144
+ code: 'CTR005',
1145
+ message: 'Cannot transfer a consignment to your own company',
1146
+ httpCode: 400,
1147
+ },
1148
+ CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: {
1149
+ code: 'CTR006',
1150
+ message: 'Transfer position not found in the source consignment',
1151
+ httpCode: 404,
1152
+ },
1153
+ CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: {
1154
+ code: 'CTR007',
1155
+ message: 'Requested quantity exceeds the available product balance',
1156
+ httpCode: 400,
1157
+ },
1141
1158
  CONSIGNMENT_TRANSFER_NOT_PENDING: { code: 'CTR008', message: 'Consignment transfer request is not pending', httpCode: 409 },
1142
1159
  CONSIGNMENT_TRANSFER_NOT_UPDATED: { code: 'CTR009', message: 'Failed to update consignment transfer request', httpCode: 500 },
1143
- CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: { code: 'CTR010', message: 'Accept payload must map every transfer position exactly once', httpCode: 400 },
1144
- CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: { code: 'CTR011', message: 'Mapped category not found in the receiver company', httpCode: 404 },
1145
- CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: { code: 'CTR012', message: 'Target consignment not found in the receiver company', httpCode: 404 },
1160
+ CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: {
1161
+ code: 'CTR010',
1162
+ message: 'Accept payload must map every transfer position exactly once',
1163
+ httpCode: 400,
1164
+ },
1165
+ CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: {
1166
+ code: 'CTR011',
1167
+ message: 'Mapped category not found in the receiver company',
1168
+ httpCode: 404,
1169
+ },
1170
+ CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: {
1171
+ code: 'CTR012',
1172
+ message: 'Target consignment not found in the receiver company',
1173
+ httpCode: 404,
1174
+ },
1146
1175
  CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
1147
1176
  };
@@ -6,4 +6,5 @@ var ConsignmentStatusEnum;
6
6
  ConsignmentStatusEnum["ACTIVE"] = "ACTIVE";
7
7
  ConsignmentStatusEnum["AVAILABLE"] = "AVAILABLE";
8
8
  ConsignmentStatusEnum["LIMITED"] = "LIMITED";
9
+ ConsignmentStatusEnum["DRAFT"] = "DRAFT";
9
10
  })(ConsignmentStatusEnum || (exports.ConsignmentStatusEnum = ConsignmentStatusEnum = {}));
package/constant/error.ts CHANGED
@@ -467,6 +467,11 @@ export const ERRORS = {
467
467
  message: 'Another bulk-move operation on this pair of orders is in progress, retry later',
468
468
  httpCode: 409,
469
469
  },
470
+ ORDER_PRODUCT_CONSIGNMENT_DRAFT: {
471
+ code: 'OP021',
472
+ message: 'Product consignment is in draft and not available for orders',
473
+ httpCode: 409,
474
+ },
470
475
 
471
476
  //TRANSACTION
472
477
  TRANSACTION_NOT_CREATED: { code: 'TR001', message: 'Failed to transaction product', httpCode: 500 },
@@ -1198,13 +1203,37 @@ export const ERRORS = {
1198
1203
  CONSIGNMENT_TRANSFER_NOT_FOUND: { code: 'CTR002', message: 'Consignment transfer request not found', httpCode: 404 },
1199
1204
  CONSIGNMENT_TRANSFER_FETCH_FAILED: { code: 'CTR003', message: 'Failed to fetch consignment transfer requests', httpCode: 500 },
1200
1205
  CONSIGNMENT_TRANSFER_RECEIVER_NOT_FOUND: { code: 'CTR004', message: 'Receiver company not found or inactive', httpCode: 404 },
1201
- CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: { code: 'CTR005', message: 'Cannot transfer a consignment to your own company', httpCode: 400 },
1202
- CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: { code: 'CTR006', message: 'Transfer position not found in the source consignment', httpCode: 404 },
1203
- CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: { code: 'CTR007', message: 'Requested quantity exceeds the available product balance', httpCode: 400 },
1206
+ CONSIGNMENT_TRANSFER_RECEIVER_IS_SENDER: {
1207
+ code: 'CTR005',
1208
+ message: 'Cannot transfer a consignment to your own company',
1209
+ httpCode: 400,
1210
+ },
1211
+ CONSIGNMENT_TRANSFER_PRODUCT_NOT_FOUND: {
1212
+ code: 'CTR006',
1213
+ message: 'Transfer position not found in the source consignment',
1214
+ httpCode: 404,
1215
+ },
1216
+ CONSIGNMENT_TRANSFER_QUANTITY_EXCEEDS_BALANCE: {
1217
+ code: 'CTR007',
1218
+ message: 'Requested quantity exceeds the available product balance',
1219
+ httpCode: 400,
1220
+ },
1204
1221
  CONSIGNMENT_TRANSFER_NOT_PENDING: { code: 'CTR008', message: 'Consignment transfer request is not pending', httpCode: 409 },
1205
1222
  CONSIGNMENT_TRANSFER_NOT_UPDATED: { code: 'CTR009', message: 'Failed to update consignment transfer request', httpCode: 500 },
1206
- CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: { code: 'CTR010', message: 'Accept payload must map every transfer position exactly once', httpCode: 400 },
1207
- CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: { code: 'CTR011', message: 'Mapped category not found in the receiver company', httpCode: 404 },
1208
- CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: { code: 'CTR012', message: 'Target consignment not found in the receiver company', httpCode: 404 },
1223
+ CONSIGNMENT_TRANSFER_ITEMS_MISMATCH: {
1224
+ code: 'CTR010',
1225
+ message: 'Accept payload must map every transfer position exactly once',
1226
+ httpCode: 400,
1227
+ },
1228
+ CONSIGNMENT_TRANSFER_CATEGORY_NOT_FOUND: {
1229
+ code: 'CTR011',
1230
+ message: 'Mapped category not found in the receiver company',
1231
+ httpCode: 404,
1232
+ },
1233
+ CONSIGNMENT_TRANSFER_TARGET_CONSIGNMENT_NOT_FOUND: {
1234
+ code: 'CTR012',
1235
+ message: 'Target consignment not found in the receiver company',
1236
+ httpCode: 404,
1237
+ },
1209
1238
  CONSIGNMENT_TRANSFER_ACCEPT_FAILED: { code: 'CTR013', message: 'Failed to accept consignment transfer request', httpCode: 500 },
1210
1239
  } as const;
@@ -2,4 +2,5 @@ export enum ConsignmentStatusEnum {
2
2
  ACTIVE = 'ACTIVE',
3
3
  AVAILABLE = 'AVAILABLE',
4
4
  LIMITED = 'LIMITED',
5
+ DRAFT = 'DRAFT',
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.62",
3
+ "version": "1.2.63",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {