diff --git a/src/faction/faction.dto.ts b/src/faction/faction.dto.ts index 0b65c47007d6424584d8fdb35ac9d9ee53eaa924..9064f56f285d3ab2aede368ad91c269ad8c2a334 100644 --- a/src/faction/faction.dto.ts +++ b/src/faction/faction.dto.ts @@ -8,6 +8,7 @@ import { Min, Max, IsOptional, + IsHexColor, } from 'class-validator'; import { GameEntity } from '../game/game.entity'; @@ -23,6 +24,8 @@ export class FactionDTO { @IsNotEmpty() @Length(2, 31) factionName: string; + @IsHexColor() + colour: string; @IsString() @IsNotEmpty() @Length(3, 15) diff --git a/src/faction/faction.entity.ts b/src/faction/faction.entity.ts index 3aa74cf615d77deb1421d52d46d4159bf7e0d241..bc0b9269bdc5618364c536632f226c4974877080 100644 --- a/src/faction/faction.entity.ts +++ b/src/faction/faction.entity.ts @@ -21,6 +21,7 @@ export class FactionEntity { @PrimaryGeneratedColumn('uuid') factionId: string; @Column('text') factionName: string; @Column({ type: 'float' }) multiplier: number; + @Column('text') colour: string; @Exclude() @Column({ type: 'text' })