@autobusal/providers 1.29.3 → 1.29.4
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 +11 -0
- package/package.json +1 -1
- package/stores/user.ts +15 -2
- package/types/orders.ts +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.29.4
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **`OrderData.addons`** (`OrderAddonData[]`) - the extra services bought at
|
|
8
|
+
checkout. There is no `data` field by design: the API withholds it because
|
|
9
|
+
the Telegram add-on's copy holds a bind token.
|
|
10
|
+
- **`OrderData.fare_display`** - the fare WITHOUT add-ons. Optional, because
|
|
11
|
+
only the single-order endpoint opts into it; `amount_display` remains fare +
|
|
12
|
+
add-ons.
|
|
13
|
+
|
|
3
14
|
## 1.29.3
|
|
4
15
|
|
|
5
16
|
### Fixed
|
package/package.json
CHANGED
package/stores/user.ts
CHANGED
|
@@ -20,7 +20,19 @@ export interface UserStore {
|
|
|
20
20
|
// login/activate/refresh); it's just never written to disk. A bootstrap
|
|
21
21
|
// fetch (see Setup/useUserBootstrap.ts) re-hydrates the full in-memory
|
|
22
22
|
// object shortly after app load using this same reduced signal.
|
|
23
|
-
|
|
23
|
+
// Edited: Ferjolt Ozuni - Date: 2026-08-07
|
|
24
|
+
// `verified` joins the subset because `status` cannot be READ without it.
|
|
25
|
+
// Status 0 means "activation pending" for a self-registered account and
|
|
26
|
+
// "switched off by staff" for one an admin created - and the two get
|
|
27
|
+
// different screens (see @autobusal/auth's Secure). Persisting the status
|
|
28
|
+
// but not the field that disambiguates it meant the first paint after a
|
|
29
|
+
// reload had to guess, and guessed activation: a deactivated employee was
|
|
30
|
+
// shown "enter the 5-digit code we emailed you" for a code that does not
|
|
31
|
+
// exist.
|
|
32
|
+
//
|
|
33
|
+
// It is a verification timestamp, not personal data - it says nothing about
|
|
34
|
+
// who the person is, which is what the rest of this redaction is for.
|
|
35
|
+
type PersistedUser = Pick<UserData, 'id' | 'name' | 'name_display' | 'type' | 'status' | 'verified'>;
|
|
24
36
|
|
|
25
37
|
const STORAGE_KEY = 'user';
|
|
26
38
|
|
|
@@ -29,7 +41,8 @@ const redact = (user: UserData): PersistedUser => ({
|
|
|
29
41
|
name: user.name,
|
|
30
42
|
name_display: user.name_display,
|
|
31
43
|
type: user.type,
|
|
32
|
-
status: user.status
|
|
44
|
+
status: user.status,
|
|
45
|
+
verified: user.verified
|
|
33
46
|
});
|
|
34
47
|
|
|
35
48
|
const stored = localStorage.getItem(STORAGE_KEY);
|
package/types/orders.ts
CHANGED
|
@@ -33,6 +33,12 @@ export interface OrderData {
|
|
|
33
33
|
passengers: TicketData[]
|
|
34
34
|
tickets: number
|
|
35
35
|
amount_display: string
|
|
36
|
+
/*
|
|
37
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-07
|
|
38
|
+
* The fare WITHOUT add-ons. Optional: only the single-order endpoint opts
|
|
39
|
+
* into it (it costs a sum query), so the listing does not carry it.
|
|
40
|
+
*/
|
|
41
|
+
fare_display?: string
|
|
36
42
|
note_cancel: string
|
|
37
43
|
actions: string[]
|
|
38
44
|
created_at: string
|
|
@@ -42,6 +48,29 @@ export interface OrderData {
|
|
|
42
48
|
reference?: OrderData
|
|
43
49
|
updated_at: string
|
|
44
50
|
account?: any
|
|
51
|
+
|
|
52
|
+
/*
|
|
53
|
+
* Edited: Ferjolt Ozuni - Date: 2026-08-07
|
|
54
|
+
* The extra services bought at checkout. Optional: only the single-order
|
|
55
|
+
* endpoint loads them, and the listing does not.
|
|
56
|
+
*
|
|
57
|
+
* There is no `data` field by design - the API withholds it because the
|
|
58
|
+
* Telegram add-on's copy holds a bind token. See Libraries\Orders\View.
|
|
59
|
+
*/
|
|
60
|
+
addons?: OrderAddonData[]
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface OrderAddonData {
|
|
64
|
+
id: number
|
|
65
|
+
// 'flex' | 'whatsapp' | 'telegram' | 'sms' - open, since the registry is
|
|
66
|
+
// a table and a brand can be given a key this build has never heard of.
|
|
67
|
+
key: string
|
|
68
|
+
price: string
|
|
69
|
+
// The same value with the brand's currency on it. The currency is a label
|
|
70
|
+
// setting the client is never sent, so this has to be formatted server
|
|
71
|
+
// side - see Orders\OrderAddon.
|
|
72
|
+
price_display: string
|
|
73
|
+
created_at: string
|
|
45
74
|
}
|
|
46
75
|
|
|
47
76
|
export interface ContactData {
|