change folder structure

This commit is contained in:
Julian Krauser 2025-02-15 10:59:54 +01:00
parent a332e4d779
commit a09c75a998
167 changed files with 262 additions and 246 deletions

View file

@ -0,0 +1,14 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { memberAwards } from "../club/member/memberAwards";
@Entity()
export class award {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
award: string;
@OneToMany(() => memberAwards, (member) => member.award)
members: memberAwards[];
}

View file

@ -0,0 +1,33 @@
import { Column, Entity, OneToMany, PrimaryColumn, PrimaryGeneratedColumn } from "typeorm";
import { calendar } from "../club/calendar";
@Entity()
export class calendarType {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
type: string;
@Column({ type: "boolean", default: false }) // none specified cal dav request
nscdr: boolean;
@Column({ type: "varchar", length: 255 })
color: string;
@Column({ type: "varchar", length: 255, nullable: true, default: null })
passphrase: string | null;
@Column({ type: "varchar", length: 255, nullable: false, default: "" })
externalPrefix: string;
@Column({ type: "boolean", default: false })
sendToWebpage: boolean;
@OneToMany(() => calendar, (c) => c.type, {
nullable: false,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
})
calendar: calendar[];
}

View file

@ -0,0 +1,30 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { communication } from "../club/member/communication";
import { CommunicationFieldType, communicationFieldTypes } from "../../type/fieldTypes";
@Entity()
export class communicationType {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
type: string;
@Column({
type: "varchar",
length: 255,
default: "",
transformer: {
from(value: string): Array<CommunicationFieldType> {
return communicationFieldTypes.filter((e) => value?.includes(e));
},
to(value: Array<CommunicationFieldType>): string {
return value.filter((e) => communicationFieldTypes.includes(e)).join(",");
},
},
})
useColumns: Array<CommunicationFieldType>;
@OneToMany(() => communication, (communication) => communication.type)
communications: communication[];
}

View file

@ -0,0 +1,14 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { memberExecutivePositions } from "../club/member/memberExecutivePositions";
@Entity()
export class executivePosition {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
position: string;
@OneToMany(() => memberExecutivePositions, (memberExecutivePositions) => memberExecutivePositions.executivePosition)
members: memberExecutivePositions[];
}

View file

@ -0,0 +1,14 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { membership } from "../club/member/membership";
@Entity()
export class membershipStatus {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
status: string;
@OneToMany(() => membership, (membership) => membership.status)
memberships: membership[];
}

View file

@ -0,0 +1,31 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { NewsletterConfigType } from "../../enums/newsletterConfigType";
import { communicationType } from "./communicationType";
@Entity()
export class newsletterConfig {
@PrimaryColumn()
comTypeId: number;
@Column({
type: "varchar",
length: "255",
transformer: {
to(value: NewsletterConfigType) {
return value.toString();
},
from(value: string) {
return NewsletterConfigType[value as keyof typeof NewsletterConfigType];
},
},
})
config: NewsletterConfigType;
@ManyToOne(() => communicationType, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
cascade: ["insert"],
})
comType: communicationType;
}

View file

@ -0,0 +1,17 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { memberQualifications } from "../club/member/memberQualifications";
@Entity()
export class qualification {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
qualification: string;
@Column({ type: "varchar", length: 255, nullable: true })
description?: string;
@OneToMany(() => memberQualifications, (memberQualifications) => memberQualifications.qualification)
members: memberQualifications[];
}

View file

@ -0,0 +1,13 @@
import { Column, Entity, PrimaryColumn } from "typeorm";
@Entity()
export class query {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
title: string;
@Column({ type: "text", default: "" })
query: string;
}

View file

@ -0,0 +1,15 @@
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
import { memberAwards } from "../club/member/memberAwards";
import { member } from "../club/member/member";
@Entity()
export class salutation {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
salutation: string;
@OneToMany(() => member, (member) => member.salutation)
members: member[];
}

View file

@ -0,0 +1,30 @@
import { Column, Entity, PrimaryColumn } from "typeorm";
@Entity()
export class template {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, unique: true })
template: string;
@Column({ type: "varchar", length: 255, nullable: true })
description?: string;
@Column({
type: "text",
default: "{}",
transformer: {
to(value: object) {
return JSON.stringify(value);
},
from(value: string) {
return JSON.parse(value);
},
},
})
design: object;
@Column({ type: "text", default: "" })
html: string;
}

View file

@ -0,0 +1,45 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { template } from "./template";
import { PermissionModule } from "../../type/permissionTypes";
@Entity()
export class templateUsage {
@PrimaryColumn({ type: "varchar", length: 255 })
scope: `${PermissionModule}`|`${PermissionModule}.${string}`;
@Column({ type: "int", nullable: true })
headerId: number | null;
@Column({ type: "int", nullable: true })
bodyId: number | null;
@Column({ type: "int", nullable: true })
footerId: number | null;
@Column({ type: "int", nullable: true })
headerHeight: number | null;
@Column({ type: "int", nullable: true })
footerHeight: number | null;
@ManyToOne(() => template, {
nullable: true,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
})
header: template | null;
@ManyToOne(() => template, {
nullable: true,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
})
body: template | null;
@ManyToOne(() => template, {
nullable: true,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
})
footer: template | null;
}