@nomalism-com/types 0.10.25 → 0.10.27
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.
|
@@ -35,6 +35,14 @@ export interface IEntityExtended extends IFindDetailedResponse {
|
|
|
35
35
|
cabide: Cabide;
|
|
36
36
|
}) | null;
|
|
37
37
|
}
|
|
38
|
+
export interface IEntityMinified {
|
|
39
|
+
id: string;
|
|
40
|
+
price_sale: number;
|
|
41
|
+
price_cost: number;
|
|
42
|
+
tax: number;
|
|
43
|
+
multimedia_id: string;
|
|
44
|
+
integer_only: boolean;
|
|
45
|
+
}
|
|
38
46
|
export type IFindByIdResponse = Omit<IEntityExtended, ''>;
|
|
39
47
|
export type IFindRequest = Record<string, unknown>;
|
|
40
48
|
export type IFindResponse = Omit<IFindDetailedResponse, ''>;
|
|
@@ -144,6 +152,9 @@ export interface IFindByReferenceRequest {
|
|
|
144
152
|
available?: boolean;
|
|
145
153
|
type?: IProductType;
|
|
146
154
|
}
|
|
155
|
+
export interface IValidateByReferenceRequest extends IFindByReferenceRequest {
|
|
156
|
+
billing_country_id?: string;
|
|
157
|
+
}
|
|
147
158
|
export interface ILabelResponse {
|
|
148
159
|
product_parts: {
|
|
149
160
|
compositions: {
|
|
@@ -206,6 +217,7 @@ export interface IRepository {
|
|
|
206
217
|
findByPlot(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
|
|
207
218
|
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
208
219
|
findByRef(selector: IFindByReferenceRequest): Promise<IEntityExtended | null>;
|
|
220
|
+
validateByRef(selector: IValidateByReferenceRequest): Promise<IEntityMinified | null>;
|
|
209
221
|
findByProductType(params: IFindByProductTypeRequest): Promise<IFindByProductTypeResponse[]>;
|
|
210
222
|
findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
|
|
211
223
|
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(),
|