Skip to content
Snippets Groups Projects

Draw update

Merged Ghost User requested to merge draw-update into Development
5 files
+ 63
60
Compare changes
  • Side-by-side
  • Inline
Files
5
import {
Entity,
Column,
PrimaryGeneratedColumn,
ManyToOne,
Timestamp,
} from 'typeorm';
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { Game_PersonEntity, GameEntity } from '../game/game.entity';
import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
@Entity('MapDrawing')
@@ -25,27 +19,14 @@ export class MapDrawingEntity {
onDelete: 'CASCADE',
})
gameId: GameEntity;
}
@Entity('Game_Person_MapDrawing')
export class Game_Person_MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') GPmapDrawingId: string;
@Column({ type: 'timestamp' }) GPCTimeStamp: Timestamp;
@ManyToOne(
type => Game_PersonEntity,
game_person => game_person.gamepersonId,
{
onDelete: 'CASCADE',
},
)
game_person: Game_PersonEntity;
@ManyToOne(
type => MapDrawingEntity,
map_drawing => map_drawing.mapDrawingId,
{
onDelete: 'CASCADE',
},
)
map_drawing: MapDrawingEntity;
async ownershipCheck(factionEntity, role) {
if (role === 'admin') {
return factionEntity == this.faction;
} else {
return this.faction && factionEntity.factionId === this.faction.factionId
? true
: false;
}
}
}
Loading