@nomalism-com/types 0.9.497 → 0.9.499
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.
|
@@ -68,7 +68,7 @@ export interface IRepository {
|
|
|
68
68
|
findByOwnerPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
69
69
|
findProductByCabideProductId(selector: IShared.IFindByIdRequest): Promise<Product.IEntityExtended[]>;
|
|
70
70
|
create(data: ICreateRequest): Promise<Entity>;
|
|
71
|
-
update(data: IUpdateRequest): Promise<Entity | null>;
|
|
71
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
72
72
|
createProductByCabideProductId(data: ICreateProductByCabideProductIdRequest): Promise<Product.IEntityExtended>;
|
|
73
73
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
74
74
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import joi from 'joi';
|
|
2
2
|
export declare const createBody: joi.ObjectSchema<any>;
|
|
3
|
+
export declare const updateBody: joi.ObjectSchema<any>;
|
|
3
4
|
export declare const createByProductIdBody: joi.ObjectSchema<any>;
|
|
4
5
|
export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findWithPaginationQuery = exports.createByProductIdBody = exports.createBody = void 0;
|
|
6
|
+
exports.findWithPaginationQuery = exports.createByProductIdBody = exports.updateBody = exports.createBody = void 0;
|
|
7
7
|
var joi_1 = __importDefault(require("joi"));
|
|
8
8
|
var messages_1 = require("../../../shared/messages");
|
|
9
9
|
var createBodyKeys = {
|
|
@@ -18,6 +18,17 @@ var createBodyKeys = {
|
|
|
18
18
|
preco_final_2: joi_1.default.number().positive().required(),
|
|
19
19
|
};
|
|
20
20
|
exports.createBody = joi_1.default.object().keys(createBodyKeys).messages(messages_1.messages);
|
|
21
|
+
var updateBodyKeys = {
|
|
22
|
+
vat_tax_id: joi_1.default.string().uuid().optional(),
|
|
23
|
+
designation: joi_1.default.string().optional(),
|
|
24
|
+
margin: joi_1.default.number().optional(),
|
|
25
|
+
price_cost: joi_1.default.number().optional(),
|
|
26
|
+
price_sale: joi_1.default.number().optional(),
|
|
27
|
+
width: joi_1.default.number().optional(),
|
|
28
|
+
preco_final_1: joi_1.default.number().positive().optional(),
|
|
29
|
+
preco_final_2: joi_1.default.number().positive().optional(),
|
|
30
|
+
};
|
|
31
|
+
exports.updateBody = joi_1.default.object().keys(updateBodyKeys).messages(messages_1.messages);
|
|
21
32
|
var createByProductIdBodyKeys = {
|
|
22
33
|
cabide_product_id: joi_1.default.string().uuid().required(),
|
|
23
34
|
cabide_product_color: joi_1.default.string().required(),
|