@mydoormot/app-types 1.7.29 → 1.7.31
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/.turbo/turbo-build.log +18 -18
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +68 -25
- package/dist/index.d.ts +68 -25
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/business.ts +0 -1
- package/src/errand.ts +2 -1
- package/src/index.ts +1 -0
- package/src/rider.ts +4 -46
- package/src/transaction.ts +3 -0
- package/src/user.ts +0 -1
- package/src/vehicle.ts +95 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
> @mydoormot/app-types@1.7.
|
|
3
|
-
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
|
|
2
|
+
> @mydoormot/app-types@1.7.30 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
|
+
> tsup src/index.ts --format esm,cjs --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v7.3.0
|
|
8
|
+
[34mCLI[39m Target: es2021
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[34mCJS[39m Build start
|
|
11
|
+
[34mDTS[39m Build start
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m9.00 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 272ms
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m7.15 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 272ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 668ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m27.96 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m27.96 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -167,7 +167,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
|
167
167
|
return NotificationType2;
|
|
168
168
|
})(NotificationType || {});
|
|
169
169
|
|
|
170
|
-
// src/
|
|
170
|
+
// src/vehicle.ts
|
|
171
171
|
var VehicleType = /* @__PURE__ */ ((VehicleType2) => {
|
|
172
172
|
VehicleType2["Bike"] = "bike";
|
|
173
173
|
VehicleType2["Shuttle"] = "shuttle";
|
|
@@ -177,6 +177,8 @@ var VehicleLogType = /* @__PURE__ */ ((VehicleLogType2) => {
|
|
|
177
177
|
VehicleLogType2["REFUEL"] = "REFUEL";
|
|
178
178
|
return VehicleLogType2;
|
|
179
179
|
})(VehicleLogType || {});
|
|
180
|
+
|
|
181
|
+
// src/rider.ts
|
|
180
182
|
var RemittanceStatus = /* @__PURE__ */ ((RemittanceStatus2) => {
|
|
181
183
|
RemittanceStatus2["Pending"] = "pending";
|
|
182
184
|
RemittanceStatus2["Remitted"] = "remitted";
|
package/dist/index.d.cts
CHANGED
|
@@ -72,7 +72,6 @@ type User = {
|
|
|
72
72
|
accountType?: 'business' | 'personal';
|
|
73
73
|
hasOnboarded?: boolean;
|
|
74
74
|
lastActivity?: string;
|
|
75
|
-
isManaged?: boolean;
|
|
76
75
|
lastLoggedInBusinessId?: string;
|
|
77
76
|
globalRole: GlobalRoles | `${GlobalRoles}`;
|
|
78
77
|
isActive?: boolean;
|
|
@@ -180,25 +179,6 @@ interface InvoiceItem {
|
|
|
180
179
|
itemDetails?: Errand;
|
|
181
180
|
}
|
|
182
181
|
|
|
183
|
-
type Rider = {
|
|
184
|
-
id: string;
|
|
185
|
-
userId: string;
|
|
186
|
-
vehicleId?: string;
|
|
187
|
-
currLocation: {
|
|
188
|
-
coordinates: number[];
|
|
189
|
-
};
|
|
190
|
-
vehicleNumber?: string;
|
|
191
|
-
verified: boolean;
|
|
192
|
-
active: boolean;
|
|
193
|
-
updatedAt: Date;
|
|
194
|
-
createdAt: Date;
|
|
195
|
-
rating: number;
|
|
196
|
-
version: number;
|
|
197
|
-
hasBeenRated: boolean;
|
|
198
|
-
state?: string | State;
|
|
199
|
-
currentErrand?: Errand;
|
|
200
|
-
lastDeliveredErrand?: Errand;
|
|
201
|
-
};
|
|
202
182
|
declare enum VehicleType {
|
|
203
183
|
Bike = "bike",
|
|
204
184
|
Shuttle = "shuttle"
|
|
@@ -214,9 +194,6 @@ type Vehicle = {
|
|
|
214
194
|
shortName?: string;
|
|
215
195
|
userId?: string;
|
|
216
196
|
};
|
|
217
|
-
type RiderWithUserDetails = Rider & {
|
|
218
|
-
userDetails?: User;
|
|
219
|
-
};
|
|
220
197
|
type VehicleWithRider = Vehicle & {
|
|
221
198
|
riders: RiderWithUserDetails[];
|
|
222
199
|
};
|
|
@@ -235,12 +212,75 @@ type VehicleLog = {
|
|
|
235
212
|
updatedAt: string;
|
|
236
213
|
previousLogId?: string;
|
|
237
214
|
errandIdsSinceLastRefuel?: string[];
|
|
215
|
+
lastRecalculatedAt?: string;
|
|
238
216
|
vehicleDetails?: Vehicle;
|
|
239
217
|
};
|
|
240
218
|
type VehicleLogWithErrands = VehicleLog & {
|
|
241
219
|
errandsCount?: number;
|
|
242
220
|
totalErrandsRevenue?: number;
|
|
243
221
|
};
|
|
222
|
+
interface VehicleErrandStats {
|
|
223
|
+
count: number;
|
|
224
|
+
totalRevenue: number;
|
|
225
|
+
}
|
|
226
|
+
interface VehicleFuelStats {
|
|
227
|
+
totalCost: number;
|
|
228
|
+
totalLiters: number;
|
|
229
|
+
refuelCount: number;
|
|
230
|
+
}
|
|
231
|
+
interface VehicleMaintenanceStats {
|
|
232
|
+
totalCost: number;
|
|
233
|
+
recordCount: number;
|
|
234
|
+
}
|
|
235
|
+
interface VehiclePerformanceItem {
|
|
236
|
+
vehicleId: string;
|
|
237
|
+
vehicleNumber: string;
|
|
238
|
+
shortName: string | null;
|
|
239
|
+
errands: VehicleErrandStats;
|
|
240
|
+
fuel: VehicleFuelStats;
|
|
241
|
+
maintenance: VehicleMaintenanceStats;
|
|
242
|
+
netProfit: number;
|
|
243
|
+
}
|
|
244
|
+
interface VehiclePerformanceTotals {
|
|
245
|
+
totalRevenue: number;
|
|
246
|
+
totalFuelCost: number;
|
|
247
|
+
totalMaintenanceCost: number;
|
|
248
|
+
netProfit: number;
|
|
249
|
+
}
|
|
250
|
+
interface VehiclePerformanceFilters {
|
|
251
|
+
businessId: string;
|
|
252
|
+
vehicleId: string | null;
|
|
253
|
+
startDate: string | null;
|
|
254
|
+
endDate: string | null;
|
|
255
|
+
}
|
|
256
|
+
interface VehiclePerformanceData {
|
|
257
|
+
vehicles: VehiclePerformanceItem[];
|
|
258
|
+
totals: VehiclePerformanceTotals;
|
|
259
|
+
filters: VehiclePerformanceFilters;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
type Rider = {
|
|
263
|
+
id: string;
|
|
264
|
+
userId: string;
|
|
265
|
+
vehicleId?: string;
|
|
266
|
+
currLocation: {
|
|
267
|
+
coordinates: number[];
|
|
268
|
+
};
|
|
269
|
+
vehicleNumber?: string;
|
|
270
|
+
verified: boolean;
|
|
271
|
+
active: boolean;
|
|
272
|
+
updatedAt: Date;
|
|
273
|
+
createdAt: Date;
|
|
274
|
+
rating: number;
|
|
275
|
+
version: number;
|
|
276
|
+
hasBeenRated: boolean;
|
|
277
|
+
state?: string | State;
|
|
278
|
+
currentErrand?: Errand;
|
|
279
|
+
lastDeliveredErrand?: Errand;
|
|
280
|
+
};
|
|
281
|
+
type RiderWithUserDetails = Rider & {
|
|
282
|
+
userDetails?: User;
|
|
283
|
+
};
|
|
244
284
|
declare enum RemittanceStatus {
|
|
245
285
|
Pending = "pending",
|
|
246
286
|
Remitted = "remitted",
|
|
@@ -402,6 +442,7 @@ interface Errand {
|
|
|
402
442
|
userDetails?: User;
|
|
403
443
|
courierBusinessDetails?: Business;
|
|
404
444
|
riderDetails?: Rider;
|
|
445
|
+
vehicleDetails?: Vehicle;
|
|
405
446
|
}
|
|
406
447
|
interface AggregatedErrand extends Errand {
|
|
407
448
|
parcelSize: `${ParcelSize}`;
|
|
@@ -628,7 +669,6 @@ interface Business {
|
|
|
628
669
|
updatedAt: string | NullOrUndefined | Date;
|
|
629
670
|
verifiedAt: string | NullOrUndefined | Date;
|
|
630
671
|
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
631
|
-
isManaged: boolean | NullOrUndefined;
|
|
632
672
|
businessCategoryDetails: BusinessCategory | NullOrUndefined;
|
|
633
673
|
capabilities: BusinessCapability[] | NullOrUndefined;
|
|
634
674
|
}
|
|
@@ -835,6 +875,9 @@ interface TransactionItem {
|
|
|
835
875
|
quantity: number;
|
|
836
876
|
unitPrice: number;
|
|
837
877
|
totalPrice: number;
|
|
878
|
+
productId?: string;
|
|
879
|
+
variantId?: string;
|
|
880
|
+
isAddon?: boolean;
|
|
838
881
|
}
|
|
839
882
|
interface Transaction {
|
|
840
883
|
id: string;
|
|
@@ -1047,4 +1090,4 @@ declare enum LinkDestination {
|
|
|
1047
1090
|
}
|
|
1048
1091
|
type NullOrUndefined = null | undefined;
|
|
1049
1092
|
|
|
1050
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
|
1093
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -72,7 +72,6 @@ type User = {
|
|
|
72
72
|
accountType?: 'business' | 'personal';
|
|
73
73
|
hasOnboarded?: boolean;
|
|
74
74
|
lastActivity?: string;
|
|
75
|
-
isManaged?: boolean;
|
|
76
75
|
lastLoggedInBusinessId?: string;
|
|
77
76
|
globalRole: GlobalRoles | `${GlobalRoles}`;
|
|
78
77
|
isActive?: boolean;
|
|
@@ -180,25 +179,6 @@ interface InvoiceItem {
|
|
|
180
179
|
itemDetails?: Errand;
|
|
181
180
|
}
|
|
182
181
|
|
|
183
|
-
type Rider = {
|
|
184
|
-
id: string;
|
|
185
|
-
userId: string;
|
|
186
|
-
vehicleId?: string;
|
|
187
|
-
currLocation: {
|
|
188
|
-
coordinates: number[];
|
|
189
|
-
};
|
|
190
|
-
vehicleNumber?: string;
|
|
191
|
-
verified: boolean;
|
|
192
|
-
active: boolean;
|
|
193
|
-
updatedAt: Date;
|
|
194
|
-
createdAt: Date;
|
|
195
|
-
rating: number;
|
|
196
|
-
version: number;
|
|
197
|
-
hasBeenRated: boolean;
|
|
198
|
-
state?: string | State;
|
|
199
|
-
currentErrand?: Errand;
|
|
200
|
-
lastDeliveredErrand?: Errand;
|
|
201
|
-
};
|
|
202
182
|
declare enum VehicleType {
|
|
203
183
|
Bike = "bike",
|
|
204
184
|
Shuttle = "shuttle"
|
|
@@ -214,9 +194,6 @@ type Vehicle = {
|
|
|
214
194
|
shortName?: string;
|
|
215
195
|
userId?: string;
|
|
216
196
|
};
|
|
217
|
-
type RiderWithUserDetails = Rider & {
|
|
218
|
-
userDetails?: User;
|
|
219
|
-
};
|
|
220
197
|
type VehicleWithRider = Vehicle & {
|
|
221
198
|
riders: RiderWithUserDetails[];
|
|
222
199
|
};
|
|
@@ -235,12 +212,75 @@ type VehicleLog = {
|
|
|
235
212
|
updatedAt: string;
|
|
236
213
|
previousLogId?: string;
|
|
237
214
|
errandIdsSinceLastRefuel?: string[];
|
|
215
|
+
lastRecalculatedAt?: string;
|
|
238
216
|
vehicleDetails?: Vehicle;
|
|
239
217
|
};
|
|
240
218
|
type VehicleLogWithErrands = VehicleLog & {
|
|
241
219
|
errandsCount?: number;
|
|
242
220
|
totalErrandsRevenue?: number;
|
|
243
221
|
};
|
|
222
|
+
interface VehicleErrandStats {
|
|
223
|
+
count: number;
|
|
224
|
+
totalRevenue: number;
|
|
225
|
+
}
|
|
226
|
+
interface VehicleFuelStats {
|
|
227
|
+
totalCost: number;
|
|
228
|
+
totalLiters: number;
|
|
229
|
+
refuelCount: number;
|
|
230
|
+
}
|
|
231
|
+
interface VehicleMaintenanceStats {
|
|
232
|
+
totalCost: number;
|
|
233
|
+
recordCount: number;
|
|
234
|
+
}
|
|
235
|
+
interface VehiclePerformanceItem {
|
|
236
|
+
vehicleId: string;
|
|
237
|
+
vehicleNumber: string;
|
|
238
|
+
shortName: string | null;
|
|
239
|
+
errands: VehicleErrandStats;
|
|
240
|
+
fuel: VehicleFuelStats;
|
|
241
|
+
maintenance: VehicleMaintenanceStats;
|
|
242
|
+
netProfit: number;
|
|
243
|
+
}
|
|
244
|
+
interface VehiclePerformanceTotals {
|
|
245
|
+
totalRevenue: number;
|
|
246
|
+
totalFuelCost: number;
|
|
247
|
+
totalMaintenanceCost: number;
|
|
248
|
+
netProfit: number;
|
|
249
|
+
}
|
|
250
|
+
interface VehiclePerformanceFilters {
|
|
251
|
+
businessId: string;
|
|
252
|
+
vehicleId: string | null;
|
|
253
|
+
startDate: string | null;
|
|
254
|
+
endDate: string | null;
|
|
255
|
+
}
|
|
256
|
+
interface VehiclePerformanceData {
|
|
257
|
+
vehicles: VehiclePerformanceItem[];
|
|
258
|
+
totals: VehiclePerformanceTotals;
|
|
259
|
+
filters: VehiclePerformanceFilters;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
type Rider = {
|
|
263
|
+
id: string;
|
|
264
|
+
userId: string;
|
|
265
|
+
vehicleId?: string;
|
|
266
|
+
currLocation: {
|
|
267
|
+
coordinates: number[];
|
|
268
|
+
};
|
|
269
|
+
vehicleNumber?: string;
|
|
270
|
+
verified: boolean;
|
|
271
|
+
active: boolean;
|
|
272
|
+
updatedAt: Date;
|
|
273
|
+
createdAt: Date;
|
|
274
|
+
rating: number;
|
|
275
|
+
version: number;
|
|
276
|
+
hasBeenRated: boolean;
|
|
277
|
+
state?: string | State;
|
|
278
|
+
currentErrand?: Errand;
|
|
279
|
+
lastDeliveredErrand?: Errand;
|
|
280
|
+
};
|
|
281
|
+
type RiderWithUserDetails = Rider & {
|
|
282
|
+
userDetails?: User;
|
|
283
|
+
};
|
|
244
284
|
declare enum RemittanceStatus {
|
|
245
285
|
Pending = "pending",
|
|
246
286
|
Remitted = "remitted",
|
|
@@ -402,6 +442,7 @@ interface Errand {
|
|
|
402
442
|
userDetails?: User;
|
|
403
443
|
courierBusinessDetails?: Business;
|
|
404
444
|
riderDetails?: Rider;
|
|
445
|
+
vehicleDetails?: Vehicle;
|
|
405
446
|
}
|
|
406
447
|
interface AggregatedErrand extends Errand {
|
|
407
448
|
parcelSize: `${ParcelSize}`;
|
|
@@ -628,7 +669,6 @@ interface Business {
|
|
|
628
669
|
updatedAt: string | NullOrUndefined | Date;
|
|
629
670
|
verifiedAt: string | NullOrUndefined | Date;
|
|
630
671
|
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
631
|
-
isManaged: boolean | NullOrUndefined;
|
|
632
672
|
businessCategoryDetails: BusinessCategory | NullOrUndefined;
|
|
633
673
|
capabilities: BusinessCapability[] | NullOrUndefined;
|
|
634
674
|
}
|
|
@@ -835,6 +875,9 @@ interface TransactionItem {
|
|
|
835
875
|
quantity: number;
|
|
836
876
|
unitPrice: number;
|
|
837
877
|
totalPrice: number;
|
|
878
|
+
productId?: string;
|
|
879
|
+
variantId?: string;
|
|
880
|
+
isAddon?: boolean;
|
|
838
881
|
}
|
|
839
882
|
interface Transaction {
|
|
840
883
|
id: string;
|
|
@@ -1047,4 +1090,4 @@ declare enum LinkDestination {
|
|
|
1047
1090
|
}
|
|
1048
1091
|
type NullOrUndefined = null | undefined;
|
|
1049
1092
|
|
|
1050
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
|
1093
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, type Collection, type Coupon, type Customer, type CustomerTransactionStats, DeliveryStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, GlobalRoles, type Invoice, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, SettlementType, type State, type TraccarDevice, TraccarDeviceStatus, type TraccarPosition, type TrackerDevice, type Transaction, type TransactionCategory, type TransactionItem, type TransactionType, type TransactionWithCategory, type TransactionWithJoin, type User, type UserAddress, type Vehicle, type VehicleErrandStats, type VehicleFuelStats, type VehicleLog, type VehicleLogStatsSummary, VehicleLogType, type VehicleLogWithErrands, type VehicleMaintenanceStats, type VehiclePerformanceData, type VehiclePerformanceFilters, type VehiclePerformanceItem, type VehiclePerformanceTotals, VehicleType, type VehicleWithRider, type Vendor, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -119,7 +119,7 @@ var NotificationType = /* @__PURE__ */ ((NotificationType2) => {
|
|
|
119
119
|
return NotificationType2;
|
|
120
120
|
})(NotificationType || {});
|
|
121
121
|
|
|
122
|
-
// src/
|
|
122
|
+
// src/vehicle.ts
|
|
123
123
|
var VehicleType = /* @__PURE__ */ ((VehicleType2) => {
|
|
124
124
|
VehicleType2["Bike"] = "bike";
|
|
125
125
|
VehicleType2["Shuttle"] = "shuttle";
|
|
@@ -129,6 +129,8 @@ var VehicleLogType = /* @__PURE__ */ ((VehicleLogType2) => {
|
|
|
129
129
|
VehicleLogType2["REFUEL"] = "REFUEL";
|
|
130
130
|
return VehicleLogType2;
|
|
131
131
|
})(VehicleLogType || {});
|
|
132
|
+
|
|
133
|
+
// src/rider.ts
|
|
132
134
|
var RemittanceStatus = /* @__PURE__ */ ((RemittanceStatus2) => {
|
|
133
135
|
RemittanceStatus2["Pending"] = "pending";
|
|
134
136
|
RemittanceStatus2["Remitted"] = "remitted";
|
package/package.json
CHANGED
package/src/business.ts
CHANGED
|
@@ -40,7 +40,6 @@ export interface Business {
|
|
|
40
40
|
updatedAt: string | NullOrUndefined | Date;
|
|
41
41
|
verifiedAt: string | NullOrUndefined | Date;
|
|
42
42
|
registrationCompletedAt: string | NullOrUndefined | Date;
|
|
43
|
-
isManaged: boolean | NullOrUndefined;
|
|
44
43
|
businessCategoryDetails: BusinessCategory | NullOrUndefined;
|
|
45
44
|
capabilities: BusinessCapability[] | NullOrUndefined;
|
|
46
45
|
}
|
package/src/errand.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Invoice, InvoiceStatus } from './invoice';
|
|
|
4
4
|
import { City } from './location';
|
|
5
5
|
import { Rider } from './rider';
|
|
6
6
|
import { User } from './user';
|
|
7
|
+
import { Vehicle } from './vehicle';
|
|
7
8
|
|
|
8
9
|
export enum ErrandStatus {
|
|
9
10
|
Pending = 'pending',
|
|
@@ -163,7 +164,7 @@ export interface Errand {
|
|
|
163
164
|
|
|
164
165
|
// new fields
|
|
165
166
|
riderDetails?: Rider;
|
|
166
|
-
|
|
167
|
+
vehicleDetails?: Vehicle;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
export interface AggregatedErrand extends Errand {
|
package/src/index.ts
CHANGED
package/src/rider.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { Errand } from './errand';
|
|
|
3
3
|
import { State } from './location';
|
|
4
4
|
import { User } from './user';
|
|
5
5
|
|
|
6
|
+
// Re-export vehicle types for backwards compatibility
|
|
7
|
+
export type { Vehicle, VehicleWithRider, VehicleLog, VehicleLogWithErrands } from './vehicle';
|
|
8
|
+
export { VehicleType, VehicleLogType } from './vehicle';
|
|
9
|
+
|
|
6
10
|
export type Rider = {
|
|
7
11
|
id: string;
|
|
8
12
|
userId: string;
|
|
@@ -29,56 +33,10 @@ export type Rider = {
|
|
|
29
33
|
lastDeliveredErrand?: Errand;
|
|
30
34
|
};
|
|
31
35
|
|
|
32
|
-
export enum VehicleType {
|
|
33
|
-
Bike = 'bike',
|
|
34
|
-
Shuttle = 'shuttle',
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type Vehicle = {
|
|
38
|
-
id: string;
|
|
39
|
-
vehicleNumber: string;
|
|
40
|
-
version: number;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
updatedAt: string;
|
|
43
|
-
vehicleType: VehicleType | `${VehicleType}`;
|
|
44
|
-
businessId: string;
|
|
45
|
-
|
|
46
|
-
shortName?: string;
|
|
47
|
-
userId?: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
36
|
export type RiderWithUserDetails = Rider & {
|
|
51
37
|
userDetails?: User;
|
|
52
38
|
};
|
|
53
39
|
|
|
54
|
-
export type VehicleWithRider = Vehicle & {
|
|
55
|
-
riders: RiderWithUserDetails[];
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export enum VehicleLogType {
|
|
59
|
-
REFUEL = 'REFUEL',
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type VehicleLog = {
|
|
63
|
-
id: string;
|
|
64
|
-
vehicleId: string;
|
|
65
|
-
businessId: string;
|
|
66
|
-
type: VehicleLogType | `${VehicleLogType}`;
|
|
67
|
-
fuelLiters?: number;
|
|
68
|
-
fuelCost?: number;
|
|
69
|
-
note?: string;
|
|
70
|
-
createdAt: string;
|
|
71
|
-
updatedAt: string;
|
|
72
|
-
previousLogId?: string;
|
|
73
|
-
errandIdsSinceLastRefuel?: string[];
|
|
74
|
-
vehicleDetails?: Vehicle;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export type VehicleLogWithErrands = VehicleLog & {
|
|
78
|
-
errandsCount?: number;
|
|
79
|
-
totalErrandsRevenue?: number;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
40
|
// Rider Settlement Types
|
|
83
41
|
export enum RemittanceStatus {
|
|
84
42
|
Pending = 'pending',
|
package/src/transaction.ts
CHANGED
package/src/user.ts
CHANGED
package/src/vehicle.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { RiderWithUserDetails } from './rider';
|
|
2
|
+
|
|
3
|
+
export enum VehicleType {
|
|
4
|
+
Bike = 'bike',
|
|
5
|
+
Shuttle = 'shuttle',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type Vehicle = {
|
|
9
|
+
id: string;
|
|
10
|
+
vehicleNumber: string;
|
|
11
|
+
version: number;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
vehicleType: VehicleType | `${VehicleType}`;
|
|
15
|
+
businessId: string;
|
|
16
|
+
|
|
17
|
+
shortName?: string;
|
|
18
|
+
userId?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type VehicleWithRider = Vehicle & {
|
|
22
|
+
riders: RiderWithUserDetails[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export enum VehicleLogType {
|
|
26
|
+
REFUEL = 'REFUEL',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type VehicleLog = {
|
|
30
|
+
id: string;
|
|
31
|
+
vehicleId: string;
|
|
32
|
+
businessId: string;
|
|
33
|
+
type: VehicleLogType | `${VehicleLogType}`;
|
|
34
|
+
fuelLiters?: number;
|
|
35
|
+
fuelCost?: number;
|
|
36
|
+
note?: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
previousLogId?: string;
|
|
40
|
+
errandIdsSinceLastRefuel?: string[];
|
|
41
|
+
lastRecalculatedAt?: string;
|
|
42
|
+
vehicleDetails?: Vehicle;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type VehicleLogWithErrands = VehicleLog & {
|
|
46
|
+
errandsCount?: number;
|
|
47
|
+
totalErrandsRevenue?: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Vehicle Performance Types
|
|
51
|
+
export interface VehicleErrandStats {
|
|
52
|
+
count: number;
|
|
53
|
+
totalRevenue: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface VehicleFuelStats {
|
|
57
|
+
totalCost: number;
|
|
58
|
+
totalLiters: number;
|
|
59
|
+
refuelCount: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface VehicleMaintenanceStats {
|
|
63
|
+
totalCost: number;
|
|
64
|
+
recordCount: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface VehiclePerformanceItem {
|
|
68
|
+
vehicleId: string;
|
|
69
|
+
vehicleNumber: string;
|
|
70
|
+
shortName: string | null;
|
|
71
|
+
errands: VehicleErrandStats;
|
|
72
|
+
fuel: VehicleFuelStats;
|
|
73
|
+
maintenance: VehicleMaintenanceStats;
|
|
74
|
+
netProfit: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface VehiclePerformanceTotals {
|
|
78
|
+
totalRevenue: number;
|
|
79
|
+
totalFuelCost: number;
|
|
80
|
+
totalMaintenanceCost: number;
|
|
81
|
+
netProfit: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface VehiclePerformanceFilters {
|
|
85
|
+
businessId: string;
|
|
86
|
+
vehicleId: string | null;
|
|
87
|
+
startDate: string | null;
|
|
88
|
+
endDate: string | null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface VehiclePerformanceData {
|
|
92
|
+
vehicles: VehiclePerformanceItem[];
|
|
93
|
+
totals: VehiclePerformanceTotals;
|
|
94
|
+
filters: VehiclePerformanceFilters;
|
|
95
|
+
}
|