90dc-core 1.6.4 → 1.6.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.
@@ -1,5 +1,6 @@
1
1
  import { Model } from "sequelize-typescript";
2
- import type { Subscription } from "./Subscription";
2
+ import { Subscription } from "./Subscription";
3
+ import { NonConsumableProgram } from "./nonconsprogram/NonConsumableProgram";
3
4
  export declare class PersistedUser extends Model {
4
5
  userUuid: string;
5
6
  email: string;
@@ -30,4 +31,5 @@ export declare class PersistedUser extends Model {
30
31
  changeEmail: boolean;
31
32
  changeUtilityEmail: boolean;
32
33
  subscription: Subscription;
34
+ nonConsumablePrograms: NonConsumableProgram[];
33
35
  }
@@ -4,7 +4,10 @@ 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, HasOne, Index, Model, Table } from "sequelize-typescript";
7
+ import { BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table } from "sequelize-typescript";
8
+ import { Subscription } from "./Subscription";
9
+ import { UserPrograms } from "./nonconsprogram/UserNonConsumableProgram";
10
+ import { NonConsumableProgram } from "./nonconsprogram/NonConsumableProgram";
8
11
  export let PersistedUser = class PersistedUser extends Model {
9
12
  };
10
13
  __decorate([
@@ -181,8 +184,13 @@ __decorate([
181
184
  })
182
185
  ], PersistedUser.prototype, "changeUtilityEmail", void 0);
183
186
  __decorate([
184
- HasOne(()=>PersistedUser)
187
+ HasOne(()=>Subscription)
185
188
  ], PersistedUser.prototype, "subscription", void 0);
189
+ __decorate([
190
+ BelongsToMany(()=>NonConsumableProgram, {
191
+ through: ()=>UserPrograms
192
+ })
193
+ ], PersistedUser.prototype, "nonConsumablePrograms", void 0);
186
194
  PersistedUser = __decorate([
187
195
  Table
188
196
  ], PersistedUser);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {BelongsTo, Column, DataType, Default, HasOne, Index, Model, Table} from \"sequelize-typescript\";\nimport type { Subscription } from \"./Subscription\";\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(() => PersistedUser)\n declare subscription: Subscription;\n}\n"],"names":["Column","DataType","Default","HasOne","Index","Model","Table","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLEAN"],"mappings":";;;;;;AAAA,SAAmBA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,QAAO,uBAAuB;AAIvG,WAAaC,gBAAN,4BAA4BF;AA+FnC,EAAC;;IA7FEH,QAAQD,SAASO,MAAM;IACvBR,OAAO;QACNS,MAAMR,SAASS,IAAI;QACnBC,cAAcV,SAASS,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GARWN;;IAWVH;IACAJ,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;QAAEG,QAAQ,KAAK;IAAC;GAZpDR;;IAeVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAfrCL;;IAkBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GAlBpCL;;IAqBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GArBpCL;;IAwBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF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;GAxEpCL;;IA2EVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GA3EpCL;;IA8EVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GA9EpCL;;IAiFVP,OAAO;QAAES,MAAMR,SAASe,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAjFvCL;;IAoFVP,OAAO;QAAES,MAAMR,SAASe,OAAO;QAAEJ,WAAW,IAAI;IAAC;GApFvCL;;IAuFVP,OAAO;QAAES,MAAMR,SAASe,OAAO;QAAEJ,WAAW,IAAI;IAAC;GAvFvCL;;IA0FVP,OAAO;QAAES,MAAMR,SAASe,OAAO;QAAEJ,WAAW,IAAI;IAAC;GA1FvCL;;IA6FVJ,OAAO,IAAMI;GA7FHA;AAAAA;IADZD;GACYC"}
1
+ {"version":3,"sources":["../../../src/lib/dbmodels/PersistedUser.ts"],"sourcesContent":["import {BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table} 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"],"names":["BelongsToMany","Column","DataType","Default","HasOne","Index","Model","Table","Subscription","UserPrograms","NonConsumableProgram","PersistedUser","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","unique","BOOLE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AAO;QAAEJ,WAAW,IAAI;IAAC;GAvFvCL;;IA0FVV,OAAO;QAAEY,MAAMX,SAASkB,OAAO;QAAEJ,WAAW,IAAI;IAAC;GA1FvCL;;IA6FVP,OAAO,IAAMI;GA7FHG;;IAgGVX,cAAc,IAAMU,sBAAsB;QAAEW,SAAS,IAAMZ;IAAa;GAhG9DE;AAAAA;IADZJ;GACYI"}
@@ -0,0 +1,20 @@
1
+ import { Model } from "sequelize-typescript";
2
+ import { ConsumableProgramGoals, ConsumableProgramTypes, ConsumableProgramWeightGoals } from "../../enums/ProgramEnums";
3
+ import { TranslatedConsumableProgram } from "./TranslatedConsumableProgram";
4
+ import { PersistedUser } from "../PersistedUser";
5
+ export declare class NonConsumableProgram extends Model {
6
+ uuid: string;
7
+ title: string;
8
+ description: string;
9
+ coverImageUri: string;
10
+ order: number;
11
+ popularityOrder: number;
12
+ weightGoal: ConsumableProgramWeightGoals;
13
+ goal: ConsumableProgramGoals;
14
+ type: ConsumableProgramTypes;
15
+ isFree: boolean;
16
+ productIdAndroid: string | null;
17
+ productIdIos: string | null;
18
+ translatedPrograms: TranslatedConsumableProgram[];
19
+ user: PersistedUser[];
20
+ }
@@ -0,0 +1,103 @@
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 { BelongsToMany, Column, DataType, Default, HasMany, Model, Table } from "sequelize-typescript";
8
+ import { TranslatedConsumableProgram } from "./TranslatedConsumableProgram";
9
+ import { UserPrograms } from "./UserNonConsumableProgram";
10
+ import { PersistedUser } from "../PersistedUser";
11
+ export let NonConsumableProgram = class NonConsumableProgram extends Model {
12
+ };
13
+ __decorate([
14
+ Default(DataType.UUIDV4),
15
+ Column({
16
+ type: DataType.UUID,
17
+ defaultValue: DataType.UUID,
18
+ allowNull: false,
19
+ primaryKey: true
20
+ })
21
+ ], NonConsumableProgram.prototype, "uuid", void 0);
22
+ __decorate([
23
+ Column({
24
+ type: DataType.TEXT,
25
+ allowNull: false
26
+ })
27
+ ], NonConsumableProgram.prototype, "title", void 0);
28
+ __decorate([
29
+ Column({
30
+ type: DataType.TEXT,
31
+ allowNull: false
32
+ })
33
+ ], NonConsumableProgram.prototype, "description", void 0);
34
+ __decorate([
35
+ Column({
36
+ type: DataType.TEXT,
37
+ allowNull: false
38
+ })
39
+ ], NonConsumableProgram.prototype, "coverImageUri", void 0);
40
+ __decorate([
41
+ Column({
42
+ type: DataType.INTEGER,
43
+ allowNull: false
44
+ })
45
+ ], NonConsumableProgram.prototype, "order", void 0);
46
+ __decorate([
47
+ Column({
48
+ type: DataType.INTEGER,
49
+ allowNull: false,
50
+ defaultValue: 0
51
+ })
52
+ ], NonConsumableProgram.prototype, "popularityOrder", void 0);
53
+ __decorate([
54
+ Column({
55
+ type: DataType.TEXT,
56
+ allowNull: false
57
+ })
58
+ ], NonConsumableProgram.prototype, "weightGoal", void 0);
59
+ __decorate([
60
+ Column({
61
+ type: DataType.TEXT,
62
+ allowNull: false
63
+ })
64
+ ], NonConsumableProgram.prototype, "goal", void 0);
65
+ __decorate([
66
+ Column({
67
+ type: DataType.TEXT,
68
+ allowNull: false
69
+ })
70
+ ], NonConsumableProgram.prototype, "type", void 0);
71
+ __decorate([
72
+ Column({
73
+ type: DataType.BOOLEAN,
74
+ allowNull: false
75
+ })
76
+ ], NonConsumableProgram.prototype, "isFree", void 0);
77
+ __decorate([
78
+ Column({
79
+ type: DataType.TEXT,
80
+ allowNull: true
81
+ })
82
+ ], NonConsumableProgram.prototype, "productIdAndroid", void 0);
83
+ __decorate([
84
+ Column({
85
+ type: DataType.TEXT,
86
+ allowNull: true
87
+ })
88
+ ], NonConsumableProgram.prototype, "productIdIos", void 0);
89
+ __decorate([
90
+ HasMany(()=>TranslatedConsumableProgram)
91
+ ], NonConsumableProgram.prototype, "translatedPrograms", void 0);
92
+ __decorate([
93
+ BelongsToMany(()=>PersistedUser, {
94
+ through: ()=>UserPrograms
95
+ })
96
+ ], NonConsumableProgram.prototype, "user", void 0);
97
+ NonConsumableProgram = __decorate([
98
+ Table({
99
+ tableName: "NonConsumablePrograms"
100
+ })
101
+ ], NonConsumableProgram);
102
+
103
+ //# sourceMappingURL=NonConsumableProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/NonConsumableProgram.ts"],"sourcesContent":["import {\n BelongsToMany,\n Column,\n DataType,\n Default,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {\n ConsumableProgramGoals,\n ConsumableProgramTypes,\n ConsumableProgramWeightGoals,\n} from \"../../enums/ProgramEnums\";\nimport { TranslatedConsumableProgram } from \"./TranslatedConsumableProgram\";\nimport { UserPrograms } from \"./UserNonConsumableProgram\";\nimport { PersistedUser } from \"../PersistedUser\";\n\n@Table({ tableName: \"NonConsumablePrograms\" })\nexport class NonConsumableProgram 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.TEXT, allowNull: false })\n declare title: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare description: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare coverImageUri: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })\n declare popularityOrder: number;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare weightGoal: ConsumableProgramWeightGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare goal: ConsumableProgramGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: ConsumableProgramTypes;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare isFree: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdAndroid: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdIos: string | null;\n\n @HasMany(() => TranslatedConsumableProgram)\n declare translatedPrograms: TranslatedConsumableProgram[];\n\n @BelongsToMany(() => PersistedUser, { through: () => UserPrograms })\n declare user: PersistedUser[];\n}\n"],"names":["BelongsToMany","Column","DataType","Default","HasMany","Model","Table","TranslatedConsumableProgram","UserPrograms","PersistedUser","NonConsumableProgram","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","INTEGER","BOOLEAN","through","tableName"],"mappings":";;;;;;AAAA,SACEA,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAM9B,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,YAAY,QAAQ,6BAA6B;AAC1D,SAASC,aAAa,QAAQ,mBAAmB;AAGjD,WAAaC,uBAAN,mCAAmCL;AAgD1C,EAAC;;IA/CEF,QAAQD,SAASS,MAAM;IACvBV,OAAO;QACNW,MAAMV,SAASW,IAAI;QACnBC,cAAcZ,SAASW,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWN;;IAUVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GAVrCL;;IAaVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GAbrCL;;IAgBVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GAhBrCL;;IAmBVT,OAAO;QAAEW,MAAMV,SAASgB,OAAO;QAAEH,WAAW,KAAK;IAAC;GAnBxCL;;IAsBVT,OAAO;QAAEW,MAAMV,SAASgB,OAAO;QAAEH,WAAW,KAAK;QAAED,cAAc;IAAE;GAtBzDJ;;IAyBVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GAzBrCL;;IA4BVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GA5BrCL;;IA+BVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,KAAK;IAAC;GA/BrCL;;IAkCVT,OAAO;QAAEW,MAAMV,SAASiB,OAAO;QAAEJ,WAAW,KAAK;IAAC;GAlCxCL;;IAqCVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,IAAI;IAAC;GArCpCL;;IAwCVT,OAAO;QAAEW,MAAMV,SAASe,IAAI;QAAEF,WAAW,IAAI;IAAC;GAxCpCL;;IA2CVN,QAAQ,IAAMG;GA3CJG;;IA8CVV,cAAc,IAAMS,eAAe;QAAEW,SAAS,IAAMZ;IAAa;GA9CvDE;AAAAA;IADZJ,MAAM;QAAEe,WAAW;IAAwB;GAC/BX"}
@@ -0,0 +1,19 @@
1
+ import { Model } from "sequelize-typescript";
2
+ import { ConsumableProgramGoals, ConsumableProgramTypes, ConsumableProgramWeightGoals } from "../../enums/ProgramEnums";
3
+ import { NonConsumableProgram } from "./NonConsumableProgram";
4
+ export declare class TranslatedConsumableProgram extends Model {
5
+ uuid: string;
6
+ programUuid: string;
7
+ title: string;
8
+ language: string;
9
+ description: string;
10
+ coverImageUri: string;
11
+ order: number;
12
+ weightGoal: ConsumableProgramWeightGoals;
13
+ goal: ConsumableProgramGoals;
14
+ type: ConsumableProgramTypes;
15
+ isFree: boolean;
16
+ productIdAndroid: string | null;
17
+ productIdIos: string | null;
18
+ originalProgram: NonConsumableProgram;
19
+ }
@@ -0,0 +1,97 @@
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 { BelongsTo, Column, DataType, Default, ForeignKey, Model, Table } from "sequelize-typescript";
8
+ import { NonConsumableProgram } from "./NonConsumableProgram";
9
+ export let TranslatedConsumableProgram = class TranslatedConsumableProgram extends Model {
10
+ };
11
+ __decorate([
12
+ Default(DataType.UUIDV4),
13
+ Column({
14
+ type: DataType.UUID,
15
+ defaultValue: DataType.UUID,
16
+ allowNull: false,
17
+ primaryKey: true
18
+ })
19
+ ], TranslatedConsumableProgram.prototype, "uuid", void 0);
20
+ __decorate([
21
+ ForeignKey(()=>NonConsumableProgram),
22
+ Column(DataType.UUID)
23
+ ], TranslatedConsumableProgram.prototype, "programUuid", void 0);
24
+ __decorate([
25
+ Column({
26
+ type: DataType.TEXT,
27
+ allowNull: false
28
+ })
29
+ ], TranslatedConsumableProgram.prototype, "title", void 0);
30
+ __decorate([
31
+ Column({
32
+ type: DataType.TEXT,
33
+ allowNull: false
34
+ })
35
+ ], TranslatedConsumableProgram.prototype, "language", void 0);
36
+ __decorate([
37
+ Column({
38
+ type: DataType.TEXT,
39
+ allowNull: false
40
+ })
41
+ ], TranslatedConsumableProgram.prototype, "description", void 0);
42
+ __decorate([
43
+ Column({
44
+ type: DataType.TEXT,
45
+ allowNull: false
46
+ })
47
+ ], TranslatedConsumableProgram.prototype, "coverImageUri", void 0);
48
+ __decorate([
49
+ Column({
50
+ type: DataType.INTEGER,
51
+ allowNull: false
52
+ })
53
+ ], TranslatedConsumableProgram.prototype, "order", void 0);
54
+ __decorate([
55
+ Column({
56
+ type: DataType.TEXT,
57
+ allowNull: false
58
+ })
59
+ ], TranslatedConsumableProgram.prototype, "weightGoal", void 0);
60
+ __decorate([
61
+ Column({
62
+ type: DataType.TEXT,
63
+ allowNull: false
64
+ })
65
+ ], TranslatedConsumableProgram.prototype, "goal", void 0);
66
+ __decorate([
67
+ Column({
68
+ type: DataType.TEXT,
69
+ allowNull: false
70
+ })
71
+ ], TranslatedConsumableProgram.prototype, "type", void 0);
72
+ __decorate([
73
+ Column({
74
+ type: DataType.BOOLEAN,
75
+ allowNull: false
76
+ })
77
+ ], TranslatedConsumableProgram.prototype, "isFree", void 0);
78
+ __decorate([
79
+ Column({
80
+ type: DataType.TEXT,
81
+ allowNull: true
82
+ })
83
+ ], TranslatedConsumableProgram.prototype, "productIdAndroid", void 0);
84
+ __decorate([
85
+ Column({
86
+ type: DataType.TEXT,
87
+ allowNull: true
88
+ })
89
+ ], TranslatedConsumableProgram.prototype, "productIdIos", void 0);
90
+ __decorate([
91
+ BelongsTo(()=>NonConsumableProgram)
92
+ ], TranslatedConsumableProgram.prototype, "originalProgram", void 0);
93
+ TranslatedConsumableProgram = __decorate([
94
+ Table
95
+ ], TranslatedConsumableProgram);
96
+
97
+ //# sourceMappingURL=TranslatedConsumableProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/TranslatedConsumableProgram.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n Default,\n ForeignKey,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {\n ConsumableProgramGoals,\n ConsumableProgramTypes,\n ConsumableProgramWeightGoals,\n} from \"../../enums/ProgramEnums\";\nimport { NonConsumableProgram } from \"./NonConsumableProgram\";\n\n@Table\nexport class TranslatedConsumableProgram 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(() => NonConsumableProgram)\n @Column(DataType.UUID)\n declare programUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare title: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare language: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare description: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare coverImageUri: string;\n\n @Column({ type: DataType.INTEGER, allowNull: false })\n declare order: number;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare weightGoal: ConsumableProgramWeightGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare goal: ConsumableProgramGoals;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: ConsumableProgramTypes;\n\n @Column({ type: DataType.BOOLEAN, allowNull: false })\n declare isFree: boolean;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdAndroid: string | null;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare productIdIos: string | null;\n\n @BelongsTo(() => NonConsumableProgram)\n declare originalProgram: NonConsumableProgram;\n}\n"],"names":["BelongsTo","Column","DataType","Default","ForeignKey","Model","Table","NonConsumableProgram","TranslatedConsumableProgram","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","INTEGER","BOOLEAN"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,UAAU,EACVC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAM9B,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,WAAaC,8BAAN,0CAA0CH;AAiDjD,EAAC;;IAhDEF,QAAQD,SAASO,MAAM;IACvBR,OAAO;QACNS,MAAMR,SAASS,IAAI;QACnBC,cAAcV,SAASS,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWN;;IAUVJ,WAAW,IAAMG;IACjBN,OAAOC,SAASS,IAAI;GAXVH;;IAcVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAdrCL;;IAiBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAjBrCL;;IAoBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GApBrCL;;IAuBVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAvBrCL;;IA0BVP,OAAO;QAAES,MAAMR,SAASc,OAAO;QAAEH,WAAW,KAAK;IAAC;GA1BxCL;;IA6BVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GA7BrCL;;IAgCVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAhCrCL;;IAmCVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,KAAK;IAAC;GAnCrCL;;IAsCVP,OAAO;QAAES,MAAMR,SAASe,OAAO;QAAEJ,WAAW,KAAK;IAAC;GAtCxCL;;IAyCVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GAzCpCL;;IA4CVP,OAAO;QAAES,MAAMR,SAASa,IAAI;QAAEF,WAAW,IAAI;IAAC;GA5CpCL;;IA+CVR,UAAU,IAAMO;GA/CNC;AAAAA;IADZF;GACYE"}
@@ -0,0 +1,5 @@
1
+ import { Model } from "sequelize-typescript";
2
+ export declare class UserPrograms extends Model<UserPrograms> {
3
+ userUuid: string;
4
+ programUuid: string;
5
+ }
@@ -0,0 +1,30 @@
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 { Table, Column, Model, ForeignKey, DataType } from "sequelize-typescript";
8
+ import { PersistedUser } from "../PersistedUser";
9
+ import { NonConsumableProgram } from "./NonConsumableProgram";
10
+ export let UserPrograms = class UserPrograms extends Model {
11
+ };
12
+ __decorate([
13
+ ForeignKey(()=>PersistedUser),
14
+ Column({
15
+ type: DataType.UUID,
16
+ allowNull: false
17
+ })
18
+ ], UserPrograms.prototype, "userUuid", void 0);
19
+ __decorate([
20
+ ForeignKey(()=>NonConsumableProgram),
21
+ Column({
22
+ type: DataType.UUID,
23
+ allowNull: false
24
+ })
25
+ ], UserPrograms.prototype, "programUuid", void 0);
26
+ UserPrograms = __decorate([
27
+ Table
28
+ ], UserPrograms);
29
+
30
+ //# sourceMappingURL=UserNonConsumableProgram.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.ts"],"sourcesContent":["import {Table, Column, Model, ForeignKey, DataType} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../PersistedUser\";\nimport { NonConsumableProgram } from \"./NonConsumableProgram\";\n\n@Table\nexport class UserPrograms extends Model<UserPrograms> {\n @ForeignKey(() => PersistedUser)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare userUuid: string;\n\n @ForeignKey(() => NonConsumableProgram)\n @Column({\n type: DataType.UUID,\n allowNull: false,\n })\n declare programUuid: string;\n}\n"],"names":["Table","Column","Model","ForeignKey","DataType","PersistedUser","NonConsumableProgram","UserPrograms","type","UUID","allowNull"],"mappings":";;;;;;AAAA,SAAQA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,QAAQ,QAAO,uBAAuB;AAChF,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,WAAaC,eAAN,2BAA2BL;AAclC,EAAC;;IAbIC,WAAW,IAAME;IACjBJ,OAAO;QACJO,MAAMJ,SAASK,IAAI;QACnBC,WAAW,KAAK;IACpB;GALSH;;IAQRJ,WAAW,IAAMG;IACjBL,OAAO;QACJO,MAAMJ,SAASK,IAAI;QACnBC,WAAW,KAAK;IACpB;GAZSH;AAAAA;IADZP;GACYO"}
@@ -0,0 +1,17 @@
1
+ export declare enum ConsumableProgramWeightGoals {
2
+ GAIN_WEIGHT = "GainWeight",
3
+ LOSE_WEIGHT = "LoseWeight",
4
+ MAINTAIN = "Maintain"
5
+ }
6
+ export declare enum ConsumableProgramGoals {
7
+ BUILD_MUSCLE = "BuildMuscle",
8
+ GAIN_STRENGTH = "GainStrength",
9
+ BUILD_MUSCLE_AND_GAIN_STRENGTH = "BuildMuscleAndGainStrength"
10
+ }
11
+ export declare enum ConsumableProgramTypes {
12
+ BODYWEIGHT_HOME_WORKOUT = "BodyweightHomeWorkout",
13
+ BODYWEIGHT_ONLY_BODYWEIGHT = "BodyweightOnlyBodyweight",
14
+ BODYWEIGHT_WEIGHTED_CALI = "BodyweightWeightedCali",
15
+ WEIGHTS = "Weights",
16
+ BOTH = "Both"
17
+ }
@@ -0,0 +1,22 @@
1
+ export var ConsumableProgramWeightGoals;
2
+ (function(ConsumableProgramWeightGoals) {
3
+ ConsumableProgramWeightGoals["GAIN_WEIGHT"] = "GainWeight";
4
+ ConsumableProgramWeightGoals["LOSE_WEIGHT"] = "LoseWeight";
5
+ ConsumableProgramWeightGoals["MAINTAIN"] = "Maintain";
6
+ })(ConsumableProgramWeightGoals || (ConsumableProgramWeightGoals = {}));
7
+ export var ConsumableProgramGoals;
8
+ (function(ConsumableProgramGoals) {
9
+ ConsumableProgramGoals["BUILD_MUSCLE"] = "BuildMuscle";
10
+ ConsumableProgramGoals["GAIN_STRENGTH"] = "GainStrength";
11
+ ConsumableProgramGoals["BUILD_MUSCLE_AND_GAIN_STRENGTH"] = "BuildMuscleAndGainStrength";
12
+ })(ConsumableProgramGoals || (ConsumableProgramGoals = {}));
13
+ export var ConsumableProgramTypes;
14
+ (function(ConsumableProgramTypes) {
15
+ ConsumableProgramTypes["BODYWEIGHT_HOME_WORKOUT"] = "BodyweightHomeWorkout";
16
+ ConsumableProgramTypes["BODYWEIGHT_ONLY_BODYWEIGHT"] = "BodyweightOnlyBodyweight";
17
+ ConsumableProgramTypes["BODYWEIGHT_WEIGHTED_CALI"] = "BodyweightWeightedCali";
18
+ ConsumableProgramTypes["WEIGHTS"] = "Weights";
19
+ ConsumableProgramTypes["BOTH"] = "Both";
20
+ })(ConsumableProgramTypes || (ConsumableProgramTypes = {}));
21
+
22
+ //# sourceMappingURL=ProgramEnums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/enums/ProgramEnums.ts"],"sourcesContent":["export enum ConsumableProgramWeightGoals {\n GAIN_WEIGHT = \"GainWeight\",\n LOSE_WEIGHT = \"LoseWeight\",\n MAINTAIN = \"Maintain\",\n}\n\nexport enum ConsumableProgramGoals {\n BUILD_MUSCLE = \"BuildMuscle\",\n GAIN_STRENGTH = \"GainStrength\",\n BUILD_MUSCLE_AND_GAIN_STRENGTH = \"BuildMuscleAndGainStrength\",\n}\n\nexport enum ConsumableProgramTypes {\n BODYWEIGHT_HOME_WORKOUT = \"BodyweightHomeWorkout\",\n BODYWEIGHT_ONLY_BODYWEIGHT = \"BodyweightOnlyBodyweight\",\n BODYWEIGHT_WEIGHTED_CALI = \"BodyweightWeightedCali\",\n WEIGHTS = \"Weights\",\n BOTH = \"Both\",\n}\n"],"names":["ConsumableProgramWeightGoals","GAIN_WEIGHT","LOSE_WEIGHT","MAINTAIN","ConsumableProgramGoals","BUILD_MUSCLE","GAIN_STRENGTH","BUILD_MUSCLE_AND_GAIN_STRENGTH","ConsumableProgramTypes","BODYWEIGHT_HOME_WORKOUT","BODYWEIGHT_ONLY_BODYWEIGHT","BODYWEIGHT_WEIGHTED_CALI","WEIGHTS","BOTH"],"mappings":"WAAO;UAAKA,4BAA4B;IAA5BA,6BACRC,iBAAc;IADND,6BAERE,iBAAc;IAFNF,6BAGRG,cAAW;GAHHH,iCAAAA;WAML;UAAKI,sBAAsB;IAAtBA,uBACRC,kBAAe;IADPD,uBAERE,mBAAgB;IAFRF,uBAGRG,oCAAiC;GAHzBH,2BAAAA;WAML;UAAKI,sBAAsB;IAAtBA,uBACRC,6BAA0B;IADlBD,uBAERE,gCAA6B;IAFrBF,uBAGRG,8BAA2B;IAHnBH,uBAIRI,aAAU;IAJFJ,uBAKRK,UAAO;GALCL,2BAAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,5 +1,7 @@
1
- import {BelongsTo, Column, DataType, Default, HasOne, Index, Model, Table} from "sequelize-typescript";
2
- import type { Subscription } from "./Subscription";
1
+ import {BelongsToMany, Column, DataType, Default, HasOne, Index, Model, Table} from "sequelize-typescript";
2
+ import { Subscription } from "./Subscription";
3
+ import {UserPrograms} from "./nonconsprogram/UserNonConsumableProgram";
4
+ import {NonConsumableProgram} from "./nonconsprogram/NonConsumableProgram";
3
5
 
4
6
  @Table
5
7
  export class PersistedUser extends Model {
@@ -95,6 +97,9 @@ export class PersistedUser extends Model {
95
97
  @Column({ type: DataType.BOOLEAN, allowNull: true })
96
98
  declare changeUtilityEmail: boolean;
97
99
 
98
- @HasOne(() => PersistedUser)
100
+ @HasOne(() => Subscription)
99
101
  declare subscription: Subscription;
102
+
103
+ @BelongsToMany(() => NonConsumableProgram, { through: () => UserPrograms })
104
+ declare nonConsumablePrograms: NonConsumableProgram[];
100
105
  }
@@ -0,0 +1,68 @@
1
+ import {
2
+ BelongsToMany,
3
+ Column,
4
+ DataType,
5
+ Default,
6
+ HasMany,
7
+ Model,
8
+ Table,
9
+ } from "sequelize-typescript";
10
+ import {
11
+ ConsumableProgramGoals,
12
+ ConsumableProgramTypes,
13
+ ConsumableProgramWeightGoals,
14
+ } from "../../enums/ProgramEnums";
15
+ import { TranslatedConsumableProgram } from "./TranslatedConsumableProgram";
16
+ import { UserPrograms } from "./UserNonConsumableProgram";
17
+ import { PersistedUser } from "../PersistedUser";
18
+
19
+ @Table({ tableName: "NonConsumablePrograms" })
20
+ export class NonConsumableProgram extends Model {
21
+ @Default(DataType.UUIDV4)
22
+ @Column({
23
+ type: DataType.UUID,
24
+ defaultValue: DataType.UUID,
25
+ allowNull: false,
26
+ primaryKey: true,
27
+ })
28
+ declare uuid: string;
29
+
30
+ @Column({ type: DataType.TEXT, allowNull: false })
31
+ declare title: string;
32
+
33
+ @Column({ type: DataType.TEXT, allowNull: false })
34
+ declare description: string;
35
+
36
+ @Column({ type: DataType.TEXT, allowNull: false })
37
+ declare coverImageUri: string;
38
+
39
+ @Column({ type: DataType.INTEGER, allowNull: false })
40
+ declare order: number;
41
+
42
+ @Column({ type: DataType.INTEGER, allowNull: false, defaultValue: 0 })
43
+ declare popularityOrder: number;
44
+
45
+ @Column({ type: DataType.TEXT, allowNull: false })
46
+ declare weightGoal: ConsumableProgramWeightGoals;
47
+
48
+ @Column({ type: DataType.TEXT, allowNull: false })
49
+ declare goal: ConsumableProgramGoals;
50
+
51
+ @Column({ type: DataType.TEXT, allowNull: false })
52
+ declare type: ConsumableProgramTypes;
53
+
54
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
55
+ declare isFree: boolean;
56
+
57
+ @Column({ type: DataType.TEXT, allowNull: true })
58
+ declare productIdAndroid: string | null;
59
+
60
+ @Column({ type: DataType.TEXT, allowNull: true })
61
+ declare productIdIos: string | null;
62
+
63
+ @HasMany(() => TranslatedConsumableProgram)
64
+ declare translatedPrograms: TranslatedConsumableProgram[];
65
+
66
+ @BelongsToMany(() => PersistedUser, { through: () => UserPrograms })
67
+ declare user: PersistedUser[];
68
+ }
@@ -0,0 +1,67 @@
1
+ import {
2
+ BelongsTo,
3
+ Column,
4
+ DataType,
5
+ Default,
6
+ ForeignKey,
7
+ Model,
8
+ Table,
9
+ } from "sequelize-typescript";
10
+ import {
11
+ ConsumableProgramGoals,
12
+ ConsumableProgramTypes,
13
+ ConsumableProgramWeightGoals,
14
+ } from "../../enums/ProgramEnums";
15
+ import { NonConsumableProgram } from "./NonConsumableProgram";
16
+
17
+ @Table
18
+ export class TranslatedConsumableProgram extends Model {
19
+ @Default(DataType.UUIDV4)
20
+ @Column({
21
+ type: DataType.UUID,
22
+ defaultValue: DataType.UUID,
23
+ allowNull: false,
24
+ primaryKey: true,
25
+ })
26
+ declare uuid: string;
27
+
28
+ @ForeignKey(() => NonConsumableProgram)
29
+ @Column(DataType.UUID)
30
+ declare programUuid: string;
31
+
32
+ @Column({ type: DataType.TEXT, allowNull: false })
33
+ declare title: string;
34
+
35
+ @Column({ type: DataType.TEXT, allowNull: false })
36
+ declare language: string;
37
+
38
+ @Column({ type: DataType.TEXT, allowNull: false })
39
+ declare description: string;
40
+
41
+ @Column({ type: DataType.TEXT, allowNull: false })
42
+ declare coverImageUri: string;
43
+
44
+ @Column({ type: DataType.INTEGER, allowNull: false })
45
+ declare order: number;
46
+
47
+ @Column({ type: DataType.TEXT, allowNull: false })
48
+ declare weightGoal: ConsumableProgramWeightGoals;
49
+
50
+ @Column({ type: DataType.TEXT, allowNull: false })
51
+ declare goal: ConsumableProgramGoals;
52
+
53
+ @Column({ type: DataType.TEXT, allowNull: false })
54
+ declare type: ConsumableProgramTypes;
55
+
56
+ @Column({ type: DataType.BOOLEAN, allowNull: false })
57
+ declare isFree: boolean;
58
+
59
+ @Column({ type: DataType.TEXT, allowNull: true })
60
+ declare productIdAndroid: string | null;
61
+
62
+ @Column({ type: DataType.TEXT, allowNull: true })
63
+ declare productIdIos: string | null;
64
+
65
+ @BelongsTo(() => NonConsumableProgram)
66
+ declare originalProgram: NonConsumableProgram;
67
+ }
@@ -0,0 +1,20 @@
1
+ import {Table, Column, Model, ForeignKey, DataType} from "sequelize-typescript";
2
+ import { PersistedUser } from "../PersistedUser";
3
+ import { NonConsumableProgram } from "./NonConsumableProgram";
4
+
5
+ @Table
6
+ export class UserPrograms extends Model<UserPrograms> {
7
+ @ForeignKey(() => PersistedUser)
8
+ @Column({
9
+ type: DataType.UUID,
10
+ allowNull: false,
11
+ })
12
+ declare userUuid: string;
13
+
14
+ @ForeignKey(() => NonConsumableProgram)
15
+ @Column({
16
+ type: DataType.UUID,
17
+ allowNull: false,
18
+ })
19
+ declare programUuid: string;
20
+ }
@@ -0,0 +1,19 @@
1
+ export enum ConsumableProgramWeightGoals {
2
+ GAIN_WEIGHT = "GainWeight",
3
+ LOSE_WEIGHT = "LoseWeight",
4
+ MAINTAIN = "Maintain",
5
+ }
6
+
7
+ export enum ConsumableProgramGoals {
8
+ BUILD_MUSCLE = "BuildMuscle",
9
+ GAIN_STRENGTH = "GainStrength",
10
+ BUILD_MUSCLE_AND_GAIN_STRENGTH = "BuildMuscleAndGainStrength",
11
+ }
12
+
13
+ export enum ConsumableProgramTypes {
14
+ BODYWEIGHT_HOME_WORKOUT = "BodyweightHomeWorkout",
15
+ BODYWEIGHT_ONLY_BODYWEIGHT = "BodyweightOnlyBodyweight",
16
+ BODYWEIGHT_WEIGHTED_CALI = "BodyweightWeightedCali",
17
+ WEIGHTS = "Weights",
18
+ BOTH = "Both",
19
+ }