@autobusal/providers 1.43.9 → 1.44.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/package.json +1 -1
- package/types/promotions.ts +71 -0
- package/types/settings.ts +15 -0
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promotions - the strip under the mobile app's search form.
|
|
3
|
+
*
|
|
4
|
+
* Claude - 2026-09-12. Two shapes, because the admin and the app want
|
|
5
|
+
* different things: the ADMIN edits every locale at once (`Record<string,
|
|
6
|
+
* string>`), while the app is sent one language, already resolved.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** One locale map, e.g. `{ en: "Summer sale", it: "Saldi estivi" }`. */
|
|
10
|
+
export type LocalizedField = Record<string, string>;
|
|
11
|
+
|
|
12
|
+
/** A row in the admin's list. */
|
|
13
|
+
export interface PromotionRowData {
|
|
14
|
+
id: number;
|
|
15
|
+
/** the English title, or empty when the promotion is only a picture */
|
|
16
|
+
title: string;
|
|
17
|
+
link: string | null;
|
|
18
|
+
image_url: string | null;
|
|
19
|
+
/** d/m/Y, or null for "from now" / "until I say" */
|
|
20
|
+
starts_at: string | null;
|
|
21
|
+
ends_at: string | null;
|
|
22
|
+
position: number;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
/** switched on AND inside its dates today - what the phone would show now */
|
|
25
|
+
live: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** One promotion as the form edits it. */
|
|
29
|
+
export interface PromotionData {
|
|
30
|
+
id: number;
|
|
31
|
+
title: LocalizedField;
|
|
32
|
+
text: LocalizedField;
|
|
33
|
+
cta: LocalizedField;
|
|
34
|
+
link: string | null;
|
|
35
|
+
image_url: string | null;
|
|
36
|
+
starts_at: string | null;
|
|
37
|
+
ends_at: string | null;
|
|
38
|
+
position: number;
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* What the form posts. The localized fields travel as ONE JSON-encoded
|
|
44
|
+
* object each - never bracket-notation array fields, which the brands' BFF
|
|
45
|
+
* proxy turns into the literal string "Array".
|
|
46
|
+
*/
|
|
47
|
+
export interface PromotionSaveData {
|
|
48
|
+
title: string;
|
|
49
|
+
text: string;
|
|
50
|
+
cta: string;
|
|
51
|
+
link: string;
|
|
52
|
+
starts_at: string;
|
|
53
|
+
ends_at: string;
|
|
54
|
+
position: string;
|
|
55
|
+
enabled: string;
|
|
56
|
+
image?: File;
|
|
57
|
+
image_remove?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* What the PUBLIC settings payload carries: already narrowed to the
|
|
62
|
+
* promotions live today, already in the reader's language.
|
|
63
|
+
*/
|
|
64
|
+
export interface PublicPromotion {
|
|
65
|
+
id: number;
|
|
66
|
+
image_url: string | null;
|
|
67
|
+
link: string | null;
|
|
68
|
+
title: string;
|
|
69
|
+
text: string;
|
|
70
|
+
cta: string;
|
|
71
|
+
}
|
package/types/settings.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PublicPromotion } from './promotions';
|
|
2
|
+
|
|
1
3
|
export interface SettingsData {
|
|
2
4
|
// Edited: Ferjolt Ozuni - Date: 2026-08-03
|
|
3
5
|
// The earliest bookable date as the SERVER reckons it, d/m/Y. The date
|
|
@@ -30,6 +32,19 @@ export interface SettingsData {
|
|
|
30
32
|
// been - Meta then falls back to the homepage hero as it always did.
|
|
31
33
|
share_image?: string | null
|
|
32
34
|
|
|
35
|
+
// Claude - 2026-09-12: the mobile app's launch artwork (1080x2400 WebP,
|
|
36
|
+
// uploaded on the admin's Visual tab), or null when the brand has not
|
|
37
|
+
// set one - the app then shows the artwork compiled into it. The web
|
|
38
|
+
// frontend does not render this; it travels here because the app reads
|
|
39
|
+
// the same public settings payload.
|
|
40
|
+
launch_artwork?: string | null
|
|
41
|
+
|
|
42
|
+
// Claude - 2026-09-12: the promotions under the app's search form, already
|
|
43
|
+
// narrowed to the ones live today and resolved to this request's language.
|
|
44
|
+
// Always present, possibly empty - an empty list means "fall back to the
|
|
45
|
+
// single `banner` below", which is how an older app build keeps working.
|
|
46
|
+
promotions?: PublicPromotion[]
|
|
47
|
+
|
|
33
48
|
// Edited: Ferjolt Ozuni - Date: 2026-08-01
|
|
34
49
|
// Present ONLY while the brand is under construction - obtapi omits it
|
|
35
50
|
// entirely on a live site, so its presence is the switch itself and there
|