ff-admin-server/src/entity/protocolVoting.ts

31 lines
658 B
TypeScript
Raw Normal View History

2024-10-10 12:44:41 +00:00
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { protocol } from "./protocol";
@Entity()
2024-10-11 12:44:09 +00:00
export class protocolVoting {
2024-10-10 12:44:41 +00:00
@PrimaryGeneratedColumn("increment")
2024-10-11 12:44:09 +00:00
id: number;
2024-10-10 12:44:41 +00:00
@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;
}