@nomalism-com/types 0.10.26 → 0.10.28
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.
|
@@ -37,6 +37,7 @@ export interface IEntityExtended extends IFindDetailedResponse {
|
|
|
37
37
|
}
|
|
38
38
|
export interface IEntityMinified {
|
|
39
39
|
id: string;
|
|
40
|
+
id_provider: string;
|
|
40
41
|
price_sale: number;
|
|
41
42
|
price_cost: number;
|
|
42
43
|
tax: number;
|
|
@@ -152,6 +153,9 @@ export interface IFindByReferenceRequest {
|
|
|
152
153
|
available?: boolean;
|
|
153
154
|
type?: IProductType;
|
|
154
155
|
}
|
|
156
|
+
export interface IValidateByReferenceRequest extends IFindByReferenceRequest {
|
|
157
|
+
billing_country_id?: string;
|
|
158
|
+
}
|
|
155
159
|
export interface ILabelResponse {
|
|
156
160
|
product_parts: {
|
|
157
161
|
compositions: {
|
|
@@ -214,7 +218,7 @@ export interface IRepository {
|
|
|
214
218
|
findByPlot(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
|
|
215
219
|
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
216
220
|
findByRef(selector: IFindByReferenceRequest): Promise<IEntityExtended | null>;
|
|
217
|
-
validateByRef(selector:
|
|
221
|
+
validateByRef(selector: IValidateByReferenceRequest): Promise<IEntityMinified | null>;
|
|
218
222
|
findByProductType(params: IFindByProductTypeRequest): Promise<IFindByProductTypeResponse[]>;
|
|
219
223
|
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
220
224
|
find(selector: IFindRequest): Promise<IFindResponse[]>;
|
|
@@ -6,6 +6,7 @@ export declare const findQuery: joi.ObjectSchema<any>;
|
|
|
6
6
|
export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
|
|
7
7
|
export declare const basicSearchQuery: joi.ObjectSchema<any>;
|
|
8
8
|
export declare const findByRef: joi.ObjectSchema<any>;
|
|
9
|
+
export declare const validateByRef: joi.ObjectSchema<any>;
|
|
9
10
|
export declare const findOrCreateProductionProductBody: joi.ObjectSchema<any>;
|
|
10
11
|
export declare const findByProductTypeParams: joi.ObjectSchema<any>;
|
|
11
12
|
export declare const printLabelQuery: 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.duplicateProductBody = exports.printLabelQuery = exports.findByProductTypeParams = exports.findOrCreateProductionProductBody = exports.findByRef = exports.basicSearchQuery = exports.findWithPaginationQuery = exports.findQuery = exports.bulkUpdateBody = exports.updateBody = exports.createBody = void 0;
|
|
18
|
+
exports.duplicateProductBody = exports.printLabelQuery = exports.findByProductTypeParams = exports.findOrCreateProductionProductBody = exports.validateByRef = 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");
|
|
@@ -115,6 +115,11 @@ var findByRefKeys = {
|
|
|
115
115
|
.valid.apply(_c, interface_1.productTypes).optional(),
|
|
116
116
|
};
|
|
117
117
|
exports.findByRef = joi_1.default.object().keys(findByRefKeys).messages(messages_1.messages);
|
|
118
|
+
var validateByRefKeys = __assign(__assign({}, findByRefKeys), { billing_country_id: joi_1.default.string().uuid().optional() });
|
|
119
|
+
exports.validateByRef = joi_1.default
|
|
120
|
+
.object()
|
|
121
|
+
.keys(validateByRefKeys)
|
|
122
|
+
.messages(messages_1.messages);
|
|
118
123
|
var findOrCreateProductionProductKeys = {
|
|
119
124
|
name: joi_1.default.string().required(),
|
|
120
125
|
type: joi_1.default.string().required(),
|