build: add TypeScript configuration and generate declaration files
- 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
This commit is contained in:
63
src/models/food-item.model.ts
Normal file
63
src/models/food-item.model.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import { Column, Model, Table, HasMany, DataType } from 'sequelize-typescript';
|
||||
import { MealFood } from './meal-food.model';
|
||||
import { PlannedFood } from './planned-food.model';
|
||||
|
||||
@Table
|
||||
export class FoodItem extends Model {
|
||||
@Column({ allowNull: false })
|
||||
name: string;
|
||||
|
||||
@Column
|
||||
name_tagalog: string;
|
||||
|
||||
@Column
|
||||
category: string;
|
||||
|
||||
@Column({ type: DataType.FLOAT, allowNull: false })
|
||||
calories: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
protein_g: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
carbs_g: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
fat_g: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
fiber_g: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
sugar_g: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 0 })
|
||||
sodium_mg: number;
|
||||
|
||||
@Column({ type: DataType.FLOAT, defaultValue: 100 })
|
||||
serving_size_g: number;
|
||||
|
||||
@Column
|
||||
serving_description: string;
|
||||
|
||||
@Column({ defaultValue: 'manual' })
|
||||
source: string;
|
||||
|
||||
@Column({ defaultValue: false })
|
||||
is_filipino: boolean;
|
||||
|
||||
@Column({ defaultValue: false })
|
||||
is_favorite: boolean;
|
||||
|
||||
@Column(DataType.TEXT)
|
||||
api_data: string;
|
||||
|
||||
@Column({ defaultValue: DataType.NOW })
|
||||
last_updated: Date;
|
||||
|
||||
@HasMany(() => MealFood)
|
||||
mealFoods: MealFood[];
|
||||
|
||||
@HasMany(() => PlannedFood)
|
||||
plannedFoods: PlannedFood[];
|
||||
}
|
||||
Reference in New Issue
Block a user