- Add tsconfig.json for TypeScript compilation with declaration and source map generation - Generate .d.ts declaration files for all modules, services, controllers, and models - Update package.json with NestJS dependencies and TypeScript development tools - Include database files in the distribution output for persistence
34 lines
711 B
TypeScript
34 lines
711 B
TypeScript
import { Column, Model, Table, BelongsTo, ForeignKey, DataType } from 'sequelize-typescript';
|
|
import { User } from './user.model';
|
|
|
|
@Table
|
|
export class UserGoal extends Model {
|
|
@ForeignKey(() => User)
|
|
@Column
|
|
UserId: number;
|
|
|
|
@BelongsTo(() => User)
|
|
user: User;
|
|
|
|
@Column({ defaultValue: 'recomp' })
|
|
goal_type: string;
|
|
|
|
@Column(DataType.FLOAT)
|
|
target_weight_kg: number;
|
|
|
|
@Column({ type: DataType.FLOAT, defaultValue: 0.5 })
|
|
weekly_goal_kg: number;
|
|
|
|
@Column({ defaultValue: 150 })
|
|
target_protein_g: number;
|
|
|
|
@Column({ defaultValue: 200 })
|
|
target_carbs_g: number;
|
|
|
|
@Column({ defaultValue: 60 })
|
|
target_fat_g: number;
|
|
|
|
@Column({ defaultValue: 2000 })
|
|
target_water_ml: number;
|
|
}
|