@autobusal/providers 1.3.6 → 1.3.7

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
@@ -4,6 +4,18 @@ All notable changes to `@autobusal/providers` are documented here. This project
4
4
  adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.3.7] - 2026-07-27
8
+
9
+ ### Added
10
+
11
+ - `FoundData.external`/`FoundData.price.id` widened to admit external
12
+ bus-route provider offers (Mode A: search + redirect) - `id`/`price.id`
13
+ become the synthetic `ext:{provider}:{offer_id}` string, and an optional
14
+ `external: {provider, mode, offer_id}` discriminator marks the row so the
15
+ frontend never sends it to local-only endpoints (seat maps, coupons,
16
+ checkout). Scoped to `FoundData` only - the shared `PriceData`/`RouteData`
17
+ interfaces (used by operator-side price editing) are untouched.
18
+
7
19
  ## [1.3.6] - 2026-07-25
8
20
 
9
21
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
package/types/routes.ts CHANGED
@@ -82,14 +82,29 @@ export interface PolicyData {
82
82
  policies: string
83
83
  }
84
84
 
85
- export interface FoundData extends Omit<RouteData, 'locations'> {
86
- price: PriceData
85
+ export interface FoundData extends Omit<RouteData, 'locations' | 'id'> {
86
+ id: number | string
87
+ // Edited: Ferjolt Ozuni - Date: 2026-07-27
88
+ // `id` widened here (and on `price` below), NOT on the shared PriceData/
89
+ // RouteData interfaces - those are also used by operator-side price
90
+ // editing (operator-routes) and coupons/Step4 (routes-order), which
91
+ // still assume a real numeric local id.
92
+ price: Omit<PriceData, 'id'> & { id: number | string }
87
93
  duration: string
88
94
  customs: string[]
89
95
  locations: {
90
96
  from: LocationData
91
97
  to: LocationData
92
98
  }
99
+ // present only on external-provider offers (Mode A: search + redirect) -
100
+ // `id`/`price.id` are then the synthetic "ext:{provider}:{offer_id}"
101
+ // string, never a real local route/price id - never sent to
102
+ // local-only endpoints (seat maps, coupons, checkout)
103
+ external?: {
104
+ provider: string
105
+ mode: 'redirect' | 'booking'
106
+ offer_id: string
107
+ }
93
108
  }
94
109
 
95
110
  export interface PriceData {