@mydoormot/app-types 2.1.4 → 2.2.1
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 +3 -1
- package/dist/index.d.cts +101 -45
- package/dist/index.d.ts +101 -45
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/business.ts +5 -2
- package/src/errand.ts +0 -5
- package/src/index.ts +3 -0
- package/src/integration.ts +12 -0
- package/src/invoice.ts +3 -1
- package/src/platform.ts +17 -0
- package/src/rider.ts +0 -1
- package/src/tracker.ts +66 -0
- package/src/vehicle.ts +2 -38
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@2.
|
|
2
|
+
> @mydoormot/app-types@2.2.0 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
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m18.21 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 51ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m15.13 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 51ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 646ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m58.74 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m58.74 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -188,6 +188,7 @@ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
|
|
|
188
188
|
})(InvoiceStatus || {});
|
|
189
189
|
var InvoiceItemType = /* @__PURE__ */ ((InvoiceItemType2) => {
|
|
190
190
|
InvoiceItemType2["Errand"] = "errand";
|
|
191
|
+
InvoiceItemType2["Manual"] = "manual";
|
|
191
192
|
return InvoiceItemType2;
|
|
192
193
|
})(InvoiceItemType || {});
|
|
193
194
|
var InvoiceGenerationType = /* @__PURE__ */ ((InvoiceGenerationType2) => {
|
|
@@ -217,6 +218,7 @@ var InvoiceEventType = /* @__PURE__ */ ((InvoiceEventType2) => {
|
|
|
217
218
|
InvoiceEventType2["LineAmountChanged"] = "line_amount_changed";
|
|
218
219
|
InvoiceEventType2["PaymentRecorded"] = "payment_recorded";
|
|
219
220
|
InvoiceEventType2["PaymentReversed"] = "payment_reversed";
|
|
221
|
+
InvoiceEventType2["PaymentUpdated"] = "payment_updated";
|
|
220
222
|
InvoiceEventType2["StatusChanged"] = "status_changed";
|
|
221
223
|
InvoiceEventType2["Viewed"] = "viewed";
|
|
222
224
|
return InvoiceEventType2;
|
|
@@ -331,7 +333,7 @@ var BusinessRole = /* @__PURE__ */ ((BusinessRole2) => {
|
|
|
331
333
|
var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
|
|
332
334
|
MembershipStatus2["ACTIVE"] = "ACTIVE";
|
|
333
335
|
MembershipStatus2["PENDING_ACTIVATION"] = "PENDING_ACTIVATION";
|
|
334
|
-
MembershipStatus2["
|
|
336
|
+
MembershipStatus2["DISABLED"] = "DISABLED";
|
|
335
337
|
return MembershipStatus2;
|
|
336
338
|
})(MembershipStatus || {});
|
|
337
339
|
var DEFAULT_BUSINESS_FUEL_SETTINGS = {
|
package/dist/index.d.cts
CHANGED
|
@@ -170,7 +170,8 @@ declare enum InvoiceStatus {
|
|
|
170
170
|
Failed = "failed"
|
|
171
171
|
}
|
|
172
172
|
declare enum InvoiceItemType {
|
|
173
|
-
Errand = "errand"
|
|
173
|
+
Errand = "errand",
|
|
174
|
+
Manual = "manual"
|
|
174
175
|
}
|
|
175
176
|
declare enum InvoiceGenerationType {
|
|
176
177
|
Auto = "auto",
|
|
@@ -196,6 +197,7 @@ declare enum InvoiceEventType {
|
|
|
196
197
|
LineAmountChanged = "line_amount_changed",
|
|
197
198
|
PaymentRecorded = "payment_recorded",
|
|
198
199
|
PaymentReversed = "payment_reversed",
|
|
200
|
+
PaymentUpdated = "payment_updated",
|
|
199
201
|
StatusChanged = "status_changed",
|
|
200
202
|
Viewed = "viewed"
|
|
201
203
|
}
|
|
@@ -503,7 +505,7 @@ declare enum BusinessRole {
|
|
|
503
505
|
declare enum MembershipStatus {
|
|
504
506
|
ACTIVE = "ACTIVE",
|
|
505
507
|
PENDING_ACTIVATION = "PENDING_ACTIVATION",
|
|
506
|
-
|
|
508
|
+
DISABLED = "DISABLED"
|
|
507
509
|
}
|
|
508
510
|
interface OpeningHours {
|
|
509
511
|
open: string;
|
|
@@ -542,7 +544,7 @@ interface BusinessModules {
|
|
|
542
544
|
*/
|
|
543
545
|
riderPayouts?: boolean;
|
|
544
546
|
/** External GPS tracker feed; needs an API key to be useful. */
|
|
545
|
-
|
|
547
|
+
vehicleTracking?: boolean;
|
|
546
548
|
/**
|
|
547
549
|
* WhatsApp notifications to the business's users and customers on errand
|
|
548
550
|
* events.
|
|
@@ -611,6 +613,9 @@ interface BusinessMember {
|
|
|
611
613
|
pgId: string;
|
|
612
614
|
role: BusinessRole | `${BusinessRole}`;
|
|
613
615
|
status: MembershipStatus | `${MembershipStatus}`;
|
|
616
|
+
disabledAt: string | NullOrUndefined;
|
|
617
|
+
disabledBy: string | NullOrUndefined;
|
|
618
|
+
disabledReason: string | NullOrUndefined;
|
|
614
619
|
invitedBy: string | NullOrUndefined;
|
|
615
620
|
userDetails: User | NullOrUndefined;
|
|
616
621
|
invitedByUserDetails: User | NullOrUndefined;
|
|
@@ -641,34 +646,6 @@ declare enum VehicleType {
|
|
|
641
646
|
Bike = "bike",
|
|
642
647
|
Shuttle = "shuttle"
|
|
643
648
|
}
|
|
644
|
-
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
645
|
-
type GeoPoint = {
|
|
646
|
-
type: 'Point';
|
|
647
|
-
coordinates: [number, number];
|
|
648
|
-
};
|
|
649
|
-
/**
|
|
650
|
-
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
651
|
-
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
652
|
-
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
653
|
-
*/
|
|
654
|
-
type TrackerPosition = {
|
|
655
|
-
latitude: number;
|
|
656
|
-
longitude: number;
|
|
657
|
-
speed?: number;
|
|
658
|
-
course?: number;
|
|
659
|
-
accuracy?: number;
|
|
660
|
-
valid?: boolean;
|
|
661
|
-
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
662
|
-
motion?: boolean;
|
|
663
|
-
/** Engine on/off, when the device reports it. */
|
|
664
|
-
ignition?: boolean;
|
|
665
|
-
/** ISO time the GPS computed the position — the truest "when". */
|
|
666
|
-
fixTime?: string;
|
|
667
|
-
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
668
|
-
deviceTime?: string;
|
|
669
|
-
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
670
|
-
serverTime?: string;
|
|
671
|
-
};
|
|
672
649
|
type Vehicle = {
|
|
673
650
|
id: string;
|
|
674
651
|
vehicleNumber: string;
|
|
@@ -679,15 +656,9 @@ type Vehicle = {
|
|
|
679
656
|
businessId: string;
|
|
680
657
|
shortName?: string;
|
|
681
658
|
userId?: string;
|
|
682
|
-
/** External GPS device uniqueId bound to this vehicle. */
|
|
683
|
-
trackerId?: string;
|
|
684
|
-
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
685
|
-
location?: GeoPoint;
|
|
686
|
-
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
687
|
-
position?: TrackerPosition;
|
|
688
659
|
};
|
|
689
660
|
type VehicleWithRider = Vehicle & {
|
|
690
|
-
riders:
|
|
661
|
+
riders: Rider[];
|
|
691
662
|
};
|
|
692
663
|
declare enum VehicleLogType {
|
|
693
664
|
REFUEL = "REFUEL"
|
|
@@ -871,7 +842,6 @@ type Rider = {
|
|
|
871
842
|
};
|
|
872
843
|
vehicleNumber?: string;
|
|
873
844
|
verified: boolean;
|
|
874
|
-
active: boolean;
|
|
875
845
|
updatedAt: Date;
|
|
876
846
|
createdAt: Date;
|
|
877
847
|
rating: number;
|
|
@@ -1061,11 +1031,6 @@ interface PendingErrand {
|
|
|
1061
1031
|
rider: string;
|
|
1062
1032
|
customerId: string;
|
|
1063
1033
|
deliveryStatus: ErrandStatus;
|
|
1064
|
-
invoice: {
|
|
1065
|
-
invoiceStatus: string;
|
|
1066
|
-
refId: string;
|
|
1067
|
-
transactionId: string;
|
|
1068
|
-
};
|
|
1069
1034
|
nameOfItem: string;
|
|
1070
1035
|
pickupDetails: {
|
|
1071
1036
|
cityId: string;
|
|
@@ -1849,6 +1814,97 @@ interface PortalHandleAvailability {
|
|
|
1849
1814
|
reason?: string;
|
|
1850
1815
|
}
|
|
1851
1816
|
|
|
1817
|
+
/**
|
|
1818
|
+
* Platform-wide suggestions for businesses that haven't set their own values.
|
|
1819
|
+
* Prefill forms only — e.g. `business.settings.fuel?.revenuePercent ??
|
|
1820
|
+
* platform.fuel.revenuePercent`. Never applied to a business's calculations.
|
|
1821
|
+
*/
|
|
1822
|
+
interface PlatformSettings {
|
|
1823
|
+
fuel: {
|
|
1824
|
+
/** Current pump price per litre, for prefilling refuel logs. */
|
|
1825
|
+
pumpPrice: number | null;
|
|
1826
|
+
revenuePercent: number | null;
|
|
1827
|
+
};
|
|
1828
|
+
riderPay: {
|
|
1829
|
+
defaultPercentage: number | null;
|
|
1830
|
+
};
|
|
1831
|
+
createdAt: string;
|
|
1832
|
+
updatedAt: string;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
1836
|
+
type GeoPoint = {
|
|
1837
|
+
type: 'Point';
|
|
1838
|
+
coordinates: [number, number];
|
|
1839
|
+
};
|
|
1840
|
+
/** Lynqone's device kind, synced on import. */
|
|
1841
|
+
type TrackerType = 'car' | 'bike';
|
|
1842
|
+
/** `unbound`: no longer in the connected lynqone account. */
|
|
1843
|
+
type TrackerStatus = 'active' | 'unbound';
|
|
1844
|
+
type MotionState = 'moving' | 'stopped';
|
|
1845
|
+
/**
|
|
1846
|
+
* A trimmed-down Traccar position kept as the tracker's latest fix. Carries the
|
|
1847
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
1848
|
+
* (moving vs. idle, heading), `fixTime` gauges staleness.
|
|
1849
|
+
*/
|
|
1850
|
+
type TrackerPosition = {
|
|
1851
|
+
latitude: number;
|
|
1852
|
+
longitude: number;
|
|
1853
|
+
speed?: number;
|
|
1854
|
+
course?: number;
|
|
1855
|
+
accuracy?: number;
|
|
1856
|
+
valid?: boolean;
|
|
1857
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
1858
|
+
motion?: boolean;
|
|
1859
|
+
/** Engine on/off, when the device reports it. */
|
|
1860
|
+
ignition?: boolean;
|
|
1861
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
1862
|
+
fixTime?: string;
|
|
1863
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
1864
|
+
deviceTime?: string;
|
|
1865
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
1866
|
+
serverTime?: string;
|
|
1867
|
+
/** Traccar's free-form attributes bag, as sent. */
|
|
1868
|
+
attributes?: Record<string, unknown>;
|
|
1869
|
+
};
|
|
1870
|
+
/**
|
|
1871
|
+
* A GPS tracker from the business's lynqone account. Only the last position is
|
|
1872
|
+
* kept; history stays in lynqone.
|
|
1873
|
+
*/
|
|
1874
|
+
type Tracker = {
|
|
1875
|
+
id: string;
|
|
1876
|
+
businessId: string;
|
|
1877
|
+
/** Lynqone's tracker uuid. */
|
|
1878
|
+
lynqoneTrackerId: string;
|
|
1879
|
+
/** Device id, for display and search. */
|
|
1880
|
+
uniqueIdentifier: string;
|
|
1881
|
+
name?: string;
|
|
1882
|
+
type?: TrackerType;
|
|
1883
|
+
/** Unset means unassigned. A vehicle has at most one tracker. */
|
|
1884
|
+
vehicleId?: string;
|
|
1885
|
+
location?: GeoPoint;
|
|
1886
|
+
lastPosition?: TrackerPosition;
|
|
1887
|
+
lastSeenAt?: string;
|
|
1888
|
+
motionState?: MotionState;
|
|
1889
|
+
motionChangedAt?: string;
|
|
1890
|
+
batteryLevel?: number;
|
|
1891
|
+
lowBatteryAt?: string;
|
|
1892
|
+
status: TrackerStatus;
|
|
1893
|
+
createdAt: string;
|
|
1894
|
+
updatedAt: string;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
type IntegrationProvider = 'lynqone';
|
|
1898
|
+
type IntegrationStatus = 'connected' | 'disconnected' | 'error';
|
|
1899
|
+
/** What `GET /tracking/lynqone` returns. The key itself is never sent. */
|
|
1900
|
+
type LynqoneIntegrationSummary = {
|
|
1901
|
+
status: IntegrationStatus;
|
|
1902
|
+
connectedAt?: string;
|
|
1903
|
+
disconnectedAt?: string;
|
|
1904
|
+
lastError?: string;
|
|
1905
|
+
trackerCount: number;
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1852
1908
|
interface PaginateResult<T> {
|
|
1853
1909
|
docs: T[];
|
|
1854
1910
|
totalDocs: number;
|
|
@@ -1871,4 +1927,4 @@ declare enum LinkDestination {
|
|
|
1871
1927
|
}
|
|
1872
1928
|
type NullOrUndefined = null | undefined;
|
|
1873
1929
|
|
|
1874
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, 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, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
|
1930
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type IntegrationProvider, type IntegrationStatus, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type LynqoneIntegrationSummary, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type MotionState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PlatformSettings, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type Tracker, type TrackerPosition, type TrackerStatus, type TrackerType, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, 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, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.d.ts
CHANGED
|
@@ -170,7 +170,8 @@ declare enum InvoiceStatus {
|
|
|
170
170
|
Failed = "failed"
|
|
171
171
|
}
|
|
172
172
|
declare enum InvoiceItemType {
|
|
173
|
-
Errand = "errand"
|
|
173
|
+
Errand = "errand",
|
|
174
|
+
Manual = "manual"
|
|
174
175
|
}
|
|
175
176
|
declare enum InvoiceGenerationType {
|
|
176
177
|
Auto = "auto",
|
|
@@ -196,6 +197,7 @@ declare enum InvoiceEventType {
|
|
|
196
197
|
LineAmountChanged = "line_amount_changed",
|
|
197
198
|
PaymentRecorded = "payment_recorded",
|
|
198
199
|
PaymentReversed = "payment_reversed",
|
|
200
|
+
PaymentUpdated = "payment_updated",
|
|
199
201
|
StatusChanged = "status_changed",
|
|
200
202
|
Viewed = "viewed"
|
|
201
203
|
}
|
|
@@ -503,7 +505,7 @@ declare enum BusinessRole {
|
|
|
503
505
|
declare enum MembershipStatus {
|
|
504
506
|
ACTIVE = "ACTIVE",
|
|
505
507
|
PENDING_ACTIVATION = "PENDING_ACTIVATION",
|
|
506
|
-
|
|
508
|
+
DISABLED = "DISABLED"
|
|
507
509
|
}
|
|
508
510
|
interface OpeningHours {
|
|
509
511
|
open: string;
|
|
@@ -542,7 +544,7 @@ interface BusinessModules {
|
|
|
542
544
|
*/
|
|
543
545
|
riderPayouts?: boolean;
|
|
544
546
|
/** External GPS tracker feed; needs an API key to be useful. */
|
|
545
|
-
|
|
547
|
+
vehicleTracking?: boolean;
|
|
546
548
|
/**
|
|
547
549
|
* WhatsApp notifications to the business's users and customers on errand
|
|
548
550
|
* events.
|
|
@@ -611,6 +613,9 @@ interface BusinessMember {
|
|
|
611
613
|
pgId: string;
|
|
612
614
|
role: BusinessRole | `${BusinessRole}`;
|
|
613
615
|
status: MembershipStatus | `${MembershipStatus}`;
|
|
616
|
+
disabledAt: string | NullOrUndefined;
|
|
617
|
+
disabledBy: string | NullOrUndefined;
|
|
618
|
+
disabledReason: string | NullOrUndefined;
|
|
614
619
|
invitedBy: string | NullOrUndefined;
|
|
615
620
|
userDetails: User | NullOrUndefined;
|
|
616
621
|
invitedByUserDetails: User | NullOrUndefined;
|
|
@@ -641,34 +646,6 @@ declare enum VehicleType {
|
|
|
641
646
|
Bike = "bike",
|
|
642
647
|
Shuttle = "shuttle"
|
|
643
648
|
}
|
|
644
|
-
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
645
|
-
type GeoPoint = {
|
|
646
|
-
type: 'Point';
|
|
647
|
-
coordinates: [number, number];
|
|
648
|
-
};
|
|
649
|
-
/**
|
|
650
|
-
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
651
|
-
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
652
|
-
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
653
|
-
*/
|
|
654
|
-
type TrackerPosition = {
|
|
655
|
-
latitude: number;
|
|
656
|
-
longitude: number;
|
|
657
|
-
speed?: number;
|
|
658
|
-
course?: number;
|
|
659
|
-
accuracy?: number;
|
|
660
|
-
valid?: boolean;
|
|
661
|
-
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
662
|
-
motion?: boolean;
|
|
663
|
-
/** Engine on/off, when the device reports it. */
|
|
664
|
-
ignition?: boolean;
|
|
665
|
-
/** ISO time the GPS computed the position — the truest "when". */
|
|
666
|
-
fixTime?: string;
|
|
667
|
-
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
668
|
-
deviceTime?: string;
|
|
669
|
-
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
670
|
-
serverTime?: string;
|
|
671
|
-
};
|
|
672
649
|
type Vehicle = {
|
|
673
650
|
id: string;
|
|
674
651
|
vehicleNumber: string;
|
|
@@ -679,15 +656,9 @@ type Vehicle = {
|
|
|
679
656
|
businessId: string;
|
|
680
657
|
shortName?: string;
|
|
681
658
|
userId?: string;
|
|
682
|
-
/** External GPS device uniqueId bound to this vehicle. */
|
|
683
|
-
trackerId?: string;
|
|
684
|
-
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
685
|
-
location?: GeoPoint;
|
|
686
|
-
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
687
|
-
position?: TrackerPosition;
|
|
688
659
|
};
|
|
689
660
|
type VehicleWithRider = Vehicle & {
|
|
690
|
-
riders:
|
|
661
|
+
riders: Rider[];
|
|
691
662
|
};
|
|
692
663
|
declare enum VehicleLogType {
|
|
693
664
|
REFUEL = "REFUEL"
|
|
@@ -871,7 +842,6 @@ type Rider = {
|
|
|
871
842
|
};
|
|
872
843
|
vehicleNumber?: string;
|
|
873
844
|
verified: boolean;
|
|
874
|
-
active: boolean;
|
|
875
845
|
updatedAt: Date;
|
|
876
846
|
createdAt: Date;
|
|
877
847
|
rating: number;
|
|
@@ -1061,11 +1031,6 @@ interface PendingErrand {
|
|
|
1061
1031
|
rider: string;
|
|
1062
1032
|
customerId: string;
|
|
1063
1033
|
deliveryStatus: ErrandStatus;
|
|
1064
|
-
invoice: {
|
|
1065
|
-
invoiceStatus: string;
|
|
1066
|
-
refId: string;
|
|
1067
|
-
transactionId: string;
|
|
1068
|
-
};
|
|
1069
1034
|
nameOfItem: string;
|
|
1070
1035
|
pickupDetails: {
|
|
1071
1036
|
cityId: string;
|
|
@@ -1849,6 +1814,97 @@ interface PortalHandleAvailability {
|
|
|
1849
1814
|
reason?: string;
|
|
1850
1815
|
}
|
|
1851
1816
|
|
|
1817
|
+
/**
|
|
1818
|
+
* Platform-wide suggestions for businesses that haven't set their own values.
|
|
1819
|
+
* Prefill forms only — e.g. `business.settings.fuel?.revenuePercent ??
|
|
1820
|
+
* platform.fuel.revenuePercent`. Never applied to a business's calculations.
|
|
1821
|
+
*/
|
|
1822
|
+
interface PlatformSettings {
|
|
1823
|
+
fuel: {
|
|
1824
|
+
/** Current pump price per litre, for prefilling refuel logs. */
|
|
1825
|
+
pumpPrice: number | null;
|
|
1826
|
+
revenuePercent: number | null;
|
|
1827
|
+
};
|
|
1828
|
+
riderPay: {
|
|
1829
|
+
defaultPercentage: number | null;
|
|
1830
|
+
};
|
|
1831
|
+
createdAt: string;
|
|
1832
|
+
updatedAt: string;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
1836
|
+
type GeoPoint = {
|
|
1837
|
+
type: 'Point';
|
|
1838
|
+
coordinates: [number, number];
|
|
1839
|
+
};
|
|
1840
|
+
/** Lynqone's device kind, synced on import. */
|
|
1841
|
+
type TrackerType = 'car' | 'bike';
|
|
1842
|
+
/** `unbound`: no longer in the connected lynqone account. */
|
|
1843
|
+
type TrackerStatus = 'active' | 'unbound';
|
|
1844
|
+
type MotionState = 'moving' | 'stopped';
|
|
1845
|
+
/**
|
|
1846
|
+
* A trimmed-down Traccar position kept as the tracker's latest fix. Carries the
|
|
1847
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
1848
|
+
* (moving vs. idle, heading), `fixTime` gauges staleness.
|
|
1849
|
+
*/
|
|
1850
|
+
type TrackerPosition = {
|
|
1851
|
+
latitude: number;
|
|
1852
|
+
longitude: number;
|
|
1853
|
+
speed?: number;
|
|
1854
|
+
course?: number;
|
|
1855
|
+
accuracy?: number;
|
|
1856
|
+
valid?: boolean;
|
|
1857
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
1858
|
+
motion?: boolean;
|
|
1859
|
+
/** Engine on/off, when the device reports it. */
|
|
1860
|
+
ignition?: boolean;
|
|
1861
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
1862
|
+
fixTime?: string;
|
|
1863
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
1864
|
+
deviceTime?: string;
|
|
1865
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
1866
|
+
serverTime?: string;
|
|
1867
|
+
/** Traccar's free-form attributes bag, as sent. */
|
|
1868
|
+
attributes?: Record<string, unknown>;
|
|
1869
|
+
};
|
|
1870
|
+
/**
|
|
1871
|
+
* A GPS tracker from the business's lynqone account. Only the last position is
|
|
1872
|
+
* kept; history stays in lynqone.
|
|
1873
|
+
*/
|
|
1874
|
+
type Tracker = {
|
|
1875
|
+
id: string;
|
|
1876
|
+
businessId: string;
|
|
1877
|
+
/** Lynqone's tracker uuid. */
|
|
1878
|
+
lynqoneTrackerId: string;
|
|
1879
|
+
/** Device id, for display and search. */
|
|
1880
|
+
uniqueIdentifier: string;
|
|
1881
|
+
name?: string;
|
|
1882
|
+
type?: TrackerType;
|
|
1883
|
+
/** Unset means unassigned. A vehicle has at most one tracker. */
|
|
1884
|
+
vehicleId?: string;
|
|
1885
|
+
location?: GeoPoint;
|
|
1886
|
+
lastPosition?: TrackerPosition;
|
|
1887
|
+
lastSeenAt?: string;
|
|
1888
|
+
motionState?: MotionState;
|
|
1889
|
+
motionChangedAt?: string;
|
|
1890
|
+
batteryLevel?: number;
|
|
1891
|
+
lowBatteryAt?: string;
|
|
1892
|
+
status: TrackerStatus;
|
|
1893
|
+
createdAt: string;
|
|
1894
|
+
updatedAt: string;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
type IntegrationProvider = 'lynqone';
|
|
1898
|
+
type IntegrationStatus = 'connected' | 'disconnected' | 'error';
|
|
1899
|
+
/** What `GET /tracking/lynqone` returns. The key itself is never sent. */
|
|
1900
|
+
type LynqoneIntegrationSummary = {
|
|
1901
|
+
status: IntegrationStatus;
|
|
1902
|
+
connectedAt?: string;
|
|
1903
|
+
disconnectedAt?: string;
|
|
1904
|
+
lastError?: string;
|
|
1905
|
+
trackerCount: number;
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1852
1908
|
interface PaginateResult<T> {
|
|
1853
1909
|
docs: T[];
|
|
1854
1910
|
totalDocs: number;
|
|
@@ -1871,4 +1927,4 @@ declare enum LinkDestination {
|
|
|
1871
1927
|
}
|
|
1872
1928
|
type NullOrUndefined = null | undefined;
|
|
1873
1929
|
|
|
1874
|
-
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type TrackerPosition, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, 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, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
|
1930
|
+
export { type AddonGroup, type AddonGroupItem, type AddressDetails, AddressTypes, type AggregatedErrand, AuthType, type Business, BusinessCapability, type BusinessCategory, type BusinessCourierLink, BusinessCourierLinkStatus, type BusinessFuelSettings, type BusinessLimits, type BusinessMember, type BusinessModuleKey, type BusinessModuleStates, type BusinessModules, type BusinessPg, BusinessPlan, type BusinessPortal, type BusinessRiderPaySettings, BusinessRole, type BusinessSettings, BusinessStatus, BusinessType, type BusinessWhatsappConfig, type City, type Collection, type Customer, type CustomerAddress, type CustomerBilling, type CustomerTransactionStats, DEFAULT_BUSINESS_FUEL_SETTINGS, DEFAULT_BUSINESS_RIDER_PAY_SETTINGS, DEFAULT_BUSINESS_SETTINGS, DeliveryStatus, type DraftErrand, DraftErrandStatus, type Enterprise, type EnterpriseCategoryDoc, type EnterpriseSubCategoryDoc, EnterpriseType, type Errand, type ErrandDeliveryTiming, ErrandFulfilment, ErrandInvoiceState, type ErrandPackagingQuality, type ErrandRating, type ErrandReview, type ErrandReviewLink, type ErrandRiderBehavior, ErrandStatus, type ErrandTimeline, type ExpensePaidBy, FeePaymentStatus, FeeSettlement, type FuelDueData, type FuelDueItem, FuelDueStatus, type FuelDueTotals, type FuelPercentSuggestion, type FuelSinceLastRefuel, type FuelSuggestionConfidence, type GeoPoint, GlobalRoles, type IntegrationProvider, type IntegrationStatus, type Invoice, type InvoiceDrift, type InvoiceEvent, InvoiceEventType, InvoiceGenerationType, type InvoiceItem, InvoiceItemType, type InvoicePayment, InvoicePaymentMethod, InvoiceStatus, type LatLng, LinkDestination, type LynqoneIntegrationSummary, type MaintenanceItem, type MaintenancePartUsage, type MaintenanceRecord, type MaintenanceStats, type MaintenanceStatsSummary, type MaintenanceTopItem, MembershipStatus, type ModuleState, type MotionState, type Notification, type NotificationData, NotificationType, type NullOrUndefined, type OpeningHours, PLAN_LIMIT_REACHED, PLAN_REQUIRED, type PaginateResult, PaymentOptions, PayoutPeriodType, PayoutRateSource, type PendingErrand, type PlatformSettings, type PortalHandleAvailability, PortalStatus, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductOptionValue, type ProductStatus, type ProductTag, type ProductVariant, type ProductVariantPrice, type PublicPortal, type PublicPortalBusiness, RemittanceStatus, type Rider, type RiderPayout, type RiderPayoutAdjustment, type RiderPayoutPreview, type RiderPayoutPreviewItem, RiderPayoutStatus, type RiderPerformanceItem, type RiderPerformanceStats, type RiderPerformanceSummary, type RiderPerformanceTimeSeries, type RiderSettlement, type RiderWithUserDetails, RoleType, type State, SweepExclusionReason, type Tracker, type TrackerPosition, type TrackerStatus, type TrackerType, type Transaction, type TransactionCategory, type TransactionItem, type TransactionRiderUser, 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, WhatsappButtonType, WhatsappComponentType, WhatsappEvent, WhatsappRecipient, type WhatsappSendLog, type WhatsappTemplate, type WhatsappTemplateButton, type WhatsappTemplateComponent, WhatsappTemplateMetaStatus, WhatsappTemplateParamSource, type WhatsappTemplateSource, errandTimeline };
|
package/dist/index.js
CHANGED
|
@@ -115,6 +115,7 @@ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
|
|
|
115
115
|
})(InvoiceStatus || {});
|
|
116
116
|
var InvoiceItemType = /* @__PURE__ */ ((InvoiceItemType2) => {
|
|
117
117
|
InvoiceItemType2["Errand"] = "errand";
|
|
118
|
+
InvoiceItemType2["Manual"] = "manual";
|
|
118
119
|
return InvoiceItemType2;
|
|
119
120
|
})(InvoiceItemType || {});
|
|
120
121
|
var InvoiceGenerationType = /* @__PURE__ */ ((InvoiceGenerationType2) => {
|
|
@@ -144,6 +145,7 @@ var InvoiceEventType = /* @__PURE__ */ ((InvoiceEventType2) => {
|
|
|
144
145
|
InvoiceEventType2["LineAmountChanged"] = "line_amount_changed";
|
|
145
146
|
InvoiceEventType2["PaymentRecorded"] = "payment_recorded";
|
|
146
147
|
InvoiceEventType2["PaymentReversed"] = "payment_reversed";
|
|
148
|
+
InvoiceEventType2["PaymentUpdated"] = "payment_updated";
|
|
147
149
|
InvoiceEventType2["StatusChanged"] = "status_changed";
|
|
148
150
|
InvoiceEventType2["Viewed"] = "viewed";
|
|
149
151
|
return InvoiceEventType2;
|
|
@@ -258,7 +260,7 @@ var BusinessRole = /* @__PURE__ */ ((BusinessRole2) => {
|
|
|
258
260
|
var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
|
|
259
261
|
MembershipStatus2["ACTIVE"] = "ACTIVE";
|
|
260
262
|
MembershipStatus2["PENDING_ACTIVATION"] = "PENDING_ACTIVATION";
|
|
261
|
-
MembershipStatus2["
|
|
263
|
+
MembershipStatus2["DISABLED"] = "DISABLED";
|
|
262
264
|
return MembershipStatus2;
|
|
263
265
|
})(MembershipStatus || {});
|
|
264
266
|
var DEFAULT_BUSINESS_FUEL_SETTINGS = {
|
package/package.json
CHANGED
package/src/business.ts
CHANGED
|
@@ -227,7 +227,7 @@ export enum BusinessRole {
|
|
|
227
227
|
export enum MembershipStatus {
|
|
228
228
|
ACTIVE = 'ACTIVE',
|
|
229
229
|
PENDING_ACTIVATION = 'PENDING_ACTIVATION',
|
|
230
|
-
|
|
230
|
+
DISABLED = 'DISABLED',
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
export interface OpeningHours {
|
|
@@ -268,7 +268,7 @@ export interface BusinessModules {
|
|
|
268
268
|
*/
|
|
269
269
|
riderPayouts?: boolean;
|
|
270
270
|
/** External GPS tracker feed; needs an API key to be useful. */
|
|
271
|
-
|
|
271
|
+
vehicleTracking?: boolean;
|
|
272
272
|
/**
|
|
273
273
|
* WhatsApp notifications to the business's users and customers on errand
|
|
274
274
|
* events.
|
|
@@ -375,6 +375,9 @@ export interface BusinessMember {
|
|
|
375
375
|
pgId: string;
|
|
376
376
|
role: BusinessRole | `${BusinessRole}`;
|
|
377
377
|
status: MembershipStatus | `${MembershipStatus}`;
|
|
378
|
+
disabledAt: string | NullOrUndefined;
|
|
379
|
+
disabledBy: string | NullOrUndefined;
|
|
380
|
+
disabledReason: string | NullOrUndefined;
|
|
378
381
|
invitedBy: string | NullOrUndefined;
|
|
379
382
|
userDetails: User | NullOrUndefined;
|
|
380
383
|
invitedByUserDetails: User | NullOrUndefined;
|
package/src/errand.ts
CHANGED
|
@@ -63,11 +63,6 @@ export interface PendingErrand {
|
|
|
63
63
|
rider: string;
|
|
64
64
|
customerId: string;
|
|
65
65
|
deliveryStatus: ErrandStatus;
|
|
66
|
-
invoice: {
|
|
67
|
-
invoiceStatus: string;
|
|
68
|
-
refId: string;
|
|
69
|
-
transactionId: string;
|
|
70
|
-
};
|
|
71
66
|
nameOfItem: string;
|
|
72
67
|
pickupDetails: {
|
|
73
68
|
cityId: string;
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type IntegrationProvider = 'lynqone';
|
|
2
|
+
|
|
3
|
+
export type IntegrationStatus = 'connected' | 'disconnected' | 'error';
|
|
4
|
+
|
|
5
|
+
/** What `GET /tracking/lynqone` returns. The key itself is never sent. */
|
|
6
|
+
export type LynqoneIntegrationSummary = {
|
|
7
|
+
status: IntegrationStatus;
|
|
8
|
+
connectedAt?: string;
|
|
9
|
+
disconnectedAt?: string;
|
|
10
|
+
lastError?: string;
|
|
11
|
+
trackerCount: number;
|
|
12
|
+
};
|
package/src/invoice.ts
CHANGED
|
@@ -11,7 +11,8 @@ export enum InvoiceStatus {
|
|
|
11
11
|
|
|
12
12
|
export enum InvoiceItemType {
|
|
13
13
|
Errand = 'errand',
|
|
14
|
-
//
|
|
14
|
+
// Added by hand; no errand behind it. A negative amount is a credit.
|
|
15
|
+
Manual = 'manual',
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export enum InvoiceGenerationType {
|
|
@@ -41,6 +42,7 @@ export enum InvoiceEventType {
|
|
|
41
42
|
LineAmountChanged = 'line_amount_changed',
|
|
42
43
|
PaymentRecorded = 'payment_recorded',
|
|
43
44
|
PaymentReversed = 'payment_reversed',
|
|
45
|
+
PaymentUpdated = 'payment_updated',
|
|
44
46
|
StatusChanged = 'status_changed',
|
|
45
47
|
Viewed = 'viewed',
|
|
46
48
|
}
|
package/src/platform.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-wide suggestions for businesses that haven't set their own values.
|
|
3
|
+
* Prefill forms only — e.g. `business.settings.fuel?.revenuePercent ??
|
|
4
|
+
* platform.fuel.revenuePercent`. Never applied to a business's calculations.
|
|
5
|
+
*/
|
|
6
|
+
export interface PlatformSettings {
|
|
7
|
+
fuel: {
|
|
8
|
+
/** Current pump price per litre, for prefilling refuel logs. */
|
|
9
|
+
pumpPrice: number | null;
|
|
10
|
+
revenuePercent: number | null;
|
|
11
|
+
};
|
|
12
|
+
riderPay: {
|
|
13
|
+
defaultPercentage: number | null;
|
|
14
|
+
};
|
|
15
|
+
createdAt: string;
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
}
|
package/src/rider.ts
CHANGED
package/src/tracker.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
2
|
+
export type GeoPoint = {
|
|
3
|
+
type: 'Point';
|
|
4
|
+
coordinates: [number, number];
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
/** Lynqone's device kind, synced on import. */
|
|
8
|
+
export type TrackerType = 'car' | 'bike';
|
|
9
|
+
|
|
10
|
+
/** `unbound`: no longer in the connected lynqone account. */
|
|
11
|
+
export type TrackerStatus = 'active' | 'unbound';
|
|
12
|
+
|
|
13
|
+
export type MotionState = 'moving' | 'stopped';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A trimmed-down Traccar position kept as the tracker's latest fix. Carries the
|
|
17
|
+
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
18
|
+
* (moving vs. idle, heading), `fixTime` gauges staleness.
|
|
19
|
+
*/
|
|
20
|
+
export type TrackerPosition = {
|
|
21
|
+
latitude: number;
|
|
22
|
+
longitude: number;
|
|
23
|
+
speed?: number;
|
|
24
|
+
course?: number;
|
|
25
|
+
accuracy?: number;
|
|
26
|
+
valid?: boolean;
|
|
27
|
+
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
28
|
+
motion?: boolean;
|
|
29
|
+
/** Engine on/off, when the device reports it. */
|
|
30
|
+
ignition?: boolean;
|
|
31
|
+
/** ISO time the GPS computed the position — the truest "when". */
|
|
32
|
+
fixTime?: string;
|
|
33
|
+
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
34
|
+
deviceTime?: string;
|
|
35
|
+
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
36
|
+
serverTime?: string;
|
|
37
|
+
/** Traccar's free-form attributes bag, as sent. */
|
|
38
|
+
attributes?: Record<string, unknown>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A GPS tracker from the business's lynqone account. Only the last position is
|
|
43
|
+
* kept; history stays in lynqone.
|
|
44
|
+
*/
|
|
45
|
+
export type Tracker = {
|
|
46
|
+
id: string;
|
|
47
|
+
businessId: string;
|
|
48
|
+
/** Lynqone's tracker uuid. */
|
|
49
|
+
lynqoneTrackerId: string;
|
|
50
|
+
/** Device id, for display and search. */
|
|
51
|
+
uniqueIdentifier: string;
|
|
52
|
+
name?: string;
|
|
53
|
+
type?: TrackerType;
|
|
54
|
+
/** Unset means unassigned. A vehicle has at most one tracker. */
|
|
55
|
+
vehicleId?: string;
|
|
56
|
+
location?: GeoPoint;
|
|
57
|
+
lastPosition?: TrackerPosition;
|
|
58
|
+
lastSeenAt?: string;
|
|
59
|
+
motionState?: MotionState;
|
|
60
|
+
motionChangedAt?: string;
|
|
61
|
+
batteryLevel?: number;
|
|
62
|
+
lowBatteryAt?: string;
|
|
63
|
+
status: TrackerStatus;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
};
|
package/src/vehicle.ts
CHANGED
|
@@ -1,41 +1,11 @@
|
|
|
1
1
|
import { Errand } from './errand';
|
|
2
|
-
import {
|
|
2
|
+
import { Rider } from './rider';
|
|
3
3
|
|
|
4
4
|
export enum VehicleType {
|
|
5
5
|
Bike = 'bike',
|
|
6
6
|
Shuttle = 'shuttle',
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
/** GeoJSON Point. `coordinates` is `[longitude, latitude]`. */
|
|
10
|
-
export type GeoPoint = {
|
|
11
|
-
type: 'Point';
|
|
12
|
-
coordinates: [number, number];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A trimmed-down Traccar position kept as the vehicle's latest fix. Carries the
|
|
17
|
-
* scalar fields a GeoPoint can't — `speed`/`course` drive derived state
|
|
18
|
-
* (moving vs. idle, heading), `recordedAt` gauges staleness.
|
|
19
|
-
*/
|
|
20
|
-
export type TrackerPosition = {
|
|
21
|
-
latitude: number;
|
|
22
|
-
longitude: number;
|
|
23
|
-
speed?: number;
|
|
24
|
-
course?: number;
|
|
25
|
-
accuracy?: number;
|
|
26
|
-
valid?: boolean;
|
|
27
|
-
/** Traccar's moving/stopped determination — steadier than speed alone. */
|
|
28
|
-
motion?: boolean;
|
|
29
|
-
/** Engine on/off, when the device reports it. */
|
|
30
|
-
ignition?: boolean;
|
|
31
|
-
/** ISO time the GPS computed the position — the truest "when". */
|
|
32
|
-
fixTime?: string;
|
|
33
|
-
/** ISO time from the device's own clock (drift/buffering signal). */
|
|
34
|
-
deviceTime?: string;
|
|
35
|
-
/** ISO time Traccar received the report — lags `fixTime` when buffered. */
|
|
36
|
-
serverTime?: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
9
|
export type Vehicle = {
|
|
40
10
|
id: string;
|
|
41
11
|
vehicleNumber: string;
|
|
@@ -47,16 +17,10 @@ export type Vehicle = {
|
|
|
47
17
|
|
|
48
18
|
shortName?: string;
|
|
49
19
|
userId?: string;
|
|
50
|
-
/** External GPS device uniqueId bound to this vehicle. */
|
|
51
|
-
trackerId?: string;
|
|
52
|
-
/** Latest known tracker position, as a GeoPoint for proximity queries. */
|
|
53
|
-
location?: GeoPoint;
|
|
54
|
-
/** Latest tracker fix with richer scalar fields (speed, course, …). */
|
|
55
|
-
position?: TrackerPosition;
|
|
56
20
|
};
|
|
57
21
|
|
|
58
22
|
export type VehicleWithRider = Vehicle & {
|
|
59
|
-
riders:
|
|
23
|
+
riders: Rider[];
|
|
60
24
|
};
|
|
61
25
|
|
|
62
26
|
export enum VehicleLogType {
|