@nomalism-com/types 0.17.1 → 0.17.2
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.
- package/dist/modules/document/purchase/interfaces.d.ts +4 -3
- package/dist/modules/document/quebra/interfaces.d.ts +2 -1
- package/dist/modules/document/quebra/route.schema.js +2 -34
- package/dist/modules/supply/documentLineNote/interfaces.d.ts +27 -0
- package/dist/modules/supply/documentLineNote/interfaces.js +12 -0
- package/dist/modules/supply/documentLineNote/route.schema.d.ts +6 -0
- package/dist/modules/supply/documentLineNote/route.schema.js +22 -0
- package/dist/shared/entities/index.d.ts +1 -0
- package/dist/shared/entities/stock.d.ts +18 -8
- package/dist/shared/interface.d.ts +0 -13
- package/dist/shared/interface.js +1 -7
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
+
import { DocumentLineNote } from '../../../shared/entities';
|
|
2
3
|
export declare const Route = "purchase";
|
|
3
4
|
export declare const UpperName = "Purchase";
|
|
4
5
|
export declare const LowerName: string;
|
|
5
6
|
export type IUnpaidMaterialEntranceLineType = 'Por comprar' | 'Comprado' | 'Devolvido' | 'Prisão';
|
|
6
7
|
export interface IUnpaidMaterialEntranceLineDetails {
|
|
7
8
|
quantity: number;
|
|
8
|
-
notes:
|
|
9
|
-
|
|
10
|
-
pc_link: string;
|
|
9
|
+
notes: Omit<DocumentLineNote, 'id' | 'document_line_id'>[];
|
|
10
|
+
pc_name: string | null;
|
|
11
|
+
pc_link: string | null;
|
|
11
12
|
}
|
|
12
13
|
export interface IUnpaidMaterialEntranceLineResponse {
|
|
13
14
|
group: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
+
import * as IDocumentLineNote from '../../supply/documentLineNote/interfaces';
|
|
2
3
|
export declare const Route = "quebra";
|
|
3
4
|
export declare const UpperName = "Quebra";
|
|
4
5
|
export declare const LowerName: string;
|
|
@@ -18,7 +19,7 @@ export interface IInventoryLossResponse {
|
|
|
18
19
|
export interface ICreateManyProducts {
|
|
19
20
|
id: string;
|
|
20
21
|
quantity: number;
|
|
21
|
-
note?:
|
|
22
|
+
note?: IDocumentLineNote.ICreateRequest;
|
|
22
23
|
}
|
|
23
24
|
export interface ICreateManyRequest {
|
|
24
25
|
products: ICreateManyProducts[];
|
|
@@ -1,48 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
|
-
var _a;
|
|
29
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
6
|
exports.createQuebraBody = void 0;
|
|
31
7
|
var joi_1 = __importDefault(require("joi"));
|
|
32
|
-
var IShared = __importStar(require("../../../shared/interface"));
|
|
33
8
|
var messages_1 = require("../../../shared/messages");
|
|
34
|
-
var
|
|
35
|
-
type: (_a = joi_1.default
|
|
36
|
-
.string())
|
|
37
|
-
.valid.apply(_a, IShared.documentLineNoteType).required(),
|
|
38
|
-
note: joi_1.default.string().required(),
|
|
39
|
-
id: joi_1.default.string().uuid().required(),
|
|
40
|
-
document_line_id: joi_1.default.string().uuid().required(),
|
|
41
|
-
};
|
|
9
|
+
var route_schema_1 = require("../../supply/documentLineNote/route.schema");
|
|
42
10
|
var productsCreateQuebraKeys = {
|
|
43
11
|
id: joi_1.default.string().uuid().required(),
|
|
44
12
|
quantity: joi_1.default.number().positive().required(),
|
|
45
|
-
note: joi_1.default.object().keys(
|
|
13
|
+
note: joi_1.default.object().keys(route_schema_1.createBodyKeys).optional(),
|
|
46
14
|
};
|
|
47
15
|
var createQuebraKeys = {
|
|
48
16
|
products: joi_1.default
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as IShared from '../../../shared/interface';
|
|
2
|
+
import { DocumentLineNote } from '../../../shared/entities';
|
|
3
|
+
export declare const IDocumentLineNoteTypeEnum: {
|
|
4
|
+
Prisao: 'Prisao';
|
|
5
|
+
Quebra: 'Quebra';
|
|
6
|
+
Entrada: 'Entrada';
|
|
7
|
+
};
|
|
8
|
+
export type IDocumentLineNoteType = (typeof IDocumentLineNoteTypeEnum)[keyof typeof IDocumentLineNoteTypeEnum];
|
|
9
|
+
export declare const documentLineNoteTypes: string[];
|
|
10
|
+
export type Entity = DocumentLineNote;
|
|
11
|
+
export declare const Route = "documentLineNote";
|
|
12
|
+
export declare const UpperName = "DocumentLineNote";
|
|
13
|
+
export declare const LowerName: string;
|
|
14
|
+
export interface ICreateRequest {
|
|
15
|
+
document_line_id: string;
|
|
16
|
+
type: IDocumentLineNoteType;
|
|
17
|
+
note: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IUpdateRequest {
|
|
20
|
+
note: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IRepository {
|
|
23
|
+
create(data: ICreateRequest): Promise<string>;
|
|
24
|
+
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
25
|
+
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LowerName = exports.UpperName = exports.Route = exports.documentLineNoteTypes = exports.IDocumentLineNoteTypeEnum = void 0;
|
|
4
|
+
exports.IDocumentLineNoteTypeEnum = {
|
|
5
|
+
Prisao: 'Prisao',
|
|
6
|
+
Quebra: 'Quebra',
|
|
7
|
+
Entrada: 'Entrada',
|
|
8
|
+
};
|
|
9
|
+
exports.documentLineNoteTypes = Object.keys(exports.IDocumentLineNoteTypeEnum);
|
|
10
|
+
exports.Route = 'documentLineNote';
|
|
11
|
+
exports.UpperName = 'DocumentLineNote';
|
|
12
|
+
exports.LowerName = exports.UpperName[0].toLowerCase() + exports.UpperName.substring(1);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import joi from 'joi';
|
|
2
|
+
import * as IShared from '../../../shared/interface';
|
|
3
|
+
import { ICreateRequest } from './interfaces';
|
|
4
|
+
export declare const createBodyKeys: IShared.IRouteRequest<ICreateRequest>;
|
|
5
|
+
export declare const createBody: joi.ObjectSchema<any>;
|
|
6
|
+
export declare const updateBody: joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.updateBody = exports.createBody = exports.createBodyKeys = void 0;
|
|
8
|
+
var joi_1 = __importDefault(require("joi"));
|
|
9
|
+
var messages_1 = require("../../../shared/messages");
|
|
10
|
+
var interfaces_1 = require("./interfaces");
|
|
11
|
+
exports.createBodyKeys = {
|
|
12
|
+
document_line_id: joi_1.default.string().uuid().required(),
|
|
13
|
+
note: joi_1.default.string().required(),
|
|
14
|
+
type: (_a = joi_1.default
|
|
15
|
+
.string())
|
|
16
|
+
.valid.apply(_a, interfaces_1.documentLineNoteTypes).required(),
|
|
17
|
+
};
|
|
18
|
+
exports.createBody = joi_1.default.object().keys(exports.createBodyKeys).messages(messages_1.messages);
|
|
19
|
+
var updateBodyKeys = {
|
|
20
|
+
note: joi_1.default.string().required(),
|
|
21
|
+
};
|
|
22
|
+
exports.updateBody = joi_1.default.object().keys(updateBodyKeys).messages(messages_1.messages);
|
|
@@ -131,3 +131,4 @@ export import SavedEmPicking = Stock.SavedEmPicking;
|
|
|
131
131
|
export import EmailTemplate = Integration.EmailTemplate;
|
|
132
132
|
export import EmailTemplateAttachment = Integration.EmailTemplateAttachment;
|
|
133
133
|
export import GoogleSheetImports = Stock.GoogleSheetImports;
|
|
134
|
+
export import DocumentLineNote = Stock.DocumentLineNote;
|
|
@@ -3,13 +3,13 @@ import { IAttributeDatatype } from '../../modules/stock/attribute/interfaces';
|
|
|
3
3
|
import { ICabideType } from '../../modules/supply/cabide/interface';
|
|
4
4
|
import { IDocumentTypeUserType, IDocumentTypeCodeType } from '../../modules/supply/documentType/interfaces';
|
|
5
5
|
import { IBatchType, IPaymentOrigin } from '../../modules/supply/payment/interface';
|
|
6
|
-
import { IProductType } from '../../modules/stock/product/interface';
|
|
6
|
+
import { IProductType, IEntityExtended } from '../../modules/stock/product/interface';
|
|
7
7
|
import { IImageType } from '../../modules/stock/productImage/interface';
|
|
8
8
|
import { IQueryParameterDatatype } from '../../modules/stock/queryParameter/interfaces';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import * as IClientCurrentAccount from '../../modules/supply/clientCurrentAccount/interfaces';
|
|
9
|
+
import { IData, IMetadata } from '../../modules/supply/documentLine/interfaces';
|
|
10
|
+
import { IPhcDocumentType } from '../../modules/supply/clientCurrentAccount/interfaces';
|
|
12
11
|
import { ISavedEmPickingData } from '../../modules/stock/savedEmPicking/interfaces';
|
|
12
|
+
import { IDocumentLineNoteType } from '../../modules/supply/documentLineNote/interfaces';
|
|
13
13
|
export type Attribute = {
|
|
14
14
|
id: string;
|
|
15
15
|
name: string;
|
|
@@ -562,7 +562,7 @@ export type DocumentHeader = {
|
|
|
562
562
|
};
|
|
563
563
|
export type DocumentLine = {
|
|
564
564
|
id: string;
|
|
565
|
-
product:
|
|
565
|
+
product: IEntityExtended | null;
|
|
566
566
|
product_id: string | null;
|
|
567
567
|
avg_unit_cost: number | null;
|
|
568
568
|
prison: boolean;
|
|
@@ -570,8 +570,8 @@ export type DocumentLine = {
|
|
|
570
570
|
document_line_group_id: string;
|
|
571
571
|
document_line_folder_id: string | null;
|
|
572
572
|
index: number;
|
|
573
|
-
data:
|
|
574
|
-
metadata:
|
|
573
|
+
data: IData;
|
|
574
|
+
metadata: IMetadata;
|
|
575
575
|
quantity: number;
|
|
576
576
|
preco_custo: number;
|
|
577
577
|
provider_discount: number;
|
|
@@ -804,7 +804,7 @@ export type PhcHeaders = {
|
|
|
804
804
|
telephone: string | null;
|
|
805
805
|
already_imported: boolean;
|
|
806
806
|
sm_external_id: string | null;
|
|
807
|
-
phc_document_type:
|
|
807
|
+
phc_document_type: IPhcDocumentType;
|
|
808
808
|
created_at: Date;
|
|
809
809
|
updated_at: Date;
|
|
810
810
|
created_by: string;
|
|
@@ -1078,3 +1078,13 @@ export type GoogleSheetImports = {
|
|
|
1078
1078
|
created_by: string;
|
|
1079
1079
|
updated_at: Date;
|
|
1080
1080
|
};
|
|
1081
|
+
export type DocumentLineNote = {
|
|
1082
|
+
id: string;
|
|
1083
|
+
note: string;
|
|
1084
|
+
type: IDocumentLineNoteType;
|
|
1085
|
+
document_line_id: string;
|
|
1086
|
+
created_by: string;
|
|
1087
|
+
created_at: Date;
|
|
1088
|
+
updated_by: string;
|
|
1089
|
+
updated_at: string;
|
|
1090
|
+
};
|
|
@@ -73,19 +73,6 @@ export interface IFindOptionalByOwnerIdRequest {
|
|
|
73
73
|
export interface IUpdateManyResponse {
|
|
74
74
|
count: number;
|
|
75
75
|
}
|
|
76
|
-
export declare const IDocumentLineNoteTypeEnum: {
|
|
77
|
-
Prisao: 'Prisao';
|
|
78
|
-
Quebra: 'Quebra';
|
|
79
|
-
Entrada: 'Entrada';
|
|
80
|
-
};
|
|
81
|
-
export type IDocumentLineNoteType = (typeof IDocumentLineNoteTypeEnum)[keyof typeof IDocumentLineNoteTypeEnum];
|
|
82
|
-
export interface IDocumentLineNote {
|
|
83
|
-
id: string;
|
|
84
|
-
note: string;
|
|
85
|
-
type: IDocumentLineNoteType;
|
|
86
|
-
document_line_id: string;
|
|
87
|
-
}
|
|
88
|
-
export declare const documentLineNoteType: string[];
|
|
89
76
|
export type IRouteRequest<T> = Record<keyof WithoutStamps<T>, joi.AnySchema>;
|
|
90
77
|
export type IRouteRequestWithStamps<T> = Record<keyof T, joi.AnySchema>;
|
|
91
78
|
export type IRouteResponseWithStamp<T> = Record<keyof WithStampsResponse<T>, joi.AnySchema>;
|
package/dist/shared/interface.js
CHANGED
|
@@ -3,16 +3,10 @@ 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.IBrokerTopic = exports.joiValidateStamps = exports.findMinifiedReponse = exports.idNumberParam = exports.idParam = exports.findByOwnerIdQuery = exports.findByOwnerIdQueryKeys = exports.findByOptionalOwnerIdQuery = exports.findMinifiedQuery = exports.
|
|
6
|
+
exports.IBrokerTopic = exports.joiValidateStamps = exports.findMinifiedReponse = exports.idNumberParam = exports.idParam = exports.findByOwnerIdQuery = exports.findByOwnerIdQueryKeys = exports.findByOptionalOwnerIdQuery = exports.findMinifiedQuery = exports.messages = void 0;
|
|
7
7
|
var joi_1 = __importDefault(require("joi"));
|
|
8
8
|
var messages_1 = require("./messages");
|
|
9
9
|
Object.defineProperty(exports, "messages", { enumerable: true, get: function () { return messages_1.messages; } });
|
|
10
|
-
exports.IDocumentLineNoteTypeEnum = {
|
|
11
|
-
Prisao: 'Prisao',
|
|
12
|
-
Quebra: 'Quebra',
|
|
13
|
-
Entrada: 'Entrada',
|
|
14
|
-
};
|
|
15
|
-
exports.documentLineNoteType = Object.keys(exports.IDocumentLineNoteTypeEnum);
|
|
16
10
|
var findMinifiedQueryKeys = {
|
|
17
11
|
search_value: joi_1.default.string().allow('', null).optional(),
|
|
18
12
|
owner_id: joi_1.default.string().uuid().optional(),
|