@mydoormot/app-types 1.7.29 → 1.7.30
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 +6 -0
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +67 -23
- package/dist/index.d.ts +67 -23
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/rider.ts +4 -46
- package/src/transaction.ts +3 -0
- 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.29 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
|
+
[32mESM[39m [1mdist/index.js [22m[32m7.15 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 61ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m9.00 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 62ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 846ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m28.00 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m28.00 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
|
@@ -180,25 +180,6 @@ interface InvoiceItem {
|
|
|
180
180
|
itemDetails?: Errand;
|
|
181
181
|
}
|
|
182
182
|
|
|
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
183
|
declare enum VehicleType {
|
|
203
184
|
Bike = "bike",
|
|
204
185
|
Shuttle = "shuttle"
|
|
@@ -214,9 +195,6 @@ type Vehicle = {
|
|
|
214
195
|
shortName?: string;
|
|
215
196
|
userId?: string;
|
|
216
197
|
};
|
|
217
|
-
type RiderWithUserDetails = Rider & {
|
|
218
|
-
userDetails?: User;
|
|
219
|
-
};
|
|
220
198
|
type VehicleWithRider = Vehicle & {
|
|
221
199
|
riders: RiderWithUserDetails[];
|
|
222
200
|
};
|
|
@@ -235,12 +213,75 @@ type VehicleLog = {
|
|
|
235
213
|
updatedAt: string;
|
|
236
214
|
previousLogId?: string;
|
|
237
215
|
errandIdsSinceLastRefuel?: string[];
|
|
216
|
+
lastRecalculatedAt?: string;
|
|
238
217
|
vehicleDetails?: Vehicle;
|
|
239
218
|
};
|
|
240
219
|
type VehicleLogWithErrands = VehicleLog & {
|
|
241
220
|
errandsCount?: number;
|
|
242
221
|
totalErrandsRevenue?: number;
|
|
243
222
|
};
|
|
223
|
+
interface VehicleErrandStats {
|
|
224
|
+
count: number;
|
|
225
|
+
totalRevenue: number;
|
|
226
|
+
}
|
|
227
|
+
interface VehicleFuelStats {
|
|
228
|
+
totalCost: number;
|
|
229
|
+
totalLiters: number;
|
|
230
|
+
refuelCount: number;
|
|
231
|
+
}
|
|
232
|
+
interface VehicleMaintenanceStats {
|
|
233
|
+
totalCost: number;
|
|
234
|
+
recordCount: number;
|
|
235
|
+
}
|
|
236
|
+
interface VehiclePerformanceItem {
|
|
237
|
+
vehicleId: string;
|
|
238
|
+
vehicleNumber: string;
|
|
239
|
+
shortName: string | null;
|
|
240
|
+
errands: VehicleErrandStats;
|
|
241
|
+
fuel: VehicleFuelStats;
|
|
242
|
+
maintenance: VehicleMaintenanceStats;
|
|
243
|
+
netProfit: number;
|
|
244
|
+
}
|
|
245
|
+
interface VehiclePerformanceTotals {
|
|
246
|
+
totalRevenue: number;
|
|
247
|
+
totalFuelCost: number;
|
|
248
|
+
totalMaintenanceCost: number;
|
|
249
|
+
netProfit: number;
|
|
250
|
+
}
|
|
251
|
+
interface VehiclePerformanceFilters {
|
|
252
|
+
businessId: string;
|
|
253
|
+
vehicleId: string | null;
|
|
254
|
+
startDate: string | null;
|
|
255
|
+
endDate: string | null;
|
|
256
|
+
}
|
|
257
|
+
interface VehiclePerformanceData {
|
|
258
|
+
vehicles: VehiclePerformanceItem[];
|
|
259
|
+
totals: VehiclePerformanceTotals;
|
|
260
|
+
filters: VehiclePerformanceFilters;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
type Rider = {
|
|
264
|
+
id: string;
|
|
265
|
+
userId: string;
|
|
266
|
+
vehicleId?: string;
|
|
267
|
+
currLocation: {
|
|
268
|
+
coordinates: number[];
|
|
269
|
+
};
|
|
270
|
+
vehicleNumber?: string;
|
|
271
|
+
verified: boolean;
|
|
272
|
+
active: boolean;
|
|
273
|
+
updatedAt: Date;
|
|
274
|
+
createdAt: Date;
|
|
275
|
+
rating: number;
|
|
276
|
+
version: number;
|
|
277
|
+
hasBeenRated: boolean;
|
|
278
|
+
state?: string | State;
|
|
279
|
+
currentErrand?: Errand;
|
|
280
|
+
lastDeliveredErrand?: Errand;
|
|
281
|
+
};
|
|
282
|
+
type RiderWithUserDetails = Rider & {
|
|
283
|
+
userDetails?: User;
|
|
284
|
+
};
|
|
244
285
|
declare enum RemittanceStatus {
|
|
245
286
|
Pending = "pending",
|
|
246
287
|
Remitted = "remitted",
|
|
@@ -835,6 +876,9 @@ interface TransactionItem {
|
|
|
835
876
|
quantity: number;
|
|
836
877
|
unitPrice: number;
|
|
837
878
|
totalPrice: number;
|
|
879
|
+
productId?: string;
|
|
880
|
+
variantId?: string;
|
|
881
|
+
isAddon?: boolean;
|
|
838
882
|
}
|
|
839
883
|
interface Transaction {
|
|
840
884
|
id: string;
|
|
@@ -1047,4 +1091,4 @@ declare enum LinkDestination {
|
|
|
1047
1091
|
}
|
|
1048
1092
|
type NullOrUndefined = null | undefined;
|
|
1049
1093
|
|
|
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 };
|
|
1094
|
+
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
|
@@ -180,25 +180,6 @@ interface InvoiceItem {
|
|
|
180
180
|
itemDetails?: Errand;
|
|
181
181
|
}
|
|
182
182
|
|
|
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
183
|
declare enum VehicleType {
|
|
203
184
|
Bike = "bike",
|
|
204
185
|
Shuttle = "shuttle"
|
|
@@ -214,9 +195,6 @@ type Vehicle = {
|
|
|
214
195
|
shortName?: string;
|
|
215
196
|
userId?: string;
|
|
216
197
|
};
|
|
217
|
-
type RiderWithUserDetails = Rider & {
|
|
218
|
-
userDetails?: User;
|
|
219
|
-
};
|
|
220
198
|
type VehicleWithRider = Vehicle & {
|
|
221
199
|
riders: RiderWithUserDetails[];
|
|
222
200
|
};
|
|
@@ -235,12 +213,75 @@ type VehicleLog = {
|
|
|
235
213
|
updatedAt: string;
|
|
236
214
|
previousLogId?: string;
|
|
237
215
|
errandIdsSinceLastRefuel?: string[];
|
|
216
|
+
lastRecalculatedAt?: string;
|
|
238
217
|
vehicleDetails?: Vehicle;
|
|
239
218
|
};
|
|
240
219
|
type VehicleLogWithErrands = VehicleLog & {
|
|
241
220
|
errandsCount?: number;
|
|
242
221
|
totalErrandsRevenue?: number;
|
|
243
222
|
};
|
|
223
|
+
interface VehicleErrandStats {
|
|
224
|
+
count: number;
|
|
225
|
+
totalRevenue: number;
|
|
226
|
+
}
|
|
227
|
+
interface VehicleFuelStats {
|
|
228
|
+
totalCost: number;
|
|
229
|
+
totalLiters: number;
|
|
230
|
+
refuelCount: number;
|
|
231
|
+
}
|
|
232
|
+
interface VehicleMaintenanceStats {
|
|
233
|
+
totalCost: number;
|
|
234
|
+
recordCount: number;
|
|
235
|
+
}
|
|
236
|
+
interface VehiclePerformanceItem {
|
|
237
|
+
vehicleId: string;
|
|
238
|
+
vehicleNumber: string;
|
|
239
|
+
shortName: string | null;
|
|
240
|
+
errands: VehicleErrandStats;
|
|
241
|
+
fuel: VehicleFuelStats;
|
|
242
|
+
maintenance: VehicleMaintenanceStats;
|
|
243
|
+
netProfit: number;
|
|
244
|
+
}
|
|
245
|
+
interface VehiclePerformanceTotals {
|
|
246
|
+
totalRevenue: number;
|
|
247
|
+
totalFuelCost: number;
|
|
248
|
+
totalMaintenanceCost: number;
|
|
249
|
+
netProfit: number;
|
|
250
|
+
}
|
|
251
|
+
interface VehiclePerformanceFilters {
|
|
252
|
+
businessId: string;
|
|
253
|
+
vehicleId: string | null;
|
|
254
|
+
startDate: string | null;
|
|
255
|
+
endDate: string | null;
|
|
256
|
+
}
|
|
257
|
+
interface VehiclePerformanceData {
|
|
258
|
+
vehicles: VehiclePerformanceItem[];
|
|
259
|
+
totals: VehiclePerformanceTotals;
|
|
260
|
+
filters: VehiclePerformanceFilters;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
type Rider = {
|
|
264
|
+
id: string;
|
|
265
|
+
userId: string;
|
|
266
|
+
vehicleId?: string;
|
|
267
|
+
currLocation: {
|
|
268
|
+
coordinates: number[];
|
|
269
|
+
};
|
|
270
|
+
vehicleNumber?: string;
|
|
271
|
+
verified: boolean;
|
|
272
|
+
active: boolean;
|
|
273
|
+
updatedAt: Date;
|
|
274
|
+
createdAt: Date;
|
|
275
|
+
rating: number;
|
|
276
|
+
version: number;
|
|
277
|
+
hasBeenRated: boolean;
|
|
278
|
+
state?: string | State;
|
|
279
|
+
currentErrand?: Errand;
|
|
280
|
+
lastDeliveredErrand?: Errand;
|
|
281
|
+
};
|
|
282
|
+
type RiderWithUserDetails = Rider & {
|
|
283
|
+
userDetails?: User;
|
|
284
|
+
};
|
|
244
285
|
declare enum RemittanceStatus {
|
|
245
286
|
Pending = "pending",
|
|
246
287
|
Remitted = "remitted",
|
|
@@ -835,6 +876,9 @@ interface TransactionItem {
|
|
|
835
876
|
quantity: number;
|
|
836
877
|
unitPrice: number;
|
|
837
878
|
totalPrice: number;
|
|
879
|
+
productId?: string;
|
|
880
|
+
variantId?: string;
|
|
881
|
+
isAddon?: boolean;
|
|
838
882
|
}
|
|
839
883
|
interface Transaction {
|
|
840
884
|
id: string;
|
|
@@ -1047,4 +1091,4 @@ declare enum LinkDestination {
|
|
|
1047
1091
|
}
|
|
1048
1092
|
type NullOrUndefined = null | undefined;
|
|
1049
1093
|
|
|
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 };
|
|
1094
|
+
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/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/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
|
+
}
|