@nomalism-com/types 0.22.35 → 0.22.37

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.
@@ -1,5 +1,5 @@
1
1
  import * as IShared from "../../../shared/interface";
2
- import { Attribute, Product, ProductName, UnitOfMeasure, ProductSubCategory, ProductCategory, TypeOfInventory, ProductImage, VatTax, VatTaxZone, ProductVirtuals, ProductBaseVirtuals, ProductPromotionVirtuals, CabideProduct } 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";
@@ -10,6 +10,13 @@ export declare const LowerName: string;
10
10
  export type IProductVirtuals = ProductVirtuals;
11
11
  export type IProductBaseVirtuals = ProductBaseVirtuals;
12
12
  export type IProductPromotionVirtuals = ProductPromotionVirtuals;
13
+ export interface IEntityFromCabide extends Pick<Entity, "id" | "cabide_product_color" | "designation" | "vat_tax_id" | "id_provider" | "width"> {
14
+ thumbnail: string | null;
15
+ cabide_product: (CabideProduct & {
16
+ cabide: Cabide;
17
+ }) | null;
18
+ virtual: ProductBaseVirtuals | null;
19
+ }
13
20
  export interface IEntityWithStock extends Entity {
14
21
  unit_of_measure_quantity: UnitOfMeasure;
15
22
  unit_of_measure_weight: UnitOfMeasure;
@@ -26,6 +33,9 @@ export interface IEntityWithStock extends Entity {
26
33
  promotions: IProductPromotionVirtuals[];
27
34
  product_images: ProductImage[];
28
35
  product_parts: IProductPart.IFindByRefProduct[];
36
+ cabide_product: (CabideProduct & {
37
+ cabide: Cabide;
38
+ }) | null;
29
39
  extended_virtual: ProductVirtuals | null;
30
40
  }
31
41
  export interface IEntityMinified {
@@ -238,6 +248,7 @@ export interface IFindForMobileResponse {
238
248
  }
239
249
  export interface IRepository {
240
250
  findForMobile(params: IFindForMobileRequest): Promise<IFindForMobileResponse | null>;
251
+ findByIdFromCabide(selector: IShared.IFindByIdRequest): Promise<IEntityFromCabide | null>;
241
252
  findByIdWithStock(selector: IShared.IFindByIdRequest): Promise<IEntityWithStock | null>;
242
253
  findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
243
254
  checkStockByIds(data: ICheckStockByIdsRequest): Promise<ICheckStockByIdsResponse[]>;
@@ -1,4 +1,4 @@
1
- import { ProductImage, UnitOfMeasure, VatTax, VatTaxZone, ProductSheet } from "../../../shared/entities";
1
+ import { ProductImage, UnitOfMeasure, VatTax, VatTaxZone } from "../../../shared/entities";
2
2
  import { IProductPromotionVirtuals, IProductVirtuals } from "../product/interface";
3
3
  export declare const Route = "products_sheets";
4
4
  export declare const UpperName = "ProductsSheets";
@@ -6,7 +6,6 @@ export declare const LowerName: string;
6
6
  export interface IProductsSheetsRequest {
7
7
  products_google_sheet_id: string;
8
8
  }
9
- export type Entity = ProductSheet;
10
9
  export type IProductsForSheetsResponse = Record<string, any>;
11
10
  export type IProductFromSheetsValues = Record<string, any>;
12
11
  export type SheetsCreateOrUpdate = "create" | "update";
@@ -16,16 +15,13 @@ export interface IProductsForNomaResponse {
16
15
  state: string;
17
16
  values: IProductsForSheetsResponse;
18
17
  }
19
- export interface IEntityFromCabide extends Pick<Entity, "id" | "cabide_product_color" | "vat_tax_id" | "id_provider" | "width"> {
20
- thumbnail: string | null;
21
- virtual: IProductVirtuals | null;
22
- }
23
18
  export interface IProduct extends Omit<IProductsForNomaResponse, "values"> {
24
19
  id: string;
25
20
  created_at: Date;
26
21
  updated_at: Date;
27
22
  values: IProductFromSheetsValues;
28
23
  imported_from_sheets: boolean;
24
+ id_provider: string;
29
25
  origin_cabide_product_id?: string | null;
30
26
  vat_tax_id: string;
31
27
  unit_of_measure_quantity_id: string;
@@ -45,7 +41,6 @@ export interface IProduct extends Omit<IProductsForNomaResponse, "values"> {
45
41
  };
46
42
  promotions: IProductPromotionVirtuals[];
47
43
  product_images: ProductImage[];
48
- id_provider: number;
49
44
  }
50
45
  export interface IProductSheetsWithIndex {
51
46
  index: number;
@@ -1,31 +1,27 @@
1
- import * as IShared from "../../../shared/interface";
2
- import { Cabide } from "../../../shared/entities";
1
+ import * as IShared from '../../../shared/interface';
2
+ import * as Product from '../../stock/product/interface';
3
+ import { Cabide } from '../../../shared/entities';
3
4
  export type Entity = Cabide;
4
5
  export declare const Route = "cabide";
5
6
  export declare const UpperName = "Cabide";
6
7
  export declare const LowerName = "cabide";
7
8
  export declare const CabideTypeEnum: {
8
- B: "B";
9
- BL: "BL";
10
- TA: "TA";
11
- TAC: "TAC";
12
- VA: "VA";
13
- VAE: "VAE";
14
- VAL: "VAL";
15
- VAP: "VAP";
16
- VAPP: "VAPP";
9
+ B: 'B';
10
+ BL: 'BL';
11
+ TA: 'TA';
12
+ TAC: 'TAC';
13
+ VA: 'VA';
14
+ VAE: 'VAE';
15
+ VAL: 'VAL';
16
+ VAP: 'VAP';
17
+ VAPP: 'VAPP';
17
18
  };
18
19
  export type ICabideType = (typeof CabideTypeEnum)[keyof typeof CabideTypeEnum];
19
- export type IStateType = "Abertos" | "Fechados";
20
+ export type IStateType = 'Abertos' | 'Fechados';
20
21
  export declare const cabideTypes: string[];
21
22
  export interface IFindByIdResponse extends Entity {
22
- cabide_product: {
23
- pre_artigo: {
24
- extended_virtual: {
25
- reference: string;
26
- designation: string;
27
- } | null;
28
- };
23
+ product: {
24
+ virtual: Pick<Product.IProductBaseVirtuals, 'reference'> | null;
29
25
  };
30
26
  }
31
27
  export interface ICreateRequest {
@@ -38,7 +34,7 @@ export interface ICreateRequest {
38
34
  export interface IFindRequest {
39
35
  cabide_state: IStateType;
40
36
  }
41
- export interface IFindResponse extends Omit<Entity, "created_at" | "created_by" | "updated_at" | "updated_by" | "product_id" | "id" | "type"> {
37
+ export interface IFindResponse extends Entity {
42
38
  product_counter: number;
43
39
  }
44
40
  export interface IUpdateRequest {
@@ -54,7 +50,7 @@ export interface IDeleteRequest {
54
50
  export interface IFindByIdProviderRequest {
55
51
  id_provider: number;
56
52
  }
57
- export type IFindByIdProviderResponse = Omit<Entity, "created_at" | "created_by" | "updated_at" | "updated_by" | "product_id" | "id" | "type">;
53
+ export type IFindByIdProviderResponse = Entity;
58
54
  export interface IFindCabideProvidersResponse {
59
55
  id_provider: number;
60
56
  name: string;
@@ -70,7 +66,7 @@ export interface IBasicSearchRequest extends IShared.IPaginationRequest {
70
66
  search_value: string | null;
71
67
  inactive?: boolean;
72
68
  }
73
- export interface IBasicSearchResponse extends Pick<Entity, "id" | "origin_id" | "code"> {
69
+ export interface IBasicSearchResponse extends Pick<Entity, 'id' | 'origin_id' | 'code'> {
74
70
  reference: string;
75
71
  product_counter: number;
76
72
  }
@@ -1,7 +1,7 @@
1
- import { ProductGoogleSheets } from "main";
2
- import { CabideProduct } from "../../../shared/entities";
3
- import * as IShared from "../../../shared/interface";
4
- import * as Attribute from "../../stock/attribute/interfaces";
1
+ import { CabideProduct } from '../../../shared/entities';
2
+ import * as IShared from '../../../shared/interface';
3
+ import * as Attribute from '../../stock/attribute/interfaces';
4
+ import * as Product from '../../stock/product/interface';
5
5
  export type Entity = CabideProduct;
6
6
  export declare const Route = "cabide_product";
7
7
  export declare const UpperName = "CabideProduct";
@@ -49,7 +49,7 @@ export interface IUpdateRequest {
49
49
  }
50
50
  export interface IFindCabideByOwnerResponse extends Entity {
51
51
  pre_artigo: {
52
- extended_virtual: {
52
+ virtual: {
53
53
  reference: string;
54
54
  designation: string;
55
55
  } | null;
@@ -65,6 +65,11 @@ export interface IFindCabideByOwnerResponse extends Entity {
65
65
  maintenance_assocs: number;
66
66
  };
67
67
  }[];
68
+ cabide_product: {
69
+ _count: {
70
+ cabide_order_products: number;
71
+ };
72
+ } | null;
68
73
  _count: {
69
74
  product_attributes: number;
70
75
  };
@@ -83,10 +88,10 @@ export interface IRepository {
83
88
  findById(select: IShared.IFindByIdRequest): Promise<IFindCabideByOwnerResponse | null>;
84
89
  findByOwner(selector: IShared.IFindByOwnerIdRequest): Promise<IFindCabideByOwnerResponse[]>;
85
90
  findByOwnerPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
86
- findProductByCabideProductId(selector: IShared.IFindByIdRequest): Promise<ProductGoogleSheets.IEntityFromCabide[]>;
91
+ findProductByCabideProductId(selector: IShared.IFindByIdRequest): Promise<Product.IEntityFromCabide[]>;
87
92
  create(data: ICreateRequest): Promise<Entity>;
88
93
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
89
- createProductByCabideProductId(data: ICreateProductByCabideProductIdRequest): Promise<ProductGoogleSheets.IEntityFromCabide>;
94
+ createProductByCabideProductId(data: ICreateProductByCabideProductIdRequest): Promise<Product.IEntityFromCabide>;
90
95
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
91
96
  }
92
97
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -127,4 +127,3 @@ export import EmailTemplateAttachment = Integration.EmailTemplateAttachment;
127
127
  export import GoogleSheetImports = Stock.GoogleSheetImports;
128
128
  export import DocumentLineNote = Stock.DocumentLineNote;
129
129
  export import SavedProviderProposal = Stock.SavedProviderProposal;
130
- export import ProductSheet = Stock.ProductSheet;
@@ -1212,29 +1212,3 @@ export type SavedProviderProposal = {
1212
1212
  created_by: string;
1213
1213
  updated_by: string;
1214
1214
  };
1215
- export type ProductSheet = {
1216
- id: boolean;
1217
- reference: boolean;
1218
- type: boolean;
1219
- state: boolean;
1220
- values: boolean;
1221
- imported_from_sheets: boolean;
1222
- imported_from_product_sheets: boolean;
1223
- origin_cabide_product_id: boolean;
1224
- vat_tax_id: boolean;
1225
- unit_of_measure_quantity_id: boolean;
1226
- cabide_product_color: boolean;
1227
- weight: boolean;
1228
- width: boolean;
1229
- height: boolean;
1230
- length: boolean;
1231
- diameter: boolean;
1232
- no_discount: boolean;
1233
- provider_ref: boolean;
1234
- margin: boolean;
1235
- id_provider: boolean;
1236
- created_at: Date;
1237
- updated_at: Date;
1238
- created_by: string;
1239
- updated_by: string;
1240
- };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "typescript",
10
10
  "helper"
11
11
  ],
12
- "version": "0.22.35",
12
+ "version": "0.22.37",
13
13
  "main": "./dist/index.min.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "files": [