@nomalism-com/types 0.10.32 → 0.10.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.
@@ -28,6 +28,8 @@ export interface ICreateRequest {
28
28
  id_provider: number;
29
29
  code: string;
30
30
  type: ICabideType;
31
+ prazo_entrega?: string | null;
32
+ qtd_minima?: string | null;
31
33
  }
32
34
  export interface IFindRequest {
33
35
  cabide_state: IStateType;
@@ -39,6 +41,8 @@ export interface IUpdateRequest {
39
41
  code?: string;
40
42
  type?: ICabideType;
41
43
  inactive?: boolean;
44
+ prazo_entrega?: string | null;
45
+ qtd_minima?: string | null;
42
46
  }
43
47
  export interface IDeleteRequest {
44
48
  id: string;
@@ -21,12 +21,16 @@ var createBodyKeys = {
21
21
  id_provider: joi_1.default.number().required(),
22
22
  code: joi_1.default.string().required(),
23
23
  type: joi_1.default.string().required(),
24
+ prazo_entrega: joi_1.default.string().allow(null).optional(),
25
+ qtd_minima: joi_1.default.string().allow(null).optional(),
24
26
  };
25
27
  exports.createBody = joi_1.default.object().keys(createBodyKeys).messages(messages_1.messages);
26
28
  var updateBodyKeys = {
27
29
  code: joi_1.default.string().optional(),
28
30
  type: joi_1.default.string().optional(),
29
31
  inactive: joi_1.default.boolean().optional(),
32
+ prazo_entrega: joi_1.default.string().allow(null).optional(),
33
+ qtd_minima: joi_1.default.string().allow(null).optional(),
30
34
  };
31
35
  exports.updateBody = joi_1.default.object().keys(updateBodyKeys).messages(messages_1.messages);
32
36
  var findQueryParamsKeys = {
@@ -10,12 +10,13 @@ export interface ICreateRequest {
10
10
  cabide_id: string;
11
11
  vat_tax_id: string;
12
12
  designation: string;
13
- margin: number;
14
- price_sale: number;
15
- price_cost: number;
13
+ margin?: number;
14
+ price_sale?: number;
15
+ price_cost?: number;
16
16
  width: number;
17
17
  preco_final_1: number;
18
18
  preco_final_2: number;
19
+ preco_final_3: number;
19
20
  }
20
21
  export interface IUpdateRequest {
21
22
  vat_tax_id?: string;
@@ -26,6 +27,7 @@ export interface IUpdateRequest {
26
27
  width?: number;
27
28
  preco_final_1?: number;
28
29
  preco_final_2?: number;
30
+ preco_final_3?: number;
29
31
  }
30
32
  export interface IFindCabideByOwnerResponse extends Entity {
31
33
  pre_artigo: {
@@ -10,12 +10,13 @@ var createBodyKeys = {
10
10
  cabide_id: joi_1.default.string().uuid().required(),
11
11
  vat_tax_id: joi_1.default.string().uuid().required(),
12
12
  designation: joi_1.default.string().required(),
13
- margin: joi_1.default.number().required(),
14
- price_cost: joi_1.default.number().required(),
15
- price_sale: joi_1.default.number().required(),
13
+ margin: joi_1.default.number().optional(),
14
+ price_cost: joi_1.default.number().optional(),
15
+ price_sale: joi_1.default.number().optional(),
16
16
  width: joi_1.default.number().required(),
17
17
  preco_final_1: joi_1.default.number().positive().required(),
18
18
  preco_final_2: joi_1.default.number().positive().required(),
19
+ preco_final_3: joi_1.default.number().positive().required(),
19
20
  };
20
21
  exports.createBody = joi_1.default.object().keys(createBodyKeys).messages(messages_1.messages);
21
22
  var updateBodyKeys = {
@@ -27,6 +28,7 @@ var updateBodyKeys = {
27
28
  width: joi_1.default.number().optional(),
28
29
  preco_final_1: joi_1.default.number().positive().optional(),
29
30
  preco_final_2: joi_1.default.number().positive().optional(),
31
+ preco_final_3: joi_1.default.number().positive().optional(),
30
32
  };
31
33
  exports.updateBody = joi_1.default.object().keys(updateBodyKeys).messages(messages_1.messages);
32
34
  var createByProductIdBodyKeys = {
@@ -27,11 +27,13 @@ interface IFindDetailedResponse extends Entity {
27
27
  }
28
28
  export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
29
29
  export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, 'user' | 'preferential_contact' | 'addresses' | 'personas' | 'exemption_reason' | 'client_type' | 'segments_area' | 'country' | 'language' | 'default_payment_method' | 'default_maturity_date' | 'default_delivery_method' | 'default_vehicle'>;
30
- export interface IFindRequest {
30
+ export interface IFindByQueryRequest {
31
31
  number?: number[];
32
32
  id?: string[];
33
33
  nif?: string | null;
34
34
  }
35
+ export interface IFindRequest {
36
+ }
35
37
  export type IFindResponse = Omit<IFindDetailedResponse, ''>;
36
38
  export interface IFindPaginatedRequest extends IFindRequest, IShared.IPaginationRequest {
37
39
  }
@@ -81,6 +83,7 @@ export interface IRepository {
81
83
  findById(selector: IShared.IFindByIdRequest): Promise<IFindByIdResponse | null>;
82
84
  findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
83
85
  findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
86
+ findByQuery(params: IFindByQueryRequest): Promise<IFindResponse[]>;
84
87
  find(selector: IFindRequest): Promise<IFindResponse[]>;
85
88
  findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
86
89
  create(data: ICreateRequest): Promise<IFindResponse>;
@@ -78,9 +78,6 @@ exports.findQuery = joi_1.default.object().keys(findQueryKeys).messages(messages
78
78
  var findWithPaginationQueryKeys = {
79
79
  per_page: joi_1.default.number().integer().positive().default(10).optional(),
80
80
  current_page: joi_1.default.number().integer().positive().default(1).optional(),
81
- number: joi_1.default.array().items(joi_1.default.number().positive().required()).optional(),
82
- id: joi_1.default.array().items(joi_1.default.string().uuid().required()).optional(),
83
- nif: joi_1.default.string().optional(),
84
81
  };
85
82
  exports.findWithPaginationQuery = joi_1.default
86
83
  .object()
@@ -27,10 +27,12 @@ interface IFindDetailedResponse extends Entity {
27
27
  }
28
28
  export type IFindByIdResponse = Omit<IFindDetailedResponse, ''>;
29
29
  export type IFindByOwnerIdResponse = Omit<IFindDetailedResponse, 'user' | 'preferential_contact' | 'addresses' | 'personas' | 'exemption_reason' | 'country' | 'language' | 'support_language' | 'provider_type' | 'default_payment_method' | 'default_maturity_date' | 'default_delivery_method' | 'default_vehicle'>;
30
- export interface IFindRequest {
30
+ export interface IFindByQueryRequest {
31
31
  number?: number[];
32
32
  id?: string[];
33
33
  }
34
+ export interface IFindRequest {
35
+ }
34
36
  export type IFindResponse = Omit<IFindDetailedResponse, ''>;
35
37
  export type IFindPaginatedRequest = IShared.IPaginationRequest;
36
38
  export type IFindWithPaginationResponse = IShared.IPaginationResponse<Omit<IFindDetailedResponse, ''>>;
@@ -74,6 +76,7 @@ export interface IRepository {
74
76
  findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
75
77
  findMinified(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
76
78
  findMinifiedManufacturer(params?: IShared.IFindMinifiedRequest): Promise<IShared.IFindMinifiedResponse[]>;
79
+ findByQuery(params: IFindByQueryRequest): Promise<IFindResponse[]>;
77
80
  find(selector: IFindRequest): Promise<IFindResponse[]>;
78
81
  findPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
79
82
  create(data: ICreateRequest): Promise<IFindResponse>;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.10.32",
12
+ "version": "0.10.34",
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [
@@ -37,11 +37,11 @@
37
37
  "joi-to-swagger": "^6.2.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@types/convert-units": "^2.3.7",
41
- "@types/node": "^18.18.5",
40
+ "@types/convert-units": "^2.3.8",
41
+ "@types/node": "^18.18.6",
42
42
  "@typescript-eslint/eslint-plugin": "^6.8.0",
43
43
  "@typescript-eslint/parser": "^6.8.0",
44
- "concurrently": "^8.2.1",
44
+ "concurrently": "^8.2.2",
45
45
  "eslint": "^8.51.0",
46
46
  "eslint-config-airbnb-base": "^15.0.0",
47
47
  "eslint-config-prettier": "^9.0.0",