UNPKG

echadospalante-core

Version:

This package contains the core of the echadospalante project, it contains the domain entities, helpers, and other utilities that are shared between the different services.

36 lines (28 loc) 726 B
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn, } from "typeorm"; import { DepartmentData } from "./department.data"; import { UserDetailData } from "./user-detail.data"; @Entity({ name: "municipality" }) export class MunicipalityData { @PrimaryGeneratedColumn() id: number; @Column() name: string; @CreateDateColumn() createdAt: Date; @UpdateDateColumn() updatedAt: Date; @ManyToOne(() => DepartmentData, (department) => department.municipalities) @JoinColumn({ name: "departmentId" }) department: DepartmentData; @OneToMany(() => UserDetailData, (ud) => ud.municipality) userDetails: UserDetailData[]; }