@mydoormot/app-types 2.2.4 → 2.3.0
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 +0 -3
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +0 -3
- package/package.json +1 -1
- package/src/business.ts +0 -4
- package/src/customer.ts +4 -0
- package/src/errand.ts +31 -0
- package/src/user.ts +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mydoormot/app-types@2.2.
|
|
2
|
+
> @mydoormot/app-types@2.2.5 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
|
+
[32mESM[39m [1mdist/index.js [22m[32m15.03 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 64ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m18.10 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 64ms
|
|
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 674ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m60.35 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m60.35 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -83,7 +83,6 @@ var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
|
83
83
|
})(RoleType || {});
|
|
84
84
|
var GlobalRoles = /* @__PURE__ */ ((GlobalRoles2) => {
|
|
85
85
|
GlobalRoles2["SUPER_ADMIN"] = "SUPER_ADMIN";
|
|
86
|
-
GlobalRoles2["ADMIN"] = "ADMIN";
|
|
87
86
|
GlobalRoles2["USER"] = "USER";
|
|
88
87
|
return GlobalRoles2;
|
|
89
88
|
})(GlobalRoles || {});
|
|
@@ -325,9 +324,7 @@ var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
|
|
|
325
324
|
})(BusinessStatus || {});
|
|
326
325
|
var BusinessRole = /* @__PURE__ */ ((BusinessRole2) => {
|
|
327
326
|
BusinessRole2["OWNER"] = "OWNER";
|
|
328
|
-
BusinessRole2["MANAGER"] = "MANAGER";
|
|
329
327
|
BusinessRole2["RIDER"] = "RIDER";
|
|
330
|
-
BusinessRole2["STAFF"] = "STAFF";
|
|
331
328
|
return BusinessRole2;
|
|
332
329
|
})(BusinessRole || {});
|
|
333
330
|
var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -41,7 +41,6 @@ declare enum RoleType {
|
|
|
41
41
|
}
|
|
42
42
|
declare enum GlobalRoles {
|
|
43
43
|
SUPER_ADMIN = "SUPER_ADMIN",
|
|
44
|
-
ADMIN = "ADMIN",
|
|
45
44
|
USER = "USER"
|
|
46
45
|
}
|
|
47
46
|
declare enum AuthType {
|
|
@@ -130,6 +129,8 @@ interface Customer {
|
|
|
130
129
|
createdAt: string;
|
|
131
130
|
updatedAt: string;
|
|
132
131
|
customerBusinessId?: string;
|
|
132
|
+
/** How this customer normally pays; new errands for them start with it. Unset reads as `invoice`. */
|
|
133
|
+
paymentMode?: FeeSettlement;
|
|
133
134
|
transactionStats?: CustomerTransactionStats;
|
|
134
135
|
}
|
|
135
136
|
/**
|
|
@@ -498,9 +499,7 @@ interface Vendor {
|
|
|
498
499
|
}
|
|
499
500
|
declare enum BusinessRole {
|
|
500
501
|
OWNER = "OWNER",
|
|
501
|
-
|
|
502
|
-
RIDER = "RIDER",
|
|
503
|
-
STAFF = "STAFF"
|
|
502
|
+
RIDER = "RIDER"
|
|
504
503
|
}
|
|
505
504
|
declare enum MembershipStatus {
|
|
506
505
|
ACTIVE = "ACTIVE",
|
|
@@ -1177,6 +1176,31 @@ interface AggregatedErrand extends Errand {
|
|
|
1177
1176
|
};
|
|
1178
1177
|
riderUserDetails?: User;
|
|
1179
1178
|
}
|
|
1179
|
+
type PublicBusiness = Pick<Business, 'id' | 'name' | 'logoUrl' | 'officeNumber'>;
|
|
1180
|
+
type PublicPlace = Pick<AddressDetails, 'fullName' | 'address' | 'landmark'>;
|
|
1181
|
+
/**
|
|
1182
|
+
* `GET /errands/:alias/tracking`, which needs no login. An `AggregatedErrand`
|
|
1183
|
+
* cut down to what a tracking page shows: same field names, fewer fields.
|
|
1184
|
+
*/
|
|
1185
|
+
type PublicTrackedErrand = Pick<AggregatedErrand, 'aliasId' | 'deliveryStatus' | 'updatedAt' | 'nameOfItem' | 'additionalData'> & {
|
|
1186
|
+
errandTimeline: (Pick<ErrandTimeline, 'currTimelineIndex'> & {
|
|
1187
|
+
timeline: {
|
|
1188
|
+
status: ErrandStatus | `${ErrandStatus}`;
|
|
1189
|
+
date?: Date;
|
|
1190
|
+
}[];
|
|
1191
|
+
}) | null;
|
|
1192
|
+
riderDetails: Pick<Rider, 'firstName' | 'lastName' | 'mobileNumber'> | null;
|
|
1193
|
+
businessDetails: PublicBusiness | null;
|
|
1194
|
+
courierBusinessDetails: PublicBusiness | null;
|
|
1195
|
+
pickupDetails: PublicPlace;
|
|
1196
|
+
deliveryDetails: PublicPlace;
|
|
1197
|
+
pickupLocation: {
|
|
1198
|
+
cityName?: string;
|
|
1199
|
+
};
|
|
1200
|
+
deliveryLocation: {
|
|
1201
|
+
cityName?: string;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1180
1204
|
interface ErrandRating {
|
|
1181
1205
|
createdAt: string;
|
|
1182
1206
|
errandId: string;
|
|
@@ -1940,4 +1964,4 @@ declare enum LinkDestination {
|
|
|
1940
1964
|
}
|
|
1941
1965
|
type NullOrUndefined = null | undefined;
|
|
1942
1966
|
|
|
1943
|
-
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 ConnectionStatus, 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 };
|
|
1967
|
+
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 ConnectionStatus, 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, type PublicTrackedErrand, 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
|
@@ -41,7 +41,6 @@ declare enum RoleType {
|
|
|
41
41
|
}
|
|
42
42
|
declare enum GlobalRoles {
|
|
43
43
|
SUPER_ADMIN = "SUPER_ADMIN",
|
|
44
|
-
ADMIN = "ADMIN",
|
|
45
44
|
USER = "USER"
|
|
46
45
|
}
|
|
47
46
|
declare enum AuthType {
|
|
@@ -130,6 +129,8 @@ interface Customer {
|
|
|
130
129
|
createdAt: string;
|
|
131
130
|
updatedAt: string;
|
|
132
131
|
customerBusinessId?: string;
|
|
132
|
+
/** How this customer normally pays; new errands for them start with it. Unset reads as `invoice`. */
|
|
133
|
+
paymentMode?: FeeSettlement;
|
|
133
134
|
transactionStats?: CustomerTransactionStats;
|
|
134
135
|
}
|
|
135
136
|
/**
|
|
@@ -498,9 +499,7 @@ interface Vendor {
|
|
|
498
499
|
}
|
|
499
500
|
declare enum BusinessRole {
|
|
500
501
|
OWNER = "OWNER",
|
|
501
|
-
|
|
502
|
-
RIDER = "RIDER",
|
|
503
|
-
STAFF = "STAFF"
|
|
502
|
+
RIDER = "RIDER"
|
|
504
503
|
}
|
|
505
504
|
declare enum MembershipStatus {
|
|
506
505
|
ACTIVE = "ACTIVE",
|
|
@@ -1177,6 +1176,31 @@ interface AggregatedErrand extends Errand {
|
|
|
1177
1176
|
};
|
|
1178
1177
|
riderUserDetails?: User;
|
|
1179
1178
|
}
|
|
1179
|
+
type PublicBusiness = Pick<Business, 'id' | 'name' | 'logoUrl' | 'officeNumber'>;
|
|
1180
|
+
type PublicPlace = Pick<AddressDetails, 'fullName' | 'address' | 'landmark'>;
|
|
1181
|
+
/**
|
|
1182
|
+
* `GET /errands/:alias/tracking`, which needs no login. An `AggregatedErrand`
|
|
1183
|
+
* cut down to what a tracking page shows: same field names, fewer fields.
|
|
1184
|
+
*/
|
|
1185
|
+
type PublicTrackedErrand = Pick<AggregatedErrand, 'aliasId' | 'deliveryStatus' | 'updatedAt' | 'nameOfItem' | 'additionalData'> & {
|
|
1186
|
+
errandTimeline: (Pick<ErrandTimeline, 'currTimelineIndex'> & {
|
|
1187
|
+
timeline: {
|
|
1188
|
+
status: ErrandStatus | `${ErrandStatus}`;
|
|
1189
|
+
date?: Date;
|
|
1190
|
+
}[];
|
|
1191
|
+
}) | null;
|
|
1192
|
+
riderDetails: Pick<Rider, 'firstName' | 'lastName' | 'mobileNumber'> | null;
|
|
1193
|
+
businessDetails: PublicBusiness | null;
|
|
1194
|
+
courierBusinessDetails: PublicBusiness | null;
|
|
1195
|
+
pickupDetails: PublicPlace;
|
|
1196
|
+
deliveryDetails: PublicPlace;
|
|
1197
|
+
pickupLocation: {
|
|
1198
|
+
cityName?: string;
|
|
1199
|
+
};
|
|
1200
|
+
deliveryLocation: {
|
|
1201
|
+
cityName?: string;
|
|
1202
|
+
};
|
|
1203
|
+
};
|
|
1180
1204
|
interface ErrandRating {
|
|
1181
1205
|
createdAt: string;
|
|
1182
1206
|
errandId: string;
|
|
@@ -1940,4 +1964,4 @@ declare enum LinkDestination {
|
|
|
1940
1964
|
}
|
|
1941
1965
|
type NullOrUndefined = null | undefined;
|
|
1942
1966
|
|
|
1943
|
-
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 ConnectionStatus, 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 };
|
|
1967
|
+
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 ConnectionStatus, 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, type PublicTrackedErrand, 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
|
@@ -10,7 +10,6 @@ var RoleType = /* @__PURE__ */ ((RoleType2) => {
|
|
|
10
10
|
})(RoleType || {});
|
|
11
11
|
var GlobalRoles = /* @__PURE__ */ ((GlobalRoles2) => {
|
|
12
12
|
GlobalRoles2["SUPER_ADMIN"] = "SUPER_ADMIN";
|
|
13
|
-
GlobalRoles2["ADMIN"] = "ADMIN";
|
|
14
13
|
GlobalRoles2["USER"] = "USER";
|
|
15
14
|
return GlobalRoles2;
|
|
16
15
|
})(GlobalRoles || {});
|
|
@@ -252,9 +251,7 @@ var BusinessStatus = /* @__PURE__ */ ((BusinessStatus2) => {
|
|
|
252
251
|
})(BusinessStatus || {});
|
|
253
252
|
var BusinessRole = /* @__PURE__ */ ((BusinessRole2) => {
|
|
254
253
|
BusinessRole2["OWNER"] = "OWNER";
|
|
255
|
-
BusinessRole2["MANAGER"] = "MANAGER";
|
|
256
254
|
BusinessRole2["RIDER"] = "RIDER";
|
|
257
|
-
BusinessRole2["STAFF"] = "STAFF";
|
|
258
255
|
return BusinessRole2;
|
|
259
256
|
})(BusinessRole || {});
|
|
260
257
|
var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
|
package/package.json
CHANGED
package/src/business.ts
CHANGED
|
@@ -217,11 +217,7 @@ export interface Vendor {
|
|
|
217
217
|
|
|
218
218
|
export enum BusinessRole {
|
|
219
219
|
OWNER = 'OWNER',
|
|
220
|
-
// ADMIN = 'ADMIN', // Reserved for future use
|
|
221
|
-
MANAGER = 'MANAGER',
|
|
222
220
|
RIDER = 'RIDER',
|
|
223
|
-
STAFF = 'STAFF',
|
|
224
|
-
// MEMBER = 'MEMBER', // Reserved for future use
|
|
225
221
|
}
|
|
226
222
|
|
|
227
223
|
export enum MembershipStatus {
|
package/src/customer.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// import { Business, City, State } from '.';
|
|
2
|
+
import { FeeSettlement } from './errand';
|
|
2
3
|
|
|
3
4
|
export interface CustomerTransactionStats {
|
|
4
5
|
totalSaleCount: number;
|
|
@@ -41,6 +42,9 @@ export interface Customer {
|
|
|
41
42
|
|
|
42
43
|
customerBusinessId?: string;
|
|
43
44
|
|
|
45
|
+
/** How this customer normally pays; new errands for them start with it. Unset reads as `invoice`. */
|
|
46
|
+
paymentMode?: FeeSettlement;
|
|
47
|
+
|
|
44
48
|
transactionStats?: CustomerTransactionStats;
|
|
45
49
|
|
|
46
50
|
// From aggregation
|
package/src/errand.ts
CHANGED
|
@@ -254,6 +254,37 @@ export interface AggregatedErrand extends Errand {
|
|
|
254
254
|
riderUserDetails?: User;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
type PublicBusiness = Pick<
|
|
258
|
+
Business,
|
|
259
|
+
'id' | 'name' | 'logoUrl' | 'officeNumber'
|
|
260
|
+
>;
|
|
261
|
+
type PublicPlace = Pick<AddressDetails, 'fullName' | 'address' | 'landmark'>;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* `GET /errands/:alias/tracking`, which needs no login. An `AggregatedErrand`
|
|
265
|
+
* cut down to what a tracking page shows: same field names, fewer fields.
|
|
266
|
+
*/
|
|
267
|
+
export type PublicTrackedErrand = Pick<
|
|
268
|
+
AggregatedErrand,
|
|
269
|
+
'aliasId' | 'deliveryStatus' | 'updatedAt' | 'nameOfItem' | 'additionalData'
|
|
270
|
+
> & {
|
|
271
|
+
errandTimeline:
|
|
272
|
+
| (Pick<ErrandTimeline, 'currTimelineIndex'> & {
|
|
273
|
+
timeline: {
|
|
274
|
+
status: ErrandStatus | `${ErrandStatus}`;
|
|
275
|
+
date?: Date;
|
|
276
|
+
}[];
|
|
277
|
+
})
|
|
278
|
+
| null;
|
|
279
|
+
riderDetails: Pick<Rider, 'firstName' | 'lastName' | 'mobileNumber'> | null;
|
|
280
|
+
businessDetails: PublicBusiness | null;
|
|
281
|
+
courierBusinessDetails: PublicBusiness | null;
|
|
282
|
+
pickupDetails: PublicPlace;
|
|
283
|
+
deliveryDetails: PublicPlace;
|
|
284
|
+
pickupLocation: { cityName?: string };
|
|
285
|
+
deliveryLocation: { cityName?: string };
|
|
286
|
+
};
|
|
287
|
+
|
|
257
288
|
export interface ErrandTimeline {
|
|
258
289
|
id: string;
|
|
259
290
|
errandId: string;
|