@autobusal/providers 1.20.0 → 1.22.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 +15 -0
- package/Setup/Preload.tsx +9 -1
- package/package.json +1 -1
- package/types/routes.ts +30 -4
- package/types/settings.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.22.0
|
|
4
|
+
|
|
5
|
+
**Flexible Ticket, and the `policies` rename.**
|
|
6
|
+
|
|
7
|
+
- `PolicyData` is now `InformationData`, and its field `policies` is `information` — the route's free-text box is luggage, pets, boarding and ID, and never was cancellation terms. Calling it Policies invited operators to type terms into it that would then contradict the terms actually sold.
|
|
8
|
+
- `RouteData.policies_en|sq` → `information_en|sq`.
|
|
9
|
+
- `RouteData` gains `refund_hours` / `reschedule_hours`: the operator's own notice windows, in hours before departure. **Internal** — they reach the operator's route form and the admin, never a public payload. `null` means "not offered on this line", which is why they are nullable rather than 0.
|
|
10
|
+
- New `FlexOffer`, the response of `GET /api/orders/flex`. Its hours are already resolved to the **stricter** leg of a return trip, so they are the numbers that will be enforced. Either may be null on its own — an operator who will reschedule but not refund is a real case.
|
|
11
|
+
|
|
3
12
|
All notable changes to `@autobusal/providers` are documented here. This project
|
|
4
13
|
adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
5
14
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
@@ -7,6 +16,12 @@ adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
7
16
|
> Note: 1.8.0 through 1.11.0 were published without changelog entries. The
|
|
8
17
|
> gap is left as-is rather than reconstructed after the fact.
|
|
9
18
|
|
|
19
|
+
## 1.21.0
|
|
20
|
+
|
|
21
|
+
`SettingsData.today` — the earliest bookable date as the server reckons it,
|
|
22
|
+
handed to the calendar at startup so the picker stops flooring on the buyer's
|
|
23
|
+
device clock.
|
|
24
|
+
|
|
10
25
|
## 1.20.0
|
|
11
26
|
|
|
12
27
|
`FoundData.departs_in` — minutes until departure, for same-day searches only,
|
package/Setup/Preload.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonLd } from '@autobusal/common';
|
|
1
|
+
import { JsonLd, setServerToday } from '@autobusal/common';
|
|
2
2
|
import { SettingsData } from '../types/settings';
|
|
3
3
|
import { useSystemTheme } from '@autobusal/hooks';
|
|
4
4
|
|
|
@@ -15,6 +15,14 @@ interface Props {
|
|
|
15
15
|
// fallback rendered above the router; a page's own <Meta title=...> renders
|
|
16
16
|
// deeper in the tree and correctly overrides it once data loads.
|
|
17
17
|
const Preload = ({ data, children }: Props): JSX.Element => {
|
|
18
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
19
|
+
// Hand the booking calendar the SERVER's idea of today, before anything
|
|
20
|
+
// renders one. Without it the picker floors on the buyer's device clock -
|
|
21
|
+
// so somebody in Shanghai on the 5th could not select the 4th for an
|
|
22
|
+
// Italian coach that had not left yet, on a date the server would have
|
|
23
|
+
// sold them quite happily.
|
|
24
|
+
setServerToday(data.today);
|
|
25
|
+
|
|
18
26
|
// we arrange the font family names before inserting them
|
|
19
27
|
const fontTitle = data.theme.fontFamily.title.replace(/ /g, '+');
|
|
20
28
|
const fontContent = data.theme.fontFamily.content.replace(/ /g, '+');
|
package/package.json
CHANGED
package/types/routes.ts
CHANGED
|
@@ -31,8 +31,16 @@ export interface RouteData {
|
|
|
31
31
|
language: string
|
|
32
32
|
template: string
|
|
33
33
|
searchable: number
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
information_en: string
|
|
35
|
+
information_sq: string
|
|
36
|
+
|
|
37
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
38
|
+
// The operator's own notice windows, in hours before departure, for
|
|
39
|
+
// Flexible Ticket. INTERNAL - they reach the operator's own route form and
|
|
40
|
+
// the admin, never a public payload. `null` is "not offered on this line",
|
|
41
|
+
// which is why they are nullable rather than 0.
|
|
42
|
+
refund_hours: number | null
|
|
43
|
+
reschedule_hours: number | null
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
export interface AvailableData {
|
|
@@ -93,9 +101,27 @@ export interface FeatureData {
|
|
|
93
101
|
image?: string[]
|
|
94
102
|
}
|
|
95
103
|
|
|
96
|
-
export interface
|
|
104
|
+
export interface InformationData {
|
|
97
105
|
id: number
|
|
98
|
-
|
|
106
|
+
information: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The Flexible Ticket offer for one booking (GET /api/orders/flex).
|
|
111
|
+
*
|
|
112
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
113
|
+
*
|
|
114
|
+
* The hours here are already resolved to the STRICTER leg of a return trip,
|
|
115
|
+
* so they are the numbers that will actually be enforced. Either may be null
|
|
116
|
+
* on its own: an operator who will reschedule but not refund is a real case,
|
|
117
|
+
* and the checkout has to be able to say so rather than imply both.
|
|
118
|
+
*/
|
|
119
|
+
export interface FlexOffer {
|
|
120
|
+
available: boolean
|
|
121
|
+
price?: number
|
|
122
|
+
price_display?: string
|
|
123
|
+
refund_hours?: number | null
|
|
124
|
+
reschedule_hours?: number | null
|
|
99
125
|
}
|
|
100
126
|
|
|
101
127
|
export interface FoundData extends Omit<RouteData, 'locations' | 'id'> {
|
package/types/settings.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export interface SettingsData {
|
|
2
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
3
|
+
// The earliest bookable date as the SERVER reckons it, d/m/Y. The date
|
|
4
|
+
// picker floors on this rather than on the browser's clock, which is the
|
|
5
|
+
// buyer's clock and says nothing about where they are travelling.
|
|
6
|
+
today?: string
|
|
7
|
+
|
|
2
8
|
url: string
|
|
3
9
|
|
|
4
10
|
// Edited: Ferjolt Ozuni - Date: 2026-08-01
|