@nomalism-com/types 0.9.550 → 0.9.551

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.
@@ -197,6 +197,10 @@ export interface IFindByProductTypeResponse {
197
197
  reference: string;
198
198
  price: number;
199
199
  }
200
+ export interface IDuplicateProductRequest {
201
+ product_id: string;
202
+ color_id: string[];
203
+ }
200
204
  export interface IRepository {
201
205
  findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
202
206
  findByPlot(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
@@ -213,6 +217,7 @@ export interface IRepository {
213
217
  create(data: ICreateRequest): Promise<IFindResponse>;
214
218
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<IFindResponse | null>;
215
219
  deleteOne(selector: IShared.IFindByIdRequest): Promise<IFindResponse | null>;
220
+ duplicateProduct(params: IDuplicateProductRequest): Promise<IFindResponse>;
216
221
  }
217
222
  export type IApi = Omit<IRepository, 'getLabelData'>;
218
223
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -9,3 +9,4 @@ export declare const findByRef: joi.ObjectSchema<any>;
9
9
  export declare const findOrCreateProductionProductBody: joi.ObjectSchema<any>;
10
10
  export declare const findByProductTypeParams: joi.ObjectSchema<any>;
11
11
  export declare const printLabelQuery: joi.ObjectSchema<any>;
12
+ export declare const duplicateProductParams: joi.ObjectSchema<any>;
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  var _a, _b, _c, _d;
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.printLabelQuery = exports.findByProductTypeParams = exports.findOrCreateProductionProductBody = exports.findByRef = exports.basicSearchQuery = exports.findWithPaginationQuery = exports.findQuery = exports.bulkUpdateBody = exports.updateBody = exports.createBody = void 0;
18
+ exports.duplicateProductParams = exports.printLabelQuery = exports.findByProductTypeParams = exports.findOrCreateProductionProductBody = exports.findByRef = exports.basicSearchQuery = exports.findWithPaginationQuery = exports.findQuery = exports.bulkUpdateBody = exports.updateBody = exports.createBody = void 0;
19
19
  var joi_1 = __importDefault(require("joi"));
20
20
  var messages_1 = require("../../../shared/messages");
21
21
  var interface_1 = require("./interface");
@@ -146,3 +146,11 @@ exports.printLabelQuery = joi_1.default
146
146
  .object()
147
147
  .keys(printLabelQueryKeys)
148
148
  .messages(messages_1.messages);
149
+ var duplicateProductParamsKeys = {
150
+ product_id: joi_1.default.string().uuid().required(),
151
+ color_id: joi_1.default.array().items(joi_1.default.string().uuid().required()).required(),
152
+ };
153
+ exports.duplicateProductParams = joi_1.default
154
+ .object()
155
+ .keys(duplicateProductParamsKeys)
156
+ .messages(messages_1.messages);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.9.550",
12
+ "version": "0.9.551",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [