@pastelarai/pastelarai-shared-types 1.0.115 → 1.0.118

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,8 +1,8 @@
1
- import { CONTENTTYPE, STORAGEUNIT, TASKACTIONTYPE, TASKUNIT, UNIT } from "src/data/types";
1
+ import { CONTENTTYPE, STATUS, STORAGEUNIT, TASKACTIONTYPE, TASKUNIT, UNIT } from "src/data/types";
2
2
  import { PRODUCTCATEGORY } from "src/data/categories";
3
3
  import { IdName } from "./bill";
4
4
  import { Avatar, Customer, ProductInRange } from "./ranges";
5
- import { WorkingRecipe, WorkingRecipeContent } from "./recipes";
5
+ import { WorkingRecipe, Content, WorkingContent } from "./recipes";
6
6
  export interface Format {
7
7
  _id?: string;
8
8
  name: string;
@@ -22,7 +22,7 @@ export interface CompositionBase {
22
22
  format: Format;
23
23
  units_per_batch: number;
24
24
  stock?: number;
25
- content_list: ProductContent[];
25
+ content_list: Content[];
26
26
  tasks_list: TaskProduct[];
27
27
  costs: Costs;
28
28
  }
@@ -30,15 +30,6 @@ export type PricingType = "whole_pricing" | "portion_pricing" | "pack_pricing";
30
30
  export type Composition = CompositionBase & {
31
31
  [key in PricingType]?: Pricing;
32
32
  };
33
- export interface ProductContent {
34
- _id?: string;
35
- name: string;
36
- weight?: number;
37
- quantity?: number;
38
- cost: number;
39
- type: CONTENTTYPE;
40
- unit: UNIT;
41
- }
42
33
  export interface Costs {
43
34
  content: number;
44
35
  labor: number;
@@ -76,7 +67,7 @@ export interface ScannedProduct {
76
67
  name: string;
77
68
  category: PRODUCTCATEGORY;
78
69
  description: string;
79
- content_list: WorkingRecipeContent[];
70
+ content_list: WorkingContent[];
80
71
  recipes: WorkingRecipe[];
81
72
  }
82
73
  export interface IdNameAvatar extends IdName {
@@ -108,3 +99,41 @@ export interface TaskProduct {
108
99
  unit: UNIT;
109
100
  };
110
101
  }
102
+ export interface WorkingFormat extends Format {
103
+ category?: PRODUCTCATEGORY;
104
+ creationMode?: "CUS" | "GLO";
105
+ status?: STATUS;
106
+ isValid?: boolean;
107
+ errors?: {
108
+ type: boolean;
109
+ nb_pers: boolean;
110
+ size: boolean;
111
+ type_sale: boolean;
112
+ duplicate: boolean;
113
+ };
114
+ }
115
+ export interface WorkingCompositionBase extends Omit<CompositionBase, 'format' | 'content_list'> {
116
+ format: WorkingFormat;
117
+ selected?: boolean;
118
+ content_list: WorkingContent[];
119
+ }
120
+ export type WorkingComposition = WorkingCompositionBase & {
121
+ [key in PricingType]?: Pricing;
122
+ };
123
+ export interface WorkingProduct {
124
+ name: string;
125
+ category: PRODUCTCATEGORY;
126
+ holidays: string;
127
+ storage: {
128
+ unit: STORAGEUNIT;
129
+ value: number;
130
+ };
131
+ stock: number;
132
+ description: string;
133
+ base_format: string;
134
+ composition: WorkingComposition[];
135
+ _id?: string;
136
+ using?: {
137
+ ranges_list: IdNameAvatar[];
138
+ };
139
+ }
@@ -1,7 +1,7 @@
1
1
  import { RECIPECATEGORY } from "src/data/categories";
2
2
  import { CONTENTTYPE, UNIT, STORAGEUNIT } from "../data/types";
3
3
  import { IdName } from "./bill";
4
- export interface RecipeContent {
4
+ export interface Content {
5
5
  _id?: string;
6
6
  name: string;
7
7
  weight: number;
@@ -34,7 +34,7 @@ export interface Recipe {
34
34
  description: string;
35
35
  prep_time?: number;
36
36
  stock: number;
37
- ingredients_list: RecipeContent[];
37
+ ingredients_list: Content[];
38
38
  steps_list: string[];
39
39
  laminated_dough?: LaminatedDough;
40
40
  costs: RecipeCost;
@@ -44,7 +44,7 @@ export interface Recipe {
44
44
  recipes_list: IdName[];
45
45
  };
46
46
  }
47
- export interface WorkingRecipeContent extends RecipeContent {
47
+ export interface WorkingContent extends Content {
48
48
  error: boolean;
49
49
  }
50
50
  export interface WorkingLaminatedDough extends Omit<LaminatedDough, 'ingredient_id'> {
@@ -52,7 +52,7 @@ export interface WorkingLaminatedDough extends Omit<LaminatedDough, 'ingredient_
52
52
  error: boolean;
53
53
  }
54
54
  export interface WorkingRecipe extends Omit<Recipe, 'ingredients_list' | 'laminated_dough'> {
55
- ingredients_list: WorkingRecipeContent[];
55
+ ingredients_list: WorkingContent[];
56
56
  laminated_dough?: WorkingLaminatedDough;
57
57
  subrecipes?: WorkingRecipe[];
58
58
  }
@@ -1,7 +1,7 @@
1
1
  import { IdName, IngredientInBill } from "./bill";
2
2
  import { Ingredient } from "./ingredients";
3
- import { Format, ProductContent, TaskProduct } from "./products";
4
- import { LaminatedDough, RecipeContent } from "./recipes";
3
+ import { Format, TaskProduct } from "./products";
4
+ import { LaminatedDough, Content } from "./recipes";
5
5
  import { Supplier } from "./suppliers";
6
6
  import { Additional } from "./team";
7
7
  import { Avatar, ProductInRange } from "./ranges";
@@ -17,7 +17,7 @@ export interface SuggestionsResults {
17
17
  export interface CompositionProductSearchResult {
18
18
  format: Format;
19
19
  units_per_batch: number;
20
- content_list?: ProductContent[];
20
+ content_list?: Content[];
21
21
  tasks_list?: TaskProduct[];
22
22
  }
23
23
  export interface ProductSearchResult {
@@ -35,7 +35,7 @@ export interface RecipeSearchResult {
35
35
  category: RECIPECATEGORY;
36
36
  description: string;
37
37
  prep_time: number;
38
- ingredients_list?: RecipeContent[];
38
+ ingredients_list?: Content[];
39
39
  steps_list?: string[];
40
40
  laminated_dough?: LaminatedDough;
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pastelarai/pastelarai-shared-types",
3
- "version": "1.0.115",
3
+ "version": "1.0.118",
4
4
  "description": "Shared types for PastelarAI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",