build errors fixed
This commit is contained in:
1 parent
d3a36b6103
commit
6580564767
8 files changed
+132
-93
No files matched your search
@@ -1,13 +1,21 @@
|
||||
import { User as SharedUser, Client, FitnessProfile, Attendance, Recommendation, FitnessGoal } from "@fitai/shared";
|
||||
import {
|
||||
User as SharedUser,
|
||||
Client,
|
||||
FitnessProfile,
|
||||
Attendance,
|
||||
Recommendation,
|
||||
FitnessGoal,
|
||||
} from "@fitai/shared";
|
||||
|
||||
// Database Entity Types
|
||||
export interface User extends SharedUser {
|
||||
// Explicitly include gymId so server imports can rely on it even if shared types lag behind build
|
||||
gymId?: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export type { Client, FitnessProfile, Attendance, Recommendation, FitnessGoal };
|
||||
|
||||
|
||||
// Database Interface - allows us to swap implementations
|
||||
export interface IDatabase {
|
||||
// Connection management
|
||||
@@ -58,7 +66,10 @@ export interface IDatabase {
|
||||
|
||||
// Recommendation operations
|
||||
createRecommendation(
|
||||
recommendation: Omit<Recommendation, "createdAt" | "approvedAt" | "approvedBy">,
|
||||
recommendation: Omit<
|
||||
Recommendation,
|
||||
"createdAt" | "approvedAt" | "approvedBy"
|
||||
>,
|
||||
): Promise<Recommendation>;
|
||||
getRecommendationsByUserId(userId: string): Promise<Recommendation[]>;
|
||||
getAllRecommendations(): Promise<Recommendation[]>;
|
||||
@@ -70,16 +81,22 @@ export interface IDatabase {
|
||||
|
||||
// Fitness Goals operations
|
||||
createFitnessGoal(
|
||||
goal: Omit<FitnessGoal, "createdAt" | "updatedAt">
|
||||
goal: Omit<FitnessGoal, "createdAt" | "updatedAt">,
|
||||
): Promise<FitnessGoal>;
|
||||
getFitnessGoalById(id: string): Promise<FitnessGoal | null>;
|
||||
getFitnessGoalsByUserId(userId: string, status?: string): Promise<FitnessGoal[]>;
|
||||
getFitnessGoalsByUserId(
|
||||
userId: string,
|
||||
status?: string,
|
||||
): Promise<FitnessGoal[]>;
|
||||
updateFitnessGoal(
|
||||
id: string,
|
||||
updates: Partial<FitnessGoal>
|
||||
updates: Partial<FitnessGoal>,
|
||||
): Promise<FitnessGoal | null>;
|
||||
deleteFitnessGoal(id: string): Promise<boolean>;
|
||||
updateGoalProgress(id: string, currentValue: number): Promise<FitnessGoal | null>;
|
||||
updateGoalProgress(
|
||||
id: string,
|
||||
currentValue: number,
|
||||
): Promise<FitnessGoal | null>;
|
||||
completeGoal(id: string): Promise<FitnessGoal | null>;
|
||||
|
||||
// Dashboard operations
|
||||
|
||||
Reference in new issue
Block a user