90dc-core 1.7.0 → 1.7.2

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.
@@ -27,7 +27,7 @@ __decorate([
27
27
  ], UserPrograms.prototype, "programUuid", void 0);
28
28
  __decorate([
29
29
  Column({
30
- type: DataType.UUID,
30
+ type: DataType.STRING,
31
31
  allowNull: false
32
32
  })
33
33
  ], UserPrograms.prototype, "purchasePlatform", void 0);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.ts"],"sourcesContent":["import {Table, Column, Model, ForeignKey, DataType, PrimaryKey} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../PersistedUser\";\nimport { NonConsumableProgram } from \"./NonConsumableProgram\";\n\n@Table({ tableName: \"UserPrograms\", timestamps: true })\nexport class UserPrograms extends Model<UserPrograms> {\n @PrimaryKey\n @ForeignKey(() => PersistedUser)\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @PrimaryKey\n @ForeignKey(() => NonConsumableProgram)\n @Column({ type: DataType.UUID, allowNull: false })\n declare programUuid: string;\n\n @Column({ type: DataType.UUID, allowNull: false })\n declare purchasePlatform: string;\n}\n\n"],"names":["Table","Column","Model","ForeignKey","DataType","PrimaryKey","PersistedUser","NonConsumableProgram","UserPrograms","type","UUID","allowNull","tableName","timestamps"],"mappings":";;;;;;AAAA,SAAQA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,UAAU,QAAO,uBAAuB;AAC5F,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,WAAaC,eAAN,2BAA2BN;AAalC,EAAC;;IAZIG;IACAF,WAAW,IAAMG;IACjBL,OAAO;QAAEQ,MAAML,SAASM,IAAI;QAAEC,WAAW,KAAK;IAAC;GAHvCH;;IAMRH;IACAF,WAAW,IAAMI;IACjBN,OAAO;QAAEQ,MAAML,SAASM,IAAI;QAAEC,WAAW,KAAK;IAAC;GARvCH;;IAWRP,OAAO;QAAEQ,MAAML,SAASM,IAAI;QAAEC,WAAW,KAAK;IAAC;GAXvCH;AAAAA;IADZR,MAAM;QAAEY,WAAW;QAAgBC,YAAY,IAAI;IAAC;GACxCL"}
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/nonconsprogram/UserNonConsumableProgram.ts"],"sourcesContent":["import {Table, Column, Model, ForeignKey, DataType, PrimaryKey} from \"sequelize-typescript\";\nimport { PersistedUser } from \"../PersistedUser\";\nimport { NonConsumableProgram } from \"./NonConsumableProgram\";\n\n@Table({ tableName: \"UserPrograms\", timestamps: true })\nexport class UserPrograms extends Model<UserPrograms> {\n @PrimaryKey\n @ForeignKey(() => PersistedUser)\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @PrimaryKey\n @ForeignKey(() => NonConsumableProgram)\n @Column({ type: DataType.UUID, allowNull: false })\n declare programUuid: string;\n\n @Column({ type: DataType.STRING, allowNull: false })\n declare purchasePlatform: string;\n}\n\n"],"names":["Table","Column","Model","ForeignKey","DataType","PrimaryKey","PersistedUser","NonConsumableProgram","UserPrograms","type","UUID","allowNull","STRING","tableName","timestamps"],"mappings":";;;;;;AAAA,SAAQA,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,UAAU,QAAO,uBAAuB;AAC5F,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,oBAAoB,QAAQ,yBAAyB;AAG9D,WAAaC,eAAN,2BAA2BN;AAalC,EAAC;;IAZIG;IACAF,WAAW,IAAMG;IACjBL,OAAO;QAAEQ,MAAML,SAASM,IAAI;QAAEC,WAAW,KAAK;IAAC;GAHvCH;;IAMRH;IACAF,WAAW,IAAMI;IACjBN,OAAO;QAAEQ,MAAML,SAASM,IAAI;QAAEC,WAAW,KAAK;IAAC;GARvCH;;IAWRP,OAAO;QAAEQ,MAAML,SAASQ,MAAM;QAAED,WAAW,KAAK;IAAC;GAXzCH;AAAAA;IADZR,MAAM;QAAEa,WAAW;QAAgBC,YAAY,IAAI;IAAC;GACxCN"}
@@ -34,7 +34,10 @@ __decorate([
34
34
  ], Program.prototype, "userUuid", void 0);
35
35
  __decorate([
36
36
  ForeignKey(()=>NonConsumableProgram),
37
- Column
37
+ Column({
38
+ type: DataType.UUID,
39
+ allowNull: true
40
+ })
38
41
  ], Program.prototype, "nonConsumableProgramUuid", void 0);
39
42
  __decorate([
40
43
  Column({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/dbmodels/program/Program.ts"],"sourcesContent":["import { Workout } from \"./Workout\";\nimport {\n BeforeDestroy, BelongsTo,\n Column,\n DataType,\n Default, ForeignKey,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {NonConsumableProgram} from \"../nonconsprogram/NonConsumableProgram\";\n\n@Table\nexport class Program extends Model<Program> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare programId: string;\n\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @ForeignKey(() => NonConsumableProgram)\n @Column\n declare nonConsumableProgramUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare startDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare programType: string;\n\n @Column({ type: DataType.DATE, allowNull: true })\n declare createdAt: Date;\n\n @HasMany(() => Workout, { foreignKey: \"programId\", onDelete: \"CASCADE\" })\n declare workout: Workout[];\n\n @BelongsTo(() => NonConsumableProgram)\n declare nonConsumableProgram: NonConsumableProgram;\n\n @BeforeDestroy\n static async deleteRelatedWorkouts(instance: Program) {\n const workouts = await instance.$get(\"workout\", { scope: \"workout\" });\n\n for (const workout of workouts) {\n await workout.destroy();\n }\n }\n}\n"],"names":["Workout","BeforeDestroy","BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Model","Table","NonConsumableProgram","Program","deleteRelatedWorkouts","instance","workouts","$get","scope","workout","destroy","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","DATE","foreignKey","onDelete"],"mappings":";;;;;;AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SACEC,aAAa,EAAEC,SAAS,EACxBC,MAAM,EACNC,QAAQ,EACRC,OAAO,EAAEC,UAAU,EACnBC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAAQC,oBAAoB,QAAO,yCAAyC;AAG5E,WAAaC,UAAN,sBAAsBH;IAgC3B,aACaI,sBAAsBC,QAAiB,EAAE;QACpD,MAAMC,WAAW,MAAMD,SAASE,IAAI,CAAC,WAAW;YAAEC,OAAO;QAAU;QAEnE,KAAK,MAAMC,WAAWH,SAAU;YAC9B,MAAMG,QAAQC,OAAO;QACvB;IACF;AACF,EAAC;;IAvCEb,QAAQD,SAASe,MAAM;IACvBhB,OAAO;QACNiB,MAAMhB,SAASiB,IAAI;QACnBC,cAAclB,SAASiB,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWb;;IAUVR,OAAO;QAAEiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,KAAK;IAAC;GAVrCZ;;IAaVL,WAAW,IAAMI;IACjBP;GAdUQ;;IAiBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAjBrCZ;;IAoBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,IAAI;IAAC;GApBpCZ;;IAuBVR,OAAO;QAAEiB,MAAMhB,SAASsB,IAAI;QAAEH,WAAW,IAAI;IAAC;GAvBpCZ;;IA0BVJ,QAAQ,IAAMP,SAAS;QAAE2B,YAAY;QAAaC,UAAU;IAAU;GA1B5DjB;;IA6BVT,UAAU,IAAMQ;GA7BNC;;IAgCVV;GAhCUU;AAAAA;IADZF;GACYE"}
1
+ {"version":3,"sources":["../../../../src/lib/dbmodels/program/Program.ts"],"sourcesContent":["import { Workout } from \"./Workout\";\nimport {\n BeforeDestroy, BelongsTo,\n Column,\n DataType,\n Default, ForeignKey,\n HasMany,\n Model,\n Table,\n} from \"sequelize-typescript\";\nimport {NonConsumableProgram} from \"../nonconsprogram/NonConsumableProgram\";\n\n@Table\nexport class Program extends Model<Program> {\n @Default(DataType.UUIDV4)\n @Column({\n type: DataType.UUID,\n defaultValue: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare programId: string;\n\n @Column({ type: DataType.UUID, allowNull: false })\n declare userUuid: string;\n\n @ForeignKey(() => NonConsumableProgram)\n @Column({type: DataType.UUID, allowNull: true})\n declare nonConsumableProgramUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare startDate: string;\n\n @Column({ type: DataType.TEXT, allowNull: true })\n declare programType: string;\n\n @Column({ type: DataType.DATE, allowNull: true })\n declare createdAt: Date;\n\n @HasMany(() => Workout, { foreignKey: \"programId\", onDelete: \"CASCADE\" })\n declare workout: Workout[];\n\n @BelongsTo(() => NonConsumableProgram)\n declare nonConsumableProgram: NonConsumableProgram;\n\n @BeforeDestroy\n static async deleteRelatedWorkouts(instance: Program) {\n const workouts = await instance.$get(\"workout\", { scope: \"workout\" });\n\n for (const workout of workouts) {\n await workout.destroy();\n }\n }\n}\n"],"names":["Workout","BeforeDestroy","BelongsTo","Column","DataType","Default","ForeignKey","HasMany","Model","Table","NonConsumableProgram","Program","deleteRelatedWorkouts","instance","workouts","$get","scope","workout","destroy","UUIDV4","type","UUID","defaultValue","allowNull","primaryKey","TEXT","DATE","foreignKey","onDelete"],"mappings":";;;;;;AAAA,SAASA,OAAO,QAAQ,YAAY;AACpC,SACEC,aAAa,EAAEC,SAAS,EACxBC,MAAM,EACNC,QAAQ,EACRC,OAAO,EAAEC,UAAU,EACnBC,OAAO,EACPC,KAAK,EACLC,KAAK,QACA,uBAAuB;AAC9B,SAAQC,oBAAoB,QAAO,yCAAyC;AAG5E,WAAaC,UAAN,sBAAsBH;IAgC3B,aACaI,sBAAsBC,QAAiB,EAAE;QACpD,MAAMC,WAAW,MAAMD,SAASE,IAAI,CAAC,WAAW;YAAEC,OAAO;QAAU;QAEnE,KAAK,MAAMC,WAAWH,SAAU;YAC9B,MAAMG,QAAQC,OAAO;QACvB;IACF;AACF,EAAC;;IAvCEb,QAAQD,SAASe,MAAM;IACvBhB,OAAO;QACNiB,MAAMhB,SAASiB,IAAI;QACnBC,cAAclB,SAASiB,IAAI;QAC3BE,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWb;;IAUVR,OAAO;QAAEiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,KAAK;IAAC;GAVrCZ;;IAaVL,WAAW,IAAMI;IACjBP,OAAO;QAACiB,MAAMhB,SAASiB,IAAI;QAAEE,WAAW,IAAI;IAAA;GAdlCZ;;IAiBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,KAAK;IAAC;GAjBrCZ;;IAoBVR,OAAO;QAAEiB,MAAMhB,SAASqB,IAAI;QAAEF,WAAW,IAAI;IAAC;GApBpCZ;;IAuBVR,OAAO;QAAEiB,MAAMhB,SAASsB,IAAI;QAAEH,WAAW,IAAI;IAAC;GAvBpCZ;;IA0BVJ,QAAQ,IAAMP,SAAS;QAAE2B,YAAY;QAAaC,UAAU;IAAU;GA1B5DjB;;IA6BVT,UAAU,IAAMQ;GA7BNC;;IAgCVV;GAhCUU;AAAAA;IADZF;GACYE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "90dc-core",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "A package that contains utils and interfaces used to create 90dc",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -14,7 +14,7 @@ export class UserPrograms extends Model<UserPrograms> {
14
14
  @Column({ type: DataType.UUID, allowNull: false })
15
15
  declare programUuid: string;
16
16
 
17
- @Column({ type: DataType.UUID, allowNull: false })
17
+ @Column({ type: DataType.STRING, allowNull: false })
18
18
  declare purchasePlatform: string;
19
19
  }
20
20
 
@@ -25,7 +25,7 @@ export class Program extends Model<Program> {
25
25
  declare userUuid: string;
26
26
 
27
27
  @ForeignKey(() => NonConsumableProgram)
28
- @Column
28
+ @Column({type: DataType.UUID, allowNull: true})
29
29
  declare nonConsumableProgramUuid: string;
30
30
 
31
31
  @Column({ type: DataType.TEXT, allowNull: false })