From 74ee77f814c269718cb99847e4a43600fc52b41f Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 5 Dec 2020 09:48:01 +0100 Subject: [PATCH 1/5] Cleaned up some relations for users ref #14 --- src/models/entities/User.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/models/entities/User.ts b/src/models/entities/User.ts index 7da56db..762ec92 100644 --- a/src/models/entities/User.ts +++ b/src/models/entities/User.ts @@ -81,13 +81,15 @@ export class User { /** * permissions */ + @IsOptional() @ManyToOne(() => Permission, permission => permission.users, { nullable: true }) permissions: Permission[]; /** * groups */ - @ManyToMany(() => UserGroup) + @IsOptional() + @ManyToMany(() => UserGroup, { nullable: true }) @JoinTable() groups: UserGroup[]; @@ -96,7 +98,7 @@ export class User { */ @Column() @IsBoolean() - enabled: boolean; + enabled: boolean = true; /** * jwt refresh count @@ -110,12 +112,13 @@ export class User { */ @Column() @IsString() - profilepic: string; + profilePic: string; /** * actions */ - @OneToMany(() => UserAction, action => action.user) + @IsOptional() + @OneToMany(() => UserAction, action => action.user, { nullable: true }) actions: UserAction /** From dadaacfaaeed6f4cc1a1c01abc6428601708fbcb Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 5 Dec 2020 10:16:47 +0100 Subject: [PATCH 2/5] first part of the user class cleanuo ref #11 #14 --- src/models/creation/CreateUser.ts | 16 ++++++++++++---- src/models/entities/User.ts | 32 +++++++++++++++---------------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/models/creation/CreateUser.ts b/src/models/creation/CreateUser.ts index 81b0b1e..a27071d 100644 --- a/src/models/creation/CreateUser.ts +++ b/src/models/creation/CreateUser.ts @@ -9,21 +9,30 @@ import { UserGroup } from '../entities/UserGroup'; export class CreateUser { @IsString() firstname: string; + @IsString() + @IsOptional() middlename?: string; + @IsOptional() @IsString() username?: string; + @IsPhoneNumber("ZZ") @IsOptional() phone?: string; + @IsString() password: string; + @IsString() lastname: string; + @IsEmail() @IsString() + @IsOptional() email?: string; + @IsOptional() groupId?: number[] | number @@ -58,15 +67,14 @@ export class CreateUser { } } - const new_uuid = uuid.v4() - newUser.email = this.email newUser.username = this.username newUser.firstname = this.firstname newUser.middlename = this.middlename newUser.lastname = this.lastname - newUser.uuid = new_uuid - newUser.password = await argon2.hash(this.password + new_uuid); + newUser.uuid = uuid.v4() + newUser.phone = this.phone + newUser.password = await argon2.hash(this.password + newUser.uuid); console.log(newUser) return newUser; diff --git a/src/models/entities/User.ts b/src/models/entities/User.ts index 762ec92..1d2065e 100644 --- a/src/models/entities/User.ts +++ b/src/models/entities/User.ts @@ -13,7 +13,6 @@ export class User { * autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; @@ -21,30 +20,30 @@ export class User { * uuid */ @Column() - @IsUUID("4") + @IsUUID(4) uuid: string; /** * user email */ - @Column() + @Column({ nullable: true }) @IsEmail() - email: string; + email?: string; /** * user phone */ - @Column() - @IsPhoneNumber("ZZ") + @Column({ nullable: true }) @IsOptional() - phone: string; + @IsPhoneNumber("ZZ") + phone?: string; /** * username */ - @Column() + @Column({ nullable: true }) @IsString() - username: string; + username?: string; /** * firstname @@ -57,10 +56,10 @@ export class User { /** * middlename */ - @Column() + @Column({ nullable: true }) @IsString() @IsOptional() - middlename: string; + middlename?: string; /** * lastname @@ -83,7 +82,7 @@ export class User { */ @IsOptional() @ManyToOne(() => Permission, permission => permission.users, { nullable: true }) - permissions: Permission[]; + permissions?: Permission[]; /** * groups @@ -105,21 +104,22 @@ export class User { */ @IsInt() @Column({ default: 1 }) - refreshTokenCount: number; + refreshTokenCount?: number; /** * profilepic */ - @Column() + @Column({ nullable: true }) @IsString() - profilePic: string; + @IsOptional() + profilePic?: string; /** * actions */ @IsOptional() @OneToMany(() => UserAction, action => action.user, { nullable: true }) - actions: UserAction + actions: UserAction[] /** * calculate all permissions From a42595bd15ec7646b5b18758aee4c178857e1427 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 5 Dec 2020 10:23:53 +0100 Subject: [PATCH 3/5] Cleaned up the createUser a little bit ref #11 #14 --- src/models/creation/CreateUser.ts | 58 +++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/src/models/creation/CreateUser.ts b/src/models/creation/CreateUser.ts index a27071d..fb7841a 100644 --- a/src/models/creation/CreateUser.ts +++ b/src/models/creation/CreateUser.ts @@ -7,35 +7,71 @@ import { User } from '../entities/User'; import { UserGroup } from '../entities/UserGroup'; export class CreateUser { + /** + * The new user's first name. + */ @IsString() firstname: string; + /** + * The new user's middle name. + * Optinal. + */ @IsString() @IsOptional() middlename?: string; + /** + * The new user's last name. + */ + @IsString() + lastname: string; + + /** + * The new user's username. + * You have to provide at least one of: {email, username}. + */ @IsOptional() @IsString() username?: string; - @IsPhoneNumber("ZZ") - @IsOptional() - phone?: string; - - @IsString() - password: string; - - @IsString() - lastname: string; - + /** + * The new user's email address. + * You have to provide at least one of: {email, username}. + */ @IsEmail() @IsString() @IsOptional() email?: string; + /** + * The new user's phone number. + * Optional + */ + @IsPhoneNumber("ZZ") + @IsOptional() + phone?: string; + + /** + * The new user's password. + * This will of course not be saved in plaintext :) + */ + @IsString() + password: string; + + /** + * The new user's groups' id(s). + * You can provide either one groupId or an array of groupIDs. + * Optional. + */ @IsOptional() groupId?: number[] | number + //TODO: ProfilePics + + /** + * Converts this to a User Entity. + */ public async toUser(): Promise { let newUser: User = new User(); @@ -75,8 +111,8 @@ export class CreateUser { newUser.uuid = uuid.v4() newUser.phone = this.phone newUser.password = await argon2.hash(this.password + newUser.uuid); + //TODO: ProfilePics - console.log(newUser) return newUser; } } \ No newline at end of file From 109e145a1970952a2375df9f1f6cf57f056982ff Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 5 Dec 2020 10:31:24 +0100 Subject: [PATCH 4/5] Cleaned up the createUserGroup a little bit ref #11 #14 --- src/models/creation/CreateUserGroup.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/models/creation/CreateUserGroup.ts b/src/models/creation/CreateUserGroup.ts index d55618c..959bea5 100644 --- a/src/models/creation/CreateUserGroup.ts +++ b/src/models/creation/CreateUserGroup.ts @@ -1,28 +1,30 @@ import { IsOptional, IsString } from 'class-validator'; -import { GroupNameNeededError } from '../../errors/UserGroupErrors'; import { UserGroup } from '../entities/UserGroup'; export class CreateUserGroup { - @IsOptional() + /** + * The new group's name. + */ @IsString() name: string; + + /** + * The new group's description. + * Optinal. + */ @IsOptional() @IsString() description?: string; + /** + * Converts this to a UserGroup entity. + */ public async toUserGroup(): Promise { let newUserGroup: UserGroup = new UserGroup(); - if (this.name === undefined) { - throw new GroupNameNeededError(); - } + newUserGroup.name = this.name; + newUserGroup.description = this.description; - newUserGroup.name = this.name - if (this.description) { - newUserGroup.description = this.description - } - - console.log(newUserGroup) return newUserGroup; } } \ No newline at end of file From a1105f06abf28d72b691c9431fd54083a82d8318 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Sat, 5 Dec 2020 10:43:28 +0100 Subject: [PATCH 5/5] Cleaned up a load of relations and optional stuff ref #11 --- src/models/entities/Address.ts | 9 ++++---- src/models/entities/DistanceDonation.ts | 2 +- src/models/entities/Donation.ts | 6 ++---- src/models/entities/Donor.ts | 2 +- src/models/entities/FixedDonation.ts | 4 ++-- src/models/entities/GroupContact.ts | 28 +++++++++---------------- src/models/entities/Participant.ts | 7 +++---- src/models/entities/Permission.ts | 7 +++---- src/models/entities/Runner.ts | 2 +- src/models/entities/RunnerCard.ts | 5 ++--- src/models/entities/RunnerGroup.ts | 3 +-- src/models/entities/RunnerTeam.ts | 2 +- src/models/entities/Scan.ts | 19 +++++------------ src/models/entities/ScanStation.ts | 9 ++++---- src/models/entities/Track.ts | 7 +++---- src/models/entities/TrackScan.ts | 12 +++++------ src/models/entities/UserAction.ts | 5 ++--- src/models/entities/UserGroup.ts | 1 - 18 files changed, 50 insertions(+), 80 deletions(-) diff --git a/src/models/entities/Address.ts b/src/models/entities/Address.ts index 735ecd3..6cc1d11 100644 --- a/src/models/entities/Address.ts +++ b/src/models/entities/Address.ts @@ -1,11 +1,11 @@ -import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm"; import { IsInt, IsNotEmpty, IsOptional, IsPostalCode, - IsString, + IsString } from "class-validator"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { Participant } from "./Participant"; import { RunnerOrganisation } from "./RunnerOrganisation"; @@ -18,14 +18,13 @@ export class Address { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; /** * The address's description. */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsString() @IsOptional() description?: string; @@ -43,7 +42,7 @@ export class Address { * The address's second line. * Containing optional information. */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsString() @IsOptional() address2?: string; diff --git a/src/models/entities/DistanceDonation.ts b/src/models/entities/DistanceDonation.ts index d5610d7..9051849 100644 --- a/src/models/entities/DistanceDonation.ts +++ b/src/models/entities/DistanceDonation.ts @@ -13,7 +13,7 @@ export class DistanceDonation extends Donation { * The runner associated. */ @IsNotEmpty() - @ManyToOne(() => Runner, runner => runner.distanceDonations, { nullable: true }) + @ManyToOne(() => Runner, runner => runner.distanceDonations) runner: Runner; /** diff --git a/src/models/entities/Donation.ts b/src/models/entities/Donation.ts index 2609a98..4af3485 100644 --- a/src/models/entities/Donation.ts +++ b/src/models/entities/Donation.ts @@ -1,7 +1,6 @@ import { IsInt, - IsNotEmpty, - IsOptional + IsNotEmpty } from "class-validator"; import { Entity, ManyToOne, PrimaryGeneratedColumn, TableInheritance } from "typeorm"; import { Participant } from "./Participant"; @@ -16,7 +15,6 @@ export abstract class Donation { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; @@ -24,7 +22,7 @@ export abstract class Donation { * The donations's donor. */ @IsNotEmpty() - @ManyToOne(() => Participant, donor => donor.donations, { nullable: true }) + @ManyToOne(() => Participant, donor => donor.donations) donor: Participant; /** diff --git a/src/models/entities/Donor.ts b/src/models/entities/Donor.ts index ca65afd..b92b06a 100644 --- a/src/models/entities/Donor.ts +++ b/src/models/entities/Donor.ts @@ -1,5 +1,5 @@ -import { Entity, Column, ChildEntity } from "typeorm"; import { IsBoolean } from "class-validator"; +import { ChildEntity, Column } from "typeorm"; import { Participant } from "./Participant"; /** diff --git a/src/models/entities/FixedDonation.ts b/src/models/entities/FixedDonation.ts index dd05c40..8ab366d 100644 --- a/src/models/entities/FixedDonation.ts +++ b/src/models/entities/FixedDonation.ts @@ -1,5 +1,5 @@ -import { Entity, Column, ChildEntity } from "typeorm"; -import { IsInt, IsPositive, } from "class-validator"; +import { IsInt, IsPositive } from "class-validator"; +import { ChildEntity, Column } from "typeorm"; import { Donation } from "./Donation"; /** diff --git a/src/models/entities/GroupContact.ts b/src/models/entities/GroupContact.ts index 5d12066..c7c8f18 100644 --- a/src/models/entities/GroupContact.ts +++ b/src/models/entities/GroupContact.ts @@ -1,15 +1,14 @@ -import { PrimaryGeneratedColumn, Column, OneToMany, ManyToOne, Entity } from "typeorm"; import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, - IsPositive, - IsString, + + IsString } from "class-validator"; +import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { Address } from "./Address"; -import { Donation } from "./Donation"; import { RunnerGroup } from "./RunnerGroup"; /** @@ -17,11 +16,10 @@ import { RunnerGroup } from "./RunnerGroup"; */ @Entity() export class GroupContact { - /** - * Autogenerated unique id (primary key). - */ + /** + * Autogenerated unique id (primary key). + */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; @@ -37,7 +35,7 @@ export class GroupContact { * The contact's middle name. * Optional */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsOptional() @IsString() middlename?: string; @@ -62,7 +60,7 @@ export class GroupContact { * The contact's phone number. * Optional */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsOptional() @IsPhoneNumber("DE") phone?: string; @@ -71,19 +69,13 @@ export class GroupContact { * The contact's email address. * Optional */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsOptional() @IsEmail() email?: string; /** - * Used to link the contact as the donor of a donation. - */ - @OneToMany(() => Donation, donation => donation.donor, { nullable: true }) - donations: Donation[]; - - /** - * Used to link runners to donations. + * Used to link contacts to groups. */ @OneToMany(() => RunnerGroup, group => group.contact, { nullable: true }) groups: RunnerGroup[]; diff --git a/src/models/entities/Participant.ts b/src/models/entities/Participant.ts index 53562a3..2e40f5d 100644 --- a/src/models/entities/Participant.ts +++ b/src/models/entities/Participant.ts @@ -1,13 +1,13 @@ -import { PrimaryGeneratedColumn, Column, OneToMany, ManyToOne, Entity, TableInheritance } from "typeorm"; import { IsEmail, IsInt, IsNotEmpty, IsOptional, IsPhoneNumber, - IsPositive, - IsString, + + IsString } from "class-validator"; +import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn, TableInheritance } from "typeorm"; import { Address } from "./Address"; import { Donation } from "./Donation"; @@ -21,7 +21,6 @@ export abstract class Participant { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; diff --git a/src/models/entities/Permission.ts b/src/models/entities/Permission.ts index 751efe3..b9e2777 100644 --- a/src/models/entities/Permission.ts +++ b/src/models/entities/Permission.ts @@ -1,10 +1,10 @@ -import { PrimaryGeneratedColumn, Column, OneToMany, Entity, ManyToOne } from "typeorm"; import { IsInt, IsNotEmpty, - IsOptional, - IsString, + + IsString } from "class-validator"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { User } from './User'; import { UserGroup } from './UserGroup'; /** @@ -16,7 +16,6 @@ export abstract class Permission { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; diff --git a/src/models/entities/Runner.ts b/src/models/entities/Runner.ts index 7a8d0ad..5454f64 100644 --- a/src/models/entities/Runner.ts +++ b/src/models/entities/Runner.ts @@ -15,7 +15,7 @@ export class Runner extends Participant { * The runner's associated group. */ @IsNotEmpty() - @ManyToOne(() => RunnerGroup, group => group.runners, { nullable: true }) + @ManyToOne(() => RunnerGroup, group => group.runners, { nullable: false }) group: RunnerGroup; /** diff --git a/src/models/entities/RunnerCard.ts b/src/models/entities/RunnerCard.ts index 0ba0428..49ea0da 100644 --- a/src/models/entities/RunnerCard.ts +++ b/src/models/entities/RunnerCard.ts @@ -1,12 +1,12 @@ -import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm"; import { IsBoolean, IsEAN, IsInt, IsNotEmpty, IsOptional, - IsString, + IsString } from "class-validator"; +import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { Runner } from "./Runner"; import { TrackScan } from "./TrackScan"; @@ -19,7 +19,6 @@ export class RunnerCard { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; diff --git a/src/models/entities/RunnerGroup.ts b/src/models/entities/RunnerGroup.ts index 2033d88..c042384 100644 --- a/src/models/entities/RunnerGroup.ts +++ b/src/models/entities/RunnerGroup.ts @@ -18,12 +18,11 @@ export abstract class RunnerGroup { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; /** - * The group's first name. + * The group's name. */ @Column() @IsNotEmpty() diff --git a/src/models/entities/RunnerTeam.ts b/src/models/entities/RunnerTeam.ts index 44a047a..21cdcb4 100644 --- a/src/models/entities/RunnerTeam.ts +++ b/src/models/entities/RunnerTeam.ts @@ -15,7 +15,7 @@ export class RunnerTeam extends RunnerGroup { * Optional */ @IsNotEmpty() - @ManyToOne(() => RunnerOrganisation, org => org.teams, { nullable: true }) + @ManyToOne(() => RunnerOrganisation, org => org.teams, { nullable: false }) parentGroup?: RunnerOrganisation; /** diff --git a/src/models/entities/Scan.ts b/src/models/entities/Scan.ts index 75ec65d..b8fc079 100644 --- a/src/models/entities/Scan.ts +++ b/src/models/entities/Scan.ts @@ -1,11 +1,11 @@ -import { PrimaryGeneratedColumn, Column, ManyToOne, Entity, TableInheritance } from "typeorm"; import { IsBoolean, IsInt, IsNotEmpty, - IsOptional, - IsPositive, + + IsPositive } from "class-validator"; +import { Column, Entity, ManyToOne, PrimaryGeneratedColumn, TableInheritance } from "typeorm"; import { Runner } from "./Runner"; /** @@ -18,7 +18,6 @@ export abstract class Scan { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; @@ -26,7 +25,7 @@ export abstract class Scan { * The associated runner. */ @IsNotEmpty() - @ManyToOne(() => Runner, runner => runner.scans, { nullable: true }) + @ManyToOne(() => Runner, runner => runner.scans, { nullable: false }) runner: Runner; /** @@ -43,12 +42,4 @@ export abstract class Scan { @Column() @IsBoolean() valid: boolean = true; - - /** - * seconds since last scan - */ - @IsInt() - @IsOptional() - secondsSinceLastScan: number; - -} +} \ No newline at end of file diff --git a/src/models/entities/ScanStation.ts b/src/models/entities/ScanStation.ts index c529b25..f014da8 100644 --- a/src/models/entities/ScanStation.ts +++ b/src/models/entities/ScanStation.ts @@ -1,11 +1,11 @@ -import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm"; import { IsBoolean, IsInt, IsNotEmpty, IsOptional, - IsString, + IsString } from "class-validator"; +import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { Track } from "./Track"; import { TrackScan } from "./TrackScan"; @@ -18,14 +18,13 @@ export class ScanStation { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; /** * The station's description. */ - @Column({nullable: true}) + @Column({ nullable: true }) @IsOptional() @IsString() description?: string; @@ -34,7 +33,7 @@ export class ScanStation { * The track this station is associated with. */ @IsNotEmpty() - @ManyToOne(() => Track, track => track.stations, { nullable: true }) + @ManyToOne(() => Track, track => track.stations, { nullable: false }) track: Track; /** diff --git a/src/models/entities/Track.ts b/src/models/entities/Track.ts index ad6f476..34f3bb6 100644 --- a/src/models/entities/Track.ts +++ b/src/models/entities/Track.ts @@ -1,11 +1,11 @@ -import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm"; import { IsInt, IsNotEmpty, - IsOptional, + IsPositive, - IsString, + IsString } from "class-validator"; +import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"; import { ScanStation } from "./ScanStation"; import { TrackScan } from "./TrackScan"; @@ -18,7 +18,6 @@ export class Track { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number;; diff --git a/src/models/entities/TrackScan.ts b/src/models/entities/TrackScan.ts index f7bee32..759c3d7 100644 --- a/src/models/entities/TrackScan.ts +++ b/src/models/entities/TrackScan.ts @@ -1,17 +1,15 @@ -import { PrimaryGeneratedColumn, Column, ManyToOne, Entity, ChildEntity } from "typeorm"; import { - IsBoolean, IsDateString, IsInt, IsNotEmpty, - IsOptional, - IsPositive, + + IsPositive } from "class-validator"; -import { Scan } from "./Scan"; -import { Runner } from "./Runner"; -import { Track } from "./Track"; +import { ChildEntity, Column, ManyToOne } from "typeorm"; import { RunnerCard } from "./RunnerCard"; +import { Scan } from "./Scan"; import { ScanStation } from "./ScanStation"; +import { Track } from "./Track"; /** * Defines the scan interface. diff --git a/src/models/entities/UserAction.ts b/src/models/entities/UserAction.ts index c9caf60..92c41f0 100644 --- a/src/models/entities/UserAction.ts +++ b/src/models/entities/UserAction.ts @@ -1,10 +1,10 @@ -import { PrimaryGeneratedColumn, Column, OneToMany, Entity, ManyToOne } from "typeorm"; import { IsInt, IsNotEmpty, IsOptional, - IsString, + IsString } from "class-validator"; +import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm"; import { User } from './User'; /** @@ -16,7 +16,6 @@ export class UserAction { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number; diff --git a/src/models/entities/UserGroup.ts b/src/models/entities/UserGroup.ts index 2156d14..e86b2a6 100644 --- a/src/models/entities/UserGroup.ts +++ b/src/models/entities/UserGroup.ts @@ -16,7 +16,6 @@ export class UserGroup { * Autogenerated unique id (primary key). */ @PrimaryGeneratedColumn() - @IsOptional() @IsInt() id: number;