@evinvest/sites-contract 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Adds `addCents` to the base.
3
+ */
4
+ export type AddOption = {
5
+ id: string;
6
+ labels: {
7
+ [key in string]: string;
8
+ };
9
+ addCents: number;
10
+ };
11
+ /**
12
+ * A storefront's address; its region and country are the site's.
13
+ */
14
+ export type Address = {
15
+ street: string;
16
+ /**
17
+ * A French postal code: five digits.
18
+ */
19
+ postalCode: string;
20
+ locality: string;
21
+ };
22
+ /**
23
+ * A place's `booking` setting: the providers it has a page on, and the one it offers by
24
+ * default — `manual` or one of them. `manual` is always there, so never configured.
25
+ */
26
+ export type BookingConfig = {
27
+ default: BookingProvider;
28
+ providers: {
29
+ [key in PageProvider]?: BookingPage;
30
+ };
31
+ };
32
+ /**
33
+ * A provider's booking page.
34
+ */
35
+ export type BookingPage = {
36
+ url: string;
37
+ };
38
+ /**
39
+ * Where a slot is booked.
40
+ */
41
+ export type BookingProvider = "manual" | "link" | "google_calendar" | "cal_com";
42
+ /**
43
+ * A day of the week, as the hours name it.
44
+ */
45
+ export type DayOfWeek = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday";
46
+ /**
47
+ * `discountBp` taken off the subtotal, in basis points: 1 000 is 10 % off.
48
+ */
49
+ export type DiscountOption = {
50
+ id: string;
51
+ labels: {
52
+ [key in string]: string;
53
+ };
54
+ discountBp: number;
55
+ };
56
+ /**
57
+ * Degrees, on the globe.
58
+ */
59
+ export type Geo = {
60
+ lat: number;
61
+ lng: number;
62
+ };
63
+ /**
64
+ * What a landing reads of its brand's experiments: the overrides of the current ones, by key.
65
+ */
66
+ export type LiveExperiments = {
67
+ experiments: {
68
+ [key in string]: LiveOverride;
69
+ };
70
+ };
71
+ /**
72
+ * The fields of an override a landing takes, as it is sent them: only those set, each valid
73
+ * against the experiment's current declaration.
74
+ */
75
+ export type LiveOverride = {
76
+ enabled?: boolean;
77
+ weights?: Array<number>;
78
+ holdout?: number;
79
+ };
80
+ /**
81
+ * A messenger the customer writes the brand on.
82
+ */
83
+ export type Messenger = "whatsapp" | "telegram";
84
+ /**
85
+ * The subtotal times `multiplyBp`, in basis points: 11 000 is ×1.1.
86
+ */
87
+ export type MultiplyOption = {
88
+ id: string;
89
+ labels: {
90
+ [key in string]: string;
91
+ };
92
+ multiplyBp: number;
93
+ };
94
+ /**
95
+ * How one need is priced.
96
+ */
97
+ export type NeedPricing = {
98
+ "kind": "estimate";
99
+ baseCents: number;
100
+ inputs: Array<string>;
101
+ } | {
102
+ "kind": "fixed";
103
+ cents: number;
104
+ };
105
+ /**
106
+ * A row of opening hours, in the place's local time (Europe/Paris for every place in v1).
107
+ */
108
+ export type OpeningHours = {
109
+ /**
110
+ * One at least, each once, in week order.
111
+ */
112
+ days: Array<DayOfWeek>;
113
+ /**
114
+ * `HH:MM`.
115
+ */
116
+ opens: string;
117
+ /**
118
+ * After `opens`: a night across midnight is two rows.
119
+ */
120
+ closes: string;
121
+ };
122
+ /**
123
+ * A provider with a page of its own, which a place configures: every one but `manual`,
124
+ * which is always available.
125
+ */
126
+ export type PageProvider = "link" | "google_calendar" | "cal_com";
127
+ /**
128
+ * A place's live settings: only the fields that are set. Empty: the site serves its baked
129
+ * config.
130
+ */
131
+ export type PlaceLive = {
132
+ phone?: string;
133
+ whatsapp?: string;
134
+ /**
135
+ * The place's Telegram bot: its username, without the `@`.
136
+ */
137
+ telegram?: string;
138
+ /**
139
+ * The landing's messenger buttons switched off where `false`; a messenger left out is on.
140
+ */
141
+ messengers?: {
142
+ [key in Messenger]?: boolean;
143
+ };
144
+ hours?: Array<OpeningHours>;
145
+ /**
146
+ * Commune names.
147
+ */
148
+ serviceArea?: Array<string>;
149
+ address?: Address;
150
+ geo?: Geo;
151
+ storefrontPhoto?: string;
152
+ /**
153
+ * A text per locale; a site keeps it only when every locale it speaks is there.
154
+ */
155
+ landmark?: {
156
+ [key in string]: string;
157
+ };
158
+ rating?: Rating;
159
+ booking?: BookingConfig;
160
+ /**
161
+ * Where the place asks for a Google review.
162
+ */
163
+ reviewUrl?: string;
164
+ };
165
+ /**
166
+ * An enum the visitor answers: bedrooms, a surface band, a zone, a frequency. Its kind says
167
+ * what its options do, and when: every `add` first, then every `multiply`, then every
168
+ * `discount`.
169
+ */
170
+ export type PricingInput = {
171
+ "kind": "add";
172
+ id: string;
173
+ labels: {
174
+ [key in string]: string;
175
+ };
176
+ options: Array<AddOption>;
177
+ } | {
178
+ "kind": "multiply";
179
+ id: string;
180
+ labels: {
181
+ [key in string]: string;
182
+ };
183
+ options: Array<MultiplyOption>;
184
+ } | {
185
+ "kind": "discount";
186
+ id: string;
187
+ labels: {
188
+ [key in string]: string;
189
+ };
190
+ options: Array<DiscountOption>;
191
+ };
192
+ /**
193
+ * A checked model, in its wire shape: every value within the limits, which keeps a price
194
+ * within an `i64` and a double alike. Only [`PricingModel::parse`] makes one.
195
+ */
196
+ export type PricingModel = {
197
+ format: 1;
198
+ currency: "EUR";
199
+ /**
200
+ * `YYYY-MM-DD`, a day the calendar has: when the prices hold from. Stored with every lead
201
+ * priced by it.
202
+ */
203
+ validFrom: string;
204
+ /**
205
+ * The estimate's total is rounded half up to a multiple of this (1 = to the cent).
206
+ */
207
+ roundToCents: number;
208
+ /**
209
+ * An estimate never comes out below this, after the rounding.
210
+ */
211
+ minimumCents: number;
212
+ inputs: Array<PricingInput>;
213
+ /**
214
+ * By the brand's need slug; a need not here is a quote.
215
+ */
216
+ needs: {
217
+ [key in string]: NeedPricing;
218
+ };
219
+ };
220
+ /**
221
+ * Google's rating for the place, with when it was read: the API's terms cap how long a copy
222
+ * may be shown.
223
+ */
224
+ export type Rating = {
225
+ /**
226
+ * 1 to 5.
227
+ */
228
+ value: number;
229
+ count: number;
230
+ /**
231
+ * An RFC 3339 instant, as sent.
232
+ */
233
+ fetchedAt: string;
234
+ };
@@ -0,0 +1,2 @@
1
+ // AUTO-GENERATED by `nix run .#gen` — do not edit.
2
+ export {};