@autobusal/providers 1.35.0 → 1.37.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.37.0
4
+
5
+ ### Added
6
+
7
+ - **Shipments types** (`ShipmentData`, `ShipmentStatus`, `SHIPMENT_STATUSES`, `ShipmentHistoryData`, etc.) for the new operator shipping module - see `@autobusal/operator-shipments` and `@autobusal/track-shipment`.
8
+ - **`OperatorData.mobile_access` / `OperatorData.shipping_enabled`** - both admin-only booleans, properly typed now rather than one of them (`mobile_access`) being narrow-cast at its one call site to avoid a cross-repo publish that this release needed anyway.
9
+
10
+ ## 1.36.0
11
+
12
+ ### Added
13
+
14
+ - **`LabelSettings.locales`** - `{default, available}`, an admin-editable override of `preferences.languages` (which UI locales this label's site responds to, and its default). Null until the new admin-label Locales tab saves one, in which case `preferences.languages` keeps coming from the label's settings.json file exactly as before.
15
+
3
16
  ## 1.35.0
4
17
 
5
18
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.35.0",
3
+ "version": "1.37.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
@@ -42,6 +42,15 @@ export interface OperatorData {
42
42
  user: UserData
43
43
  funds_display: string
44
44
  logo?: string[]
45
+ // Edited: Ferjolt Ozuni - Date: 2026-08-10
46
+ // Both admin-only, both booleans - whether this operator (and its
47
+ // employees) may use the mobile apps, and whether it sees the
48
+ // Shipments module at all. Previously mobile_access was left off this
49
+ // shared type deliberately, to avoid a cross-repo publish for a single
50
+ // field - no longer a reason to exclude it now that this file is
51
+ // already being published for shipping_enabled.
52
+ mobile_access?: boolean
53
+ shipping_enabled?: boolean
45
54
  }
46
55
 
47
56
  export interface GalleryData {
package/types/settings.ts CHANGED
@@ -140,6 +140,19 @@ export interface LabelSettings {
140
140
  currency: string
141
141
  affiliate_max_tickets: number
142
142
 
143
+ /**
144
+ * Edited: Ferjolt Ozuni - Date: 2026-08-10
145
+ * Admin-editable override of `preferences.languages` (the label's active
146
+ * UI locales) - null until an admin saves the Locales tab, in which case
147
+ * `preferences.languages` keeps coming from the label's settings.json
148
+ * file, same as before this existed. See Labels\AdminController::
149
+ * locales() and the add_locales_to_labels_settings migration.
150
+ */
151
+ locales?: {
152
+ default: string
153
+ available: string[]
154
+ } | null
155
+
143
156
  legal: {
144
157
  kop: string
145
158
  njb: string
@@ -0,0 +1,57 @@
1
+ export const SHIPMENT_STATUSES = [
2
+ 'registered', 'picked_up', 'in_transit', 'arrived', 'delivered', 'returned', 'cancelled'
3
+ ] as const;
4
+
5
+ export type ShipmentStatus = typeof SHIPMENT_STATUSES[number]
6
+
7
+ export interface ShipmentHistoryData {
8
+ id: number
9
+ status: ShipmentStatus
10
+ location?: string
11
+ note?: string
12
+ created_at: string
13
+ }
14
+
15
+ export interface ShipmentRouteData {
16
+ id: number
17
+ name: string
18
+ }
19
+
20
+ export interface ShipmentOperatorData {
21
+ id: number
22
+ company: string
23
+ brand_name?: string
24
+ display_name: string
25
+ }
26
+
27
+ export interface ShipmentData {
28
+ id: number
29
+ operator_id?: number
30
+ route_id: number
31
+ date_travel: string
32
+ tracking_number: string
33
+ status: ShipmentStatus
34
+
35
+ sender_name: string
36
+ sender_phone: string
37
+ sender_email?: string
38
+
39
+ receiver_name: string
40
+ receiver_phone: string
41
+ receiver_email?: string
42
+
43
+ pickup_point?: string
44
+ dropoff_point?: string
45
+
46
+ weight?: number
47
+ dimensions?: string
48
+ description?: string
49
+ declared_value?: number
50
+
51
+ price: number
52
+ notes?: string
53
+
54
+ route?: ShipmentRouteData
55
+ operator?: ShipmentOperatorData
56
+ history?: ShipmentHistoryData[]
57
+ }