- Create Relais entity - Create Relais module, controller, service with CRUD - Update Users entity with ManyToOne relation to Relais - Update GestionnairesService to handle relaisId Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
917 B
TypeScript
36 lines
917 B
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, OneToMany } from 'typeorm';
|
|
import { Users } from './users.entity';
|
|
|
|
@Entity('relais', { schema: 'public' })
|
|
export class Relais {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ name: 'nom' })
|
|
nom: string;
|
|
|
|
@Column({ name: 'adresse' })
|
|
adresse: string;
|
|
|
|
@Column({ type: 'jsonb', name: 'horaires_ouverture', nullable: true })
|
|
horaires_ouverture?: any;
|
|
|
|
@Column({ name: 'ligne_fixe', nullable: true })
|
|
ligne_fixe?: string;
|
|
|
|
@Column({ default: true, name: 'actif' })
|
|
actif: boolean;
|
|
|
|
@Column({ type: 'text', name: 'notes', nullable: true })
|
|
notes?: string;
|
|
|
|
@CreateDateColumn({ name: 'cree_le', type: 'timestamptz' })
|
|
cree_le: Date;
|
|
|
|
@UpdateDateColumn({ name: 'modifie_le', type: 'timestamptz' })
|
|
modifie_le: Date;
|
|
|
|
@OneToMany(() => Users, user => user.relais)
|
|
gestionnaires: Users[];
|
|
}
|