From 62398b23fe2eb474cd5a33c125da374cbf36789a Mon Sep 17 00:00:00 2001
From: L4168 <L4168@student.jamk.fi>
Date: Wed, 10 Jul 2019 13:15:02 +0300
Subject: [PATCH] added hex colour to faction

---
 src/faction/faction.dto.ts    | 3 +++
 src/faction/faction.entity.ts | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/faction/faction.dto.ts b/src/faction/faction.dto.ts
index 0b65c47..9064f56 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 3aa74cf..bc0b926 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' })
-- 
GitLab