protocol tables

This commit is contained in:
Julian Krauser 2024-10-10 14:44:41 +02:00
parent edc35f2f87
commit dd74005043
6 changed files with 262 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { protocol } from "./protocol";
@Entity()
export class protocolAgenda {
@PrimaryGeneratedColumn("increment")
id: string;
@Column({ type: "varchar", length: 255 })
topic: string;
@Column({ type: "varchar", length: 255, default: "" })
context: string;
@ManyToOne(() => protocol, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
protocol: protocol;
}

View file

@ -0,0 +1,21 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { protocol } from "./protocol";
@Entity()
export class protocolDecisions {
@PrimaryGeneratedColumn("increment")
id: string;
@Column({ type: "varchar", length: 255 })
topic: string;
@Column({ type: "varchar", length: 255, default: "" })
context: string;
@ManyToOne(() => protocol, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
protocol: protocol;
}

View file

@ -0,0 +1,26 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { protocol } from "./protocol";
import { member } from "./member";
@Entity()
export class protocolPresence {
@PrimaryColumn()
memberId: string;
@PrimaryColumn()
protocolId: string;
@ManyToOne(() => member, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
member: member;
@ManyToOne(() => protocol, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
protocol: protocol;
}

View file

@ -0,0 +1,30 @@
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { protocol } from "./protocol";
@Entity()
export class protocolVotings {
@PrimaryGeneratedColumn("increment")
id: string;
@Column({ type: "varchar", length: 255 })
topic: string;
@Column({ type: "varchar", length: 255, default: "" })
context: string;
@Column({ type: "int", default: 0 })
favour: number;
@Column({ type: "int", default: 0 })
abstain: number;
@Column({ type: "int", default: 0 })
against: number;
@ManyToOne(() => protocol, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
protocol: protocol;
}