@gobolt/genesis 0.7.3 → 0.8.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.
Files changed (192) hide show
  1. package/dist/components/Avatar/__stories__/Avatar.stories.d.ts +9 -0
  2. package/dist/components/Avatar/__tests__/Avatar.test.d.ts +1 -0
  3. package/dist/components/Badge/__stories__/Badge.stories.d.ts +17 -0
  4. package/dist/components/Badge/__tests__/Badge.test.d.ts +1 -0
  5. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +23 -0
  6. package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +9 -0
  7. package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.d.ts +1 -0
  8. package/dist/components/Button/__stories__/Button.stories.d.ts +12 -0
  9. package/dist/components/Button/__stories__/IconButton.stories.d.ts +8 -0
  10. package/dist/components/Button/__stories__/UtilityButton.stories.d.ts +8 -0
  11. package/dist/components/Button/__tests__/Button.test.d.ts +1 -0
  12. package/dist/components/Card/__stories__/Card.stories.d.ts +7 -0
  13. package/dist/components/Card/__tests__/Card.test.d.ts +1 -0
  14. package/dist/components/Chat/__stories__/Chat.stories.d.ts +19 -0
  15. package/dist/components/Checkbox/__stories__/Checkbox.stories.d.ts +7 -0
  16. package/dist/components/Checkbox/__tests__/Checkbox.test.d.ts +1 -0
  17. package/dist/components/Dashboard/Dashboard.d.ts +5 -0
  18. package/dist/components/Dashboard/__mocks__/dashboard-data.d.ts +13 -0
  19. package/dist/components/Dashboard/__stories__/Dashboard.stories.d.ts +6 -0
  20. package/dist/components/Dashboard/__stories__/DashboardLayoutContent.d.ts +2 -0
  21. package/dist/components/Dashboard/__stories__/DashboardLayoutHeader.d.ts +2 -0
  22. package/dist/components/Dashboard/__stories__/DashboardLayoutStory.d.ts +12 -0
  23. package/dist/components/Dashboard/__stories__/charts/LineChart.d.ts +12 -0
  24. package/dist/components/Dashboard/__tests__/Dashboard.test.d.ts +1 -0
  25. package/dist/components/Dashboard/index.d.ts +2 -0
  26. package/dist/components/Dashboard/styles.d.ts +13 -0
  27. package/dist/components/DatePicker/__stories__/DatePicker.stories.d.ts +9 -0
  28. package/dist/components/DatePicker/__tests__/DatePicker.test.d.ts +1 -0
  29. package/dist/components/DateRangePicker/__stories__/DateRangePicker.stories.d.ts +10 -0
  30. package/dist/components/DateRangePicker/__tests__/DateRangePicker.test.d.ts +1 -0
  31. package/dist/components/ErrorBoundary/__stories__/ErrorBoundary.stories.d.ts +7 -0
  32. package/dist/components/ErrorBoundary/__tests__/ErrorBoundary.test.d.ts +1 -0
  33. package/dist/components/ErrorBoundary/styles.d.ts +13 -0
  34. package/dist/components/ErrorBoundaryFallback/__stories__/ErrorBoundaryFallback.stories.d.ts +7 -0
  35. package/dist/components/Filters/Filter.d.ts +23 -0
  36. package/dist/components/Filters/FilterRow.d.ts +8 -0
  37. package/dist/components/Filters/Filters.d.ts +8 -0
  38. package/dist/components/Filters/__stories__/Filters.stories.d.ts +7 -0
  39. package/dist/components/Filters/__stories__/mock.d.ts +5 -0
  40. package/dist/components/Filters/__tests__/Filters.test.d.ts +1 -0
  41. package/dist/components/Filters/index.d.ts +2 -0
  42. package/dist/components/Filters/styles.d.ts +28 -0
  43. package/dist/components/Form/Form.d.ts +1 -1
  44. package/dist/components/Form/__stories__/Form.stories.d.ts +6 -0
  45. package/dist/components/Form/__stories__/FormStory.d.ts +1 -0
  46. package/dist/components/Form/__tests__/form.test.d.ts +1 -0
  47. package/dist/components/GlobalHeader/__stories__/GlobalHeader.stories.d.ts +11 -0
  48. package/dist/components/GlobalHeader/__tests__/GlobalHeader.test.d.ts +1 -0
  49. package/dist/components/GlobalHeader/styles.d.ts +15 -0
  50. package/dist/components/Glyph/Glyph.d.ts +3 -0
  51. package/dist/components/Glyph/__stories__/Glyph.stories.d.ts +6 -0
  52. package/dist/components/Glyph/custom/__stories__/UnitNumber.stories.d.ts +7 -0
  53. package/dist/components/Glyph/index.d.ts +4 -0
  54. package/dist/components/Glyph/styles.d.ts +13 -0
  55. package/dist/components/Input/__stories__/Input.stories.d.ts +12 -0
  56. package/dist/components/Input/__tests__/Input.test.d.ts +1 -0
  57. package/dist/components/InputAddon/__stories__/InputAdd.stories.d.ts +10 -0
  58. package/dist/components/Insights/BarChart/__stories__/BarChart.stories.d.ts +8 -0
  59. package/dist/components/Insights/BarChart/__stories__/BarChart.vehicle-insights.stories.d.ts +12 -0
  60. package/dist/components/Insights/BarChart/__tests__/BarChart.test.d.ts +1 -0
  61. package/dist/components/Insights/DonutChart/__stories__/DonutChart.stories.d.ts +8 -0
  62. package/dist/components/Insights/DonutChart/__tests__/DonutChart.test.d.ts +1 -0
  63. package/dist/components/Insights/LineChart/__stories__/LineChart.stories.d.ts +6 -0
  64. package/dist/components/Insights/LineChart/__tests__/LineChart.test.d.ts +1 -0
  65. package/dist/components/Insights/__stories__/InsightsDrawer.stories.d.ts +12 -0
  66. package/dist/components/Layout/Content/ResponsiveContent.d.ts +7 -0
  67. package/dist/components/Layout/MainLayout/MainLayout.d.ts +9 -0
  68. package/dist/components/Layout/MainLayout/__stories__/MainLayout.stories.d.ts +8 -0
  69. package/dist/components/Layout/MainLayout/index.d.ts +2 -0
  70. package/dist/components/Layout/MainLayout/styles.d.ts +4 -0
  71. package/dist/components/Layout/__stories__/Layout.stories.d.ts +6 -0
  72. package/dist/components/Layout/__tests__/Layout.test.d.ts +1 -0
  73. package/dist/components/Message/__stories__/Message.stories.d.ts +15 -0
  74. package/dist/components/Message/__tests__/Message.test.d.ts +1 -0
  75. package/dist/components/NavBar/NavBar.d.ts +30 -0
  76. package/dist/components/NavBar/NavItem.d.ts +15 -0
  77. package/dist/components/NavBar/NavMenu.d.ts +7 -0
  78. package/dist/components/NavBar/__stories__/AppLayout.stories.d.ts +10 -0
  79. package/dist/components/NavBar/__stories__/NavBar.stories.d.ts +15 -0
  80. package/dist/components/NavBar/__stories__/NavItem.stories.d.ts +16 -0
  81. package/dist/components/NavBar/__stories__/fixtures.d.ts +8 -0
  82. package/dist/components/NavBar/__tests__/NavBar.test.d.ts +1 -0
  83. package/dist/components/NavBar/index.d.ts +2 -0
  84. package/dist/components/NavBar/styles.d.ts +33 -0
  85. package/dist/components/Notification/NotificationBadge/__stories__/NotificationBadge.stories.d.ts +12 -0
  86. package/dist/components/Notification/NotificationBadge/__tests__/NotificationBadge.test.d.ts +1 -0
  87. package/dist/components/Notification/NotificationBadge/index.d.ts +2 -0
  88. package/dist/components/Notification/__stories__/Notification.stories.d.ts +10 -0
  89. package/dist/components/Notification/__tests__/Notification.test.d.ts +1 -0
  90. package/dist/components/OverflowMenu/__stories__/OverflowMenu.stories.d.ts +8 -0
  91. package/dist/components/OverflowMenu/__tests__/OverflowMenu.test.d.ts +0 -0
  92. package/dist/components/OverflowMenuItem/__stories__/OverflowMenuItem.stories.d.ts +7 -0
  93. package/dist/components/Popover/__stories__/Popover.stories.d.ts +6 -0
  94. package/dist/components/Popover/__tests__/Popover.test.d.ts +1 -0
  95. package/dist/components/Progress/__stories__/Progress.stories.d.ts +18 -0
  96. package/dist/components/Progress/__tests__/Progress.test.d.ts +1 -0
  97. package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +8 -0
  98. package/dist/components/Radio/__tests__/RadioGroup.test.d.ts +1 -0
  99. package/dist/components/Row/__stories__/Row.stories.d.ts +12 -0
  100. package/dist/components/Row/__tests__/Row.test.d.ts +1 -0
  101. package/dist/components/SegmentedControls/__stories__/SegmentedControls.stories.d.ts +8 -0
  102. package/dist/components/SegmentedControls/__tests__/SegmentedControls.test.d.ts +1 -0
  103. package/dist/components/Select/__stories__/Select.stories.d.ts +11 -0
  104. package/dist/components/Shapes/__stories__/Shapes.stories.d.ts +8 -0
  105. package/dist/components/Shapes/__tests__/Shapes.test.d.ts +1 -0
  106. package/dist/components/Stories/position-checker.d.ts +6 -0
  107. package/dist/components/Switch/__stories__/Switch.stories.d.ts +8 -0
  108. package/dist/components/Switch/__tests__/Switch.test.d.ts +1 -0
  109. package/dist/components/Table/InfiniteScrollTable/__stories__/SpaceX.stories.d.ts +6 -0
  110. package/dist/components/Table/InfiniteScrollTable/__stories__/TableInfiniteScroll.stories.d.ts +13 -0
  111. package/dist/components/Table/InfiniteScrollTable/__stories__/api.d.ts +7 -0
  112. package/dist/components/Table/InfiniteScrollTable/__stories__/exampleConfig.d.ts +26 -0
  113. package/dist/components/Table/InfiniteScrollTable/__stories__/spacexConfig.d.ts +2 -0
  114. package/dist/components/Table/InfiniteScrollTable/types.d.ts +88 -0
  115. package/dist/components/Table/TableControls/__stories__/CustomPaginationStandalone.stories.d.ts +9 -0
  116. package/dist/components/Table/TableControls/__stories__/PaginationNumber.stories.d.ts +7 -0
  117. package/dist/components/Table/TableControls/__stories__/TableControls.stories.d.ts +8 -0
  118. package/dist/components/Table/TableControls/__tests__/CustomPagination.test.d.ts +1 -0
  119. package/dist/components/Table/TableControls/__tests__/TableControls.test.d.ts +1 -0
  120. package/dist/components/Table/TableControls/styles.d.ts +13 -0
  121. package/dist/components/Table/__stories__/GenesisTable.stories.d.ts +5 -0
  122. package/dist/components/Table/__stories__/Table.stories.d.ts +10 -0
  123. package/dist/components/Table/__tests__/table.test.d.ts +1 -0
  124. package/dist/components/TableWithControls/__stories__/InfiniteScrollSelectRowsStory.d.ts +1 -0
  125. package/dist/components/TableWithControls/__stories__/InfiniteScrollStory.d.ts +13 -0
  126. package/dist/components/TableWithControls/__stories__/PaginationStory.d.ts +6 -0
  127. package/dist/components/TableWithControls/__stories__/TablePage.stories.d.ts +6 -0
  128. package/dist/components/TableWithControls/__stories__/TableWithControls.stories.d.ts +13 -0
  129. package/dist/components/TableWithControls/__tests__/TableWithControls.test.d.ts +1 -0
  130. package/dist/components/Tabs/__stories__/Tabs.stories.d.ts +9 -0
  131. package/dist/components/Tabs/__tests__/Tabs.test.d.ts +1 -0
  132. package/dist/components/Tag/__stories__/Tag.stories.d.ts +10 -0
  133. package/dist/components/Tile/__stories__/Tile.stories.d.ts +6 -0
  134. package/dist/components/Tile/__tests__/Tile.test.d.ts +1 -0
  135. package/dist/components/TileLog/TileLog.d.ts +10 -0
  136. package/dist/components/TileLog/__stories__/TileLog.stories.d.ts +22 -0
  137. package/dist/components/TileLog/index.d.ts +2 -0
  138. package/dist/components/TileLog/styles.d.ts +15 -0
  139. package/dist/components/Toast/__stories__/Toast.stories.d.ts +15 -0
  140. package/dist/components/Toast/__tests__/Toast.test.d.ts +1 -0
  141. package/dist/components/Tooltip/__stories__/Tooltip.stories.d.ts +8 -0
  142. package/dist/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
  143. package/dist/components/Typography/Typography.d.ts +2 -1
  144. package/dist/components/Typography/__stories__/Typography.stories.d.ts +15 -0
  145. package/dist/components/Typography/__tests__/Typography.test.d.ts +1 -0
  146. package/dist/components/UtilityButton/UtilityButton.d.ts +1 -2
  147. package/dist/components/index.d.ts +4 -0
  148. package/dist/genesis/ComponentOverview.stories.d.ts +6 -0
  149. package/dist/genesis/GenesisThemeBreakdown.d.ts +3 -0
  150. package/dist/genesis/GenesisThemeDemo.d.ts +4 -0
  151. package/dist/genesis/GenesisThemeDemo.stories.d.ts +6 -0
  152. package/dist/genesis/Lab.stories.d.ts +5 -0
  153. package/dist/genesis/stories.d.ts +4 -0
  154. package/dist/genesis/styles.d.ts +11 -0
  155. package/dist/index.cjs +867 -179
  156. package/dist/index.js +805 -117
  157. package/dist/interface/address.d.ts +10 -0
  158. package/dist/interface/appointment.d.ts +56 -0
  159. package/dist/interface/appointmentV2.d.ts +64 -0
  160. package/dist/interface/appointmentsState.d.ts +20 -0
  161. package/dist/interface/common.d.ts +2 -0
  162. package/dist/interface/completionData.d.ts +18 -0
  163. package/dist/interface/deliveryPartner.d.ts +24 -0
  164. package/dist/interface/organization.d.ts +9 -0
  165. package/dist/interface/pagination.d.ts +8 -0
  166. package/dist/interface/roles.d.ts +9 -0
  167. package/dist/interface/route.d.ts +72 -0
  168. package/dist/interface/routeAnalysis.d.ts +107 -0
  169. package/dist/interface/routeAutomationJob.d.ts +94 -0
  170. package/dist/interface/routeAutomationLog.d.ts +9 -0
  171. package/dist/interface/routeEvent.d.ts +55 -0
  172. package/dist/interface/serviceArea.d.ts +17 -0
  173. package/dist/interface/util.d.ts +3 -0
  174. package/dist/interface/vehicle.d.ts +119 -0
  175. package/dist/interface/workOrder.d.ts +22 -0
  176. package/dist/providers/__stories__/GenesisProvider.stories.d.ts +5 -0
  177. package/dist/setupTests.d.ts +1 -0
  178. package/dist/styles/design-tokens/border-tokens/BorderTokenList.d.ts +1 -0
  179. package/dist/styles/design-tokens/border-tokens/BorderTokens.stories.d.ts +5 -0
  180. package/dist/styles/design-tokens/color-tokens/ColorTokens.stories.d.ts +6 -0
  181. package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.d.ts +1 -0
  182. package/dist/styles/design-tokens/sizing-tokens/index.stories.d.ts +5 -0
  183. package/dist/styles/design-tokens/typography-tokens/TypographyTokens.stories.d.ts +7 -0
  184. package/dist/styles/design-tokens/variables.d.ts +706 -0
  185. package/dist/styles/theme/genesis-theme.types.d.ts +263 -0
  186. package/dist/styles/theme/theme-tree/ThemeTree.d.ts +1 -0
  187. package/dist/styles/theme/theme-tree/ThemeTree.stories.d.ts +5 -0
  188. package/dist/test/setup.d.ts +3 -0
  189. package/dist/test/setup.types.d.ts +6 -0
  190. package/dist/types/events.d.ts +21 -0
  191. package/dist/utils/simple-markdown.d.ts +4 -0
  192. package/package.json +2 -1
@@ -0,0 +1,10 @@
1
+ export interface Address {
2
+ id: string;
3
+ country: string;
4
+ city: string;
5
+ province: string;
6
+ address: string;
7
+ address_two: string | null;
8
+ postal_code: string;
9
+ nickname: string | null;
10
+ }
@@ -0,0 +1,56 @@
1
+ import { Fulfillment, Storage } from '@secondcloset/types';
2
+ import { Address } from './address';
3
+ export type AppointmentOrShipment = Omit<Storage.Appointment, "user_firstname" | "user_lastname"> | Omit<Fulfillment.Appointment, "user_firstname" | "user_lastname">;
4
+ export type AppointmentMissOTIFStatus = {
5
+ status: "early" | "late";
6
+ durationMin: number;
7
+ };
8
+ export type AppointmentOntimeOTIFStatus = {
9
+ status: "on_time";
10
+ };
11
+ export type AppointmentOTIFStatus = AppointmentMissOTIFStatus | AppointmentOntimeOTIFStatus;
12
+ export type BvrAppointmentDetails = {
13
+ id: string;
14
+ address: Address;
15
+ number: string;
16
+ status: string;
17
+ job_subtype: string;
18
+ created_at: string;
19
+ updated_at: string;
20
+ organization_name: string | null;
21
+ };
22
+ export type BvrAppointment = {
23
+ id: string;
24
+ date: string;
25
+ type: string;
26
+ number: string;
27
+ status: string;
28
+ timerange: string;
29
+ address: Address;
30
+ job_type: string;
31
+ job_subtype: string;
32
+ start_time: string | null;
33
+ end_time: string | null;
34
+ organization_name: string | null;
35
+ };
36
+ export declare enum AppointmentStatus {
37
+ request_received = "request_received",
38
+ confirmed = "confirmed",
39
+ scheduled = "scheduled",
40
+ cancelled = "cancelled",
41
+ ready = "ready",
42
+ loaded = "loaded",
43
+ on_the_way = "on_the_way",
44
+ arrived = "arrived",
45
+ incomplete = "incomplete",
46
+ started = "started",
47
+ done = "done",
48
+ staging = "staging",
49
+ completed = "completed",
50
+ signed = "signed",
51
+ failed = "failed"
52
+ }
53
+ export declare enum ParcelAppointmentPackageStatus {
54
+ pending_receiving = "pending_receiving",
55
+ staged = "staged"
56
+ }
@@ -0,0 +1,64 @@
1
+ import { AppointmentStatus, AppointmentSubtype, AppointmentType, DeliveryType, ScServiceCode } from '@secondcloset/types/src/fulfillment';
2
+ export type Address = {
3
+ addresss: string;
4
+ line_1: string;
5
+ line_2: string;
6
+ city: string;
7
+ province: string;
8
+ country: string;
9
+ postal_code: string;
10
+ nickname: string | null;
11
+ is_primary: boolean | null;
12
+ coordinates: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ };
17
+ export type Customer = {
18
+ id: string;
19
+ name: string;
20
+ phone_number: string | null;
21
+ user_id: string | null;
22
+ };
23
+ export type PackageWeight = {
24
+ weight_unit: string;
25
+ weight_value: number;
26
+ };
27
+ export type Appointment = {
28
+ id: string;
29
+ date: string;
30
+ timeslot: string;
31
+ number: string;
32
+ job_type: AppointmentType;
33
+ job_subtype: AppointmentSubtype;
34
+ status: AppointmentStatus;
35
+ air_skip: string | null;
36
+ delivery_service_level: ScServiceCode;
37
+ delivery_type: DeliveryType;
38
+ service_area: string;
39
+ organization_name: string | null;
40
+ timezone: string | null;
41
+ state: "assigned" | "unassigned";
42
+ recommended_route_user_count: number;
43
+ order_id: string;
44
+ organization_id: string;
45
+ transport_work_order_id: string | null;
46
+ route_id: string | null;
47
+ parcel_service_level: string | null;
48
+ order_number: string;
49
+ external_order_number: string | null;
50
+ order_platform: string | null;
51
+ external_platform_version: string | null;
52
+ arrival_eta: string | null;
53
+ estimated_duration_seconds: number | null;
54
+ range_of_days_start_date: string | null;
55
+ range_of_days_end_date: string | null;
56
+ type: string | null;
57
+ package_count: number;
58
+ package_weights: PackageWeight[] | null;
59
+ package_ids: string[] | null;
60
+ tracking_numbers: string[] | null;
61
+ master_tracking_number: string | null;
62
+ customer: Customer | null;
63
+ address: Address | null;
64
+ };
@@ -0,0 +1,20 @@
1
+ import { Storage } from '@secondcloset/types';
2
+ import { AppointmentOrShipment } from './appointment';
3
+ export type AppointmentsLibrary = {
4
+ [appointmentID: string]: AppointmentOrShipment;
5
+ };
6
+ type AppointmentsMarkers = {
7
+ [stringifiedMarkerKey: string]: string[];
8
+ };
9
+ type AppointmentsIDsMap = {
10
+ [appointmentID: string]: string;
11
+ };
12
+ export interface AppointmentsState {
13
+ appointmentsLibrary: AppointmentsLibrary;
14
+ appointmentsMarkers: AppointmentsMarkers;
15
+ inventoryPickupCrossDockDeliveryPairs: AppointmentsIDsMap;
16
+ reverseLogisticsReturnToSenderPairs: AppointmentsIDsMap;
17
+ inventoryOnHandAppointmentIDMap: AppointmentsIDsMap;
18
+ appointmentTimeslots: Storage.AppointmentSlot[];
19
+ }
20
+ export {};
@@ -0,0 +1,2 @@
1
+ export type Location = [number, number];
2
+ export type Environment = "staging" | "preprod" | "production";
@@ -0,0 +1,18 @@
1
+ interface CompletionLocation {
2
+ type: "Point" | string;
3
+ coordinates: [number, number];
4
+ }
5
+ export interface CompletionData {
6
+ id: string;
7
+ appointment_id: string;
8
+ route_id: string;
9
+ user_id: string;
10
+ completion_location: CompletionLocation;
11
+ is_wrong_location: boolean;
12
+ wrong_location_reason: string | null;
13
+ distance_to_appointment_in_meters: number;
14
+ deleted_at: string | null;
15
+ created_at: string;
16
+ updated_at: string;
17
+ }
18
+ export {};
@@ -0,0 +1,24 @@
1
+ import { ServiceArea } from '@secondcloset/types/src/_common';
2
+ export interface DeliveryPartner {
3
+ id: string;
4
+ type: DeliveryPartnerType;
5
+ company_name: string;
6
+ email?: string;
7
+ address?: string;
8
+ phone_number?: string;
9
+ incorporation_id?: string;
10
+ website?: string;
11
+ created_at: string;
12
+ }
13
+ export type DeliveryPartnerType = "fleet_operator" | "independent_operator";
14
+ export type DeliveryPartnerDriver = {
15
+ id: string;
16
+ first_name: string;
17
+ last_name: string;
18
+ email: string;
19
+ service_areas: ServiceArea[];
20
+ terms_and_conditions_signed: boolean;
21
+ terms_and_conditions_signed_at: string;
22
+ company_name?: string;
23
+ created_at: string;
24
+ };
@@ -0,0 +1,9 @@
1
+ export interface OrganizationName {
2
+ id: string;
3
+ name: string;
4
+ }
5
+ export type Organization = OrganizationName & {
6
+ phone_number: string | null;
7
+ email: string | null;
8
+ created_at: string;
9
+ };
@@ -0,0 +1,8 @@
1
+ export interface Pagination {
2
+ count: number;
3
+ pages: number;
4
+ per_page: number;
5
+ current: number;
6
+ next: number | null;
7
+ previous: number | null;
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface Permission {
2
+ id: string;
3
+ name: string;
4
+ }
5
+ export interface Role {
6
+ id: string;
7
+ name: string;
8
+ permissions: Permission[];
9
+ }
@@ -0,0 +1,72 @@
1
+ import { Storage } from '@secondcloset/types';
2
+ import { AppointmentOrShipment } from './appointment';
3
+ import { VehicleKind, VehicleType } from './vehicle';
4
+ export interface RouteItem {
5
+ appointment_id: string;
6
+ appointment_type: "fulfillment" | "storage";
7
+ type: AppointmentOrShipment;
8
+ status: string;
9
+ number: string;
10
+ date: string;
11
+ timerange: Storage.AppointmentSlot;
12
+ sequence: number;
13
+ }
14
+ export interface RouteUser {
15
+ user_id: string;
16
+ email: string;
17
+ first_name: string;
18
+ last_name: string;
19
+ subrole: string;
20
+ assigned_role: string;
21
+ delivery_partner_id?: string;
22
+ delivery_partner_name?: string;
23
+ }
24
+ export type Route = {
25
+ id: string;
26
+ route_date: string;
27
+ route_name: string;
28
+ route_number: string;
29
+ route_status: string;
30
+ route_color: string;
31
+ dispatch_time: string;
32
+ notes: string;
33
+ vehicle_id: string | null;
34
+ vehicle_type: VehicleType | null;
35
+ created_at: string;
36
+ route_items: RouteItem[];
37
+ route_users: RouteUser[];
38
+ estimated_travel_distance_in_meters: number | null;
39
+ estimated_travel_time_in_seconds: number | null;
40
+ automation_job_id: string | null;
41
+ route_items_updated: boolean;
42
+ hub_id: string | null;
43
+ published_at: string | null;
44
+ recommended_route_user_count: number | null;
45
+ color?: string | null;
46
+ dominant_delivery_type?: string;
47
+ dominant_zone_id?: string;
48
+ dominant_zone_name?: string;
49
+ } & RouteVehicleKind;
50
+ export type RouteVehicleKind = {
51
+ vehicle_kind_id: string;
52
+ vehicle_kind_name: string;
53
+ vehicle_kind_fuel_type: VehicleKind["fuel_type"];
54
+ } | {
55
+ vehicle_kind_id: null;
56
+ vehicle_kind_name: null;
57
+ vehicle_kind_fuel_type: null;
58
+ };
59
+ export interface InternalVehicle {
60
+ id: string;
61
+ type: Extract<VehicleType, "internal">;
62
+ }
63
+ export interface DSPVehicle {
64
+ id: null;
65
+ type: Extract<VehicleType, "dsp_default">;
66
+ }
67
+ export type RouteActionReason = {
68
+ name: string;
69
+ notes?: string;
70
+ };
71
+ export type RouteDeleteReason = RouteActionReason;
72
+ export type RouteUpdateReason = RouteActionReason;
@@ -0,0 +1,107 @@
1
+ import { ServiceArea } from '@secondcloset/types/src/_common';
2
+ import { AppointmentOrShipment } from './appointment';
3
+ type RouteItem = {
4
+ appointment_id: string;
5
+ type: string;
6
+ status: string;
7
+ number: string;
8
+ date: string;
9
+ timerange: string;
10
+ stop_duration: number;
11
+ timezone: string;
12
+ sequence: number;
13
+ total_weight: number;
14
+ total_items_count: number;
15
+ estimated_duration_seconds?: number;
16
+ delivery_type: Exclude<AppointmentOrShipment["delivery_type"], undefined>;
17
+ delivery_service_level: Exclude<AppointmentOrShipment["delivery_service_level"], undefined>;
18
+ coordinates: {
19
+ lat: number;
20
+ lng: number;
21
+ };
22
+ };
23
+ export type RouteAnalysisStatisticsAppointment = Omit<RouteItem, "type"> & {
24
+ appointment_id: string | "warehouse-id" | "depot";
25
+ type: number;
26
+ is_pickup?: boolean;
27
+ stop_duration: number;
28
+ arrival_eta?: string;
29
+ departure_eta?: string;
30
+ mapbox_arrival_eta?: string;
31
+ mapbox_departure_eta?: string;
32
+ travel_distance_in_meters?: number;
33
+ actual_travel_distance_in_meters?: number;
34
+ actual_travel_duration_in_seconds?: number;
35
+ total_duration_in_seconds?: number;
36
+ travel_duration_in_seconds?: number;
37
+ skip_prediction?: boolean;
38
+ date?: string;
39
+ number?: string;
40
+ status?: string;
41
+ sequence?: number;
42
+ timezone?: string;
43
+ timerange?: string;
44
+ coordinates?: {
45
+ lat: number;
46
+ lng: number;
47
+ };
48
+ total_weight?: number;
49
+ delivery_type?: string;
50
+ total_items_count?: number;
51
+ delivery_service_level?: string;
52
+ estimated_duration_seconds?: number | null;
53
+ service_area?: {
54
+ name?: ServiceArea;
55
+ };
56
+ start_time?: string | null;
57
+ end_time?: string | null;
58
+ organization_id?: string;
59
+ organization_name?: string | null;
60
+ failed_reason?: string | null;
61
+ incomplete_at?: string | null;
62
+ };
63
+ type RouteAnalysisStatistics = {
64
+ appointments: RouteAnalysisStatisticsAppointment[];
65
+ total_duration_in_seconds: number;
66
+ total_travel_distance_in_meters: number;
67
+ total_weight: number;
68
+ total_items_count: number;
69
+ route_polyline?: number[][];
70
+ };
71
+ export type RouteAnalysis = {
72
+ id: string;
73
+ external_route_id: string;
74
+ analysis: RouteAnalysisStatistics;
75
+ analysis_snapshot: RouteAnalysisStatistics;
76
+ analysis_snapshot_planning?: RouteAnalysisStatistics | null;
77
+ };
78
+ export type RouteAnalysisMap = {
79
+ [routeID: string]: RouteAnalysis;
80
+ };
81
+ export type RouteAnalysisTotal = {
82
+ id: string;
83
+ external_route_id: string;
84
+ total_duration_in_seconds: number;
85
+ total_travel_distance_in_meters: number;
86
+ total_weight_in_grams: number;
87
+ total_items_count: number;
88
+ total_stops_count: number;
89
+ created_at: string;
90
+ updated_at: string;
91
+ route_progress_info?: {
92
+ completed_appointments: number;
93
+ failed_appointments: number;
94
+ total_appointments: number;
95
+ };
96
+ };
97
+ export type RouteAnalysisTotalMap = {
98
+ [routeID: string]: RouteAnalysisTotal;
99
+ };
100
+ export type RoutePolyline = {
101
+ external_route_id: string;
102
+ route_polyline: number[][] | null;
103
+ };
104
+ export type RoutePolylineMap = {
105
+ [routeID: string]: RoutePolyline;
106
+ };
107
+ export {};
@@ -0,0 +1,94 @@
1
+ import { ServiceArea } from '@secondcloset/types/src/_common';
2
+ export declare enum JobStatus {
3
+ CREATING_ROUTES = "creating_routes",
4
+ CREATING_DISTANCE_ETAS = "creating_distance_etas",
5
+ ACTIVE = "active",
6
+ COMPLETED = "completed",
7
+ COMPLETED_WITHOUT_STATISTICS = "completed_without_statistics",
8
+ FAILED = "failed",
9
+ CANCELLED = "cancelled"
10
+ }
11
+ export declare const OngoingJobStatus: JobStatus[];
12
+ export type AutomationJobStatisticsAppointment = {
13
+ id: string;
14
+ route_id?: string;
15
+ stop_duration: number;
16
+ timerange?: string;
17
+ ets: string;
18
+ etd: string;
19
+ type: number;
20
+ nextmv_arrival_eta: string;
21
+ nextmv_departure_eta: string;
22
+ google_arrival_eta: string;
23
+ google_departure_eta: string;
24
+ google_duration_in_seconds: number;
25
+ google_travel_duration_in_seconds: number;
26
+ google_travel_distance_in_meters: number;
27
+ duration_in_seconds: number;
28
+ travel_duration_in_seconds: number;
29
+ };
30
+ export type AutomationJobStatistics = {
31
+ vehicle_id: string;
32
+ route_id: string;
33
+ job_id: string;
34
+ appointments: AutomationJobStatisticsAppointment[];
35
+ total_google_duration_in_seconds: number;
36
+ total_google_travel_duration_in_seconds: number;
37
+ total_google_travel_distance_in_meters?: number;
38
+ total_duration_in_seconds: number;
39
+ total_travel_duration_in_seconds: number;
40
+ total_stop_time: number;
41
+ aph: number;
42
+ google_aph: number;
43
+ total_items_count: number;
44
+ total_weight: number;
45
+ };
46
+ export interface AutomateRoutingDtoConfiguration {
47
+ vehicle_penalization: number;
48
+ min_max_factor: number;
49
+ max_stops: number;
50
+ min_stops: number;
51
+ morning_threshold: number;
52
+ afternoon_threshold: number;
53
+ evening_threshold: number;
54
+ wrong_route_length: number;
55
+ timeslot_threshold_penalization: number;
56
+ time_on_road_penalization: number;
57
+ speed_scaling_factor: number;
58
+ dont_use_selector: boolean;
59
+ unassigned_penalty: number;
60
+ route_automation_runtime: number;
61
+ timezone: string;
62
+ limits: {
63
+ [key: number]: number;
64
+ };
65
+ }
66
+ export interface RouteAutomationJob {
67
+ appointment_ids: string[];
68
+ completed_at: string | null;
69
+ created_at: string;
70
+ date: string;
71
+ id: string;
72
+ output: string | null;
73
+ input: {
74
+ configuration: Partial<AutomateRoutingDtoConfiguration>;
75
+ date?: string;
76
+ speed?: number;
77
+ };
78
+ service_area: ServiceArea;
79
+ status: JobStatus;
80
+ updated_at: string;
81
+ vehicle_ids: string[];
82
+ user_id: string;
83
+ user_name: string;
84
+ version: string;
85
+ queue?: {
86
+ count?: number;
87
+ state?: string;
88
+ };
89
+ statistics?: AutomationJobStatistics[];
90
+ total_vehicles_count: number;
91
+ total_assigned_count: number;
92
+ total_unassigned_count: number;
93
+ total_routes_count: number;
94
+ }
@@ -0,0 +1,9 @@
1
+ import { RouteAutomationJob } from './routeAutomationJob';
2
+ export type RouteAutomationLogKind = "started" | "completed" | "completed_without_statistics" | "active" | "failed" | "cancelled";
3
+ export type RouteAutomationLog = {
4
+ id: string;
5
+ job: RouteAutomationJob;
6
+ kind: RouteAutomationLogKind;
7
+ created_at: Date;
8
+ userName: string;
9
+ };
@@ -0,0 +1,55 @@
1
+ export type RouteEvent = {
2
+ id: string;
3
+ route_id: string;
4
+ route_date: string;
5
+ route_name: string | null;
6
+ route_number: string | null;
7
+ service_area: string;
8
+ user_email: string | null;
9
+ action: RouteEventAction;
10
+ method: RouteEventActionMethod;
11
+ reason: string | null;
12
+ notes: string | null;
13
+ changes: RouteEventChanges | null;
14
+ created_at: string;
15
+ };
16
+ export type RouteEventKind = "route_event_create" | "route_event_update" | "route_event_delete";
17
+ export interface RouteEventWithKind extends RouteEvent {
18
+ kind: RouteEventKind;
19
+ }
20
+ export declare enum RouteEventAction {
21
+ CREATE = "create",
22
+ UPDATE = "update",
23
+ DELETE = "delete",
24
+ START = "start",
25
+ COMPLETE = "complete"
26
+ }
27
+ export declare enum RouteEventActionMethod {
28
+ MANUAL = "manual",
29
+ SYSTEM = "system"
30
+ }
31
+ type RouteEventKeyTypeMap = {
32
+ dispatch_time: string;
33
+ hub_id: string;
34
+ hub_name: string;
35
+ num_appts: number;
36
+ num_route_users: number;
37
+ published_at: string;
38
+ route_date: string;
39
+ route_name: string;
40
+ route_status: string;
41
+ sequence_changed: boolean;
42
+ vehicle_id: string;
43
+ vehicle_kind_id: string;
44
+ vehicle_kind_fuel_type: string;
45
+ vehicle_kind_name: string;
46
+ };
47
+ type RouteEventChangeValue<T> = {
48
+ from: T | null;
49
+ to: T | null;
50
+ } | null;
51
+ type RouteEventChangeKeys = keyof RouteEventKeyTypeMap;
52
+ export type RouteEventChanges = {
53
+ [key in RouteEventChangeKeys]: RouteEventChangeValue<RouteEventKeyTypeMap[key]>;
54
+ };
55
+ export {};
@@ -0,0 +1,17 @@
1
+ import { FacilityCode, ServiceArea as ServiceAreaName } from '@secondcloset/types/src/_common';
2
+ export type CountryCode = "CA" | "US";
3
+ export type Address = {
4
+ country: CountryCode;
5
+ province: string;
6
+ };
7
+ export type ServiceAreaData = {
8
+ id: number;
9
+ name: ServiceAreaName;
10
+ timezone: string;
11
+ timezone_iana: string;
12
+ humanized_name: string;
13
+ address: Address;
14
+ facilities: FacilityCode[];
15
+ created_at: string;
16
+ updated_at: string;
17
+ };
@@ -0,0 +1,3 @@
1
+ export type ConvertDateToString<T extends Record<string, unknown>, K extends keyof T> = {
2
+ [Key in keyof T]: Key extends K ? string : T[Key];
3
+ };