@simonarcher/fika-types 1.0.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.
@@ -0,0 +1,98 @@
1
+ import type { GeoPoint, Timestamp } from "firebase-admin/firestore";
2
+ export interface RoasterData {
3
+ id: string;
4
+ name: string;
5
+ logoImage?: string;
6
+ about?: string;
7
+ country: string;
8
+ countryCode: string;
9
+ city?: string;
10
+ contactDetails?: {
11
+ phone?: string;
12
+ instagram?: string;
13
+ website?: string;
14
+ email?: string;
15
+ address?: {
16
+ formattedAddress: string;
17
+ shortFormattedAddress?: string;
18
+ addressLine1?: string;
19
+ addressLine2?: string;
20
+ postalCode?: string;
21
+ province?: string;
22
+ country: string;
23
+ city: string;
24
+ };
25
+ };
26
+ addedByUser?: string;
27
+ active: boolean;
28
+ createdAt?: Timestamp;
29
+ updatedAt?: Timestamp;
30
+ status: "inReview" | "approved" | "rejected";
31
+ additionalInfo?: string;
32
+ suppliedShops?: string[];
33
+ geoPoint?: GeoPoint;
34
+ }
35
+ export interface SubmissionRoasterData {
36
+ name: string;
37
+ logoImage?: string;
38
+ about?: string;
39
+ country: string;
40
+ countryCode: string;
41
+ city?: string;
42
+ contactDetails?: {
43
+ phone?: string;
44
+ instagram?: string;
45
+ website?: string;
46
+ email?: string;
47
+ address?: {
48
+ formattedAddress: string;
49
+ country: string;
50
+ city: string;
51
+ };
52
+ };
53
+ userId: string;
54
+ status: "inReview" | "approved" | "rejected";
55
+ active: boolean;
56
+ additionalInfo?: string;
57
+ geoPoint?: GeoPoint;
58
+ }
59
+ export type DecafMethod = "Swiss Water" | "Sugarcane / Ethyl Acetate" | "Carbon Dioxide (CO₂)" | "Methylene Chloride" | "Mountain Water" | "Unknown";
60
+ export type CoffeeProcessingMethod = "Washed (Wet)" | "Natural (Dry)" | "Honey" | "Anaerobic Fermentation" | "Carbonic Maceration" | "Wet-Hulled" | "Semi-Washed" | "Experimental / Other" | "Unknown";
61
+ export type RoastLevel = 'Light' | 'Medium' | 'Dark' | 'Medium-Dark' | 'Medium-Light' | 'Espresso';
62
+ export interface CoffeeBeanData {
63
+ id: string;
64
+ name: string;
65
+ description?: string;
66
+ image?: string;
67
+ roasterId: string;
68
+ country?: string;
69
+ region?: string;
70
+ origin?: string;
71
+ elevation?: number;
72
+ processing?: CoffeeProcessingMethod;
73
+ tastingNotes?: string[];
74
+ isDecaf: boolean;
75
+ decafMethod?: DecafMethod;
76
+ shops?: string[];
77
+ active: boolean;
78
+ createdAt?: Timestamp;
79
+ updatedAt?: Timestamp;
80
+ }
81
+ export interface SubmissionCoffeeBeanData {
82
+ name: string;
83
+ description?: string;
84
+ image?: string;
85
+ roasterId: string;
86
+ country?: string;
87
+ region?: string;
88
+ origin?: string;
89
+ elevation?: number;
90
+ processing?: CoffeeProcessingMethod;
91
+ tastingNotes?: string[];
92
+ isDecaf: boolean;
93
+ decafMethod?: DecafMethod;
94
+ userId: string;
95
+ status: "inReview" | "approved" | "rejected";
96
+ active: boolean;
97
+ }
98
+ export declare const COFFEE_PRODUCING_COUNTRIES: string[];
package/dist/coffee.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COFFEE_PRODUCING_COUNTRIES = void 0;
4
+ exports.COFFEE_PRODUCING_COUNTRIES = [
5
+ "Bolivia",
6
+ "Brazil",
7
+ "Burundi",
8
+ "Colombia",
9
+ "Costa Rica",
10
+ "Dominican Republic",
11
+ "Ecuador",
12
+ "El Salvador",
13
+ "Ethiopia",
14
+ "Guatemala",
15
+ "Haiti",
16
+ "Honduras",
17
+ "India",
18
+ "Indonesia",
19
+ "Jamaica",
20
+ "Kenya",
21
+ "Mexico",
22
+ "Nicaragua",
23
+ "Panama",
24
+ "Papua New Guinea",
25
+ "Peru",
26
+ "Rwanda",
27
+ "Tanzania",
28
+ "Uganda",
29
+ "Vietnam",
30
+ "Yemen",
31
+ "Other",
32
+ ];
@@ -0,0 +1,2 @@
1
+ export * from './shop';
2
+ export * from './coffee';
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Export all shop-related types
18
+ __exportStar(require("./shop"), exports);
19
+ // Export all coffee-related types
20
+ __exportStar(require("./coffee"), exports);
package/dist/shop.d.ts ADDED
@@ -0,0 +1,299 @@
1
+ import type { Timestamp } from "firebase-admin/firestore";
2
+ import type { GeoPoint, Timestamp as AdminTimestamp } from "firebase-admin/firestore";
3
+ import type { CoffeeProcessingMethod, DecafMethod, RoastLevel } from "./coffee";
4
+ export type MenuItemDrinkType = "Filter" | "ColdBrew" | "Specialty" | "Espresso" | "Milk" | "Tea" | "Other";
5
+ export type MenuItemFoodType = "Breakfast" | "Lunch" | "Pastry" | "Snack" | "Sweets" | "Sandwiches" | "Other";
6
+ export type MenuItemType = MenuItemDrinkType | MenuItemFoodType;
7
+ export type MenuItemCategory = "drink" | "food";
8
+ export interface MenuItem {
9
+ id: string;
10
+ name: string;
11
+ description?: string;
12
+ price: number;
13
+ type: MenuItemType;
14
+ category: MenuItemCategory;
15
+ available: boolean;
16
+ image?: string;
17
+ createdAt: number;
18
+ updatedAt: number;
19
+ currency: string;
20
+ coffeeBeanIds?: string[];
21
+ }
22
+ export interface NewMenuItem {
23
+ name: string;
24
+ description?: string;
25
+ price: number;
26
+ type: MenuItemType;
27
+ category: MenuItemCategory;
28
+ available: boolean;
29
+ image?: string;
30
+ currency: string;
31
+ coffeeBeanIds?: string[];
32
+ }
33
+ export interface StaffMember {
34
+ id: string;
35
+ userId: string;
36
+ profilePicture?: string;
37
+ membershipId: string;
38
+ role: string;
39
+ shopId: string;
40
+ name?: string;
41
+ bio?: string;
42
+ favouriteCoffeeDrink?: string;
43
+ email?: string;
44
+ isWorking: boolean;
45
+ shiftStart?: number;
46
+ createdAt: Date;
47
+ updatedAt: Date;
48
+ }
49
+ export interface StaffMemberInvite {
50
+ id: string;
51
+ shopId: string;
52
+ invitedEmail: string;
53
+ token: string;
54
+ role: "owner" | "staff";
55
+ status: "pending" | "accepted" | "declined";
56
+ expiresAt: AdminTimestamp;
57
+ createdAt: AdminTimestamp;
58
+ updatedAt: AdminTimestamp;
59
+ }
60
+ export type ShopOpeningTimes = {
61
+ monday?: {
62
+ open: string;
63
+ close: string;
64
+ };
65
+ tuesday?: {
66
+ open: string;
67
+ close: string;
68
+ };
69
+ wednesday?: {
70
+ open: string;
71
+ close: string;
72
+ };
73
+ thursday?: {
74
+ open: string;
75
+ close: string;
76
+ };
77
+ friday?: {
78
+ open: string;
79
+ close: string;
80
+ };
81
+ saturday?: {
82
+ open: string;
83
+ close: string;
84
+ };
85
+ sunday?: {
86
+ open: string;
87
+ close: string;
88
+ };
89
+ };
90
+ export type ShopData = {
91
+ id: string;
92
+ name: string;
93
+ about?: string;
94
+ businessStatus?: string;
95
+ fikaRating?: number;
96
+ totalReviews?: number;
97
+ ratingDetails?: {
98
+ coffee: number;
99
+ service: number;
100
+ ambience: number;
101
+ };
102
+ googleRating?: number;
103
+ coverImage?: string;
104
+ logoImage?: string;
105
+ addedByUser?: string;
106
+ ownerId?: string;
107
+ platformLoyaltyRewards?: {
108
+ hasPlatformLoyaltyRewards?: boolean;
109
+ stampsRequired?: number;
110
+ };
111
+ info?: {
112
+ hasWifi: boolean;
113
+ wifiName: string;
114
+ wifiPassword: string;
115
+ laptopFriendly: boolean;
116
+ hasKitchen: boolean;
117
+ servesBreakfast: boolean;
118
+ servesLunch: boolean;
119
+ servesVegetarianFood: boolean;
120
+ discountOnReusableCup: boolean;
121
+ hasLoyaltyRewards: boolean;
122
+ };
123
+ socials?: {
124
+ instagram: string;
125
+ facebook: string;
126
+ tiktok: string;
127
+ twitter: string;
128
+ };
129
+ location?: {
130
+ latitude: number;
131
+ longitude: number;
132
+ };
133
+ geoPoint?: GeoPoint;
134
+ regularOpeningHours?: DayOpeningHours[];
135
+ contactDetails?: {
136
+ contactNumber: string;
137
+ website: string;
138
+ address: {
139
+ formattedAddress: string;
140
+ shortFormattedAddress: string;
141
+ addressLine1: string;
142
+ addressLine2: string;
143
+ postalCode: string;
144
+ province: string;
145
+ country: string;
146
+ };
147
+ };
148
+ addedAt?: AdminTimestamp;
149
+ images?: {
150
+ cover?: string;
151
+ general?: string[];
152
+ menu?: string[];
153
+ };
154
+ };
155
+ interface OpeningTime {
156
+ day: number;
157
+ hour: number | null;
158
+ minute: number | null;
159
+ }
160
+ export interface DayOpeningHours {
161
+ dayOfWeek: string;
162
+ open?: OpeningTime;
163
+ close?: OpeningTime;
164
+ }
165
+ export interface FullShopData extends ShopData {
166
+ staff: StaffMember[];
167
+ roastingAndBeansInfo?: RoastingAndBeansInfo;
168
+ }
169
+ export interface RoastingAndBeansInfo {
170
+ roasters?: string[];
171
+ hasDecaf?: boolean;
172
+ decafMethods?: DecafMethod[];
173
+ flavourNotes?: string[];
174
+ coffeeBeans?: string[];
175
+ coffeeOriginCountries?: string[];
176
+ processingMethods?: CoffeeProcessingMethod[];
177
+ roastLevels?: RoastLevel[];
178
+ singleOrigin?: boolean;
179
+ directTrade?: boolean;
180
+ seasonal?: boolean;
181
+ }
182
+ export interface ShopPaymentOptions {
183
+ acceptsCashOnly: boolean;
184
+ acceptsCreditCards: boolean;
185
+ acceptsDebitCards: boolean;
186
+ acceptsNfc: boolean;
187
+ }
188
+ export interface SubmissionShopData {
189
+ shopName: string;
190
+ lat?: number;
191
+ long?: number;
192
+ active: boolean;
193
+ userId: string;
194
+ status: string;
195
+ isOwner: boolean;
196
+ ownerEmail: string;
197
+ countryCode: string;
198
+ city: string;
199
+ }
200
+ export type SubmissionShopFormData = {
201
+ shopName: string;
202
+ lat?: number;
203
+ long?: number;
204
+ isOwner: boolean;
205
+ ownerEmail: string;
206
+ countryCode: string;
207
+ city: string;
208
+ placeId?: string;
209
+ address?: string;
210
+ info?: {
211
+ hasWifi: string;
212
+ laptopFriendly: string;
213
+ hasKitchen: string;
214
+ discountOnReusableCup: string;
215
+ hasLoyaltyRewards: string;
216
+ };
217
+ geoPoint?: {
218
+ latitude: number;
219
+ longitude: number;
220
+ };
221
+ review?: ShopReview;
222
+ images?: {
223
+ cover?: string;
224
+ general?: string[];
225
+ menu?: string[];
226
+ };
227
+ regularOpeningHours?: DayOpeningHours[];
228
+ contactDetails?: {
229
+ contactNumber?: string;
230
+ website?: string;
231
+ address?: {
232
+ formattedAddress?: string;
233
+ shortFormattedAddress?: string;
234
+ city?: string;
235
+ country?: string;
236
+ };
237
+ };
238
+ };
239
+ export interface ShopReview {
240
+ id: string;
241
+ userId: string;
242
+ shopId?: string;
243
+ reviewText?: string;
244
+ imageUrl?: string | undefined;
245
+ createdAt: Timestamp;
246
+ createdAtISO?: string;
247
+ ratings?: {
248
+ coffee?: number;
249
+ service?: number;
250
+ ambience?: number;
251
+ };
252
+ }
253
+ export interface PostShopReviewData {
254
+ userId: string | undefined;
255
+ shopId: string;
256
+ reviewText?: string;
257
+ imageUrl?: string | undefined;
258
+ ratings?: {
259
+ coffee?: number;
260
+ service?: number;
261
+ ambience?: number;
262
+ };
263
+ createdAt: AdminTimestamp;
264
+ }
265
+ export interface ShopReviewSubmission {
266
+ reviewText?: string;
267
+ imageUrl?: string | undefined;
268
+ userId: string;
269
+ shopId: string;
270
+ ratings?: {
271
+ coffee?: number;
272
+ service?: number;
273
+ ambience?: number;
274
+ };
275
+ }
276
+ export interface LoyaltyRewardPlatformShop {
277
+ id: string;
278
+ name: string;
279
+ hasPlatformLoyaltyRewards: boolean;
280
+ stampsRequired: number;
281
+ countryCode: string;
282
+ city: string;
283
+ shopId: string;
284
+ coverImage?: string;
285
+ logoImage?: string;
286
+ }
287
+ export interface LoyaltyStamp {
288
+ id: string;
289
+ userId: string;
290
+ shopId: string;
291
+ issueMethod: "app" | "nfc";
292
+ issuerId: string;
293
+ createdAt: AdminTimestamp;
294
+ updatedAt?: AdminTimestamp;
295
+ type: string;
296
+ valid: boolean;
297
+ voucherId?: string;
298
+ }
299
+ export {};
package/dist/shop.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@simonarcher/fika-types",
3
+ "version": "1.0.0",
4
+ "description": "Shared TypeScript types for Fika projects",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "dev": "tsc --watch",
10
+ "clean": "rm -rf dist",
11
+ "prepublishOnly": "npm run build"
12
+ },
13
+ "devDependencies": {
14
+ "typescript": "^5.0.0",
15
+ "firebase": "^10.8.1",
16
+ "firebase-admin": "^12.0.0"
17
+ },
18
+ "peerDependencies": {
19
+ "firebase": "^10.0.0",
20
+ "firebase-admin": "^12.0.0"
21
+ },
22
+ "files": [
23
+ "dist/**/*"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/simonarcher/FIKA-schema.git"
31
+ },
32
+ "keywords": [
33
+ "typescript",
34
+ "types",
35
+ "fika",
36
+ "coffee",
37
+ "firebase"
38
+ ],
39
+ "author": "Simon Archer",
40
+ "license": "MIT",
41
+ "engines": {
42
+ "node": ">=16.0.0"
43
+ }
44
+ }