@nomalism-com/types 0.16.33 → 0.16.34
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.
|
@@ -27,12 +27,20 @@ export interface ICheckLinesInPrisonLinesRequest {
|
|
|
27
27
|
export interface ICheckLinesInPrisonRequest {
|
|
28
28
|
lines: ICheckLinesInPrisonLinesRequest[];
|
|
29
29
|
}
|
|
30
|
+
export interface ICreateLinesInPrisonProduct {
|
|
31
|
+
product_id: string;
|
|
32
|
+
quantity: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ICreateLinesInPrisonRequest {
|
|
35
|
+
products: ICreateLinesInPrisonProduct[];
|
|
36
|
+
}
|
|
30
37
|
export interface IRepository {
|
|
31
38
|
findLinesInPrison(): Promise<IFindLinesInPrisonResponse[]>;
|
|
32
39
|
findLinesInPrisonProviders(): Promise<IShared.IFindMinifiedResponse[]>;
|
|
33
40
|
putLineInPrison(params: IShared.IFindByIdRequest): Promise<void>;
|
|
34
41
|
removeLineFromPrison(params: IShared.IFindByIdRequest): Promise<void>;
|
|
35
42
|
checkLinesInPrison(params: ICheckLinesInPrisonRequest): Promise<IShared.IBrokerMessage<IShared.IBrokerTopic>[]>;
|
|
43
|
+
createLinesInPrison(params: ICreateLinesInPrisonRequest): Promise<string>;
|
|
36
44
|
}
|
|
37
45
|
export type IApi = Omit<IRepository, 'checkLinesInPrison'> & {
|
|
38
46
|
checkLinesInPrison(params: ICheckLinesInPrisonRequest): Promise<void>;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.checkLinesInPrisonBody = void 0;
|
|
7
|
+
exports.createLinesInPrisonBody = exports.checkLinesInPrisonBody = void 0;
|
|
8
8
|
var joi_1 = __importDefault(require("joi"));
|
|
9
9
|
var messages_1 = require("../../../shared/messages");
|
|
10
10
|
var interface_1 = require("./interface");
|
|
@@ -25,3 +25,18 @@ exports.checkLinesInPrisonBody = joi_1.default
|
|
|
25
25
|
.object()
|
|
26
26
|
.keys(checkLinesInPrisonBodyKeys)
|
|
27
27
|
.messages(messages_1.messages);
|
|
28
|
+
exports.createLinesInPrisonBody = joi_1.default
|
|
29
|
+
.object()
|
|
30
|
+
.keys({
|
|
31
|
+
products: joi_1.default
|
|
32
|
+
.array()
|
|
33
|
+
.items(joi_1.default
|
|
34
|
+
.object()
|
|
35
|
+
.keys({
|
|
36
|
+
product_id: joi_1.default.string().uuid().required(),
|
|
37
|
+
quantity: joi_1.default.number().positive().allow(0).required(),
|
|
38
|
+
})
|
|
39
|
+
.required())
|
|
40
|
+
.required(),
|
|
41
|
+
})
|
|
42
|
+
.required();
|