sahab-utils 1.2.9 → 1.3.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.
@@ -1,659 +1,661 @@
1
- import { DocumentReference, GeoPoint, Timestamp } from 'firebase/firestore';
2
- export type GeoPointType = GeoPoint;
3
- export type TimestampType = Timestamp;
4
- export type DistenceDueration = {
5
- distance: string;
6
- duration: string;
7
- };
8
- export declare enum CarSize {
9
- X_SMALL = 0,
10
- SMALL = 1,
11
- MEDIUM = 2,
12
- LARGE = 3,
13
- X_LARGE = 4
14
- }
15
- export type Car = {
16
- carId: string;
17
- manufacturer: string;
18
- model: string;
19
- size: CarSize;
20
- year: string;
21
- color: string;
22
- plateLetters: string;
23
- plateNumber: string;
24
- imageUrl?: string;
25
- };
26
- export type ClientLocation = {
27
- locationId: string;
28
- name: string;
29
- latitude: number;
30
- longitude: number;
31
- isPrimary?: boolean;
32
- };
33
- export type Client = {
34
- uid: string;
35
- phoneNumber: string;
36
- firstName?: string;
37
- lastName?: string;
38
- email?: string;
39
- balance?: number;
40
- rating?: number;
41
- imageUrl?: string;
42
- isTest?: boolean;
43
- isEmailVerified?: boolean;
44
- language?: string;
45
- checkoutCustomerId?: string;
46
- latitude?: number;
47
- longitude?: number;
48
- joinDate?: Date;
49
- locations?: ClientLocation[];
50
- version?: string;
51
- };
52
- export type Price = {
53
- size: CarSize;
54
- price: number;
55
- };
56
- export declare enum OrderStatus {
57
- PENDING = 0,// 0
58
- CONFIRMED = 1,// 1
59
- REJECTED = 2,// 2
60
- EXPIRED = 3,// 3
61
- IN_PROGRESS = 4,// 4
62
- COMPLETED = 5,// 5
63
- CANCELLED = 6,// 6
64
- RATED = 7,// 7
65
- STARTED = 8
66
- }
67
- export declare enum OrderPaymentType {
68
- APPLE_PAY = 0,
69
- CREDIT = 1,
70
- CASH = 2,
71
- GOOGLE_PAY = 3,
72
- SAMSUNG_PAY = 4,
73
- STC_PAY = 5,
74
- TABBY = 6,
75
- TAMARA = 7
76
- }
77
- export type Location = {
78
- geohash?: string;
79
- northeast: GeoPointType;
80
- southwest: GeoPointType;
81
- };
82
- export type Order = {
83
- orderId?: string;
84
- clientRef?: DocumentReference;
85
- clientId?: string;
86
- client?: Client;
87
- providerRef?: DocumentReference;
88
- providerId?: string;
89
- servedBy?: DocumentReference;
90
- servedByName?: string;
91
- createdDate?: TimestampType;
92
- orderDate?: TimestampType;
93
- services?: CarService[];
94
- location?: GeoPointType;
95
- locationUrl?: string;
96
- willClientBeThere?: boolean;
97
- paymentType?: OrderPaymentType;
98
- clientRating?: number;
99
- providerRating?: number;
100
- orderStatus?: OrderStatus;
101
- staticMap?: any;
102
- isPaid?: boolean;
103
- rejectedBy?: string[];
104
- finishDate?: TimestampType;
105
- arrivalDate?: TimestampType;
106
- canceledDate?: TimestampType;
107
- paymentAmount?: number;
108
- sahabPercentage?: number;
109
- sahabClientPercentage?: number;
110
- sahabOnlinePercentage?: number;
111
- sahabProviderPercentage?: number;
112
- sahabExtraPaymentAmount?: number;
113
- paymentId?: string;
114
- paymentCancelationId?: string;
115
- paymentRefundId?: string;
116
- paymentCaptureId?: string;
117
- canceledBy?: 'provider' | 'client';
118
- movementsCreated?: boolean;
119
- orderNote?: string;
120
- cancelReason?: string;
121
- isDismissed?: boolean;
122
- isLate?: boolean;
123
- promoCode?: Discount;
124
- isTest?: boolean;
125
- clientNumber?: string;
126
- usedBalance?: number;
127
- isDummyOrder?: boolean;
128
- ratingNote?: string;
129
- isAddonStructure?: boolean;
130
- isMonthlyPackage?: boolean;
131
- isPaymentSettled?: boolean;
132
- notificationTaskId?: string;
133
- providerName?: {
134
- ar: string;
135
- en: string;
136
- };
137
- providerPhoneNumber?: string;
138
- providerLogoUrl?: string;
139
- paymentGateway?: 'PAYLINK' | 'CHECKOUT' | 'TAP';
140
- };
141
- export type ReduxOrder = {
142
- orderId?: string;
143
- clientId?: string;
144
- client?: Client;
145
- servedByPath?: string;
146
- providerId?: string;
147
- servedByName?: string;
148
- createdDate?: TimestampType;
149
- orderDate?: TimestampType;
150
- canceledDate?: TimestampType;
151
- services?: CarService[];
152
- location?: GeoPointType;
153
- locationUrl?: string;
154
- willClientBeThere?: boolean;
155
- paymentType?: OrderPaymentType;
156
- clientRating?: number;
157
- providerRating?: number;
158
- orderStatus?: OrderStatus;
159
- staticMap?: any;
160
- isPaid?: boolean;
161
- rejectedBy?: string[];
162
- finishDate?: TimestampType;
163
- arrivalDate?: TimestampType;
164
- paymentAmount?: number;
165
- sahabPercentage?: number;
166
- sahabClientPercentage?: number;
167
- sahabOnlinePercentage?: number;
168
- sahabProviderPercentage?: number;
169
- sahabExtraPaymentAmount?: number;
170
- paymentId?: string;
171
- paymentCancelationId?: string;
172
- paymentRefundId?: string;
173
- paymentCaptureId?: string;
174
- canceledBy?: 'provider' | 'client';
175
- movementsCreated?: boolean;
176
- orderNote?: string;
177
- cancelReason?: string;
178
- isDismissed?: boolean;
179
- isLate?: boolean;
180
- promoCode?: Discount;
181
- clientNumber?: string;
182
- isTest?: boolean;
183
- usedBalance?: number;
184
- isDummyOrder?: boolean;
185
- ratingNote?: string;
186
- isAddonStructure?: boolean;
187
- isMonthlyPackage?: boolean;
188
- isPaymentSettled?: boolean;
189
- notificationTaskId?: string;
190
- providerName?: {
191
- ar: string;
192
- en: string;
193
- };
194
- providerPhoneNumber?: string;
195
- providerLogoUrl?: string;
196
- };
197
- export type MoneyMovement = {
198
- movementId: string;
199
- amount: number;
200
- orderId?: string;
201
- date: TimestampType;
202
- movementType: MovementType;
203
- createdBy?: string;
204
- };
205
- export declare enum MovementType {
206
- CLIENT_ORDER_PAYMENT = 0,
207
- CLIENT_BALANCE_TOP_UP = 1,
208
- PROVIDER_NEGATIVE_BALANCE_PAYMENT = 2,
209
- PROVIDER_POSITIVE_BALANCE_PAYMENT = 3,
210
- ORDER_REFUND = 4,
211
- SAHAB_PAYMENT_TO_PROVIDER = 5,
212
- SAHAB_RECEIVE_FROM_PROVIDER = 6,
213
- USING_BALANCE = 7
214
- }
215
- export declare enum ComplaintType {
216
- BUG = 0,
217
- COMPLAINT = 1
218
- }
219
- export declare enum ComplaintStatus {
220
- PENDING = 0,
221
- IN_REVIEW = 1,
222
- RESOLVED = 2
223
- }
224
- export type Complaint = {
225
- complaintId: string;
226
- complaintNumber: string;
227
- desc: string;
228
- createdDate: TimestampType;
229
- status: ComplaintStatus;
230
- type: ComplaintType;
231
- resolvedBy?: string;
232
- resolveDate?: string;
233
- };
234
- export type City = {
235
- cityId?: string;
236
- cityName: string;
237
- countryName: string;
238
- cityName_ar: string;
239
- countryName_ar: string;
240
- locationBounds?: Location;
241
- coordinates?: GeoPointType;
242
- g?: {
243
- geohash: string;
244
- geopoint: GeoPointType;
245
- };
246
- providerUid?: string;
247
- };
248
- export type Driver = {
249
- type?: 'driver';
250
- driverId?: string;
251
- providerUid?: string;
252
- firstName?: string;
253
- lastName?: string;
254
- phoneNumber?: string;
255
- imageUrl?: string;
256
- language?: 'en' | 'ar';
257
- mainPushToken?: string;
258
- hmsPushToken?: string;
259
- cities?: City[];
260
- isAllowedToCross?: boolean;
261
- deactivated?: boolean;
262
- };
263
- export type ProviderCar = {
264
- carId?: string;
265
- providerRef?: DocumentReference;
266
- manufacturer?: string;
267
- model?: string;
268
- year?: string;
269
- color?: string;
270
- plateLetters?: string;
271
- plateNumber?: string;
272
- istimarahUrl?: string;
273
- fileType?: string;
274
- };
275
- export type Day = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
276
- export type HH = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23';
277
- export type MM = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32' | '33' | '34' | '35' | '36' | '37' | '38' | '39' | '40' | '41' | '42' | '43' | '44' | '45' | '46' | '47' | '48' | '49' | '50' | '51' | '52' | '53' | '54' | '55' | '56' | '57' | '58' | '59';
278
- export type Hour = `${HH}:${MM}`;
279
- export type WorkingHour = {
280
- start: Hour;
281
- end: Hour;
282
- };
283
- export type WorkingHours = {
284
- sunday: WorkingHour[];
285
- monday: WorkingHour[];
286
- tuesday: WorkingHour[];
287
- wednesday: WorkingHour[];
288
- thursday: WorkingHour[];
289
- friday: WorkingHour[];
290
- saturday: WorkingHour[];
291
- };
292
- export declare enum ReviewStatus {
293
- PENDING = 0,
294
- IN_REVIEW = 1,
295
- ACCEPTED = 2,
296
- DECLINED = 3
297
- }
298
- export declare enum RegistrationSection {
299
- OWNER_NAME = 0,
300
- CITY = 1,
301
- RULES = 2,
302
- BUSINESS_INFO = 3,
303
- DRIVERS_INFO = 4,
304
- VEHICLE_PERMIT = 5,
305
- VEHICLE_REGISTRATION = 6,
306
- SERVICES = 7,
307
- ADDONS = 8,
308
- WORKING_HOURS = 9,
309
- OVERVIEW = 10,
310
- STATUS = 11,
311
- DONE = 12
312
- }
313
- export type DeclineReason = {
314
- reasonDesc: {
315
- ar: string;
316
- en: string;
317
- };
318
- section: RegistrationSection;
319
- };
320
- export type ProviderService = {
321
- serviceId?: string;
322
- name?: {
323
- ar: string;
324
- en: string;
325
- };
326
- imageUrl?: string;
327
- providerId?: string;
328
- prices?: Price[];
329
- description?: {
330
- ar: string;
331
- en: string;
332
- };
333
- includedServices?: {
334
- ar: string;
335
- en: string;
336
- }[];
337
- hide?: boolean;
338
- time?: number;
339
- numberOfVisits?: number;
340
- };
341
- export type ProvidedService = {
342
- serviceId?: string;
343
- name?: {
344
- ar: string;
345
- en: string;
346
- };
347
- imageUrl?: string;
348
- providerId?: string;
349
- description?: {
350
- ar: string;
351
- en: string;
352
- };
353
- price: Price;
354
- isDone?: boolean;
355
- finishDate?: TimestampType;
356
- quantity?: number;
357
- type: 'service';
358
- time?: number;
359
- includedServices?: {
360
- ar: string;
361
- en: string;
362
- }[];
363
- numberOfVisits?: number;
364
- discount?: Discount;
365
- };
366
- export type ProviderAddon = {
367
- addonId?: string;
368
- providerId?: string;
369
- name?: {
370
- ar: string;
371
- en: string;
372
- };
373
- prices?: Price[];
374
- description?: {
375
- ar: string;
376
- en: string;
377
- };
378
- hide?: boolean;
379
- time?: number;
380
- };
381
- export type ProvidedAddon = {
382
- addonId?: string;
383
- providerId?: string;
384
- name?: {
385
- ar: string;
386
- en: string;
387
- };
388
- price?: Price;
389
- description?: {
390
- ar: string;
391
- en: string;
392
- };
393
- quantity?: number;
394
- type: 'addon';
395
- time?: number;
396
- isDone?: boolean;
397
- finishDate?: TimestampType;
398
- discount?: Discount;
399
- };
400
- export type Provider = {
401
- type?: 'provider';
402
- providerUid?: string;
403
- providerName?: {
404
- ar: string;
405
- en: string;
406
- };
407
- providerPhoneNumber?: string;
408
- providerCarNumber?: string;
409
- numberOfDrivers?: number;
410
- numberOfCars?: number;
411
- totalRating?: number;
412
- numberOfRaters?: number;
413
- logoUrl?: string;
414
- phoneNumber?: string;
415
- ownerFirstName?: string;
416
- ownerLastName?: string;
417
- services?: ProviderService[];
418
- addons?: ProviderAddon[];
419
- working247?: boolean;
420
- workingHoursV2?: WorkingHours;
421
- submitDate?: TimestampType;
422
- reviewStatus?: ReviewStatus;
423
- reviewedBy?: string;
424
- declineReasons?: DeclineReason[];
425
- acceptOrdersAutomatically?: boolean;
426
- freeWashes?: number;
427
- registrationSection?: RegistrationSection;
428
- currency?: string;
429
- mainPushToken?: string;
430
- hmsPushToken?: string;
431
- isTest?: boolean;
432
- language?: 'en' | 'ar';
433
- balance?: number;
434
- permitUrl?: string;
435
- permitType?: string;
436
- checkoutCustomerId?: string;
437
- ownerEmail?: string;
438
- isEmailVerified?: boolean;
439
- receiveOrders?: boolean;
440
- isAcceptingOrders?: boolean;
441
- ordersPercentage?: number;
442
- integrations?: {
443
- email?: string;
444
- isActive?: boolean;
445
- key: string;
446
- /** Tap (and other gateways): server-side API secret */
447
- secretKey?: string;
448
- /** Tap Connect marketplace payout destination id (sub-merchant) */
449
- tapDestinationId?: string;
450
- }[];
451
- };
452
- export type Card = {
453
- id?: string;
454
- issuer?: string;
455
- expiry_month?: string;
456
- expiry_year?: string;
457
- name?: string;
458
- scheme?: string;
459
- bin?: string;
460
- last4?: string;
461
- customer?: {
462
- id?: string;
463
- };
464
- default?: boolean;
465
- customer_id?: string;
466
- };
467
- export type CheckoutCustomer = {
468
- default?: string;
469
- email?: string;
470
- id?: string;
471
- name?: string;
472
- instruments?: Card[];
473
- metadata?: {
474
- iban?: string;
475
- providerUid?: string;
476
- };
477
- };
478
- export type CarService = {
479
- car?: Car;
480
- services: Array<ProvidedService | ProvidedAddon>;
481
- isDone?: boolean;
482
- };
483
- export type Discount = {
484
- promoCodeId?: string;
485
- promoCode?: string;
486
- validFrom?: TimestampType;
487
- validTo?: TimestampType;
488
- createdAt?: TimestampType;
489
- allowedOnce?: boolean;
490
- createdByProvider?: boolean;
491
- providerUid?: string;
492
- usedBy?: string[];
493
- amount?: number;
494
- isPercentage?: boolean;
495
- maxAmount?: number;
496
- isAutoApplied?: boolean;
497
- servicesIds?: string[];
498
- addonsIds?: string[];
499
- clientIds?: string[];
500
- createrEmail?: string;
501
- sahabPercentage?: number;
502
- providerPercentage?: number;
503
- };
504
- export type OrderReview = {
505
- ratingId: string;
506
- ratingNote: string;
507
- orderId: string;
508
- orderDate: TimestampType;
509
- createdDate: TimestampType;
510
- providerId: string;
511
- arrivalDate: string;
512
- finishDate: string;
513
- rating: number;
514
- clientId: string;
515
- };
516
- export type CountryCode = {
517
- code: string;
518
- dial_code: string;
519
- flag: string;
520
- name_en: string;
521
- name_ar: string;
522
- };
523
- export type LocationInfo = {
524
- city?: string;
525
- country?: string;
526
- postalCode?: string;
527
- line1: string;
528
- line2?: string;
529
- long_name?: string;
530
- latitude?: number;
531
- longitude?: number;
532
- };
533
- export type SavedLocation = {
534
- locationId: string;
535
- name: string;
536
- latitude: number;
537
- longitude: number;
538
- isPrimary?: boolean;
539
- };
540
- export type CheckoutCard = {
541
- id?: string;
542
- type?: string;
543
- fingerprint?: string;
544
- expiry_month?: string;
545
- expiry_year?: string;
546
- scheme?: string;
547
- scheme_local?: string;
548
- last4?: string;
549
- bin?: string;
550
- card_type?: string;
551
- card_category?: string;
552
- issuer?: string;
553
- issuer_country?: string;
554
- product_type?: string;
555
- };
556
- export type CheckoutToken = {
557
- type?: string;
558
- token?: string;
559
- expires_on?: string;
560
- expiry_month?: number;
561
- expiry_year?: number;
562
- scheme?: string;
563
- scheme_local?: string;
564
- last4?: string;
565
- bin?: string;
566
- card_type?: string;
567
- card_category?: string;
568
- issuer?: string;
569
- issuer_country?: string;
570
- product_id: string;
571
- product_type: string;
572
- billing_address?: {
573
- address_line1?: string;
574
- address_line2: string;
575
- city?: string;
576
- state?: string;
577
- zip?: string;
578
- country?: string;
579
- };
580
- phone?: {
581
- country_code?: string;
582
- number?: string;
583
- };
584
- name?: string;
585
- };
586
- export type SPECIFIED_TIME = 'anytime' | number;
587
- export type PlaceOrder = {
588
- clientID: string;
589
- providerId: string;
590
- orderMilllSec: number;
591
- orderNanoSec: number;
592
- services: CarService[];
593
- lat: number;
594
- long: number;
595
- willClientBeThere: boolean;
596
- paymentType: OrderPaymentType;
597
- isPaid: boolean;
598
- paymentId: string;
599
- isProviderTest: boolean;
600
- providerReceiveOrders: boolean;
601
- orderNote: string;
602
- promoCode: Discount;
603
- driverIds: string[];
604
- providerName: {
605
- ar: string;
606
- en: string;
607
- };
608
- paymentAmount: number;
609
- usedBalance: number;
610
- providerPhoneNumber: string;
611
- isAddonStructure: boolean;
612
- isMonthlyPackage: boolean;
613
- sahabExtraPaymentAmount: number;
614
- orderId?: string;
615
- paymentGateway?: 'PAYLINK' | 'CHECKOUT' | 'TAP';
616
- /** Mirrors Order economics for server-side Tap split; optional override of client fee % */
617
- sahabClientPercentage?: number;
618
- };
619
- export type WeatherData = {
620
- date: string;
621
- precipitationProbability: number;
622
- rainAccumulation: number;
623
- cloudCover: number;
624
- humidity: number;
625
- windSpeed: number;
626
- uvIndex: number;
627
- };
628
- export type PaymentConfigs = {
629
- isCashAllowed: boolean;
630
- isGooglePayAllowed?: boolean;
631
- /** Tap GoSell merchant id for card / Apple Pay SDK config (optional; falls back in app). */
632
- tapMerchantId?: string;
633
- paymentGateways: {
634
- key: string;
635
- isActive: boolean;
636
- priority: number;
637
- }[];
638
- };
639
- export type Slot = {
640
- id: string;
641
- time: number;
642
- selected: boolean;
643
- reserved: boolean;
644
- };
645
- export type Statement = {
646
- numberOfOrders: number;
647
- completedOrders: number;
648
- ratedOrders: number;
649
- cancelledOrders: number;
650
- cashOrders: number;
651
- creditOrders: number;
652
- applePayPayments: number;
653
- expiredOrders: number;
654
- confirmedOrders: number;
655
- lateOrders: number;
656
- ordersTotal: number;
657
- orders: Order[];
658
- statmentDate?: Date | string;
659
- };
1
+ import { DocumentReference, GeoPoint, Timestamp } from 'firebase/firestore';
2
+ export type GeoPointType = GeoPoint;
3
+ export type TimestampType = Timestamp;
4
+ export type DistenceDueration = {
5
+ distance: string;
6
+ duration: string;
7
+ };
8
+ export declare enum CarSize {
9
+ X_SMALL = 0,
10
+ SMALL = 1,
11
+ MEDIUM = 2,
12
+ LARGE = 3,
13
+ X_LARGE = 4
14
+ }
15
+ export type Car = {
16
+ carId: string;
17
+ manufacturer: string;
18
+ model: string;
19
+ size: CarSize;
20
+ year: string;
21
+ color: string;
22
+ plateLetters: string;
23
+ plateNumber: string;
24
+ imageUrl?: string;
25
+ };
26
+ export type ClientLocation = {
27
+ locationId: string;
28
+ name: string;
29
+ latitude: number;
30
+ longitude: number;
31
+ isPrimary?: boolean;
32
+ };
33
+ export type Client = {
34
+ uid: string;
35
+ phoneNumber: string;
36
+ firstName?: string;
37
+ lastName?: string;
38
+ email?: string;
39
+ balance?: number;
40
+ rating?: number;
41
+ imageUrl?: string;
42
+ isTest?: boolean;
43
+ isEmailVerified?: boolean;
44
+ language?: string;
45
+ checkoutCustomerId?: string;
46
+ latitude?: number;
47
+ longitude?: number;
48
+ joinDate?: Date;
49
+ locations?: ClientLocation[];
50
+ version?: string;
51
+ tapCustomerId?: string;
52
+ };
53
+ export type Price = {
54
+ size: CarSize;
55
+ price: number;
56
+ };
57
+ export declare enum OrderStatus {
58
+ PENDING = 0,// 0
59
+ CONFIRMED = 1,// 1
60
+ REJECTED = 2,// 2
61
+ EXPIRED = 3,// 3
62
+ IN_PROGRESS = 4,// 4
63
+ COMPLETED = 5,// 5
64
+ CANCELLED = 6,// 6
65
+ RATED = 7,// 7
66
+ STARTED = 8
67
+ }
68
+ export declare enum OrderPaymentType {
69
+ APPLE_PAY = 0,
70
+ CREDIT = 1,
71
+ CASH = 2,
72
+ GOOGLE_PAY = 3,
73
+ SAMSUNG_PAY = 4,
74
+ STC_PAY = 5,
75
+ TABBY = 6,
76
+ TAMARA = 7
77
+ }
78
+ export type Location = {
79
+ geohash?: string;
80
+ northeast: GeoPointType;
81
+ southwest: GeoPointType;
82
+ };
83
+ export type Order = {
84
+ orderId?: string;
85
+ clientRef?: DocumentReference;
86
+ clientId?: string;
87
+ client?: Client;
88
+ providerRef?: DocumentReference;
89
+ providerId?: string;
90
+ servedBy?: DocumentReference;
91
+ servedByName?: string;
92
+ createdDate?: TimestampType;
93
+ orderDate?: TimestampType;
94
+ services?: CarService[];
95
+ location?: GeoPointType;
96
+ locationUrl?: string;
97
+ willClientBeThere?: boolean;
98
+ paymentType?: OrderPaymentType;
99
+ clientRating?: number;
100
+ providerRating?: number;
101
+ orderStatus?: OrderStatus;
102
+ staticMap?: any;
103
+ isPaid?: boolean;
104
+ rejectedBy?: string[];
105
+ finishDate?: TimestampType;
106
+ arrivalDate?: TimestampType;
107
+ canceledDate?: TimestampType;
108
+ paymentAmount?: number;
109
+ sahabPercentage?: number;
110
+ sahabClientPercentage?: number;
111
+ sahabOnlinePercentage?: number;
112
+ sahabProviderPercentage?: number;
113
+ sahabExtraPaymentAmount?: number;
114
+ paymentId?: string;
115
+ paymentCancelationId?: string;
116
+ paymentRefundId?: string;
117
+ paymentCaptureId?: string;
118
+ canceledBy?: 'provider' | 'client';
119
+ movementsCreated?: boolean;
120
+ orderNote?: string;
121
+ cancelReason?: string;
122
+ isDismissed?: boolean;
123
+ isLate?: boolean;
124
+ promoCode?: Discount;
125
+ isTest?: boolean;
126
+ clientNumber?: string;
127
+ usedBalance?: number;
128
+ isDummyOrder?: boolean;
129
+ ratingNote?: string;
130
+ isAddonStructure?: boolean;
131
+ isMonthlyPackage?: boolean;
132
+ isPaymentSettled?: boolean;
133
+ notificationTaskId?: string;
134
+ providerName?: {
135
+ ar: string;
136
+ en: string;
137
+ };
138
+ providerPhoneNumber?: string;
139
+ providerLogoUrl?: string;
140
+ paymentGateway?: 'PAYLINK' | 'CHECKOUT' | 'TAP';
141
+ visitDates?: number[];
142
+ };
143
+ export type ReduxOrder = {
144
+ orderId?: string;
145
+ clientId?: string;
146
+ client?: Client;
147
+ servedByPath?: string;
148
+ providerId?: string;
149
+ servedByName?: string;
150
+ createdDate?: TimestampType;
151
+ orderDate?: TimestampType;
152
+ canceledDate?: TimestampType;
153
+ services?: CarService[];
154
+ location?: GeoPointType;
155
+ locationUrl?: string;
156
+ willClientBeThere?: boolean;
157
+ paymentType?: OrderPaymentType;
158
+ clientRating?: number;
159
+ providerRating?: number;
160
+ orderStatus?: OrderStatus;
161
+ staticMap?: any;
162
+ isPaid?: boolean;
163
+ rejectedBy?: string[];
164
+ finishDate?: TimestampType;
165
+ arrivalDate?: TimestampType;
166
+ paymentAmount?: number;
167
+ sahabPercentage?: number;
168
+ sahabClientPercentage?: number;
169
+ sahabOnlinePercentage?: number;
170
+ sahabProviderPercentage?: number;
171
+ sahabExtraPaymentAmount?: number;
172
+ paymentId?: string;
173
+ paymentCancelationId?: string;
174
+ paymentRefundId?: string;
175
+ paymentCaptureId?: string;
176
+ canceledBy?: 'provider' | 'client';
177
+ movementsCreated?: boolean;
178
+ orderNote?: string;
179
+ cancelReason?: string;
180
+ isDismissed?: boolean;
181
+ isLate?: boolean;
182
+ promoCode?: Discount;
183
+ clientNumber?: string;
184
+ isTest?: boolean;
185
+ usedBalance?: number;
186
+ isDummyOrder?: boolean;
187
+ ratingNote?: string;
188
+ isAddonStructure?: boolean;
189
+ isMonthlyPackage?: boolean;
190
+ isPaymentSettled?: boolean;
191
+ notificationTaskId?: string;
192
+ providerName?: {
193
+ ar: string;
194
+ en: string;
195
+ };
196
+ providerPhoneNumber?: string;
197
+ providerLogoUrl?: string;
198
+ };
199
+ export type MoneyMovement = {
200
+ movementId: string;
201
+ amount: number;
202
+ orderId?: string;
203
+ date: TimestampType;
204
+ movementType: MovementType;
205
+ createdBy?: string;
206
+ };
207
+ export declare enum MovementType {
208
+ CLIENT_ORDER_PAYMENT = 0,
209
+ CLIENT_BALANCE_TOP_UP = 1,
210
+ PROVIDER_NEGATIVE_BALANCE_PAYMENT = 2,
211
+ PROVIDER_POSITIVE_BALANCE_PAYMENT = 3,
212
+ ORDER_REFUND = 4,
213
+ SAHAB_PAYMENT_TO_PROVIDER = 5,
214
+ SAHAB_RECEIVE_FROM_PROVIDER = 6,
215
+ USING_BALANCE = 7
216
+ }
217
+ export declare enum ComplaintType {
218
+ BUG = 0,
219
+ COMPLAINT = 1
220
+ }
221
+ export declare enum ComplaintStatus {
222
+ PENDING = 0,
223
+ IN_REVIEW = 1,
224
+ RESOLVED = 2
225
+ }
226
+ export type Complaint = {
227
+ complaintId: string;
228
+ complaintNumber: string;
229
+ desc: string;
230
+ createdDate: TimestampType;
231
+ status: ComplaintStatus;
232
+ type: ComplaintType;
233
+ resolvedBy?: string;
234
+ resolveDate?: string;
235
+ };
236
+ export type City = {
237
+ cityId?: string;
238
+ cityName: string;
239
+ countryName: string;
240
+ cityName_ar: string;
241
+ countryName_ar: string;
242
+ locationBounds?: Location;
243
+ coordinates?: GeoPointType;
244
+ g?: {
245
+ geohash: string;
246
+ geopoint: GeoPointType;
247
+ };
248
+ providerUid?: string;
249
+ };
250
+ export type Driver = {
251
+ type?: 'driver';
252
+ driverId?: string;
253
+ providerUid?: string;
254
+ firstName?: string;
255
+ lastName?: string;
256
+ phoneNumber?: string;
257
+ imageUrl?: string;
258
+ language?: 'en' | 'ar';
259
+ mainPushToken?: string;
260
+ hmsPushToken?: string;
261
+ cities?: City[];
262
+ isAllowedToCross?: boolean;
263
+ deactivated?: boolean;
264
+ };
265
+ export type ProviderCar = {
266
+ carId?: string;
267
+ providerRef?: DocumentReference;
268
+ manufacturer?: string;
269
+ model?: string;
270
+ year?: string;
271
+ color?: string;
272
+ plateLetters?: string;
273
+ plateNumber?: string;
274
+ istimarahUrl?: string;
275
+ fileType?: string;
276
+ };
277
+ export type Day = 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
278
+ export type HH = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23';
279
+ export type MM = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32' | '33' | '34' | '35' | '36' | '37' | '38' | '39' | '40' | '41' | '42' | '43' | '44' | '45' | '46' | '47' | '48' | '49' | '50' | '51' | '52' | '53' | '54' | '55' | '56' | '57' | '58' | '59';
280
+ export type Hour = `${HH}:${MM}`;
281
+ export type WorkingHour = {
282
+ start: Hour;
283
+ end: Hour;
284
+ };
285
+ export type WorkingHours = {
286
+ sunday: WorkingHour[];
287
+ monday: WorkingHour[];
288
+ tuesday: WorkingHour[];
289
+ wednesday: WorkingHour[];
290
+ thursday: WorkingHour[];
291
+ friday: WorkingHour[];
292
+ saturday: WorkingHour[];
293
+ };
294
+ export declare enum ReviewStatus {
295
+ PENDING = 0,
296
+ IN_REVIEW = 1,
297
+ ACCEPTED = 2,
298
+ DECLINED = 3
299
+ }
300
+ export declare enum RegistrationSection {
301
+ OWNER_NAME = 0,
302
+ CITY = 1,
303
+ RULES = 2,
304
+ BUSINESS_INFO = 3,
305
+ DRIVERS_INFO = 4,
306
+ VEHICLE_PERMIT = 5,
307
+ VEHICLE_REGISTRATION = 6,
308
+ SERVICES = 7,
309
+ ADDONS = 8,
310
+ WORKING_HOURS = 9,
311
+ OVERVIEW = 10,
312
+ STATUS = 11,
313
+ DONE = 12
314
+ }
315
+ export type DeclineReason = {
316
+ reasonDesc: {
317
+ ar: string;
318
+ en: string;
319
+ };
320
+ section: RegistrationSection;
321
+ };
322
+ export type ProviderService = {
323
+ serviceId?: string;
324
+ name?: {
325
+ ar: string;
326
+ en: string;
327
+ };
328
+ imageUrl?: string;
329
+ providerId?: string;
330
+ prices?: Price[];
331
+ description?: {
332
+ ar: string;
333
+ en: string;
334
+ };
335
+ includedServices?: {
336
+ ar: string;
337
+ en: string;
338
+ }[];
339
+ hide?: boolean;
340
+ time?: number;
341
+ numberOfVisits?: number;
342
+ };
343
+ export type ProvidedService = {
344
+ serviceId?: string;
345
+ name?: {
346
+ ar: string;
347
+ en: string;
348
+ };
349
+ imageUrl?: string;
350
+ providerId?: string;
351
+ description?: {
352
+ ar: string;
353
+ en: string;
354
+ };
355
+ price: Price;
356
+ isDone?: boolean;
357
+ finishDate?: TimestampType;
358
+ quantity?: number;
359
+ type: 'service';
360
+ time?: number;
361
+ includedServices?: {
362
+ ar: string;
363
+ en: string;
364
+ }[];
365
+ numberOfVisits?: number;
366
+ discount?: Discount;
367
+ };
368
+ export type ProviderAddon = {
369
+ addonId?: string;
370
+ providerId?: string;
371
+ name?: {
372
+ ar: string;
373
+ en: string;
374
+ };
375
+ prices?: Price[];
376
+ description?: {
377
+ ar: string;
378
+ en: string;
379
+ };
380
+ hide?: boolean;
381
+ time?: number;
382
+ };
383
+ export type ProvidedAddon = {
384
+ addonId?: string;
385
+ providerId?: string;
386
+ name?: {
387
+ ar: string;
388
+ en: string;
389
+ };
390
+ price?: Price;
391
+ description?: {
392
+ ar: string;
393
+ en: string;
394
+ };
395
+ quantity?: number;
396
+ type: 'addon';
397
+ time?: number;
398
+ isDone?: boolean;
399
+ finishDate?: TimestampType;
400
+ discount?: Discount;
401
+ };
402
+ export type Provider = {
403
+ type?: 'provider';
404
+ providerUid?: string;
405
+ providerName?: {
406
+ ar: string;
407
+ en: string;
408
+ };
409
+ providerPhoneNumber?: string;
410
+ providerCarNumber?: string;
411
+ numberOfDrivers?: number;
412
+ numberOfCars?: number;
413
+ totalRating?: number;
414
+ numberOfRaters?: number;
415
+ logoUrl?: string;
416
+ phoneNumber?: string;
417
+ ownerFirstName?: string;
418
+ ownerLastName?: string;
419
+ services?: ProviderService[];
420
+ addons?: ProviderAddon[];
421
+ working247?: boolean;
422
+ workingHoursV2?: WorkingHours;
423
+ submitDate?: TimestampType;
424
+ reviewStatus?: ReviewStatus;
425
+ reviewedBy?: string;
426
+ declineReasons?: DeclineReason[];
427
+ acceptOrdersAutomatically?: boolean;
428
+ freeWashes?: number;
429
+ registrationSection?: RegistrationSection;
430
+ currency?: string;
431
+ mainPushToken?: string;
432
+ hmsPushToken?: string;
433
+ isTest?: boolean;
434
+ language?: 'en' | 'ar';
435
+ balance?: number;
436
+ permitUrl?: string;
437
+ permitType?: string;
438
+ checkoutCustomerId?: string;
439
+ ownerEmail?: string;
440
+ isEmailVerified?: boolean;
441
+ receiveOrders?: boolean;
442
+ isAcceptingOrders?: boolean;
443
+ ordersPercentage?: number;
444
+ integrations?: {
445
+ email?: string;
446
+ isActive?: boolean;
447
+ key: string;
448
+ /** Tap (and other gateways): server-side API secret */
449
+ secretKey?: string;
450
+ /** Tap Connect marketplace payout destination id (sub-merchant) */
451
+ tapDestinationId?: string;
452
+ }[];
453
+ };
454
+ export type Card = {
455
+ id?: string;
456
+ issuer?: string;
457
+ expiry_month?: string;
458
+ expiry_year?: string;
459
+ name?: string;
460
+ scheme?: string;
461
+ bin?: string;
462
+ last4?: string;
463
+ customer?: {
464
+ id?: string;
465
+ };
466
+ default?: boolean;
467
+ customer_id?: string;
468
+ };
469
+ export type CheckoutCustomer = {
470
+ default?: string;
471
+ email?: string;
472
+ id?: string;
473
+ name?: string;
474
+ instruments?: Card[];
475
+ metadata?: {
476
+ iban?: string;
477
+ providerUid?: string;
478
+ };
479
+ };
480
+ export type CarService = {
481
+ car?: Car;
482
+ services: Array<ProvidedService | ProvidedAddon>;
483
+ isDone?: boolean;
484
+ };
485
+ export type Discount = {
486
+ promoCodeId?: string;
487
+ promoCode?: string;
488
+ validFrom?: TimestampType;
489
+ validTo?: TimestampType;
490
+ createdAt?: TimestampType;
491
+ allowedOnce?: boolean;
492
+ createdByProvider?: boolean;
493
+ providerUid?: string;
494
+ usedBy?: string[];
495
+ amount?: number;
496
+ isPercentage?: boolean;
497
+ maxAmount?: number;
498
+ isAutoApplied?: boolean;
499
+ servicesIds?: string[];
500
+ addonsIds?: string[];
501
+ clientIds?: string[];
502
+ createrEmail?: string;
503
+ sahabPercentage?: number;
504
+ providerPercentage?: number;
505
+ };
506
+ export type OrderReview = {
507
+ ratingId: string;
508
+ ratingNote: string;
509
+ orderId: string;
510
+ orderDate: TimestampType;
511
+ createdDate: TimestampType;
512
+ providerId: string;
513
+ arrivalDate: string;
514
+ finishDate: string;
515
+ rating: number;
516
+ clientId: string;
517
+ };
518
+ export type CountryCode = {
519
+ code: string;
520
+ dial_code: string;
521
+ flag: string;
522
+ name_en: string;
523
+ name_ar: string;
524
+ };
525
+ export type LocationInfo = {
526
+ city?: string;
527
+ country?: string;
528
+ postalCode?: string;
529
+ line1: string;
530
+ line2?: string;
531
+ long_name?: string;
532
+ latitude?: number;
533
+ longitude?: number;
534
+ };
535
+ export type SavedLocation = {
536
+ locationId: string;
537
+ name: string;
538
+ latitude: number;
539
+ longitude: number;
540
+ isPrimary?: boolean;
541
+ };
542
+ export type CheckoutCard = {
543
+ id?: string;
544
+ type?: string;
545
+ fingerprint?: string;
546
+ expiry_month?: string;
547
+ expiry_year?: string;
548
+ scheme?: string;
549
+ scheme_local?: string;
550
+ last4?: string;
551
+ bin?: string;
552
+ card_type?: string;
553
+ card_category?: string;
554
+ issuer?: string;
555
+ issuer_country?: string;
556
+ product_type?: string;
557
+ };
558
+ export type CheckoutToken = {
559
+ type?: string;
560
+ token?: string;
561
+ expires_on?: string;
562
+ expiry_month?: number;
563
+ expiry_year?: number;
564
+ scheme?: string;
565
+ scheme_local?: string;
566
+ last4?: string;
567
+ bin?: string;
568
+ card_type?: string;
569
+ card_category?: string;
570
+ issuer?: string;
571
+ issuer_country?: string;
572
+ product_id: string;
573
+ product_type: string;
574
+ billing_address?: {
575
+ address_line1?: string;
576
+ address_line2: string;
577
+ city?: string;
578
+ state?: string;
579
+ zip?: string;
580
+ country?: string;
581
+ };
582
+ phone?: {
583
+ country_code?: string;
584
+ number?: string;
585
+ };
586
+ name?: string;
587
+ };
588
+ export type SPECIFIED_TIME = 'anytime' | number;
589
+ export type PlaceOrder = {
590
+ clientID: string;
591
+ providerId: string;
592
+ orderMilllSec: number;
593
+ orderNanoSec: number;
594
+ services: CarService[];
595
+ lat: number;
596
+ long: number;
597
+ willClientBeThere: boolean;
598
+ paymentType: OrderPaymentType;
599
+ isPaid: boolean;
600
+ paymentId: string;
601
+ isProviderTest: boolean;
602
+ providerReceiveOrders: boolean;
603
+ orderNote: string;
604
+ promoCode: Discount;
605
+ driverIds: string[];
606
+ providerName: {
607
+ ar: string;
608
+ en: string;
609
+ };
610
+ paymentAmount: number;
611
+ usedBalance: number;
612
+ providerPhoneNumber: string;
613
+ isAddonStructure: boolean;
614
+ isMonthlyPackage: boolean;
615
+ sahabExtraPaymentAmount: number;
616
+ orderId?: string;
617
+ paymentGateway?: 'PAYLINK' | 'CHECKOUT' | 'TAP';
618
+ /** Mirrors Order economics for server-side Tap split; optional override of client fee % */
619
+ sahabClientPercentage?: number;
620
+ };
621
+ export type WeatherData = {
622
+ date: string;
623
+ precipitationProbability: number;
624
+ rainAccumulation: number;
625
+ cloudCover: number;
626
+ humidity: number;
627
+ windSpeed: number;
628
+ uvIndex: number;
629
+ };
630
+ export type PaymentConfigs = {
631
+ isCashAllowed: boolean;
632
+ isGooglePayAllowed?: boolean;
633
+ /** Tap GoSell merchant id for card / Apple Pay SDK config (optional; falls back in app). */
634
+ tapMerchantId?: string;
635
+ paymentGateways: {
636
+ key: string;
637
+ isActive: boolean;
638
+ priority: number;
639
+ }[];
640
+ };
641
+ export type Slot = {
642
+ id: string;
643
+ time: number;
644
+ selected: boolean;
645
+ reserved: boolean;
646
+ };
647
+ export type Statement = {
648
+ numberOfOrders: number;
649
+ completedOrders: number;
650
+ ratedOrders: number;
651
+ cancelledOrders: number;
652
+ cashOrders: number;
653
+ creditOrders: number;
654
+ applePayPayments: number;
655
+ expiredOrders: number;
656
+ confirmedOrders: number;
657
+ lateOrders: number;
658
+ ordersTotal: number;
659
+ orders: Order[];
660
+ statmentDate?: Date | string;
661
+ };