@simonarcher/fika-types 1.0.65 → 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 +94 -31
- package/package.json +1 -1
package/dist/shop.d.ts
CHANGED
|
@@ -195,6 +195,7 @@ export type ShopData = {
|
|
|
195
195
|
* --------- NEW FOR SPECIALTY SCORING (all optional/merge-friendly) ----------
|
|
196
196
|
*/
|
|
197
197
|
roasterRefs?: RoasterRef[];
|
|
198
|
+
roasterRefsIds?: string[];
|
|
198
199
|
houseRoasted?: boolean;
|
|
199
200
|
brewMethods?: string[];
|
|
200
201
|
menuKeywords?: string[];
|
|
@@ -374,32 +375,6 @@ export type SubmissionShopFormData = {
|
|
|
374
375
|
};
|
|
375
376
|
};
|
|
376
377
|
};
|
|
377
|
-
export interface ShopReview {
|
|
378
|
-
id: string;
|
|
379
|
-
userId: string;
|
|
380
|
-
shopId?: string;
|
|
381
|
-
reviewText?: string;
|
|
382
|
-
imageUrl?: string | undefined;
|
|
383
|
-
createdAt: Timestamp;
|
|
384
|
-
createdAtISO?: string;
|
|
385
|
-
ratings?: {
|
|
386
|
-
coffee?: number;
|
|
387
|
-
service?: number;
|
|
388
|
-
ambience?: number;
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
export interface PostShopReviewData {
|
|
392
|
-
userId: string | undefined;
|
|
393
|
-
shopId: string;
|
|
394
|
-
reviewText?: string;
|
|
395
|
-
imageUrl?: string | undefined;
|
|
396
|
-
ratings?: {
|
|
397
|
-
coffee?: number;
|
|
398
|
-
service?: number;
|
|
399
|
-
ambience?: number;
|
|
400
|
-
};
|
|
401
|
-
createdAt: AdminTimestamp;
|
|
402
|
-
}
|
|
403
378
|
export interface ShopReviewSubmission {
|
|
404
379
|
reviewText?: string;
|
|
405
380
|
imageUrl?: string | undefined;
|
|
@@ -480,11 +455,6 @@ export type SpecialtySemanticSignals = {
|
|
|
480
455
|
keywordDensity?: number;
|
|
481
456
|
sources?: Array<'website' | 'ig' | 'menu' | 'other'>;
|
|
482
457
|
};
|
|
483
|
-
export type SpecialtyCrowdSignals = {
|
|
484
|
-
votes?: number;
|
|
485
|
-
specialtyVotes?: number;
|
|
486
|
-
avgCraftRating?: number;
|
|
487
|
-
};
|
|
488
458
|
export type SpecialtySignals = {
|
|
489
459
|
semantic?: SpecialtySemanticSignals;
|
|
490
460
|
crowd?: SpecialtyCrowdSignals;
|
|
@@ -500,4 +470,97 @@ export type BaristaAchievement = {
|
|
|
500
470
|
year?: number;
|
|
501
471
|
notes?: string;
|
|
502
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
|
+
}
|
|
503
566
|
export {};
|