@pastelarai/pastelarai-shared-types 1.0.0

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.
@@ -0,0 +1,34 @@
1
+ export declare enum VIEWTYPE {
2
+ VIEW = "viewMode",
3
+ EDIT = "editMode",
4
+ CREATE = "createMode"
5
+ }
6
+ export declare enum FORECASTVIEWTYPE {
7
+ CALENDAR = "calendar",
8
+ PERCENT = "percent"
9
+ }
10
+ export declare enum STATUS {
11
+ DELETED = "deleted",
12
+ EDITED = "edited",
13
+ INPROCESS = "in process",
14
+ SELECTED = "selected"
15
+ }
16
+ export declare enum VALUETYPE {
17
+ FLOAT = "float",
18
+ INTEGER = "integer",
19
+ STRING = "string",
20
+ OTHER = "other"
21
+ }
22
+ export declare enum CURRENCYDISPLAYTYPE {
23
+ CURRENCY = "currency",
24
+ PERCENTAGE = "percentage"
25
+ }
26
+ export declare enum TASKACTIONTYPE {
27
+ ACT = "ACT",
28
+ REC = "REC"
29
+ }
30
+ export declare enum AVATARSTATUS {
31
+ SELECTED = "selected",
32
+ AVAILABLE = "available",
33
+ UNAVAILABLE = "unavailable"
34
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AVATARSTATUS = exports.TASKACTIONTYPE = exports.CURRENCYDISPLAYTYPE = exports.VALUETYPE = exports.STATUS = exports.FORECASTVIEWTYPE = exports.VIEWTYPE = void 0;
4
+ var VIEWTYPE;
5
+ (function (VIEWTYPE) {
6
+ VIEWTYPE["VIEW"] = "viewMode";
7
+ VIEWTYPE["EDIT"] = "editMode";
8
+ VIEWTYPE["CREATE"] = "createMode";
9
+ })(VIEWTYPE || (exports.VIEWTYPE = VIEWTYPE = {}));
10
+ var FORECASTVIEWTYPE;
11
+ (function (FORECASTVIEWTYPE) {
12
+ FORECASTVIEWTYPE["CALENDAR"] = "calendar";
13
+ FORECASTVIEWTYPE["PERCENT"] = "percent";
14
+ })(FORECASTVIEWTYPE || (exports.FORECASTVIEWTYPE = FORECASTVIEWTYPE = {}));
15
+ var STATUS;
16
+ (function (STATUS) {
17
+ STATUS["DELETED"] = "deleted";
18
+ STATUS["EDITED"] = "edited";
19
+ STATUS["INPROCESS"] = "in process";
20
+ STATUS["SELECTED"] = "selected";
21
+ })(STATUS || (exports.STATUS = STATUS = {}));
22
+ var VALUETYPE;
23
+ (function (VALUETYPE) {
24
+ VALUETYPE["FLOAT"] = "float";
25
+ VALUETYPE["INTEGER"] = "integer";
26
+ VALUETYPE["STRING"] = "string";
27
+ VALUETYPE["OTHER"] = "other";
28
+ })(VALUETYPE || (exports.VALUETYPE = VALUETYPE = {}));
29
+ var CURRENCYDISPLAYTYPE;
30
+ (function (CURRENCYDISPLAYTYPE) {
31
+ CURRENCYDISPLAYTYPE["CURRENCY"] = "currency";
32
+ CURRENCYDISPLAYTYPE["PERCENTAGE"] = "percentage";
33
+ })(CURRENCYDISPLAYTYPE || (exports.CURRENCYDISPLAYTYPE = CURRENCYDISPLAYTYPE = {}));
34
+ var TASKACTIONTYPE;
35
+ (function (TASKACTIONTYPE) {
36
+ TASKACTIONTYPE["ACT"] = "ACT";
37
+ TASKACTIONTYPE["REC"] = "REC";
38
+ })(TASKACTIONTYPE || (exports.TASKACTIONTYPE = TASKACTIONTYPE = {}));
39
+ var AVATARSTATUS;
40
+ (function (AVATARSTATUS) {
41
+ AVATARSTATUS["SELECTED"] = "selected";
42
+ AVATARSTATUS["AVAILABLE"] = "available";
43
+ AVATARSTATUS["UNAVAILABLE"] = "unavailable";
44
+ })(AVATARSTATUS || (exports.AVATARSTATUS = AVATARSTATUS = {}));
@@ -0,0 +1,20 @@
1
+ export interface Category {
2
+ key: string;
3
+ }
4
+ export interface Ingredient {
5
+ category: string | null;
6
+ name: string;
7
+ favorite_supplier: string;
8
+ user_weight: {
9
+ weight: number;
10
+ unit: string;
11
+ cost_per_unit: number;
12
+ };
13
+ cost_per_kg?: number;
14
+ weight?: number;
15
+ value?: number;
16
+ risk?: string;
17
+ forecast?: string;
18
+ [key: string]: string | number | boolean | any;
19
+ _id?: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ import { TaskProduct } from "./products";
2
+ import { ProductInRange } from "./range";
3
+ import { Assignee } from "./team";
4
+ export interface TaskProduction extends TaskProduct {
5
+ assignees_list: Assignee[];
6
+ urgent: boolean;
7
+ quantity: {
8
+ value: number;
9
+ unit: string;
10
+ };
11
+ current_quantity?: number;
12
+ }
13
+ export interface ProductionDay {
14
+ date: string;
15
+ model: boolean;
16
+ tasks_list: TaskProduction[];
17
+ team_members_list: {
18
+ _id: string;
19
+ minutes_assigned: number;
20
+ minutes_unassigned: number;
21
+ conflict: boolean;
22
+ }[];
23
+ total_durations: {
24
+ team: {
25
+ assigned: number;
26
+ unassigned: number;
27
+ total: number;
28
+ };
29
+ tasks: {
30
+ assigned: number;
31
+ unassigned: number;
32
+ total: number;
33
+ };
34
+ total: number;
35
+ };
36
+ }
37
+ export interface ProductionWeek {
38
+ _id?: string;
39
+ start_date: string;
40
+ model: boolean;
41
+ model_name: string;
42
+ content_per_day: {
43
+ products_list: ProductInRange[];
44
+ }[];
45
+ products_list: ProductInRange[];
46
+ deck_tasks_list: TaskProduction[];
47
+ production_per_day: ProductionDay[];
48
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,86 @@
1
+ import { ProductInRange, RangeAvatar } from "./range";
2
+ export interface Format {
3
+ _id: string;
4
+ name: string;
5
+ type: string;
6
+ nb_pers: number;
7
+ diameter?: number;
8
+ rect_width?: number;
9
+ rect_length?: number;
10
+ isSoldWhole: boolean;
11
+ isSoldByPortion: boolean;
12
+ isSoldByPack: boolean;
13
+ selected?: boolean;
14
+ }
15
+ export interface Composition {
16
+ format: Format;
17
+ units_per_batch?: number;
18
+ stock?: number;
19
+ content_list?: ProductContent[];
20
+ costs?: Costs;
21
+ whole_pricing?: Pricing;
22
+ portion_pricing?: Pricing;
23
+ pack_pricing?: Pricing;
24
+ selected?: boolean;
25
+ }
26
+ export interface ProductContent {
27
+ _id: string;
28
+ name: string;
29
+ weight?: number;
30
+ quantity?: number;
31
+ cost: number;
32
+ type: string;
33
+ unit: string;
34
+ }
35
+ export interface Costs {
36
+ content: number;
37
+ labor: number;
38
+ total: number;
39
+ per_unit: number;
40
+ }
41
+ export interface Pricing {
42
+ price: number;
43
+ margin: number;
44
+ margin_percentage: number;
45
+ mult_factor: number;
46
+ nb_portions?: number;
47
+ size_pack?: number;
48
+ }
49
+ export interface Product {
50
+ _id?: string;
51
+ name: string;
52
+ category: "CP01" | "CP02" | "CP03" | "CP04" | "CP05" | "CP06" | "CP07" | "CP08" | "CP09";
53
+ holidays: string;
54
+ storage: {
55
+ unit: "days" | "weeks" | "months";
56
+ value: number;
57
+ };
58
+ stock: number;
59
+ description: string;
60
+ base_format: string;
61
+ composition: Composition[];
62
+ tasks_list: TaskProduct[];
63
+ using?: {
64
+ ranges_list: RangeInUsingProduct[];
65
+ };
66
+ }
67
+ export interface RangeInUsingProduct {
68
+ _id: string;
69
+ avatar: RangeAvatar;
70
+ }
71
+ export interface DestructuredProduct extends Omit<Product, "composition" | "_id">, ProductInRange {
72
+ composition: Composition;
73
+ pricing: Pricing;
74
+ unit_cost: number;
75
+ indexComposition: number;
76
+ size: string;
77
+ selected?: boolean;
78
+ quantity?: number;
79
+ margin?: number;
80
+ }
81
+ export interface TaskProduct {
82
+ action_name: string;
83
+ action_type: "REC" | "ACT";
84
+ duration: number;
85
+ cost: number;
86
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,64 @@
1
+ export interface RangeAvatar {
2
+ color: string;
3
+ initials: string;
4
+ }
5
+ export interface ProductInRange {
6
+ _id: string;
7
+ name: string;
8
+ format_id: string;
9
+ nb_pers: number;
10
+ sale_type: "portion" | "whole" | "pack";
11
+ nb_portions?: number;
12
+ size_pack?: number;
13
+ quantity?: number;
14
+ margin?: number;
15
+ ranges_list?: RangeInSalesDay[];
16
+ custom?: boolean;
17
+ }
18
+ export interface DayContent {
19
+ products_list: ProductInRange[];
20
+ day_quantity: number;
21
+ day_margin: number;
22
+ }
23
+ export interface TotalContent {
24
+ products_list: ProductInRange[];
25
+ week_quantity: number;
26
+ week_margin: number;
27
+ }
28
+ export interface Range {
29
+ _id?: string;
30
+ name: string;
31
+ start_date: string;
32
+ end_date: string;
33
+ avatar: RangeAvatar;
34
+ description: string;
35
+ content_per_day: DayContent[];
36
+ total: TotalContent;
37
+ }
38
+ export interface RangeInSalesDay {
39
+ _id: string;
40
+ avatar: RangeAvatar;
41
+ margin: number;
42
+ quantity: number;
43
+ }
44
+ export interface SalesPlanDay {
45
+ date: string;
46
+ day_margin: number;
47
+ day_quantity: number;
48
+ products_list: ProductInRange[];
49
+ }
50
+ export interface SalesPlanWeek {
51
+ start_date: string;
52
+ week_margin: number;
53
+ week_quantity: number;
54
+ sales_per_day: SalesPlanDay[];
55
+ }
56
+ export interface SalesPlanMonth {
57
+ start_date: string;
58
+ month_margin: number;
59
+ month_quantity: number;
60
+ sales_per_day: {
61
+ date: string;
62
+ ranges_list: RangeInSalesDay[];
63
+ }[];
64
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,34 @@
1
+ export interface RecipeContent {
2
+ _id: string;
3
+ weight: number;
4
+ cost: number;
5
+ quantity: number;
6
+ unit: 'g' | 'piece';
7
+ type: 'ING' | 'REC';
8
+ }
9
+ export interface Recipe {
10
+ name: string;
11
+ recipe_base: boolean;
12
+ storage: {
13
+ unit: string;
14
+ value: number;
15
+ };
16
+ category: 'CR01' | 'CR02' | 'CR03' | 'CR04' | 'CR05' | 'CR06';
17
+ description: string;
18
+ prep_time: number;
19
+ stock: number;
20
+ ingredients_list: RecipeContent[];
21
+ steps_list: string[];
22
+ laminated_dough: {
23
+ weight_unit_dough: number;
24
+ ingredient_id: string;
25
+ weight: number;
26
+ };
27
+ costs: {
28
+ ingredients: number;
29
+ labor: number;
30
+ per_kg: number;
31
+ };
32
+ _id?: string;
33
+ products_list?: string[];
34
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,32 @@
1
+ import { STATUS } from "../data/types";
2
+ export interface Supplier {
3
+ name: string;
4
+ account: {
5
+ user: string;
6
+ pwd: string;
7
+ };
8
+ website: string;
9
+ contact: {
10
+ name: string;
11
+ email: string;
12
+ number: string;
13
+ };
14
+ _id?: string;
15
+ }
16
+ export interface WorkingSupplier extends Supplier {
17
+ status?: STATUS;
18
+ isValid?: boolean;
19
+ errors?: {
20
+ name: boolean;
21
+ account: {
22
+ user: boolean;
23
+ pwd: boolean;
24
+ };
25
+ website: boolean;
26
+ contact: {
27
+ name: boolean;
28
+ email: boolean;
29
+ number: boolean;
30
+ };
31
+ };
32
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,70 @@
1
+ import { AVATARSTATUS } from "../data/types";
2
+ export interface TeamMember {
3
+ avatar: {
4
+ color: string;
5
+ initials: string;
6
+ };
7
+ name: string;
8
+ position: string;
9
+ hourly_pay: number | undefined;
10
+ working_days: ShiftList[][];
11
+ start_date: string;
12
+ end_date?: string;
13
+ additionals: {
14
+ key: string;
15
+ value: string;
16
+ }[];
17
+ _id?: string;
18
+ days_off_list?: {
19
+ start_date: string;
20
+ end_date: string;
21
+ }[];
22
+ overtime_list?: {
23
+ date: string;
24
+ duration: number;
25
+ }[];
26
+ late_list?: {
27
+ date: string;
28
+ duration: number;
29
+ }[];
30
+ absences_list?: {
31
+ date: string;
32
+ duration: number;
33
+ shift: string;
34
+ }[];
35
+ }
36
+ export interface TeamMemberAvatar extends TeamMember {
37
+ type: AVATARSTATUS;
38
+ }
39
+ export interface ShiftList {
40
+ time_in: string | null;
41
+ time_out: string | null;
42
+ }
43
+ export interface Assignee {
44
+ _id: string;
45
+ avatar: {
46
+ color: string;
47
+ initials: string;
48
+ };
49
+ }
50
+ export interface EmployeesShift {
51
+ assignee: Assignee;
52
+ scheduled_off: boolean;
53
+ shifts_list: ShiftList[];
54
+ duration: number;
55
+ labor_cost: number;
56
+ editMode?: boolean;
57
+ }
58
+ export interface ScheduleDay {
59
+ date: string;
60
+ employees_shifts_list: EmployeesShift[];
61
+ _id?: string;
62
+ total_duration: number;
63
+ total_labor_cost: number;
64
+ }
65
+ export interface Schedule {
66
+ schedule_per_day: ScheduleDay[];
67
+ start_date: string;
68
+ total_duration: number;
69
+ total_labor_cost: number;
70
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ export interface Profile {
2
+ email: string;
3
+ firstname: string;
4
+ lastname: string;
5
+ picture?: string;
6
+ default_company: string;
7
+ company_details: {
8
+ [key: string]: Company;
9
+ };
10
+ }
11
+ export interface Company {
12
+ name: string;
13
+ currency: string;
14
+ language: string;
15
+ productionMode: string;
16
+ weight_unit: string;
17
+ subscriptionPlan: string;
18
+ role: string;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@pastelarai/pastelarai-shared-types",
3
+ "version": "1.0.0",
4
+ "description": "Shared types for PastelarAI",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": ["dist"],
8
+ "scripts": {
9
+ "build": "tsc"
10
+ },
11
+ "author": "Aurelia Azarmi",
12
+ "license": "MIT",
13
+ "devDependencies": {
14
+ "typescript": "^5.7.2"
15
+ }
16
+ }