@nomalism-com/types 0.19.158 → 0.20.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.
@@ -14,6 +14,7 @@ export declare const createMaterialEntranceClientOrderOptions: string[];
14
14
  export interface IGetMaterialEntranceInfoClientOrder {
15
15
  ef_dla_id: string;
16
16
  ordered_quantity: number;
17
+ pc_owner_id: string;
17
18
  pc_dh_id: string;
18
19
  pc_dh_number: number;
19
20
  pc_virtual_name: string;
@@ -82,7 +83,7 @@ export interface IUnfinishedPickingLineGroup {
82
83
  export type IUnfinishedPickingLineGroupExtended = IUnfinishedPickingLineGroup & IGetMaterialEntranceInfoResponse;
83
84
  export interface IUnfinishedPickingsResponse extends Pick<DocumentHeader, "id" | "owner_id"> {
84
85
  identifier: string;
85
- start_document_header_id: string;
86
+ url: string;
86
87
  lineGroups: IUnfinishedPickingLineGroupExtended[];
87
88
  }
88
89
  export interface IUndoEntradaDeMaterialRequest {
@@ -101,6 +102,7 @@ export interface IPrintLabelParamsRequest {
101
102
  document_line_id: string;
102
103
  }
103
104
  export interface IPrintLabelQueryRequest {
105
+ ef_name: string;
104
106
  pc_document_number?: number | null;
105
107
  prison: boolean;
106
108
  quantity: number;
@@ -72,8 +72,12 @@ export interface IFindRequest {
72
72
  export type IOrderType = "VA" | "Stock";
73
73
  export interface IFindResponse {
74
74
  order_type: IOrderType;
75
+ client_id?: string;
75
76
  pc_id?: string;
77
+ pc_closed?: boolean;
78
+ provider_id?: string;
76
79
  pf_id?: string;
80
+ pf_closed?: boolean;
77
81
  document_line_id: string;
78
82
  document_line_quantity: number;
79
83
  product_id: string;
@@ -9,7 +9,7 @@ export interface IUnpaidMaterialEntranceLineDetails {
9
9
  quantity: number;
10
10
  notes: DocumentLineNote[];
11
11
  pc_name: string | null;
12
- pc_id: string | null;
12
+ pc_link: string | null;
13
13
  }
14
14
  export interface IUnpaidMaterialEntranceLineResponse {
15
15
  group: string;
@@ -19,8 +19,10 @@ export interface IUnpaidMaterialEntranceLineResponse {
19
19
  designation: string;
20
20
  multimedia_id: string | null;
21
21
  provider_ref: string | null;
22
+ pf_owner_id: string;
22
23
  pf_id: string;
23
24
  ef_name: string;
25
+ pf_closed: boolean;
24
26
  quantity: number;
25
27
  discount: number;
26
28
  provider_purchase_discount: number;
@@ -1,5 +1,5 @@
1
1
  import * as IShared from "../../../shared/interface";
2
- import { Attribute, Product, UnitOfMeasure, ProductSubCategory, ProductCategory, TypeOfInventory, ProductImage, VatTax, VatTaxZone, ProductVirtuals, ProductBaseVirtuals, ProductPromotionVirtuals, CabideProduct, Cabide } from "../../../shared/entities";
2
+ import { Attribute, Product, ProductName, UnitOfMeasure, ProductSubCategory, ProductCategory, TypeOfInventory, ProductImage, VatTax, VatTaxZone, ProductVirtuals, ProductBaseVirtuals, ProductPromotionVirtuals, CabideProduct, Cabide } from "../../../shared/entities";
3
3
  import * as IProductPart from "../productPart/interface";
4
4
  import * as IProductAttribute from "../productAttribute/interface";
5
5
  import * as IDocumentLine from "../../supply/documentLine/interfaces";
@@ -20,6 +20,7 @@ export interface IEntityFromCabide extends Pick<Entity, "id" | "cabide_product_c
20
20
  export interface IEntityWithStock extends Entity {
21
21
  unit_of_measure_quantity: UnitOfMeasure;
22
22
  unit_of_measure_weight: UnitOfMeasure;
23
+ name: ProductName | null;
23
24
  product_sub_category: ProductSubCategory & {
24
25
  product_category: ProductCategory & {
25
26
  attributes: Attribute[];
@@ -94,6 +95,7 @@ export interface ICreateRequest {
94
95
  origin_id?: string | null;
95
96
  id_provider?: number;
96
97
  provider_ref?: string | null;
98
+ product_name?: string | null;
97
99
  designation?: string | null;
98
100
  barcode?: string | null;
99
101
  online?: boolean;
@@ -0,0 +1,32 @@
1
+ import * as IShared from '../../../shared/interface';
2
+ import { ProductName } from '../../../shared/entities';
3
+ export type Entity = ProductName;
4
+ export declare const Route = "product_name";
5
+ export declare const UpperName = "ProductName";
6
+ export declare const LowerName: string;
7
+ type IFindDetailedResponse = Entity;
8
+ export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
9
+ export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, ''>;
10
+ export type IFindRequest = Record<string, unknown>;
11
+ export type IFindResponse = Omit<IFindDetailedResponse, ''>;
12
+ export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
13
+ }
14
+ export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, ''>>;
15
+ export interface ICreateRequest {
16
+ name: string;
17
+ }
18
+ export interface IUpdateRequest {
19
+ name?: string;
20
+ }
21
+ export interface IRepository {
22
+ findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
23
+ findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
24
+ findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
25
+ find(selector: IFindRequest): Promise<IFindResponse[]>;
26
+ findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
27
+ create(data: ICreateRequest): Promise<Entity>;
28
+ update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
29
+ deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
30
+ }
31
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
32
+ export {};
@@ -0,0 +1,5 @@
1
+ import joi from 'joi';
2
+ export declare const createBody: joi.ObjectSchema<any>;
3
+ export declare const updateBody: joi.ObjectSchema<any>;
4
+ export declare const findQuery: joi.ObjectSchema<any>;
5
+ export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
@@ -0,0 +1,32 @@
1
+ import * as IShared from '../../../shared/interface';
2
+ import { ProductNamePreset } from '../../../shared/entities';
3
+ export type Entity = ProductNamePreset;
4
+ export declare const Route = "product_name_preset";
5
+ export declare const UpperName = "ProductNamePreset";
6
+ export declare const LowerName: string;
7
+ type IFindDetailedResponse = Entity;
8
+ export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
9
+ export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, ''>;
10
+ export type IFindRequest = Record<string, unknown>;
11
+ export type IFindResponse = Omit<IFindDetailedResponse, ''>;
12
+ export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
13
+ }
14
+ export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, ''>>;
15
+ export interface ICreateRequest {
16
+ name: string;
17
+ }
18
+ export interface IUpdateRequest {
19
+ name?: string;
20
+ }
21
+ export interface IRepository {
22
+ findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
23
+ findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
24
+ findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
25
+ find(selector: IFindRequest): Promise<IFindResponse[]>;
26
+ findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
27
+ create(data: ICreateRequest): Promise<Entity>;
28
+ update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
29
+ deleteOne(selector: IShared.IFindByIdRequest): Promise<Entity | null>;
30
+ }
31
+ export type IController = IShared.IEntityWithUserToken<IRepository>;
32
+ export {};
@@ -0,0 +1,5 @@
1
+ import joi from 'joi';
2
+ export declare const createBody: joi.ObjectSchema<any>;
3
+ export declare const updateBody: joi.ObjectSchema<any>;
4
+ export declare const findQuery: joi.ObjectSchema<any>;
5
+ export declare const findWithPaginationQuery: joi.ObjectSchema<any>;
@@ -38,6 +38,7 @@ export interface IFindByDocumentLineStateResponse {
38
38
  created_by: string;
39
39
  who_handles: string | null;
40
40
  tags: string | null;
41
+ url: string;
41
42
  upfront_total: number;
42
43
  }
43
44
  export interface IBasicSearchRequest extends IShared.IPaginationRequest {
@@ -50,8 +51,7 @@ export interface IBasicSearchResponse {
50
51
  name: string | null;
51
52
  user_number: number;
52
53
  document_line_count: number;
53
- document_header_id: string | null;
54
- start_document_header_id: string | null;
54
+ url: string | null;
55
55
  pdf_link: string | null;
56
56
  updated_at: Date;
57
57
  }
@@ -36,7 +36,7 @@ export interface IDataPagamento {
36
36
  export interface IDocumentLineDocuments {
37
37
  code: IDocumentTypeCodeType;
38
38
  user_type: IDocumentTypeUserType;
39
- start_document_header_id: string | null;
39
+ url: string | null;
40
40
  pdf_link: string | null;
41
41
  }
42
42
  export interface IHistory {
@@ -122,7 +122,7 @@ export interface IPrintLabelQueryRequest {
122
122
  }
123
123
  export interface IRepository {
124
124
  findByState(data: IFindByDocumentLineStateRequest): Promise<IFindByDocumentLineStateResponse[]>;
125
- create(data: ICreateRequest[]): Promise<IDocumentLineAssoc.IEntityExtended[]>;
125
+ create(data: ICreateRequest[]): Promise<IDocumentLineAssoc.IEntityWithDocumentLine[]>;
126
126
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
127
127
  updateData(data: IUpdateDataRequest): Promise<IUpdateLineStatesTriggerResponse>;
128
128
  updateMany(data: IUpdateManyRequest): Promise<void>;
@@ -1,3 +1,4 @@
1
+ import { IDocumentTypeUserType } from "../documentType/interfaces";
1
2
  import { IProductType } from "../../stock/product/interface";
2
3
  export declare const Route = "order_management";
3
4
  export declare const UpperName = "OrderManagement";
@@ -7,7 +8,7 @@ export interface IFindProviderProductsRequest {
7
8
  }
8
9
  export interface IFindProposals {
9
10
  name: string;
10
- start_document_header_id: string;
11
+ url: string;
11
12
  pdf_link: string | null;
12
13
  }
13
14
  export interface IFindProviderProductsResponse {
@@ -45,7 +46,10 @@ export interface IFindProductHistoryProviderOrder {
45
46
  export interface IFindProductHistoryMovement {
46
47
  date: Date;
47
48
  document_name: string;
48
- document_header_id: string | null;
49
+ link_user_type: IDocumentTypeUserType | null;
50
+ link_owner_id: string | null;
51
+ link_document_header_id: string | null;
52
+ link_closed: boolean | null;
49
53
  quantity_in: number;
50
54
  quantity_out: number;
51
55
  stock_to_date: number;
@@ -1,5 +1,6 @@
1
1
  import * as IShared from "../../../shared/interface";
2
2
  import { Persona, Country } from "../../../shared/entities";
3
+ import { IDocumentTypeUserType } from "../../supply/documentType/interfaces";
3
4
  export type Entity = Persona;
4
5
  export declare const Route = "persona";
5
6
  export declare const UpperName = "Persona";
@@ -43,7 +44,8 @@ export interface IBasicSearchRequest extends IShared.IPaginationRequest {
43
44
  inactive?: boolean;
44
45
  }
45
46
  export interface IBasicSearchResponse {
46
- id: string;
47
+ user_id: string;
48
+ user_type: IDocumentTypeUserType;
47
49
  name: string;
48
50
  number: number;
49
51
  persona_name?: string;
@@ -5,7 +5,9 @@ export declare const Route = "users";
5
5
  export declare const UpperName = "Users";
6
6
  export declare const LowerName: string;
7
7
  export interface IFindByEmailResponse extends Entity {
8
- store_operator: Pick<StoreOperator, "id" | "location_id"> | null;
8
+ store_operator: {
9
+ location_id: string;
10
+ } | null;
9
11
  }
10
12
  export interface IFindByIdResponse extends Entity {
11
13
  provider: (Providers & {
@@ -10,7 +10,6 @@ export import AttributeValue = Stock.AttributeValue;
10
10
  export import BankData = User.BankData;
11
11
  export import Clients = User.Clients;
12
12
  export import ClientType = User.ClientType;
13
- export import Chat = Stock.Chat;
14
13
  export import Color = Stock.Color;
15
14
  export import Commissioner = User.Commissioner;
16
15
  export import Composition = Stock.Composition;
@@ -33,18 +33,6 @@ export type AttributeValue = {
33
33
  created_by: string;
34
34
  updated_by: string;
35
35
  };
36
- export type Chat = {
37
- id: string;
38
- document_header_id: string;
39
- message: string;
40
- email_sent: boolean;
41
- whatsapp_sent: boolean;
42
- created_by: string;
43
- updated_by: string;
44
- created_at: Date;
45
- updated_at: Date;
46
- deleted: boolean;
47
- };
48
36
  export type Color = {
49
37
  id: string;
50
38
  primary_color_id: string;
@@ -1129,7 +1117,10 @@ export type StockMovement = {
1129
1117
  emission_date: string;
1130
1118
  name: string;
1131
1119
  pdf_link: string | null;
1132
- parent_document_header_id: string | null;
1120
+ link_user_type: IDocumentTypeUserType | null;
1121
+ link_owner_id: string | null;
1122
+ link_document_header_id: string | null;
1123
+ link_closed: boolean | null;
1133
1124
  created_by: string;
1134
1125
  quantity: number;
1135
1126
  stock_to_date: number;
@@ -126,8 +126,7 @@ export declare enum IBrokerTopic {
126
126
  perform_task = "perform_task",
127
127
  warning_email = "warning_email",
128
128
  retry_errored_emails = "retry_errored_emails",
129
- send_errored_emails_summary = "send_errored_emails_summary",
130
- dispatch_chat_message = "dispatch_chat_message"
129
+ send_errored_emails_summary = "send_errored_emails_summary"
131
130
  }
132
131
  export type IBrokerTopicPayload = {
133
132
  [IBrokerTopic.create]: Record<string, unknown>;
@@ -237,17 +236,6 @@ export type IBrokerTopicPayload = {
237
236
  [IBrokerTopic.send_errored_emails_summary]: {
238
237
  warningErrors: string[];
239
238
  };
240
- [IBrokerTopic.dispatch_chat_message]: {
241
- email: string;
242
- name: string;
243
- phone_number: string | null;
244
- reply_url: string;
245
- document_header_id: string;
246
- document_name: string;
247
- chat_id: string;
248
- message: string;
249
- created_by: string;
250
- };
251
239
  };
252
240
  export interface IBrokerMessage<T extends IBrokerTopic = IBrokerTopic> {
253
241
  topic: T;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.19.158",
12
+ "version": "0.20.2",
13
13
  "main": "./dist/index.min.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@rollup/plugin-terser": "^0.4.4",
41
41
  "@rollup/plugin-typescript": "^11.1.6",
42
- "@types/node": "^20.12.12",
42
+ "@types/node": "^20.12.13",
43
43
  "@typescript-eslint/eslint-plugin": "^7.11.0",
44
44
  "@typescript-eslint/parser": "^7.11.0",
45
45
  "eslint": "^8.57.0",
@@ -1,23 +0,0 @@
1
- import * as IShared from "../../../shared/interface";
2
- import { Chat } from "../../../shared/entities";
3
- export type Entity = Chat;
4
- export declare const Route = "chat";
5
- export declare const UpperName = "Chat";
6
- export declare const LowerName: string;
7
- export interface ICreateRequest {
8
- document_header_id: string;
9
- message: string;
10
- }
11
- export interface IUpdateRequest {
12
- message?: string;
13
- email_sent?: boolean;
14
- whatsapp_sent?: boolean;
15
- token_active?: boolean;
16
- }
17
- export interface IRepository {
18
- findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<Chat[]>;
19
- create(data: ICreateRequest): Promise<Chat>;
20
- update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
21
- deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
22
- }
23
- export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -1,3 +0,0 @@
1
- import joi from "joi";
2
- export declare const createBody: joi.ObjectSchema<any>;
3
- export declare const updateBody: joi.ObjectSchema<any>;
@@ -1,28 +0,0 @@
1
- export declare const Route = "products_sheets";
2
- export declare const UpperName = "ProductsSheets";
3
- export declare const LowerName: string;
4
- export interface IProductsSheetsRequest {
5
- products_google_sheet_id: string;
6
- }
7
- export type IProductsForSheetsResponse = Record<string, any>;
8
- export type IProductFromSheets = Record<string, any>;
9
- export type SheetsCreateOrUpdate = "create" | "update";
10
- export interface IProductsForNomaResponse {
11
- reference: string;
12
- type: string;
13
- state: string;
14
- values: IProductsForSheetsResponse;
15
- }
16
- export interface IProduct extends Omit<IProductsForNomaResponse, "values"> {
17
- id: string;
18
- created_at: Date;
19
- updated_at: Date;
20
- values: IProductFromSheets;
21
- }
22
- export interface IProductSheetsWithIndex {
23
- index: number;
24
- values: IProductFromSheets;
25
- }
26
- export interface IRepository {
27
- createOrUpdateNomaFromGoogleSheets(params: number, body: IProductsForSheetsResponse): Promise<void>;
28
- }
@@ -1,2 +0,0 @@
1
- import joi from "joi";
2
- export declare const createBody: joi.ObjectSchema<any>;