@simonarcher/fika-types 1.0.66 → 1.0.67
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/dist/shop.d.ts +93 -31
- package/package.json +1 -1
package/dist/shop.d.ts
CHANGED
|
@@ -375,32 +375,6 @@ export type SubmissionShopFormData = {
|
|
|
375
375
|
};
|
|
376
376
|
};
|
|
377
377
|
};
|
|
378
|
-
export interface ShopReview {
|
|
379
|
-
id: string;
|
|
380
|
-
userId: string;
|
|
381
|
-
shopId?: string;
|
|
382
|
-
reviewText?: string;
|
|
383
|
-
imageUrl?: string | undefined;
|
|
384
|
-
createdAt: Timestamp;
|
|
385
|
-
createdAtISO?: string;
|
|
386
|
-
ratings?: {
|
|
387
|
-
coffee?: number;
|
|
388
|
-
service?: number;
|
|
389
|
-
ambience?: number;
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
export interface PostShopReviewData {
|
|
393
|
-
userId: string | undefined;
|
|
394
|
-
shopId: string;
|
|
395
|
-
reviewText?: string;
|
|
396
|
-
imageUrl?: string | undefined;
|
|
397
|
-
ratings?: {
|
|
398
|
-
coffee?: number;
|
|
399
|
-
service?: number;
|
|
400
|
-
ambience?: number;
|
|
401
|
-
};
|
|
402
|
-
createdAt: AdminTimestamp;
|
|
403
|
-
}
|
|
404
378
|
export interface ShopReviewSubmission {
|
|
405
379
|
reviewText?: string;
|
|
406
380
|
imageUrl?: string | undefined;
|
|
@@ -481,11 +455,6 @@ export type SpecialtySemanticSignals = {
|
|
|
481
455
|
keywordDensity?: number;
|
|
482
456
|
sources?: Array<'website' | 'ig' | 'menu' | 'other'>;
|
|
483
457
|
};
|
|
484
|
-
export type SpecialtyCrowdSignals = {
|
|
485
|
-
votes?: number;
|
|
486
|
-
specialtyVotes?: number;
|
|
487
|
-
avgCraftRating?: number;
|
|
488
|
-
};
|
|
489
458
|
export type SpecialtySignals = {
|
|
490
459
|
semantic?: SpecialtySemanticSignals;
|
|
491
460
|
crowd?: SpecialtyCrowdSignals;
|
|
@@ -501,4 +470,97 @@ export type BaristaAchievement = {
|
|
|
501
470
|
year?: number;
|
|
502
471
|
notes?: string;
|
|
503
472
|
};
|
|
473
|
+
/**
|
|
474
|
+
* Denormalized version used when displaying or exporting reviews.
|
|
475
|
+
* Mirrors PostShopReviewData but includes IDs, timestamps, and optional ISO string.
|
|
476
|
+
*/
|
|
477
|
+
export interface ShopReview {
|
|
478
|
+
id: string;
|
|
479
|
+
userId: string;
|
|
480
|
+
shopId?: string;
|
|
481
|
+
reviewText?: string;
|
|
482
|
+
imageUrl?: string | undefined;
|
|
483
|
+
createdAt: Timestamp;
|
|
484
|
+
createdAtISO?: string;
|
|
485
|
+
ratings?: {
|
|
486
|
+
coffee?: number;
|
|
487
|
+
service?: number;
|
|
488
|
+
ambience?: number;
|
|
489
|
+
};
|
|
490
|
+
/** -------- Specialty crowd data -------- */
|
|
491
|
+
craftPerception?: 0 | 0.5 | 1;
|
|
492
|
+
craftRating?: 1 | 2 | 3 | 4 | 5;
|
|
493
|
+
brewSightings?: string[];
|
|
494
|
+
roasterSightings?: string[];
|
|
495
|
+
evidence?: {
|
|
496
|
+
photos?: string[];
|
|
497
|
+
links?: string[];
|
|
498
|
+
};
|
|
499
|
+
reviewerTrust?: number;
|
|
500
|
+
status?: "active" | "flagged" | "hidden";
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Incoming payload when a user posts a new review.
|
|
504
|
+
* Used in your client submission and Cloud Functions triggers.
|
|
505
|
+
*/
|
|
506
|
+
export interface PostShopReviewData {
|
|
507
|
+
userId: string | undefined;
|
|
508
|
+
shopId: string;
|
|
509
|
+
reviewText?: string;
|
|
510
|
+
imageUrl?: string | undefined;
|
|
511
|
+
ratings?: {
|
|
512
|
+
coffee?: number;
|
|
513
|
+
service?: number;
|
|
514
|
+
ambience?: number;
|
|
515
|
+
};
|
|
516
|
+
createdAt: AdminTimestamp;
|
|
517
|
+
/** -------- Specialty crowd data additions -------- */
|
|
518
|
+
/**
|
|
519
|
+
* User’s perception of whether this is a specialty coffee shop.
|
|
520
|
+
* 1 = Yes, 0.5 = Not sure, 0 = No
|
|
521
|
+
*/
|
|
522
|
+
craftPerception?: 0 | 0.5 | 1;
|
|
523
|
+
/**
|
|
524
|
+
* How “craft-focused” the experience felt (1–5 slider).
|
|
525
|
+
*/
|
|
526
|
+
craftRating?: 1 | 2 | 3 | 4 | 5;
|
|
527
|
+
/**
|
|
528
|
+
* Brewing methods or equipment observed in the shop.
|
|
529
|
+
* e.g., ["V60", "Aeropress", "Espresso", "Chemex"]
|
|
530
|
+
*/
|
|
531
|
+
brewSightings?: string[];
|
|
532
|
+
/**
|
|
533
|
+
* Roasters observed or confirmed at the shop.
|
|
534
|
+
* Ideally references `roasters/{id}` but may also be free text.
|
|
535
|
+
*/
|
|
536
|
+
roasterSightings?: string[];
|
|
537
|
+
/**
|
|
538
|
+
* Optional evidence supporting the review — photo links or menu links.
|
|
539
|
+
*/
|
|
540
|
+
evidence?: {
|
|
541
|
+
photos?: string[];
|
|
542
|
+
links?: string[];
|
|
543
|
+
};
|
|
544
|
+
/**
|
|
545
|
+
* System-assigned weight (0.5–1.5) to trust reviews more/less
|
|
546
|
+
* based on history, evidence, and consistency.
|
|
547
|
+
*/
|
|
548
|
+
reviewerTrust?: number;
|
|
549
|
+
/**
|
|
550
|
+
* Internal moderation / review status.
|
|
551
|
+
*/
|
|
552
|
+
status?: "active" | "flagged" | "hidden";
|
|
553
|
+
}
|
|
554
|
+
export interface ShopSignals {
|
|
555
|
+
crowd: SpecialtyCrowdSignals;
|
|
556
|
+
}
|
|
557
|
+
export interface SpecialtyCrowdSignals {
|
|
558
|
+
votes: number;
|
|
559
|
+
specialtyVotes: number;
|
|
560
|
+
avgCraftRating?: number | null;
|
|
561
|
+
brewTallies?: Record<string, number>;
|
|
562
|
+
roasterTallies?: Record<string, number>;
|
|
563
|
+
_smoothedCraftRatio?: number;
|
|
564
|
+
updatedAt: number;
|
|
565
|
+
}
|
|
504
566
|
export {};
|