https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
@@ -0,0 +1,70 @@
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { OrganizationAggregate } from '../Organization/OrganizationAggregate';
export enum Type {
LUCK = 0,
JOKER = 1,
QUESTION = 2
}
export enum CType {
PUBLIC = 0,
PRIVATE = 1,
ORGANIZATION = 2
}
export enum State {
ACTIVE = 0,
SOFT_DELETE = 1
}
export enum CardType {
QUIZ = 0,
SENTENCE_PAIRING = 1,
OWN_ANSWER = 2,
TRUE_FALSE = 3,
CLOSER = 4
}
export interface Card {
text: string;
type?: CardType;
answer?: string | null;
}
@Entity('Decks')
export class DeckAggregate {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ type: 'varchar', length: 255 })
name!: string;
@Column({ type: 'int'})
type!: Type;
@Column({ type: 'uuid', name: 'user_id' })
userid!: string;
@CreateDateColumn({ name: 'creation_date' })
creationdate!: Date;
@Column({ type: 'json' })
cards!: Card[];
@Column({ type: 'int', default: 0, name: 'played_number' })
playedNumber!: number;
@Column({ type: 'int', default: CType.PUBLIC })
ctype!: CType;
@UpdateDateColumn({ name: 'update_date' })
updatedate!: Date;
@Column({ type: 'int', default: State.ACTIVE })
state!: State;
@ManyToOne(() => OrganizationAggregate, { nullable: true })
@JoinColumn({ name: 'organization_id' })
organization!: OrganizationAggregate | null;
}