education controller, service, command
This commit is contained in:
parent
5368a96d0f
commit
fded8a663a
29 changed files with 884 additions and 5 deletions
|
@ -16,6 +16,7 @@ import { memberExecutivePositions } from "./memberExecutivePositions";
|
|||
import { communication } from "./communication";
|
||||
import { salutation } from "../../configuration/salutation";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
import { memberEducations } from "./memberEducations";
|
||||
|
||||
@Entity()
|
||||
export class member {
|
||||
|
@ -37,6 +38,9 @@ export class member {
|
|||
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
||||
internalId?: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
note?: string;
|
||||
|
||||
@Column()
|
||||
salutationId: number;
|
||||
|
||||
|
@ -66,6 +70,9 @@ export class member {
|
|||
@OneToMany(() => memberQualifications, (qualifications) => qualifications.member, { cascade: ["insert"] })
|
||||
qualifications: memberQualifications[];
|
||||
|
||||
@OneToMany(() => memberEducations, (educations) => educations.member, { cascade: ["insert"] })
|
||||
educations: memberEducations[];
|
||||
|
||||
firstMembershipEntry?: membership;
|
||||
lastMembershipEntry?: membership;
|
||||
preferredCommunication?: Array<communication>;
|
||||
|
|
43
src/entity/club/member/memberEducations.ts
Normal file
43
src/entity/club/member/memberEducations.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { member } from "./member";
|
||||
import { education } from "../../configuration/education";
|
||||
import { getTypeByORM } from "../../../migrations/ormHelper";
|
||||
|
||||
@Entity()
|
||||
export class memberEducations {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType })
|
||||
start: Date;
|
||||
|
||||
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
||||
end?: Date;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
note?: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
place?: string;
|
||||
|
||||
@Column()
|
||||
memberId: string;
|
||||
|
||||
@Column()
|
||||
educationId: number;
|
||||
|
||||
@ManyToOne(() => member, (member) => member.awards, {
|
||||
nullable: false,
|
||||
onDelete: "CASCADE",
|
||||
onUpdate: "RESTRICT",
|
||||
})
|
||||
member: member;
|
||||
|
||||
@ManyToOne(() => education, (education) => education.members, {
|
||||
nullable: false,
|
||||
onDelete: "RESTRICT",
|
||||
onUpdate: "RESTRICT",
|
||||
cascade: ["insert"],
|
||||
})
|
||||
education: education;
|
||||
}
|
17
src/entity/configuration/education.ts
Normal file
17
src/entity/configuration/education.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { memberEducations } from "../club/member/memberEducations";
|
||||
|
||||
@Entity()
|
||||
export class education {
|
||||
@PrimaryColumn({ generated: "increment", type: "int" })
|
||||
id: number;
|
||||
|
||||
@Column({ type: "varchar", length: 255, unique: true })
|
||||
education: string;
|
||||
|
||||
@Column({ type: "varchar", length: 255, nullable: true })
|
||||
description?: string;
|
||||
|
||||
@OneToMany(() => memberEducations, (memberEducations) => memberEducations.education)
|
||||
members: memberEducations[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue