@mydoormot/app-types 1.7.20 → 1.7.22
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 +8 -8
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +122 -1
- package/dist/index.d.ts +122 -1
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/maintenance.ts +81 -0
- package/src/rider.ts +58 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@1.7.
|
|
2
|
+
> @mydoormot/app-types@1.7.21 build /Users/chuksben/Desktop/projects/microservices/mydoormot/packages/app-types
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2021
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m8.20 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 134ms
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m6.47 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in 135ms
|
|
15
11
|
[34mDTS[39m Build start
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m6.75 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 440ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m8.51 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 440ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1476ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m22.32 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m22.32 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
NotificationType: () => NotificationType,
|
|
36
36
|
ParcelSize: () => ParcelSize,
|
|
37
37
|
PaymentOptions: () => PaymentOptions,
|
|
38
|
+
RemittanceStatus: () => RemittanceStatus,
|
|
38
39
|
RoleType: () => RoleType,
|
|
39
40
|
TraccarDeviceStatus: () => TraccarDeviceStatus,
|
|
40
41
|
VehicleLogType: () => VehicleLogType,
|
|
@@ -175,6 +176,12 @@ var VehicleLogType = /* @__PURE__ */ ((VehicleLogType2) => {
|
|
|
175
176
|
VehicleLogType2["MAINTENANCE"] = "MAINTENANCE";
|
|
176
177
|
return VehicleLogType2;
|
|
177
178
|
})(VehicleLogType || {});
|
|
179
|
+
var RemittanceStatus = /* @__PURE__ */ ((RemittanceStatus2) => {
|
|
180
|
+
RemittanceStatus2["Pending"] = "pending";
|
|
181
|
+
RemittanceStatus2["Remitted"] = "remitted";
|
|
182
|
+
RemittanceStatus2["Cancelled"] = "cancelled";
|
|
183
|
+
return RemittanceStatus2;
|
|
184
|
+
})(RemittanceStatus || {});
|
|
178
185
|
|
|
179
186
|
// src/enterprise.ts
|
|
180
187
|
var EnterpriseType = /* @__PURE__ */ ((EnterpriseType2) => {
|
|
@@ -232,6 +239,7 @@ var LinkDestination = /* @__PURE__ */ ((LinkDestination2) => {
|
|
|
232
239
|
NotificationType,
|
|
233
240
|
ParcelSize,
|
|
234
241
|
PaymentOptions,
|
|
242
|
+
RemittanceStatus,
|
|
235
243
|
RoleType,
|
|
236
244
|
TraccarDeviceStatus,
|
|
237
245
|
VehicleLogType,
|
package/dist/index.d.cts
CHANGED
|
@@ -243,6 +243,50 @@ type VehicleLogWithErrands = VehicleLog & {
|
|
|
243
243
|
errandsCount?: number;
|
|
244
244
|
totalErrandsRevenue?: number;
|
|
245
245
|
};
|
|
246
|
+
declare enum RemittanceStatus {
|
|
247
|
+
Pending = "pending",
|
|
248
|
+
Remitted = "remitted",
|
|
249
|
+
Cancelled = "cancelled"
|
|
250
|
+
}
|
|
251
|
+
interface RiderSettlement {
|
|
252
|
+
id: string;
|
|
253
|
+
errandId: string;
|
|
254
|
+
riderId: string;
|
|
255
|
+
businessId: string;
|
|
256
|
+
deliveryFee: number;
|
|
257
|
+
additionalAmount: number;
|
|
258
|
+
totalCollectionAmount: number;
|
|
259
|
+
remittedAmount: number;
|
|
260
|
+
remittanceStatus: RemittanceStatus | `${RemittanceStatus}`;
|
|
261
|
+
remittedAt?: Date;
|
|
262
|
+
remittedBy?: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
notes?: string;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
updatedAt: Date;
|
|
267
|
+
version: number;
|
|
268
|
+
}
|
|
269
|
+
interface RiderPerformanceSummary {
|
|
270
|
+
totalErrands: number;
|
|
271
|
+
totalRevenue: number;
|
|
272
|
+
riderCount: number;
|
|
273
|
+
}
|
|
274
|
+
interface RiderPerformanceItem {
|
|
275
|
+
riderId: string;
|
|
276
|
+
riderName: string;
|
|
277
|
+
errandCount: number;
|
|
278
|
+
revenue: number;
|
|
279
|
+
}
|
|
280
|
+
interface RiderPerformanceTimeSeries {
|
|
281
|
+
period: string;
|
|
282
|
+
errandCount: number;
|
|
283
|
+
revenue: number;
|
|
284
|
+
}
|
|
285
|
+
interface RiderPerformanceStats {
|
|
286
|
+
summary: RiderPerformanceSummary;
|
|
287
|
+
riders: RiderPerformanceItem[];
|
|
288
|
+
timeSeries?: RiderPerformanceTimeSeries[];
|
|
289
|
+
}
|
|
246
290
|
|
|
247
291
|
declare enum ErrandStatus {
|
|
248
292
|
Pending = "pending",
|
|
@@ -743,6 +787,83 @@ interface TrackerDevice {
|
|
|
743
787
|
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
744
788
|
}
|
|
745
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Maintenance Item - catalog of parts/services used in maintenance
|
|
792
|
+
*/
|
|
793
|
+
interface MaintenanceItem {
|
|
794
|
+
id: string;
|
|
795
|
+
name: string;
|
|
796
|
+
slug: string;
|
|
797
|
+
description?: string;
|
|
798
|
+
businessId?: string | null;
|
|
799
|
+
unit?: string;
|
|
800
|
+
defaultUnitPrice?: number;
|
|
801
|
+
isActive: boolean;
|
|
802
|
+
createdAt: string;
|
|
803
|
+
updatedAt: string;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Part usage within a maintenance record.
|
|
807
|
+
* itemName is denormalized to preserve historical accuracy.
|
|
808
|
+
*/
|
|
809
|
+
interface MaintenancePartUsage {
|
|
810
|
+
itemId: string;
|
|
811
|
+
itemName: string;
|
|
812
|
+
quantity: number;
|
|
813
|
+
unitPrice: number;
|
|
814
|
+
totalCost: number;
|
|
815
|
+
unit?: string;
|
|
816
|
+
note?: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Maintenance Record - tracks maintenance performed on a vehicle
|
|
820
|
+
*/
|
|
821
|
+
interface MaintenanceRecord {
|
|
822
|
+
id: string;
|
|
823
|
+
businessId: string;
|
|
824
|
+
vehicleId: string;
|
|
825
|
+
maintenanceDate: string;
|
|
826
|
+
parts: MaintenancePartUsage[];
|
|
827
|
+
laborCost?: number;
|
|
828
|
+
totalCost: number;
|
|
829
|
+
performedBy?: string;
|
|
830
|
+
notes?: string;
|
|
831
|
+
createdAt: string;
|
|
832
|
+
updatedAt: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Summary statistics for maintenance records
|
|
836
|
+
*/
|
|
837
|
+
interface MaintenanceStatsSummary {
|
|
838
|
+
totalCost: number;
|
|
839
|
+
totalLaborCost: number;
|
|
840
|
+
totalPartsCost: number;
|
|
841
|
+
recordCount: number;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Top item usage statistics
|
|
845
|
+
*/
|
|
846
|
+
interface MaintenanceTopItem {
|
|
847
|
+
itemId: string;
|
|
848
|
+
itemName: string;
|
|
849
|
+
totalQuantity: number;
|
|
850
|
+
totalCost: number;
|
|
851
|
+
usageCount: number;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Maintenance statistics response
|
|
855
|
+
*/
|
|
856
|
+
interface MaintenanceStats {
|
|
857
|
+
summary: MaintenanceStatsSummary;
|
|
858
|
+
topItems: MaintenanceTopItem[];
|
|
859
|
+
filters: {
|
|
860
|
+
businessId: string;
|
|
861
|
+
vehicleId: string | null;
|
|
862
|
+
startDate: string | null;
|
|
863
|
+
endDate: string | null;
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
|
|
746
867
|
interface PaginateResult<T> {
|
|
747
868
|
docs: T[];
|
|
748
869
|
totalDocs: number;
|
|
@@ -765,4 +886,4 @@ declare enum LinkDestination {
|
|
|
765
886
|
}
|
|
766
887
|
type NullOrUndefined = null | undefined;
|
|
767
888
|
|
|
768
|
-
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, 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, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, 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 };
|
|
889
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, 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, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, RoleType, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -243,6 +243,50 @@ type VehicleLogWithErrands = VehicleLog & {
|
|
|
243
243
|
errandsCount?: number;
|
|
244
244
|
totalErrandsRevenue?: number;
|
|
245
245
|
};
|
|
246
|
+
declare enum RemittanceStatus {
|
|
247
|
+
Pending = "pending",
|
|
248
|
+
Remitted = "remitted",
|
|
249
|
+
Cancelled = "cancelled"
|
|
250
|
+
}
|
|
251
|
+
interface RiderSettlement {
|
|
252
|
+
id: string;
|
|
253
|
+
errandId: string;
|
|
254
|
+
riderId: string;
|
|
255
|
+
businessId: string;
|
|
256
|
+
deliveryFee: number;
|
|
257
|
+
additionalAmount: number;
|
|
258
|
+
totalCollectionAmount: number;
|
|
259
|
+
remittedAmount: number;
|
|
260
|
+
remittanceStatus: RemittanceStatus | `${RemittanceStatus}`;
|
|
261
|
+
remittedAt?: Date;
|
|
262
|
+
remittedBy?: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
notes?: string;
|
|
265
|
+
createdAt: Date;
|
|
266
|
+
updatedAt: Date;
|
|
267
|
+
version: number;
|
|
268
|
+
}
|
|
269
|
+
interface RiderPerformanceSummary {
|
|
270
|
+
totalErrands: number;
|
|
271
|
+
totalRevenue: number;
|
|
272
|
+
riderCount: number;
|
|
273
|
+
}
|
|
274
|
+
interface RiderPerformanceItem {
|
|
275
|
+
riderId: string;
|
|
276
|
+
riderName: string;
|
|
277
|
+
errandCount: number;
|
|
278
|
+
revenue: number;
|
|
279
|
+
}
|
|
280
|
+
interface RiderPerformanceTimeSeries {
|
|
281
|
+
period: string;
|
|
282
|
+
errandCount: number;
|
|
283
|
+
revenue: number;
|
|
284
|
+
}
|
|
285
|
+
interface RiderPerformanceStats {
|
|
286
|
+
summary: RiderPerformanceSummary;
|
|
287
|
+
riders: RiderPerformanceItem[];
|
|
288
|
+
timeSeries?: RiderPerformanceTimeSeries[];
|
|
289
|
+
}
|
|
246
290
|
|
|
247
291
|
declare enum ErrandStatus {
|
|
248
292
|
Pending = "pending",
|
|
@@ -743,6 +787,83 @@ interface TrackerDevice {
|
|
|
743
787
|
lastPosition?: TraccarPosition | NullOrUndefined;
|
|
744
788
|
}
|
|
745
789
|
|
|
790
|
+
/**
|
|
791
|
+
* Maintenance Item - catalog of parts/services used in maintenance
|
|
792
|
+
*/
|
|
793
|
+
interface MaintenanceItem {
|
|
794
|
+
id: string;
|
|
795
|
+
name: string;
|
|
796
|
+
slug: string;
|
|
797
|
+
description?: string;
|
|
798
|
+
businessId?: string | null;
|
|
799
|
+
unit?: string;
|
|
800
|
+
defaultUnitPrice?: number;
|
|
801
|
+
isActive: boolean;
|
|
802
|
+
createdAt: string;
|
|
803
|
+
updatedAt: string;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Part usage within a maintenance record.
|
|
807
|
+
* itemName is denormalized to preserve historical accuracy.
|
|
808
|
+
*/
|
|
809
|
+
interface MaintenancePartUsage {
|
|
810
|
+
itemId: string;
|
|
811
|
+
itemName: string;
|
|
812
|
+
quantity: number;
|
|
813
|
+
unitPrice: number;
|
|
814
|
+
totalCost: number;
|
|
815
|
+
unit?: string;
|
|
816
|
+
note?: string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Maintenance Record - tracks maintenance performed on a vehicle
|
|
820
|
+
*/
|
|
821
|
+
interface MaintenanceRecord {
|
|
822
|
+
id: string;
|
|
823
|
+
businessId: string;
|
|
824
|
+
vehicleId: string;
|
|
825
|
+
maintenanceDate: string;
|
|
826
|
+
parts: MaintenancePartUsage[];
|
|
827
|
+
laborCost?: number;
|
|
828
|
+
totalCost: number;
|
|
829
|
+
performedBy?: string;
|
|
830
|
+
notes?: string;
|
|
831
|
+
createdAt: string;
|
|
832
|
+
updatedAt: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Summary statistics for maintenance records
|
|
836
|
+
*/
|
|
837
|
+
interface MaintenanceStatsSummary {
|
|
838
|
+
totalCost: number;
|
|
839
|
+
totalLaborCost: number;
|
|
840
|
+
totalPartsCost: number;
|
|
841
|
+
recordCount: number;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Top item usage statistics
|
|
845
|
+
*/
|
|
846
|
+
interface MaintenanceTopItem {
|
|
847
|
+
itemId: string;
|
|
848
|
+
itemName: string;
|
|
849
|
+
totalQuantity: number;
|
|
850
|
+
totalCost: number;
|
|
851
|
+
usageCount: number;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Maintenance statistics response
|
|
855
|
+
*/
|
|
856
|
+
interface MaintenanceStats {
|
|
857
|
+
summary: MaintenanceStatsSummary;
|
|
858
|
+
topItems: MaintenanceTopItem[];
|
|
859
|
+
filters: {
|
|
860
|
+
businessId: string;
|
|
861
|
+
vehicleId: string | null;
|
|
862
|
+
startDate: string | null;
|
|
863
|
+
endDate: string | null;
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
|
|
746
867
|
interface PaginateResult<T> {
|
|
747
868
|
docs: T[];
|
|
748
869
|
totalDocs: number;
|
|
@@ -765,4 +886,4 @@ declare enum LinkDestination {
|
|
|
765
886
|
}
|
|
766
887
|
type NullOrUndefined = null | undefined;
|
|
767
888
|
|
|
768
|
-
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, 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, MembershipStatus, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type PaginateResult, ParcelSize, PaymentOptions, type PendingErrand, type Rider, RoleType, 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 };
|
|
889
|
+
export { type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, type BusinessCategory, type BusinessMember, type BusinessPg, BusinessRole, type City, 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, RemittanceStatus, type Rider, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, RoleType, 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 };
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,12 @@ var VehicleLogType = /* @__PURE__ */ ((VehicleLogType2) => {
|
|
|
130
130
|
VehicleLogType2["MAINTENANCE"] = "MAINTENANCE";
|
|
131
131
|
return VehicleLogType2;
|
|
132
132
|
})(VehicleLogType || {});
|
|
133
|
+
var RemittanceStatus = /* @__PURE__ */ ((RemittanceStatus2) => {
|
|
134
|
+
RemittanceStatus2["Pending"] = "pending";
|
|
135
|
+
RemittanceStatus2["Remitted"] = "remitted";
|
|
136
|
+
RemittanceStatus2["Cancelled"] = "cancelled";
|
|
137
|
+
return RemittanceStatus2;
|
|
138
|
+
})(RemittanceStatus || {});
|
|
133
139
|
|
|
134
140
|
// src/enterprise.ts
|
|
135
141
|
var EnterpriseType = /* @__PURE__ */ ((EnterpriseType2) => {
|
|
@@ -186,6 +192,7 @@ export {
|
|
|
186
192
|
NotificationType,
|
|
187
193
|
ParcelSize,
|
|
188
194
|
PaymentOptions,
|
|
195
|
+
RemittanceStatus,
|
|
189
196
|
RoleType,
|
|
190
197
|
TraccarDeviceStatus,
|
|
191
198
|
VehicleLogType,
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maintenance Item - catalog of parts/services used in maintenance
|
|
3
|
+
*/
|
|
4
|
+
export interface MaintenanceItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
businessId?: string | null; // null = global item available to all businesses
|
|
10
|
+
unit?: string; // "piece", "liter", etc.
|
|
11
|
+
defaultUnitPrice?: number;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Part usage within a maintenance record.
|
|
19
|
+
* itemName is denormalized to preserve historical accuracy.
|
|
20
|
+
*/
|
|
21
|
+
export interface MaintenancePartUsage {
|
|
22
|
+
itemId: string;
|
|
23
|
+
itemName: string; // Snapshot of item name at time of record creation
|
|
24
|
+
quantity: number;
|
|
25
|
+
unitPrice: number;
|
|
26
|
+
totalCost: number; // quantity * unitPrice
|
|
27
|
+
unit?: string;
|
|
28
|
+
note?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Maintenance Record - tracks maintenance performed on a vehicle
|
|
33
|
+
*/
|
|
34
|
+
export interface MaintenanceRecord {
|
|
35
|
+
id: string;
|
|
36
|
+
businessId: string;
|
|
37
|
+
vehicleId: string;
|
|
38
|
+
maintenanceDate: string;
|
|
39
|
+
parts: MaintenancePartUsage[];
|
|
40
|
+
laborCost?: number;
|
|
41
|
+
totalCost: number; // sum(parts.totalCost) + laborCost
|
|
42
|
+
performedBy?: string; // User ID who performed the maintenance
|
|
43
|
+
notes?: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Summary statistics for maintenance records
|
|
50
|
+
*/
|
|
51
|
+
export interface MaintenanceStatsSummary {
|
|
52
|
+
totalCost: number;
|
|
53
|
+
totalLaborCost: number;
|
|
54
|
+
totalPartsCost: number;
|
|
55
|
+
recordCount: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Top item usage statistics
|
|
60
|
+
*/
|
|
61
|
+
export interface MaintenanceTopItem {
|
|
62
|
+
itemId: string;
|
|
63
|
+
itemName: string;
|
|
64
|
+
totalQuantity: number;
|
|
65
|
+
totalCost: number;
|
|
66
|
+
usageCount: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Maintenance statistics response
|
|
71
|
+
*/
|
|
72
|
+
export interface MaintenanceStats {
|
|
73
|
+
summary: MaintenanceStatsSummary;
|
|
74
|
+
topItems: MaintenanceTopItem[];
|
|
75
|
+
filters: {
|
|
76
|
+
businessId: string;
|
|
77
|
+
vehicleId: string | null;
|
|
78
|
+
startDate: string | null;
|
|
79
|
+
endDate: string | null;
|
|
80
|
+
};
|
|
81
|
+
}
|
package/src/rider.ts
CHANGED
|
@@ -80,7 +80,61 @@ export type VehicleLogWithErrands = VehicleLog & {
|
|
|
80
80
|
totalErrandsRevenue?: number;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
// Rider Settlement Types
|
|
84
|
+
export enum RemittanceStatus {
|
|
85
|
+
Pending = 'pending',
|
|
86
|
+
Remitted = 'remitted',
|
|
87
|
+
Cancelled = 'cancelled',
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface RiderSettlement {
|
|
91
|
+
id: string;
|
|
92
|
+
errandId: string;
|
|
93
|
+
riderId: string;
|
|
94
|
+
businessId: string;
|
|
95
|
+
|
|
96
|
+
// Money breakdown
|
|
97
|
+
deliveryFee: number;
|
|
98
|
+
additionalAmount: number;
|
|
99
|
+
totalCollectionAmount: number;
|
|
100
|
+
remittedAmount: number;
|
|
101
|
+
|
|
102
|
+
// Status
|
|
103
|
+
remittanceStatus: RemittanceStatus | `${RemittanceStatus}`;
|
|
104
|
+
remittedAt?: Date;
|
|
105
|
+
remittedBy?: string;
|
|
106
|
+
|
|
107
|
+
// Optional
|
|
108
|
+
description?: string;
|
|
109
|
+
notes?: string;
|
|
110
|
+
|
|
111
|
+
createdAt: Date;
|
|
112
|
+
updatedAt: Date;
|
|
113
|
+
version: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Rider Performance Stats Types
|
|
117
|
+
export interface RiderPerformanceSummary {
|
|
118
|
+
totalErrands: number;
|
|
119
|
+
totalRevenue: number;
|
|
120
|
+
riderCount: number;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface RiderPerformanceItem {
|
|
124
|
+
riderId: string;
|
|
125
|
+
riderName: string;
|
|
126
|
+
errandCount: number;
|
|
127
|
+
revenue: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface RiderPerformanceTimeSeries {
|
|
131
|
+
period: string;
|
|
132
|
+
errandCount: number;
|
|
133
|
+
revenue: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface RiderPerformanceStats {
|
|
137
|
+
summary: RiderPerformanceSummary;
|
|
138
|
+
riders: RiderPerformanceItem[];
|
|
139
|
+
timeSeries?: RiderPerformanceTimeSeries[];
|
|
140
|
+
}
|