90dc-core 1.9.4 → 1.9.6
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/PersistedUser.d.ts +3 -0
- package/dist/lib/dbmodels/PersistedUser.js +13 -1
- package/dist/lib/dbmodels/PersistedUser.js.map +1 -1
- package/dist/lib/dbmodels/UserCoach.d.ts +5 -0
- package/dist/lib/dbmodels/UserCoach.js +23 -0
- package/dist/lib/dbmodels/UserCoach.js.map +1 -0
- package/dist/lib/dbmodels/program/CustomProgramBlueprint.d.ts +3 -0
- package/dist/lib/dbmodels/program/CustomProgramBlueprint.js +12 -1
- package/dist/lib/dbmodels/program/CustomProgramBlueprint.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/dbmodels/PersistedUser.ts +21 -1
- package/src/lib/dbmodels/UserCoach.ts +13 -0
- package/src/lib/dbmodels/program/CustomProgramBlueprint.ts +13 -1
|
@@ -4,7 +4,7 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
|
|
|
4
4
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table } from "sequelize-typescript";
|
|
7
|
+
import { BelongsTo, BelongsToMany, Column, DataType, Default, HasMany, HasOne, Index, Model, Table } from "sequelize-typescript";
|
|
8
8
|
import { Subscription } from "./Subscription";
|
|
9
9
|
import { UserPrograms } from "./nonconsprogram/UserNonConsumableProgram";
|
|
10
10
|
import { NonConsumableProgram } from "./nonconsprogram/NonConsumableProgram";
|
|
@@ -191,6 +191,18 @@ __decorate([
|
|
|
191
191
|
through: ()=>UserPrograms
|
|
192
192
|
})
|
|
193
193
|
], PersistedUser.prototype, "nonConsumablePrograms", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
Column({
|
|
196
|
+
type: DataType.UUID,
|
|
197
|
+
allowNull: true
|
|
198
|
+
})
|
|
199
|
+
], PersistedUser.prototype, "coachUuid", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
BelongsTo(()=>PersistedUser, 'coachUuid')
|
|
202
|
+
], PersistedUser.prototype, "coach", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
HasMany(()=>PersistedUser, 'coachUuid')
|
|
205
|
+
], PersistedUser.prototype, "clients", void 0);
|
|
194
206
|
PersistedUser = __decorate([
|
|
195
207
|
Table
|
|
196
208
|
], PersistedUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {BelongsToMany
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {\n BelongsTo,\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n HasOne,\n Index,\n Model,\n Table\n} from \"sequelize-typescript\";\nimport { Subscription } from \"./Subscription\";\nimport {UserPrograms} from \"./nonconsprogram/UserNonConsumableProgram\";\nimport {NonConsumableProgram} from \"./nonconsprogram/NonConsumableProgram\";\n\n@Table\nexport class PersistedUser extends Model {\n\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true\n })\n declare userUuid: string;\n\n @Index\n @Column({ type: DataType.TEXT, allowNull: false, unique: false })\n declare email: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare password: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare firstName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare lastName?: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare avatar: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare sex: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare goal: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare isFreeVersion: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare allowsEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare gotParentalConsent: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weightGoal: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare role: 'default' | 'admin';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare level: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare type: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare days: number;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare dateOfBirth: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare metricSystem: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare height: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare weight: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare activeProgramId: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare registrationService: 'apple' | 'google' | 'facebook' | 'native';\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare utilityEmail: string;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare emailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare utilityEmailConfirmed: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeEmail: boolean;\n\n @Column({ type: DataType.BOOLEAN, allowNull: true })\n declare changeUtilityEmail: boolean;\n\n @HasOne(() => Subscription)\n declare subscription: Subscription;\n\n @BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })\n declare nonConsumablePrograms: NonConsumableProgram[];\n\n @Column({ type: DataType.UUID, allowNull: true })\n declare coachUuid?: string;\n\n @BelongsTo(() => PersistedUser, 'coachUuid')\n declare coach?: PersistedUser;\n\n @HasMany(() => PersistedUser, 'coachUuid')\n declare clients?: PersistedUser[];\n}\n"],"names":["BelongsTo","BelongsToMany","Column","DataType","Default","HasMany","HasOne","Index","Model","Table","Subscription","UserPrograms","NonConsumableProgram","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN","through"],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Column, DataType, ForeignKey, Model, Table } from "sequelize-typescript";
|
|
8
|
+
import { PersistedUser } from "./PersistedUser";
|
|
9
|
+
export let UserCoach = class UserCoach extends Model {
|
|
10
|
+
};
|
|
11
|
+
__decorate([
|
|
12
|
+
ForeignKey(()=>PersistedUser),
|
|
13
|
+
Column(DataType.UUID)
|
|
14
|
+
], UserCoach.prototype, "userUuid", void 0);
|
|
15
|
+
__decorate([
|
|
16
|
+
ForeignKey(()=>PersistedUser),
|
|
17
|
+
Column(DataType.UUID)
|
|
18
|
+
], UserCoach.prototype, "coachUuid", void 0);
|
|
19
|
+
UserCoach = __decorate([
|
|
20
|
+
Table
|
|
21
|
+
], UserCoach);
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=UserCoach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/dbmodels/UserCoach.ts"],"sourcesContent":["import { Column, DataType, ForeignKey, Model, Table } from \"sequelize-typescript\";\nimport { PersistedUser } from \"./PersistedUser\";\n\n@Table\nexport class UserCoach extends Model {\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare userUuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column(DataType.UUID)\n declare coachUuid: string;\n}\n"],"names":["Column","DataType","ForeignKey","Model","Table","PersistedUser","UserCoach","UUID"],"mappings":";;;;;;AAAA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAEC,KAAK,QAAQ,uBAAuB;AAClF,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,WAAaC,YAAN,wBAAwBH;AAQ/B,EAAC;;IAPID,WAAW,IAAMG;IACjBL,OAAOC,SAASM,IAAI;GAFZD;;IAKRJ,WAAW,IAAMG;IACjBL,OAAOC,SAASM,IAAI;GANZD;AAAAA;IADZF;GACYE"}
|
|
@@ -3,8 +3,10 @@ import { RestDay } from "./RestDay.js";
|
|
|
3
3
|
import { ChallengeBlueprint } from "./ChallengeBlueprint.js";
|
|
4
4
|
import { CustomStrengthTest } from "./CustomStrengthTest.js";
|
|
5
5
|
import { CustomWorkoutBlueprint } from "./CustomWorkoutBlueprint.js";
|
|
6
|
+
import { PersistedUser } from "../PersistedUser.js";
|
|
6
7
|
export declare class CustomProgramBlueprint extends Model {
|
|
7
8
|
uuid: string;
|
|
9
|
+
createdBy: string;
|
|
8
10
|
title: string;
|
|
9
11
|
level: string;
|
|
10
12
|
numberOfDays: number;
|
|
@@ -12,4 +14,5 @@ export declare class CustomProgramBlueprint extends Model {
|
|
|
12
14
|
restDays: RestDay[];
|
|
13
15
|
challenges: ChallengeBlueprint[];
|
|
14
16
|
strengthTests: CustomStrengthTest[];
|
|
17
|
+
user: PersistedUser;
|
|
15
18
|
}
|
|
@@ -4,11 +4,12 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
|
|
|
4
4
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Column, DataType, Default, HasMany, Model, Table } from "sequelize-typescript";
|
|
7
|
+
import { BelongsTo, Column, DataType, Default, ForeignKey, HasMany, Model, Table } from "sequelize-typescript";
|
|
8
8
|
import { RestDay } from "./RestDay.js";
|
|
9
9
|
import { ChallengeBlueprint } from "./ChallengeBlueprint.js";
|
|
10
10
|
import { CustomStrengthTest } from "./CustomStrengthTest.js";
|
|
11
11
|
import { CustomWorkoutBlueprint } from "./CustomWorkoutBlueprint.js";
|
|
12
|
+
import { PersistedUser } from "../PersistedUser.js";
|
|
12
13
|
export let CustomProgramBlueprint = class CustomProgramBlueprint extends Model {
|
|
13
14
|
};
|
|
14
15
|
__decorate([
|
|
@@ -20,6 +21,13 @@ __decorate([
|
|
|
20
21
|
primaryKey: true
|
|
21
22
|
})
|
|
22
23
|
], CustomProgramBlueprint.prototype, "uuid", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
ForeignKey(()=>PersistedUser),
|
|
26
|
+
Column({
|
|
27
|
+
type: DataType.UUID,
|
|
28
|
+
allowNull: true
|
|
29
|
+
})
|
|
30
|
+
], CustomProgramBlueprint.prototype, "createdBy", void 0);
|
|
23
31
|
__decorate([
|
|
24
32
|
Column({
|
|
25
33
|
type: DataType.STRING,
|
|
@@ -59,6 +67,9 @@ __decorate([
|
|
|
59
67
|
foreignKey: "blueprintUuid"
|
|
60
68
|
})
|
|
61
69
|
], CustomProgramBlueprint.prototype, "strengthTests", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
BelongsTo(()=>PersistedUser)
|
|
72
|
+
], CustomProgramBlueprint.prototype, "user", void 0);
|
|
62
73
|
CustomProgramBlueprint = __decorate([
|
|
63
74
|
Table
|
|
64
75
|
], CustomProgramBlueprint);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/dbmodels/program/CustomProgramBlueprint.ts"],"sourcesContent":["import {\n Column,\n DataType,\n Default,\n HasMany, Index,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {RestDay} from \"./RestDay.js\";\nimport {ChallengeBlueprint} from \"./ChallengeBlueprint.js\";\nimport {CustomStrengthTest} from \"./CustomStrengthTest.js\";\nimport {CustomWorkoutBlueprint} from \"./CustomWorkoutBlueprint.js\";\n\n@Table\nexport class CustomProgramBlueprint extends Model {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare uuid: string;\n\n @Column({ type: DataType.STRING, allowNull: false, unique: true })\n declare title: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare level: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare numberOfDays: number;\n\n @HasMany(() => CustomWorkoutBlueprint, { foreignKey: \"blueprintUuid\" })\n declare workouts: CustomWorkoutBlueprint[];\n\n @HasMany(() => RestDay, { foreignKey: \"blueprintUuid\" })\n declare restDays: RestDay[];\n\n @HasMany(() => ChallengeBlueprint, { foreignKey: \"blueprintUuid\" })\n declare challenges: ChallengeBlueprint[];\n\n @HasMany(() => CustomStrengthTest, { foreignKey: \"blueprintUuid\" })\n declare strengthTests: CustomStrengthTest[];\n}\n"],"names":["Column","DataType","Default","HasMany","Model","Table","RestDay","ChallengeBlueprint","CustomStrengthTest","CustomWorkoutBlueprint","CustomProgramBlueprint","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","STRING","unique","INTEGER","foreignKey"],"mappings":";;;;;;AAAA,SACIA,MAAM,EACNC,QAAQ,EACRC,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/dbmodels/program/CustomProgramBlueprint.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default, ForeignKey,\n HasMany, Index,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {RestDay} from \"./RestDay.js\";\nimport {ChallengeBlueprint} from \"./ChallengeBlueprint.js\";\nimport {CustomStrengthTest} from \"./CustomStrengthTest.js\";\nimport {CustomWorkoutBlueprint} from \"./CustomWorkoutBlueprint.js\";\nimport {PersistedUser} from \"../PersistedUser.js\";\n\n@Table\nexport class CustomProgramBlueprint extends Model {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare uuid: string;\n\n @ForeignKey(() => PersistedUser)\n @Column({\n type: DataType.UUID,\n allowNull: true,\n })\n declare createdBy: string;\n\n @Column({ type: DataType.STRING, allowNull: false, unique: true })\n declare title: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare level: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare numberOfDays: number;\n\n @HasMany(() => CustomWorkoutBlueprint, { foreignKey: \"blueprintUuid\" })\n declare workouts: CustomWorkoutBlueprint[];\n\n @HasMany(() => RestDay, { foreignKey: \"blueprintUuid\" })\n declare restDays: RestDay[];\n\n @HasMany(() => ChallengeBlueprint, { foreignKey: \"blueprintUuid\" })\n declare challenges: ChallengeBlueprint[];\n\n @HasMany(() => CustomStrengthTest, { foreignKey: \"blueprintUuid\" })\n declare strengthTests: CustomStrengthTest[];\n\n @BelongsTo(() => PersistedUser)\n declare user: PersistedUser;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Model","Table","RestDay","ChallengeBlueprint","CustomStrengthTest","CustomWorkoutBlueprint","PersistedUser","CustomProgramBlueprint","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","STRING","unique","INTEGER","foreignKey"],"mappings":";;;;;;AAAA,SACIA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EAAEC,UAAU,EACnBC,OAAO,EACPC,KAAK,EACLC,KAAK,QACF,uBAAuB;AAC9B,SAAQC,OAAO,QAAO,eAAe;AACrC,SAAQC,kBAAkB,QAAO,0BAA0B;AAC3D,SAAQC,kBAAkB,QAAO,0BAA0B;AAC3D,SAAQC,sBAAsB,QAAO,8BAA8B;AACnE,SAAQC,aAAa,QAAO,sBAAsB;AAGlD,WAAaC,yBAAN,qCAAqCP;AAwC5C,EAAC;;IAvCIH,QAAQD,SAASY,MAAM;IACvBb,OAAO;QACJc,MAAMb,SAASc,IAAI;QACnBC,cAAcf,SAASc,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IACpB;GAPSN;;IAURT,WAAW,IAAMQ;IACjBX,OAAO;QACJc,MAAMb,SAASc,IAAI;QACnBE,WAAW,IAAI;IACnB;GAdSL;;IAiBRZ,OAAO;QAAEc,MAAMb,SAASkB,MAAM;QAAEF,WAAW,KAAK;QAAEG,QAAQ,IAAI;IAAC;GAjBvDR;;IAoBRZ,OAAO;QAAEc,MAAMb,SAASkB,MAAM;QAAEF,WAAW,KAAK;IAAC;GApBzCL;;IAuBRZ,OAAO;QAAEc,MAAMb,SAASoB,OAAO;QAAEJ,WAAW,KAAK;IAAC;GAvB1CL;;IA0BRR,QAAQ,IAAMM,wBAAwB;QAAEY,YAAY;IAAgB;GA1B5DV;;IA6BRR,QAAQ,IAAMG,SAAS;QAAEe,YAAY;IAAgB;GA7B7CV;;IAgCRR,QAAQ,IAAMI,oBAAoB;QAAEc,YAAY;IAAgB;GAhCxDV;;IAmCRR,QAAQ,IAAMK,oBAAoB;QAAEa,YAAY;IAAgB;GAnCxDV;;IAsCRb,UAAU,IAAMY;GAtCRC;AAAAA;IADZN;GACYM"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BelongsTo,
|
|
3
|
+
BelongsToMany,
|
|
4
|
+
Column,
|
|
5
|
+
DataType,
|
|
6
|
+
Default,
|
|
7
|
+
HasMany,
|
|
8
|
+
HasOne,
|
|
9
|
+
Index,
|
|
10
|
+
Model,
|
|
11
|
+
Table
|
|
12
|
+
} from "sequelize-typescript";
|
|
2
13
|
import { Subscription } from "./Subscription";
|
|
3
14
|
import {UserPrograms} from "./nonconsprogram/UserNonConsumableProgram";
|
|
4
15
|
import {NonConsumableProgram} from "./nonconsprogram/NonConsumableProgram";
|
|
@@ -102,4 +113,13 @@ export class PersistedUser extends Model {
|
|
|
102
113
|
|
|
103
114
|
@BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })
|
|
104
115
|
declare nonConsumablePrograms: NonConsumableProgram[];
|
|
116
|
+
|
|
117
|
+
@Column({ type: DataType.UUID, allowNull: true })
|
|
118
|
+
declare coachUuid?: string;
|
|
119
|
+
|
|
120
|
+
@BelongsTo(() => PersistedUser, 'coachUuid')
|
|
121
|
+
declare coach?: PersistedUser;
|
|
122
|
+
|
|
123
|
+
@HasMany(() => PersistedUser, 'coachUuid')
|
|
124
|
+
declare clients?: PersistedUser[];
|
|
105
125
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Column, DataType, ForeignKey, Model, Table } from "sequelize-typescript";
|
|
2
|
+
import { PersistedUser } from "./PersistedUser";
|
|
3
|
+
|
|
4
|
+
@Table
|
|
5
|
+
export class UserCoach extends Model {
|
|
6
|
+
@ForeignKey(() => PersistedUser)
|
|
7
|
+
@Column(DataType.UUID)
|
|
8
|
+
declare userUuid: string;
|
|
9
|
+
|
|
10
|
+
@ForeignKey(() => PersistedUser)
|
|
11
|
+
@Column(DataType.UUID)
|
|
12
|
+
declare coachUuid: string;
|
|
13
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BelongsTo,
|
|
2
3
|
Column,
|
|
3
4
|
DataType,
|
|
4
|
-
Default,
|
|
5
|
+
Default, ForeignKey,
|
|
5
6
|
HasMany, Index,
|
|
6
7
|
Model,
|
|
7
8
|
Table,
|
|
@@ -10,6 +11,7 @@ import {RestDay} from "./RestDay.js";
|
|
|
10
11
|
import {ChallengeBlueprint} from "./ChallengeBlueprint.js";
|
|
11
12
|
import {CustomStrengthTest} from "./CustomStrengthTest.js";
|
|
12
13
|
import {CustomWorkoutBlueprint} from "./CustomWorkoutBlueprint.js";
|
|
14
|
+
import {PersistedUser} from "../PersistedUser.js";
|
|
13
15
|
|
|
14
16
|
@Table
|
|
15
17
|
export class CustomProgramBlueprint extends Model {
|
|
@@ -22,6 +24,13 @@ export class CustomProgramBlueprint extends Model {
|
|
|
22
24
|
})
|
|
23
25
|
declare uuid: string;
|
|
24
26
|
|
|
27
|
+
@ForeignKey(() => PersistedUser)
|
|
28
|
+
@Column({
|
|
29
|
+
type: DataType.UUID,
|
|
30
|
+
allowNull: true,
|
|
31
|
+
})
|
|
32
|
+
declare createdBy: string;
|
|
33
|
+
|
|
25
34
|
@Column({ type: DataType.STRING, allowNull: false, unique: true })
|
|
26
35
|
declare title: string;
|
|
27
36
|
|
|
@@ -42,4 +51,7 @@ export class CustomProgramBlueprint extends Model {
|
|
|
42
51
|
|
|
43
52
|
@HasMany(() => CustomStrengthTest, { foreignKey: "blueprintUuid" })
|
|
44
53
|
declare strengthTests: CustomStrengthTest[];
|
|
54
|
+
|
|
55
|
+
@BelongsTo(() => PersistedUser)
|
|
56
|
+
declare user: PersistedUser;
|
|
45
57
|
}
|