cleanup
and AI recommnedation fix
This commit is contained in:
1 parent
670e6675cc
commit
8353a24f6b
17 files changed
+134
-138
No files matched your search
Generated
+21
@@ -8,12 +8,33 @@
|
||||
"name": "@fitai/shared",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"clsx": "^2.1.1",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"zod": "^4.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
},
|
||||
"node_modules/clsx": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
|
||||
"integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwind-merge": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz",
|
||||
"integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/dcastil"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"clsx": "^2.1.1",
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"zod": "^4.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,10 @@ export interface User {
|
||||
email: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
role: 'admin' | 'trainer' | 'client'
|
||||
password?: string
|
||||
phone?: string
|
||||
role: 'superAdmin' | 'admin' | 'trainer' | 'client'
|
||||
imageUrl?: string
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
@@ -11,18 +14,83 @@ export interface User {
|
||||
export interface Client {
|
||||
id: string
|
||||
userId: string
|
||||
user: User
|
||||
user?: User
|
||||
membershipType: 'basic' | 'premium' | 'vip'
|
||||
membershipStatus: 'active' | 'inactive' | 'suspended'
|
||||
membershipStatus: 'active' | 'inactive' | 'suspended' | 'expired'
|
||||
joinDate: Date
|
||||
lastVisit?: Date
|
||||
emergencyContact: {
|
||||
emergencyContact?: {
|
||||
name: string
|
||||
phone: string
|
||||
relationship: string
|
||||
}
|
||||
}
|
||||
|
||||
export interface FitnessProfile {
|
||||
id: string
|
||||
userId: string
|
||||
height: string
|
||||
weight: string
|
||||
age: string
|
||||
gender: "male" | "female" | "other"
|
||||
activityLevel: "sedentary" | "lightly_active" | "moderately_active" | "very_active" | "extremely_active"
|
||||
fitnessGoals: string[]
|
||||
exerciseHabits: string
|
||||
dietHabits: string
|
||||
medicalConditions: string
|
||||
allergies?: string
|
||||
injuries?: string
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
export interface Attendance {
|
||||
id: string
|
||||
userId: string
|
||||
clientId?: string
|
||||
client?: Client
|
||||
checkInTime: Date
|
||||
checkOutTime?: Date
|
||||
type: 'gym' | 'class' | 'personal_training'
|
||||
notes?: string
|
||||
createdAt?: Date
|
||||
}
|
||||
|
||||
export interface Recommendation {
|
||||
id: string
|
||||
userId: string
|
||||
fitnessProfileId?: string
|
||||
type: "short_term" | "medium_term" | "long_term" | "ai_plan"
|
||||
recommendationText: string
|
||||
activityPlan?: string
|
||||
dietPlan?: string
|
||||
status: "pending" | "approved" | "rejected" | "completed"
|
||||
createdAt: Date
|
||||
approvedAt?: Date
|
||||
approvedBy?: string
|
||||
}
|
||||
|
||||
export interface FitnessGoal {
|
||||
id: string
|
||||
userId: string
|
||||
fitnessProfileId?: string
|
||||
goalType: "weight_target" | "strength_milestone" | "endurance_target" | "flexibility_goal" | "habit_building" | "custom"
|
||||
title: string
|
||||
description?: string
|
||||
targetValue?: number
|
||||
currentValue?: number
|
||||
unit?: string
|
||||
startDate: Date
|
||||
targetDate?: Date
|
||||
completedDate?: Date
|
||||
status: "active" | "completed" | "abandoned" | "paused"
|
||||
progress: number
|
||||
priority: "low" | "medium" | "high"
|
||||
notes?: string
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
}
|
||||
|
||||
export interface Payment {
|
||||
id: string
|
||||
clientId: string
|
||||
@@ -36,16 +104,6 @@ export interface Payment {
|
||||
description: string
|
||||
}
|
||||
|
||||
export interface Attendance {
|
||||
id: string
|
||||
clientId: string
|
||||
client: Client
|
||||
checkInTime: Date
|
||||
checkOutTime?: Date
|
||||
type: 'gym' | 'class' | 'personal_training'
|
||||
notes?: string
|
||||
}
|
||||
|
||||
export interface Notification {
|
||||
id: string
|
||||
userId: string
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
export const formatDate = (date: Date): string => {
|
||||
import { type ClassValue, clsx } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
export const formatDate = (date: Date | string): string => {
|
||||
const d = new Date(date)
|
||||
return new Intl.DateTimeFormat('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
}).format(date)
|
||||
}).format(d)
|
||||
}
|
||||
|
||||
export const formatCurrency = (
|
||||
|
||||
Reference in new issue
Block a user