feat(#194): module Cartes SYSTEM
Closes #194 Co-authored-by: Julien Martin <julien.martin@ptits-pas.fr>
This commit was merged in pull request #203.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
import { CardInstance } from './card_instances.entity';
|
||||
import { Users } from './users.entity';
|
||||
|
||||
export enum CardResponseActionType {
|
||||
ACCEPT = 'accept',
|
||||
REFUSE = 'refuse',
|
||||
ACK = 'ack',
|
||||
}
|
||||
|
||||
@Entity('card_responses', { schema: 'public' })
|
||||
export class CardResponse {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column({ name: 'id_card', type: 'uuid' })
|
||||
id_card: string;
|
||||
|
||||
@ManyToOne(() => CardInstance, (c) => c.responses, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'id_card', referencedColumnName: 'id' })
|
||||
card: CardInstance;
|
||||
|
||||
@Column({ name: 'id_utilisateur', type: 'uuid' })
|
||||
id_utilisateur: string;
|
||||
|
||||
@ManyToOne(() => Users, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'id_utilisateur', referencedColumnName: 'id' })
|
||||
user: Users;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: CardResponseActionType,
|
||||
enumName: 'card_response_action_type',
|
||||
name: 'action',
|
||||
})
|
||||
action: CardResponseActionType;
|
||||
|
||||
@Column({ name: 'comment', type: 'text', nullable: true })
|
||||
comment?: string;
|
||||
|
||||
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
|
||||
cree_le: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user