90dc-core 1.12.3 → 1.12.5
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.
- package/dist/lib/dbmodels/diet/DietMeal.d.ts +4 -0
- package/dist/lib/dbmodels/diet/DietMeal.d.ts.map +1 -1
- package/dist/lib/dbmodels/diet/DietMeal.js +3 -0
- package/dist/lib/dbmodels/diet/DietMeal.js.map +1 -1
- package/dist/lib/dbmodels/diet/DietMealRecipe.d.ts +1 -1
- package/dist/lib/dbmodels/diet/DietMealRecipe.d.ts.map +1 -1
- package/dist/lib/dbmodels/diet/DietMealRecipe.js +5 -2
- package/dist/lib/dbmodels/diet/DietMealRecipe.js.map +1 -1
- package/dist/lib/dbmodels/diet/DietProgram.d.ts +6 -0
- package/dist/lib/dbmodels/diet/DietProgram.d.ts.map +1 -1
- package/dist/lib/dbmodels/diet/DietProgram.js +37 -0
- package/dist/lib/dbmodels/diet/DietProgram.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,5 +19,9 @@ export declare class DietMeal extends Model<DietMeal> {
|
|
|
19
19
|
protein: number | null;
|
|
20
20
|
fat: number | null;
|
|
21
21
|
carbs: number | null;
|
|
22
|
+
ingredientOverrides: Array<{
|
|
23
|
+
ingredientUuid: string;
|
|
24
|
+
grams: number;
|
|
25
|
+
}> | null;
|
|
22
26
|
}
|
|
23
27
|
//# sourceMappingURL=DietMeal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DietMeal.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietMeal.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,qBACa,QAAS,SAAQ,KAAK,CAAC,QAAQ,CAAC;IAInC,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAGpB,GAAG,EAAE,OAAO,CAAC;IAMb,OAAO,EAAE,cAAc,EAAE,CAAC;IAG1B,IAAI,EAAE,QAAQ,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;IAId,UAAU,EAAE,OAAO,CAAC;IAGpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DietMeal.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietMeal.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,qBACa,QAAS,SAAQ,KAAK,CAAC,QAAQ,CAAC;IAInC,IAAI,EAAE,MAAM,CAAC;IAKb,WAAW,EAAE,MAAM,CAAC;IAGpB,GAAG,EAAE,OAAO,CAAC;IAMb,OAAO,EAAE,cAAc,EAAE,CAAC;IAG1B,IAAI,EAAE,QAAQ,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;IAId,UAAU,EAAE,OAAO,CAAC;IAGpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAGvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,mBAAmB,EAAE,KAAK,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACtF"}
|
|
@@ -57,6 +57,9 @@ _ts_decorate([
|
|
|
57
57
|
_ts_decorate([
|
|
58
58
|
Column(DataType.FLOAT)
|
|
59
59
|
], DietMeal.prototype, "carbs", void 0);
|
|
60
|
+
_ts_decorate([
|
|
61
|
+
Column(DataType.JSONB)
|
|
62
|
+
], DietMeal.prototype, "ingredientOverrides", void 0);
|
|
60
63
|
DietMeal = _ts_decorate([
|
|
61
64
|
Table
|
|
62
65
|
], DietMeal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietMeal.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Index,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { DietDay } from \"./DietDay.js\";\nimport { DietMealRecipe } from \"./DietMealRecipe.js\";\n\nexport enum MealType {\n BREAKFAST = \"breakfast\",\n LUNCH = \"lunch\",\n DINNER = \"dinner\",\n SNACK = \"snack\",\n}\n\n@Table\nexport class DietMeal extends Model<DietMeal> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Index\n @ForeignKey(() => DietDay)\n @Column(DataType.UUID)\n declare dietDayUuid: string;\n\n @BelongsTo(() => DietDay)\n declare day: DietDay;\n\n @HasMany(() => DietMealRecipe, {\n foreignKey: \"dietMealUuid\",\n onDelete: \"CASCADE\",\n })\n declare recipes: DietMealRecipe[];\n\n @Column(DataType.ENUM(...Object.values(MealType)))\n declare type: MealType;\n\n @Column(DataType.INTEGER)\n declare order: number;\n\n @Default(false)\n @Column(DataType.BOOLEAN)\n declare isFinished: boolean;\n\n @Column(DataType.INTEGER)\n declare calories: number | null;\n\n @Column(DataType.FLOAT)\n declare protein: number | null;\n\n @Column(DataType.FLOAT)\n declare fat: number | null;\n\n @Column(DataType.FLOAT)\n declare carbs: number | null;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Index","Model","PrimaryKey","Table","DietDay","DietMealRecipe","MealType","DietMeal","UUIDV4","UUID","foreignKey","onDelete","ENUM","values","INTEGER","BOOLEAN","FLOAT"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,cAAc,QAAQ,sBAAsB;AAErD,OAAO,IAAA,AAAKC,kCAAAA;;;;;WAAAA;MAKX;AAGD,OAAO,MAAMC,iBAAiBN;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietMeal.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Index,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { DietDay } from \"./DietDay.js\";\nimport { DietMealRecipe } from \"./DietMealRecipe.js\";\n\nexport enum MealType {\n BREAKFAST = \"breakfast\",\n LUNCH = \"lunch\",\n DINNER = \"dinner\",\n SNACK = \"snack\",\n}\n\n@Table\nexport class DietMeal extends Model<DietMeal> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Index\n @ForeignKey(() => DietDay)\n @Column(DataType.UUID)\n declare dietDayUuid: string;\n\n @BelongsTo(() => DietDay)\n declare day: DietDay;\n\n @HasMany(() => DietMealRecipe, {\n foreignKey: \"dietMealUuid\",\n onDelete: \"CASCADE\",\n })\n declare recipes: DietMealRecipe[];\n\n @Column(DataType.ENUM(...Object.values(MealType)))\n declare type: MealType;\n\n @Column(DataType.INTEGER)\n declare order: number;\n\n @Default(false)\n @Column(DataType.BOOLEAN)\n declare isFinished: boolean;\n\n @Column(DataType.INTEGER)\n declare calories: number | null;\n\n @Column(DataType.FLOAT)\n declare protein: number | null;\n\n @Column(DataType.FLOAT)\n declare fat: number | null;\n\n @Column(DataType.FLOAT)\n declare carbs: number | null;\n\n @Column(DataType.JSONB)\n declare ingredientOverrides: Array<{ ingredientUuid: string; grams: number }> | null;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Index","Model","PrimaryKey","Table","DietDay","DietMealRecipe","MealType","DietMeal","UUIDV4","UUID","foreignKey","onDelete","ENUM","values","INTEGER","BOOLEAN","FLOAT","JSONB"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,cAAc,QAAQ,sBAAsB;AAErD,OAAO,IAAA,AAAKC,kCAAAA;;;;;WAAAA;MAKX;AAGD,OAAO,MAAMC,iBAAiBN;AA4C9B;;;qBA1CoBO;oBACDC;;;;mBAICL;oBACDK;;;kBAGAL;;;gBAGFC;QACbK,YAAY;QACZC,UAAU;;;;oBAIKC,eAAeC;;;oBAGfC;;;;oBAIAC;;;oBAGAD;;;oBAGAE;;;oBAGAA;;;oBAGAA;;;oBAGAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DietMealRecipe.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietMealRecipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAQN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBACa,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC;IAI/C,IAAI,EAAE,MAAM,CAAC;IAKb,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,QAAQ,CAAC;IAGf,
|
|
1
|
+
{"version":3,"file":"DietMealRecipe.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietMealRecipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EAQN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBACa,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC;IAI/C,IAAI,EAAE,MAAM,CAAC;IAKb,YAAY,EAAE,MAAM,CAAC;IAGrB,IAAI,EAAE,QAAQ,CAAC;IAGf,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAG/B,UAAU,EAAE,GAAG,CAAC;CACzB"}
|
|
@@ -24,8 +24,11 @@ _ts_decorate([
|
|
|
24
24
|
})
|
|
25
25
|
], DietMealRecipe.prototype, "meal", void 0);
|
|
26
26
|
_ts_decorate([
|
|
27
|
-
Column(
|
|
28
|
-
|
|
27
|
+
Column({
|
|
28
|
+
type: DataType.INTEGER,
|
|
29
|
+
allowNull: true
|
|
30
|
+
})
|
|
31
|
+
], DietMealRecipe.prototype, "fitChefRecipeId", void 0);
|
|
29
32
|
_ts_decorate([
|
|
30
33
|
Column(DataType.JSONB)
|
|
31
34
|
], DietMealRecipe.prototype, "recipeJson", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietMealRecipe.ts"],"sourcesContent":["import {\n Table,\n Model,\n Column,\n DataType,\n Default,\n PrimaryKey,\n ForeignKey,\n BelongsTo,\n Index,\n} from \"sequelize-typescript\";\nimport { DietMeal } from \"./DietMeal.js\";\n\n@Table\nexport class DietMealRecipe extends Model<DietMealRecipe> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Index\n @ForeignKey(() => DietMeal)\n @Column(DataType.UUID)\n declare dietMealUuid: string;\n\n @BelongsTo(() => DietMeal, { onDelete: \"CASCADE\" })\n declare meal: DietMeal;\n\n @Column(DataType.INTEGER)\n declare
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietMealRecipe.ts"],"sourcesContent":["import {\n Table,\n Model,\n Column,\n DataType,\n Default,\n PrimaryKey,\n ForeignKey,\n BelongsTo,\n Index,\n} from \"sequelize-typescript\";\nimport { DietMeal } from \"./DietMeal.js\";\n\n@Table\nexport class DietMealRecipe extends Model<DietMealRecipe> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @Index\n @ForeignKey(() => DietMeal)\n @Column(DataType.UUID)\n declare dietMealUuid: string;\n\n @BelongsTo(() => DietMeal, { onDelete: \"CASCADE\" })\n declare meal: DietMeal;\n\n @Column({ type: DataType.INTEGER, allowNull: true })\n declare fitChefRecipeId: number | null;\n\n @Column(DataType.JSONB)\n declare recipeJson: any;\n}\n"],"names":["Table","Model","Column","DataType","Default","PrimaryKey","ForeignKey","BelongsTo","Index","DietMeal","DietMealRecipe","UUIDV4","UUID","onDelete","type","INTEGER","allowNull","JSONB"],"mappings":";;;;;;AAAA,SACEA,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,UAAU,EACVC,SAAS,EACTC,KAAK,QACA,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,gBAAgB;AAGzC,OAAO,MAAMC,uBAAuBT;AAmBpC;;;qBAjBoBU;oBACDC;;;;mBAICH;oBACDG;;;kBAGAH;QAAYI,UAAU;;;;;QAG7BC,MAAMX,SAASY,OAAO;QAAEC,WAAW;;;;oBAG5BC"}
|
|
@@ -6,6 +6,12 @@ export declare class DietProgram extends Model<DietProgram> {
|
|
|
6
6
|
userUuid: string;
|
|
7
7
|
startDate: Date;
|
|
8
8
|
title: string;
|
|
9
|
+
dailyCalories: number | null;
|
|
10
|
+
dailyProtein: number | null;
|
|
11
|
+
dailyCarbs: number | null;
|
|
12
|
+
dailyFats: number | null;
|
|
13
|
+
numberOfDays: number | null;
|
|
14
|
+
status: 'pending' | 'completed' | 'failed';
|
|
9
15
|
days: DietDay[];
|
|
10
16
|
shoppingLists: ShoppingList[];
|
|
11
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DietProgram.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietProgram.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAUa,WAAY,SAAQ,KAAK,CAAC,WAAW,CAAC;IAIzC,IAAI,EAAE,MAAM,CAAC;IAIb,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,IAAI,CAAC;IAGhB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DietProgram.d.ts","sourceRoot":"","sources":["../../../../src/lib/dbmodels/diet/DietProgram.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAGN,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAUa,WAAY,SAAQ,KAAK,CAAC,WAAW,CAAC;IAIzC,IAAI,EAAE,MAAM,CAAC;IAIb,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,IAAI,CAAC;IAGhB,KAAK,EAAE,MAAM,CAAC;IAGd,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAG7B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAG1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAGzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAO5B,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAM3C,IAAI,EAAE,OAAO,EAAE,CAAC;IAMhB,aAAa,EAAE,YAAY,EAAE,CAAC;CACvC"}
|
|
@@ -31,6 +31,43 @@ _ts_decorate([
|
|
|
31
31
|
allowNull: true
|
|
32
32
|
})
|
|
33
33
|
], DietProgram.prototype, "title", void 0);
|
|
34
|
+
_ts_decorate([
|
|
35
|
+
Column({
|
|
36
|
+
type: DataType.INTEGER,
|
|
37
|
+
allowNull: true
|
|
38
|
+
})
|
|
39
|
+
], DietProgram.prototype, "dailyCalories", void 0);
|
|
40
|
+
_ts_decorate([
|
|
41
|
+
Column({
|
|
42
|
+
type: DataType.FLOAT,
|
|
43
|
+
allowNull: true
|
|
44
|
+
})
|
|
45
|
+
], DietProgram.prototype, "dailyProtein", void 0);
|
|
46
|
+
_ts_decorate([
|
|
47
|
+
Column({
|
|
48
|
+
type: DataType.FLOAT,
|
|
49
|
+
allowNull: true
|
|
50
|
+
})
|
|
51
|
+
], DietProgram.prototype, "dailyCarbs", void 0);
|
|
52
|
+
_ts_decorate([
|
|
53
|
+
Column({
|
|
54
|
+
type: DataType.FLOAT,
|
|
55
|
+
allowNull: true
|
|
56
|
+
})
|
|
57
|
+
], DietProgram.prototype, "dailyFats", void 0);
|
|
58
|
+
_ts_decorate([
|
|
59
|
+
Column({
|
|
60
|
+
type: DataType.INTEGER,
|
|
61
|
+
allowNull: true
|
|
62
|
+
})
|
|
63
|
+
], DietProgram.prototype, "numberOfDays", void 0);
|
|
64
|
+
_ts_decorate([
|
|
65
|
+
Column({
|
|
66
|
+
type: DataType.ENUM('pending', 'completed', 'failed'),
|
|
67
|
+
allowNull: false,
|
|
68
|
+
defaultValue: 'pending'
|
|
69
|
+
})
|
|
70
|
+
], DietProgram.prototype, "status", void 0);
|
|
34
71
|
_ts_decorate([
|
|
35
72
|
HasMany(()=>DietDay, {
|
|
36
73
|
foreignKey: "dietProgramUuid",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietProgram.ts"],"sourcesContent":["import {\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../user/PersistedUser.js\";\nimport { DietDay } from \"./DietDay.js\";\nimport { ShoppingList } from \"./ShoppingList.js\";\n\n@Table({\n timestamps: true,\n indexes: [\n {\n unique: true,\n fields: [\"userUuid\"],\n name: \"unique_user_diet_program\",\n },\n ],\n})\nexport class DietProgram extends Model<DietProgram> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare userUuid: string;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare startDate: Date;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare title: string;\n\n @HasMany(() => DietDay, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare days: DietDay[];\n\n @HasMany(() => ShoppingList, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare shoppingLists: ShoppingList[];\n}\n"],"names":["Column","DataType","Default","ForeignKey","HasMany","Model","PrimaryKey","Table","PersistedUser","DietDay","ShoppingList","DietProgram","UUIDV4","UUID","type","DATE","allowNull","STRING","foreignKey","onDelete","timestamps","indexes","unique","fields","name"],"mappings":";;;;;;AAAA,SACEA,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,YAAY,QAAQ,oBAAoB;AAYjD,OAAO,MAAMC,oBAAoBN;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/diet/DietProgram.ts"],"sourcesContent":["import {\n Column,\n DataType,\n Default,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../user/PersistedUser.js\";\nimport { DietDay } from \"./DietDay.js\";\nimport { ShoppingList } from \"./ShoppingList.js\";\n\n@Table({\n timestamps: true,\n indexes: [\n {\n unique: true,\n fields: [\"userUuid\"],\n name: \"unique_user_diet_program\",\n },\n ],\n})\nexport class DietProgram extends Model<DietProgram> {\n @PrimaryKey\n @Default(DataType.UUIDV4)\n @Column(DataType.UUID)\n declare uuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare userUuid: string;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare startDate: Date;\n\n @Column({ type: DataType.STRING, allowNull: true })\n declare title: string;\n\n @Column({ type: DataType.INTEGER, allowNull: true })\n declare dailyCalories: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyProtein: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyCarbs: number | null;\n\n @Column({ type: DataType.FLOAT, allowNull: true })\n declare dailyFats: number | null;\n\n @Column({ type: DataType.INTEGER, allowNull: true })\n declare numberOfDays: number | null;\n\n @Column({\n type: DataType.ENUM('pending', 'completed', 'failed'),\n allowNull: false,\n defaultValue: 'pending'\n })\n declare status: 'pending' | 'completed' | 'failed';\n\n @HasMany(() => DietDay, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare days: DietDay[];\n\n @HasMany(() => ShoppingList, {\n foreignKey: \"dietProgramUuid\",\n onDelete: \"CASCADE\",\n })\n declare shoppingLists: ShoppingList[];\n}\n"],"names":["Column","DataType","Default","ForeignKey","HasMany","Model","PrimaryKey","Table","PersistedUser","DietDay","ShoppingList","DietProgram","UUIDV4","UUID","type","DATE","allowNull","STRING","INTEGER","FLOAT","ENUM","defaultValue","foreignKey","onDelete","timestamps","indexes","unique","fields","name"],"mappings":";;;;;;AAAA,SACEA,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,2BAA2B;AACzD,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,YAAY,QAAQ,oBAAoB;AAYjD,OAAO,MAAMC,oBAAoBN;AAiDjC;;;qBA/CoBO;oBACDC;;;mBAGCL;oBACDK;;;;QAGPC,MAAMb,SAASc,IAAI;QAAEC,WAAW;;;;;QAGhCF,MAAMb,SAASgB,MAAM;QAAED,WAAW;;;;;QAGlCF,MAAMb,SAASiB,OAAO;QAAEF,WAAW;;;;;QAGnCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASkB,KAAK;QAAEH,WAAW;;;;;QAGjCF,MAAMb,SAASiB,OAAO;QAAEF,WAAW;;;;;QAI3CF,MAAMb,SAASmB,IAAI,CAAC,WAAW,aAAa;QAC5CJ,WAAW;QACXK,cAAc;;;;gBAIDZ;QACba,YAAY;QACZC,UAAU;;;;gBAIGb;QACbY,YAAY;QACZC,UAAU;;;;;QAvDZC,YAAY;QACZC,SAAS;YACP;gBACEC,QAAQ;gBACRC,QAAQ;oBAAC;iBAAW;gBACpBC,MAAM;YACR;SACD"}
|