@techallee/foodverse 1.4.0 → 1.4.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techallee/foodverse",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "index.d.ts",
@@ -1,8 +1,16 @@
1
- declare type OrderSource = 'foodverse_web' | 'foodverse_local' | 'foodverse_terminal' | 'foodverse_app' | 'lieferando' | 'wolt' | 'uber_eats';
1
+ declare type OrderSource =
2
+ 'foodverse_web'
3
+ | 'foodverse_local'
4
+ | 'foodverse_terminal'
5
+ | 'foodverse_app'
6
+ | 'lieferando'
7
+ | 'wolt'
8
+ | 'uber_eats';
2
9
  declare type PrintStatus = 'pending' | 'success' | 'error';
3
10
  declare type OrderStatus = 'created' | 'confirmed' | 'prepared' | 'delivered' | 'cancelled'
4
11
  declare type DeliveryType = 'service' | 'in_house' | 'pickup' | 'delivery';
5
12
  declare type PaymentType = 'cash' | 'online' | 'card';
13
+ declare type DiscountType = 'percentage' | 'amount';
6
14
 
7
15
  declare interface Price {
8
16
  price: number;
@@ -10,6 +18,13 @@ declare interface Price {
10
18
  deliveryPrice: number;
11
19
  }
12
20
 
21
+ declare interface Discount {
22
+ discountType: DiscountType;
23
+ value: number;
24
+ startDate: string;
25
+ endDate: string;
26
+ }
27
+
13
28
  declare interface ItemAttributes {
14
29
  depositAmount?: string;
15
30
  volume?: string;
@@ -23,90 +38,95 @@ declare interface ItemAttributes {
23
38
  }
24
39
 
25
40
  declare interface OrderSpecification {
26
- name: string;
27
- quantity: number;
28
- price: number;
41
+ name: string;
42
+ quantity: number;
43
+ done: number;
44
+ price: number;
29
45
  }
30
46
 
31
47
  declare interface OrderProduct {
32
- name: string;
33
- categoryName: string;
34
- code?: string | null;
35
- quantity: number;
36
- price: number;
37
- totalPrice: number;
38
- remarks?: string | null;
39
- specifications: OrderSpecification[];
48
+ id: string;
49
+ name: string;
50
+ categoryName: string;
51
+ shortName?: string | null;
52
+ code?: string | null;
53
+ quantity: number;
54
+ done: number;
55
+ price: number;
56
+ totalPrice: number;
57
+ remarks?: string | null;
58
+ specifications: OrderSpecification[];
59
+ discount: Discount;
40
60
  }
41
61
 
42
62
  declare interface OrderPrices {
43
- deliveryFee: number;
44
- discountTotal: number;
45
- subTotal: number;
46
- totalPrice: number;
63
+ deliveryFee: number;
64
+ discountTotal: number;
65
+ subTotal: number;
66
+ totalPrice: number;
47
67
  }
48
68
 
49
69
  declare interface Address {
50
- id: string;
51
- fullName: string;
52
- street: string | null;
53
- houseNumber: string | null;
54
- postcode: string | null;
55
- city: string | null;
56
- extra: string;
57
- companyName: string | null;
58
- phoneNumber: string | null;
59
- phonePinCode: string | null;
60
- latitude: number | null;
61
- longitude: number | null;
62
- distance: number | null;
63
- route: [number, number][] | null;
64
- bbox: [[number, number], [number, number]] | null;
65
- userId: string | null;
70
+ id: string;
71
+ fullName: string;
72
+ street: string | null;
73
+ houseNumber: string | null;
74
+ postcode: string | null;
75
+ city: string | null;
76
+ extra: string;
77
+ companyName: string | null;
78
+ phoneNumber: string | null;
79
+ phonePinCode: string | null;
80
+ latitude: number | null;
81
+ longitude: number | null;
82
+ distance: number | null;
83
+ route: [number, number][] | null;
84
+ bbox: [[number, number], [number, number]] | null;
85
+ userId: string | null;
66
86
  }
67
87
 
68
88
  declare interface Order {
69
- id: string;
70
- externalId?: string | null;
71
- placedDate: string;
72
- orderPlaced?: string | null;
73
- orderDelivered?: string | null;
74
- orderPickedUp?: string | null;
75
- requestedTime?: string | null;
76
- remarks: string;
77
- remarksEn: string;
78
- remarksVi: string;
79
- publicReference: string;
80
- dayReference: string;
81
- source: OrderSource;
82
- products: OrderProduct[];
83
- separatedProducts: OrderProduct[];
84
- prices: OrderPrices;
85
- inKitchen: boolean;
86
- isPending: boolean;
87
- printStatus: PrintStatus;
88
- basket: string;
89
- paymentType: PaymentType;
90
- deliveryType: DeliveryType;
91
- status: OrderStatus;
92
- areaId?: string | null;
93
- customerId: string;
94
- userId?: string | null;
95
- restaurantId: string;
96
- staffId?: string | null;
97
- deliveredAt?: string | null;
98
- arrivedAt?: string | null;
89
+ id: string;
90
+ externalId?: string | null;
91
+ placedDate: string;
92
+ orderPlaced?: string | null;
93
+ orderDelivered?: string | null;
94
+ orderPickedUp?: string | null;
95
+ requestedTime?: string | null;
96
+ remarks: string;
97
+ remarksEn: string;
98
+ remarksVi: string;
99
+ publicReference: string;
100
+ dayReference: string;
101
+ source: OrderSource;
102
+ products: OrderProduct[];
103
+ separatedProducts: OrderProduct[];
104
+ prices: OrderPrices;
105
+ inKitchen: boolean;
106
+ isPending: boolean;
107
+ printStatus: PrintStatus;
108
+ basket: string;
109
+ paymentType: PaymentType;
110
+ deliveryType: DeliveryType;
111
+ status: OrderStatus;
112
+ areaId?: string | null;
113
+ customerId: string;
114
+ userId?: string | null;
115
+ restaurantId: string;
116
+ staffId?: string | null;
117
+ deliveredAt?: string | null;
118
+ arrivedAt?: string | null;
99
119
 
100
- customer: Address,
120
+ customer: Address,
101
121
 
102
- remainingTime: number | null;
103
- printedPrinterIds?: string[];
104
- moving: boolean | null;
105
- hidden: boolean | null;
106
- tooltip: string | null;
107
- size: [number, number];
108
- anchor: [number, number];
109
- icon: IconCollection;
122
+ remainingTime: number | null;
123
+ printedPrinterIds?: string[];
124
+ moving: boolean | null;
125
+ hidden: boolean | null;
126
+ tooltip: string | null;
127
+ size: [number, number];
128
+ anchor: [number, number];
129
+ icon: IconCollection;
110
130
 
111
- staff?: Staff | null
131
+ staff?: Staff | null
112
132
  }
@@ -19,7 +19,8 @@ declare type State =
19
19
  declare type OpenTimeType = 'pause' | 'opened' | 'delivery' | 'takeaway';
20
20
  declare type WeekDayType = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
21
21
  declare type VehicleType = 'nothing' | 'bike' | 'motorbike' | 'car' | 'scooter' | 'skateboard';
22
- declare type WalletType = 'nothing' | 'cash_register' | 'waiter_wallet' | 'courier_wallet'
22
+ declare type WalletType = 'nothing' | 'cash_register' | 'waiter_wallet' | 'courier_wallet';
23
+ declare type ReminderTrigger = 'onOrderCreated' | 'onOrderConfirmed' | 'onOrderSorted' | 'onOrderPrepared' | 'onOrderDelivered' | 'alwaysReminder';
23
24
 
24
25
  declare type Holiday = Record<State, Record<string, {datum: string; hinweis: string}>>
25
26
 
@@ -165,6 +166,15 @@ declare interface Wallet {
165
166
  records?: Transaction[];
166
167
  }
167
168
 
169
+ declare interface Reminder {
170
+ id: string;
171
+ name: string;
172
+ trigger: ReminderTrigger;
173
+ targets: RoleCode[];
174
+ remindedProducts: string[];
175
+ userId: string;
176
+ }
177
+
168
178
  declare interface Restaurant {
169
179
  id: string;
170
180
  name: string;