Skip to content
Snippets Groups Projects

Development to testing

Merged Ghost User requested to merge Development into testing
29 files
+ 405
156
Compare changes
  • Side-by-side
  • Inline
Files
29
@@ -3,18 +3,16 @@ import {
@@ -3,18 +3,16 @@ import {
Column,
Column,
PrimaryGeneratedColumn,
PrimaryGeneratedColumn,
ManyToOne,
ManyToOne,
Timestamp,
CreateDateColumn,
} from 'typeorm';
} from 'typeorm';
import { Game_PersonEntity, GameEntity } from '../game/game.entity';
import { GameEntity } from '../game/game.entity';
import { FactionEntity } from '../faction/faction.entity';
import { FactionEntity } from '../faction/faction.entity';
@Entity('MapDrawing')
@Entity('MapDrawing')
export class MapDrawingEntity {
export class MapDrawingEntity {
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@PrimaryGeneratedColumn('uuid') mapDrawingId: string;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'bool', nullable: true }) drawingIsActive: boolean;
@Column({ type: 'time', nullable: true }) drawingValidTill: string;
@Column({ type: 'json', nullable: true }) data: JSON;
@Column({ type: 'json', nullable: true }) data: JSON;
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings, {
@ManyToOne(type => FactionEntity, faction => faction.mapDrawings, {
@@ -25,27 +23,27 @@ export class MapDrawingEntity {
@@ -25,27 +23,27 @@ export class MapDrawingEntity {
onDelete: 'CASCADE',
onDelete: 'CASCADE',
})
})
gameId: GameEntity;
gameId: GameEntity;
 
 
async ownershipCheck(factionEntity, role) {
 
if (role === 'admin') {
 
return factionEntity == this.faction;
 
} else {
 
return this.faction && factionEntity.factionId === this.faction.factionId
 
? true
 
: false;
 
}
 
}
}
}
@Entity('Game_Person_MapDrawing')
@Entity('MapDrawingHistory')
export class Game_Person_MapDrawingEntity {
export class MapDrawingHistoryEntity {
@PrimaryGeneratedColumn('uuid') GPmapDrawingId: string;
@PrimaryGeneratedColumn('uuid') mapDrawingHistoryId: string;
@Column({ type: 'timestamp' }) GPCTimeStamp: Timestamp;
@CreateDateColumn() timestamp: Date;
 
@Column('bool') drawingIsActive: boolean;
 
@Column('json') data: JSON;
@ManyToOne(
@ManyToOne(() => MapDrawingEntity, mapDrawing => mapDrawing.mapDrawingId, {
type => Game_PersonEntity,
onDelete: 'CASCADE',
game_person => game_person.gamepersonId,
})
{
mapdrawing: string;
onDelete: 'CASCADE',
},
)
game_person: Game_PersonEntity;
@ManyToOne(
type => MapDrawingEntity,
map_drawing => map_drawing.mapDrawingId,
{
onDelete: 'CASCADE',
},
)
map_drawing: MapDrawingEntity;
}
}
Loading