@nomalism-com/types 0.19.34 → 0.19.36
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,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from "../../../shared/interface";
|
|
2
2
|
import { Attribute, Product, ProductName, UnitOfMeasure, ProductSubCategory, ProductCategory, TypeOfInventory, ProductImage, VatTax, VatTaxZone, ProductVirtuals, ProductBaseVirtuals, ProductPromotionVirtuals, CabideProduct, Cabide } from "../../../shared/entities";
|
|
3
|
-
import * as IProductAttribute from "../productAttribute/interface";
|
|
4
3
|
import * as IProductPart from "../productPart/interface";
|
|
5
4
|
export type Entity = Product;
|
|
6
5
|
export declare const Route = "product";
|
|
@@ -9,7 +8,13 @@ export declare const LowerName: string;
|
|
|
9
8
|
export type IProductVirtuals = ProductVirtuals;
|
|
10
9
|
export type IProductBaseVirtuals = ProductBaseVirtuals;
|
|
11
10
|
export type IProductPromotionVirtuals = ProductPromotionVirtuals;
|
|
12
|
-
interface
|
|
11
|
+
export interface IEntityFromCabide extends Entity {
|
|
12
|
+
cabide_product: (CabideProduct & {
|
|
13
|
+
cabide: Cabide;
|
|
14
|
+
}) | null;
|
|
15
|
+
virtual: ProductBaseVirtuals | null;
|
|
16
|
+
}
|
|
17
|
+
export interface IEntityWithStock extends Entity {
|
|
13
18
|
unit_of_measure_quantity: UnitOfMeasure;
|
|
14
19
|
unit_of_measure_weight: UnitOfMeasure;
|
|
15
20
|
name: ProductName | null;
|
|
@@ -22,19 +27,12 @@ interface IFindDetailedResponse extends Entity {
|
|
|
22
27
|
vat_tax: VatTax & {
|
|
23
28
|
vat_tax_zones: VatTaxZone[];
|
|
24
29
|
};
|
|
25
|
-
virtual: ProductBaseVirtuals | null;
|
|
26
30
|
promotions: IProductPromotionVirtuals[];
|
|
27
|
-
}
|
|
28
|
-
export interface IEntityExtended extends IFindDetailedResponse {
|
|
29
31
|
product_images: ProductImage[];
|
|
30
|
-
product_attributes: IProductAttribute.IFindDetailedResponse[];
|
|
31
32
|
product_parts: IProductPart.IFindByRefProduct[];
|
|
32
|
-
origin_cabide_product: CabideProduct | null;
|
|
33
33
|
cabide_product: (CabideProduct & {
|
|
34
34
|
cabide: Cabide;
|
|
35
35
|
}) | null;
|
|
36
|
-
}
|
|
37
|
-
export interface IEntityExtendedWithStock extends Omit<IEntityExtended, 'virtual'> {
|
|
38
36
|
extended_virtual: ProductVirtuals | null;
|
|
39
37
|
}
|
|
40
38
|
export interface IEntityMinified {
|
|
@@ -227,10 +225,9 @@ export interface IDuplicateProductRequest {
|
|
|
227
225
|
color_id: string[];
|
|
228
226
|
}
|
|
229
227
|
export interface IRepository {
|
|
230
|
-
|
|
231
|
-
findByIdWithStock(selector: IShared.IFindByIdRequest): Promise<
|
|
228
|
+
findByIdFromCabide(selector: IShared.IFindByIdRequest): Promise<IEntityFromCabide | null>;
|
|
229
|
+
findByIdWithStock(selector: IShared.IFindByIdRequest): Promise<IEntityWithStock | null>;
|
|
232
230
|
findByOwnerId(params: IShared.IFindByOwnerIdRequest): Promise<IFindByOwnerIdResponse[]>;
|
|
233
|
-
findByRef(selector: IFindByReferenceRequest): Promise<IEntityExtended | null>;
|
|
234
231
|
checkStockByIds(data: ICheckStockByIdsRequest): Promise<ICheckStockByIdsResponse[]>;
|
|
235
232
|
validateByRef(selector: IValidateByReferenceRequest): Promise<IEntityMinified | null>;
|
|
236
233
|
findByProductType(params: IFindByProductTypeRequest): Promise<IFindByProductTypeResponse[]>;
|
|
@@ -248,4 +245,3 @@ export interface IRepository {
|
|
|
248
245
|
}
|
|
249
246
|
export type IApi = Omit<IRepository, "getLabelData">;
|
|
250
247
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
251
|
-
export {};
|
|
@@ -88,10 +88,10 @@ export interface IRepository {
|
|
|
88
88
|
findById(select: IShared.IFindByIdRequest): Promise<IFindCabideByOwnerResponse | null>;
|
|
89
89
|
findByOwner(selector: IShared.IFindByOwnerIdRequest): Promise<IFindCabideByOwnerResponse[]>;
|
|
90
90
|
findByOwnerPaginated(selector: IFindPaginatedRequest): Promise<IFindWithPaginationResponse>;
|
|
91
|
-
findProductByCabideProductId(selector: IShared.IFindByIdRequest): Promise<Product.
|
|
91
|
+
findProductByCabideProductId(selector: IShared.IFindByIdRequest): Promise<Product.IEntityFromCabide[]>;
|
|
92
92
|
create(data: ICreateRequest): Promise<Entity>;
|
|
93
93
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<Entity | null>;
|
|
94
|
-
createProductByCabideProductId(data: ICreateProductByCabideProductIdRequest): Promise<Product.
|
|
94
|
+
createProductByCabideProductId(data: ICreateProductByCabideProductIdRequest): Promise<Product.IEntityFromCabide>;
|
|
95
95
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
96
96
|
}
|
|
97
97
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
|
-
import { PreSale, PreSaleProduct } from '../../../shared/entities';
|
|
3
|
-
import * as
|
|
2
|
+
import { PreSale, PreSaleProduct, CabideProduct } from '../../../shared/entities';
|
|
3
|
+
import * as DocumentLine from '../documentLine/interfaces';
|
|
4
4
|
export type Entity = PreSale;
|
|
5
5
|
export declare const Route = "pre_sale";
|
|
6
6
|
export declare const UpperName = "PreSale";
|
|
@@ -10,11 +10,20 @@ export type IFindResponse = Entity;
|
|
|
10
10
|
export interface IFindResponseWithCount extends Entity {
|
|
11
11
|
count_products: number;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface IPreSaleProduct {
|
|
14
|
+
id: string;
|
|
15
|
+
reference: string;
|
|
16
|
+
designation: string;
|
|
17
|
+
price_sale: number;
|
|
18
|
+
thumbnail: string | null;
|
|
19
|
+
measure: string;
|
|
20
|
+
origin_cabide_product: CabideProduct | null;
|
|
21
|
+
promotions: DocumentLine.IPromotions[];
|
|
22
|
+
}
|
|
14
23
|
export interface IEntityExtended extends Entity {
|
|
15
24
|
lines: {
|
|
16
25
|
pre_sale_product: PreSaleProduct;
|
|
17
|
-
product:
|
|
26
|
+
product: IPreSaleProduct;
|
|
18
27
|
}[];
|
|
19
28
|
}
|
|
20
29
|
export interface IPreSaleFindByUser {
|
|
@@ -58,3 +67,4 @@ export interface IRepository {
|
|
|
58
67
|
importToClientProposal: (data: IImportToClientProposalRequest) => Promise<void>;
|
|
59
68
|
}
|
|
60
69
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
70
|
+
export {};
|