@mrck-labs/vanaheim-shared 0.2.1 → 0.4.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,473 @@
1
+ /**
2
+ * Database Types for Vanaheim
3
+ *
4
+ * Shared type definitions matching the Supabase PostgreSQL schema.
5
+ * Used by both desktop and mobile apps.
6
+ */
7
+ interface ExpenseCategory {
8
+ id: string;
9
+ userId: string;
10
+ name: string;
11
+ icon: string;
12
+ color: string;
13
+ sortOrder: number;
14
+ isDefault: boolean;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ }
18
+ interface NewExpenseCategory {
19
+ name: string;
20
+ icon: string;
21
+ color: string;
22
+ sortOrder?: number;
23
+ isDefault?: boolean;
24
+ }
25
+ interface Expense {
26
+ id: string;
27
+ userId: string;
28
+ name: string;
29
+ amount: number;
30
+ currency: string;
31
+ frequency: string;
32
+ categoryId: string;
33
+ nextDueDate: string;
34
+ notes: string | null;
35
+ isShared: boolean;
36
+ sharePercentage: number;
37
+ isActive: boolean;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ category?: ExpenseCategory;
41
+ }
42
+ interface NewExpense {
43
+ name: string;
44
+ amount: number;
45
+ currency: string;
46
+ frequency: string;
47
+ categoryId: string;
48
+ nextDueDate: string;
49
+ notes?: string | null;
50
+ isShared?: boolean;
51
+ sharePercentage?: number;
52
+ isActive?: boolean;
53
+ }
54
+ interface IncomeCategory {
55
+ id: string;
56
+ userId: string;
57
+ name: string;
58
+ icon: string;
59
+ color: string;
60
+ sortOrder: number;
61
+ isDefault: boolean;
62
+ createdAt: string;
63
+ updatedAt: string;
64
+ }
65
+ interface NewIncomeCategory {
66
+ name: string;
67
+ icon: string;
68
+ color: string;
69
+ sortOrder?: number;
70
+ isDefault?: boolean;
71
+ }
72
+ interface Income {
73
+ id: string;
74
+ userId: string;
75
+ name: string;
76
+ amount: number;
77
+ currency: string;
78
+ frequency: string;
79
+ categoryId: string;
80
+ nextPayDate: string;
81
+ notes: string | null;
82
+ isActive: boolean;
83
+ createdAt: string;
84
+ updatedAt: string;
85
+ category?: IncomeCategory;
86
+ }
87
+ interface NewIncome {
88
+ name: string;
89
+ amount: number;
90
+ currency: string;
91
+ frequency: string;
92
+ categoryId: string;
93
+ nextPayDate: string;
94
+ notes?: string | null;
95
+ isActive?: boolean;
96
+ }
97
+ interface FocusCategory {
98
+ id: string;
99
+ userId: string;
100
+ name: string;
101
+ color: string;
102
+ sortOrder: number;
103
+ isDefault: boolean;
104
+ createdAt: string;
105
+ updatedAt: string;
106
+ }
107
+ interface NewFocusCategory {
108
+ name: string;
109
+ color: string;
110
+ sortOrder?: number;
111
+ isDefault?: boolean;
112
+ }
113
+ type FocusSessionStatus = "active" | "completed" | "abandoned";
114
+ interface FocusSession {
115
+ id: string;
116
+ userId: string;
117
+ title: string;
118
+ categoryId: string | null;
119
+ targetMinutes: number;
120
+ actualSeconds: number;
121
+ status: FocusSessionStatus;
122
+ startedAt: string;
123
+ completedAt: string | null;
124
+ createdAt: string;
125
+ updatedAt: string;
126
+ category?: FocusCategory;
127
+ }
128
+ interface NewFocusSession {
129
+ title: string;
130
+ categoryId?: string | null;
131
+ targetMinutes: number;
132
+ actualSeconds?: number;
133
+ status?: FocusSessionStatus;
134
+ startedAt?: string;
135
+ completedAt?: string | null;
136
+ }
137
+ interface FocusSessionFilters {
138
+ categoryId?: string;
139
+ status?: FocusSessionStatus;
140
+ startedAfter?: string;
141
+ startedBefore?: string;
142
+ }
143
+ type ChatMessageRole = "user" | "assistant" | "system";
144
+ interface ChatConversation {
145
+ id: string;
146
+ userId: string;
147
+ title: string;
148
+ createdAt: string;
149
+ updatedAt: string;
150
+ }
151
+ interface NewChatConversation {
152
+ title: string;
153
+ }
154
+ interface ChatMessage {
155
+ id: string;
156
+ conversationId: string;
157
+ role: ChatMessageRole;
158
+ content: string;
159
+ metadata: string | null;
160
+ createdAt: string;
161
+ }
162
+ interface NewChatMessage {
163
+ conversationId: string;
164
+ role: ChatMessageRole;
165
+ content: string;
166
+ metadata?: string | null;
167
+ }
168
+ interface EFLink {
169
+ id: string;
170
+ userId: string;
171
+ name: string;
172
+ url: string;
173
+ icon: string | null;
174
+ sortOrder: number;
175
+ createdAt: string;
176
+ updatedAt: string;
177
+ }
178
+ interface NewEFLink {
179
+ name: string;
180
+ url: string;
181
+ icon?: string | null;
182
+ sortOrder?: number;
183
+ }
184
+ type LieuDayType = "earned" | "used";
185
+ interface LieuDay {
186
+ id: string;
187
+ userId: string;
188
+ type: LieuDayType;
189
+ date: string;
190
+ reason: string | null;
191
+ createdAt: string;
192
+ updatedAt: string;
193
+ }
194
+ interface NewLieuDay {
195
+ type: LieuDayType;
196
+ date: string;
197
+ reason?: string | null;
198
+ }
199
+ type BankConnectionStatus = "pending" | "linked" | "expired" | "error";
200
+ type TransactionType = "debit" | "credit";
201
+ interface BankConnection {
202
+ id: string;
203
+ userId: string;
204
+ provider: string;
205
+ institutionId: string;
206
+ institutionName: string;
207
+ requisitionId: string;
208
+ accountId: string | null;
209
+ status: BankConnectionStatus;
210
+ lastSynced: string | null;
211
+ createdAt: string;
212
+ updatedAt: string;
213
+ }
214
+ interface BankTransaction {
215
+ id: string;
216
+ connectionId: string | null;
217
+ externalId: string;
218
+ amount: number;
219
+ currency: string;
220
+ description: string | null;
221
+ merchantName: string | null;
222
+ bookingDate: string;
223
+ valueDate: string | null;
224
+ transactionType: TransactionType | null;
225
+ createdAt: string;
226
+ }
227
+ interface HealthCategory {
228
+ id: string;
229
+ userId: string;
230
+ name: string;
231
+ icon: string;
232
+ color: string;
233
+ sortOrder: number;
234
+ isDefault: boolean;
235
+ createdAt: string;
236
+ updatedAt: string;
237
+ }
238
+ interface NewHealthCategory {
239
+ name: string;
240
+ icon: string;
241
+ color: string;
242
+ sortOrder?: number;
243
+ isDefault?: boolean;
244
+ }
245
+ type HealthFrequencyType = "daily" | "specific_days" | "times_per_week" | "times_per_month";
246
+ interface HealthFrequencyConfig {
247
+ days?: number[];
248
+ target?: number;
249
+ }
250
+ interface HealthHabit {
251
+ id: string;
252
+ userId: string;
253
+ categoryId: string;
254
+ name: string;
255
+ description: string | null;
256
+ frequencyType: HealthFrequencyType;
257
+ frequencyConfig: string | null;
258
+ targetAmount: number | null;
259
+ targetUnit: string | null;
260
+ streakCurrent: number;
261
+ streakBest: number;
262
+ isActive: boolean;
263
+ createdAt: string;
264
+ updatedAt: string;
265
+ category?: HealthCategory;
266
+ }
267
+ interface NewHealthHabit {
268
+ categoryId: string;
269
+ name: string;
270
+ description?: string | null;
271
+ frequencyType: HealthFrequencyType;
272
+ frequencyConfig?: HealthFrequencyConfig | null;
273
+ targetAmount?: number | null;
274
+ targetUnit?: string | null;
275
+ isActive?: boolean;
276
+ }
277
+ interface HealthCompletion {
278
+ id: string;
279
+ habitId: string;
280
+ userId: string;
281
+ date: string;
282
+ completedAt: string;
283
+ notes: string | null;
284
+ }
285
+ interface NewHealthCompletion {
286
+ habitId: string;
287
+ date?: string;
288
+ notes?: string | null;
289
+ }
290
+ interface HealthHabitFilters {
291
+ categoryId?: string;
292
+ isActive?: boolean;
293
+ frequencyType?: HealthFrequencyType;
294
+ }
295
+ interface HealthCompletionFilters {
296
+ habitId?: string;
297
+ dateFrom?: string;
298
+ dateTo?: string;
299
+ }
300
+ interface HealthStats {
301
+ totalHabits: number;
302
+ dailyHabits: number;
303
+ weeklyHabits: number;
304
+ completedToday: number;
305
+ pendingToday: number;
306
+ completionRate: number;
307
+ totalStreak: number;
308
+ bestStreak: number;
309
+ weeklyCompletions: number;
310
+ }
311
+ interface Setting {
312
+ id: string;
313
+ userId: string;
314
+ key: string;
315
+ value: string;
316
+ updatedAt: string;
317
+ }
318
+ interface ExchangeRate {
319
+ currency: string;
320
+ rateToCHF: number;
321
+ updatedAt: string;
322
+ }
323
+ interface DailyPriority {
324
+ id: string;
325
+ title: string;
326
+ completed: boolean;
327
+ order: number;
328
+ }
329
+ interface DailyPlan {
330
+ id: string;
331
+ userId: string;
332
+ date: string;
333
+ priorities: string;
334
+ reflection: string | null;
335
+ energyLevel: number | null;
336
+ createdAt: string;
337
+ updatedAt: string;
338
+ }
339
+ interface NewDailyPlan {
340
+ date: string;
341
+ priorities?: string;
342
+ reflection?: string | null;
343
+ energyLevel?: number | null;
344
+ }
345
+ interface ParsedDailyPlan extends Omit<DailyPlan, 'priorities'> {
346
+ priorities: DailyPriority[];
347
+ }
348
+ type MealType = 'breakfast' | 'lunch' | 'dinner' | 'snack';
349
+ interface MealPlan {
350
+ id: string;
351
+ userId: string;
352
+ date: string;
353
+ mealType: MealType;
354
+ recipeId: string | null;
355
+ ingredientId: string | null;
356
+ customMeal: string | null;
357
+ servings: number;
358
+ notes: string | null;
359
+ isCompleted: boolean;
360
+ createdAt: string;
361
+ updatedAt: string;
362
+ }
363
+ interface NewMealPlan {
364
+ date: string;
365
+ mealType: MealType;
366
+ recipeId?: string | null;
367
+ ingredientId?: string | null;
368
+ customMeal?: string | null;
369
+ servings?: number;
370
+ notes?: string | null;
371
+ isCompleted?: boolean;
372
+ }
373
+ interface PrepSession {
374
+ id: string;
375
+ userId: string;
376
+ scheduledDate: string;
377
+ scheduledTime: string | null;
378
+ durationMinutes: number | null;
379
+ title: string;
380
+ description: string | null;
381
+ linkedMealIds: string | null;
382
+ isCompleted: boolean;
383
+ createdAt: string;
384
+ updatedAt: string;
385
+ }
386
+ interface NewPrepSession {
387
+ scheduledDate: string;
388
+ scheduledTime?: string | null;
389
+ durationMinutes?: number | null;
390
+ title: string;
391
+ description?: string | null;
392
+ linkedMealIds?: string | null;
393
+ isCompleted?: boolean;
394
+ }
395
+ interface FocusArea {
396
+ area: string;
397
+ goal: string;
398
+ }
399
+ interface WeeklyPlan {
400
+ id: string;
401
+ userId: string;
402
+ weekStart: string;
403
+ reviewNotes: string | null;
404
+ lastWeekRating: number | null;
405
+ focusAreas: string | null;
406
+ weeklyIntention: string | null;
407
+ createdAt: string;
408
+ updatedAt: string;
409
+ }
410
+ interface NewWeeklyPlan {
411
+ weekStart: string;
412
+ reviewNotes?: string | null;
413
+ lastWeekRating?: number | null;
414
+ focusAreas?: string | null;
415
+ weeklyIntention?: string | null;
416
+ }
417
+ interface ParsedWeeklyPlan extends Omit<WeeklyPlan, 'focusAreas'> {
418
+ focusAreas: FocusArea[];
419
+ }
420
+ type NoteType = 'native' | 'craft' | 'github' | 'notion' | 'link';
421
+ interface NoteFolder {
422
+ id: string;
423
+ userId: string;
424
+ name: string;
425
+ icon: string | null;
426
+ color: string | null;
427
+ parentId: string | null;
428
+ sortOrder: number;
429
+ createdAt: string;
430
+ updatedAt: string;
431
+ }
432
+ interface NewNoteFolder {
433
+ name: string;
434
+ icon?: string | null;
435
+ color?: string | null;
436
+ parentId?: string | null;
437
+ sortOrder?: number;
438
+ }
439
+ interface Note {
440
+ id: string;
441
+ userId: string;
442
+ folderId: string | null;
443
+ title: string;
444
+ noteType: NoteType;
445
+ content: string | null;
446
+ externalUrl: string | null;
447
+ externalService: string | null;
448
+ icon: string | null;
449
+ tags: string | null;
450
+ isPinned: boolean;
451
+ lastAccessedAt: string | null;
452
+ createdAt: string;
453
+ updatedAt: string;
454
+ }
455
+ interface NewNote {
456
+ folderId?: string | null;
457
+ title: string;
458
+ noteType: NoteType;
459
+ content?: string | null;
460
+ externalUrl?: string | null;
461
+ externalService?: string | null;
462
+ icon?: string | null;
463
+ tags?: string | null;
464
+ isPinned?: boolean;
465
+ }
466
+ interface NoteFilters {
467
+ folderId?: string;
468
+ noteType?: NoteType;
469
+ isPinned?: boolean;
470
+ search?: string;
471
+ }
472
+
473
+ export type { ParsedWeeklyPlan as $, NewHealthCompletion as A, BankConnectionStatus as B, ChatMessageRole as C, HealthHabitFilters as D, ExpenseCategory as E, FocusCategory as F, HealthCompletionFilters as G, HealthCategory as H, IncomeCategory as I, HealthStats as J, ExchangeRate as K, LieuDayType as L, DailyPriority as M, NewExpenseCategory as N, DailyPlan as O, NewDailyPlan as P, ParsedDailyPlan as Q, MealType as R, Setting as S, TransactionType as T, MealPlan as U, NewMealPlan as V, PrepSession as W, NewPrepSession as X, FocusArea as Y, WeeklyPlan as Z, NewWeeklyPlan as _, Expense as a, NoteType as a0, NoteFolder as a1, NewNoteFolder as a2, Note as a3, NewNote as a4, NoteFilters as a5, NewExpense as b, NewIncomeCategory as c, Income as d, NewIncome as e, NewFocusCategory as f, FocusSessionStatus as g, FocusSession as h, NewFocusSession as i, FocusSessionFilters as j, ChatConversation as k, NewChatConversation as l, ChatMessage as m, NewChatMessage as n, EFLink as o, NewEFLink as p, LieuDay as q, NewLieuDay as r, BankConnection as s, BankTransaction as t, NewHealthCategory as u, HealthFrequencyType as v, HealthFrequencyConfig as w, HealthHabit as x, NewHealthHabit as y, HealthCompletion as z };