src/model/*: applied changes from flotte
parent
14b9d3445a
commit
e92d379a53
@ -0,0 +1,22 @@
|
||||
import { Lockable } from './CargoBike';
|
||||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
export class BikeEventType implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'timestamp'
|
||||
})
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
}
|
@ -1,54 +1,60 @@
|
||||
import { PrimaryGeneratedColumn, Column, Entity } from 'typeorm';
|
||||
import { PrimaryGeneratedColumn, Column, Entity, ManyToOne, OneToOne } from 'typeorm';
|
||||
import { Lockable } from './CargoBike';
|
||||
import { Person } from './Person';
|
||||
import { Address } from './Provider';
|
||||
import { Participant } from './Participant';
|
||||
|
||||
@Entity()
|
||||
export class ContactInformation {
|
||||
export class ContactInformation implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
@ManyToOne(type => Person, person => person.contactInformation)
|
||||
person: Person;
|
||||
|
||||
@Column()
|
||||
firstName: string;
|
||||
|
||||
@Column({
|
||||
type: 'date',
|
||||
@OneToOne(type => Participant, participant => participant.contactInformation, {
|
||||
nullable: true
|
||||
})
|
||||
retiredAt: Date;
|
||||
participant: Participant;
|
||||
|
||||
@Column(type => {
|
||||
return Address;
|
||||
})
|
||||
address: Address;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phoneExtern: string;
|
||||
phone: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phone2Extern: string;
|
||||
phone2: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phoneIntern: string;
|
||||
email: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phone2Intern: string;
|
||||
email2: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
emailExtern: string;
|
||||
note: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
nullable: true,
|
||||
type: 'timestamp'
|
||||
})
|
||||
emailIntern: string;
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
note: string;
|
||||
lockedBy: number;
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
import { Column, Entity, ManyToMany, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
import { LendingStation } from './LendingStation';
|
||||
import { Provider } from './Provider';
|
||||
|
||||
@Entity()
|
||||
export class ContactPerson {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@ManyToOne(type => ContactInformation)
|
||||
contactInformation: ContactInformation;
|
||||
|
||||
@ManyToMany(type => LendingStation, lendingStation => lendingStation.contactPersons, {
|
||||
nullable: true
|
||||
})
|
||||
lendingStations: LendingStation[];
|
||||
|
||||
@ManyToOne(type => Provider, provider => provider.contactPersons, {
|
||||
nullable: true
|
||||
})
|
||||
provider: Provider[];
|
||||
|
||||
@Column({
|
||||
type: 'boolean'
|
||||
})
|
||||
intern: boolean;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Lockable } from './CargoBike';
|
||||
import { Engagement } from './Engagement';
|
||||
|
||||
@Entity()
|
||||
export class EngagementType implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
nullable: true
|
||||
})
|
||||
description: string;
|
||||
|
||||
@OneToMany(type => Engagement, engagement => engagement.engagementTypeId)
|
||||
engagementIds: number[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'timestamp'
|
||||
})
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { CargoBike, Lockable } from './CargoBike';
|
||||
|
||||
@Entity()
|
||||
export class EquipmentType implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
type: 'text',
|
||||
default: ''
|
||||
})
|
||||
description: string;
|
||||
|
||||
@ManyToMany(type => CargoBike, cargoBike => cargoBike.miscellaneousEquipment)
|
||||
cargoBikes: CargoBike[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'timestamp'
|
||||
})
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
import { Lockable } from './CargoBike';
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
|
||||
@Entity()
|
||||
export class Person implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
firstName: string;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@OneToMany(type => ContactInformation, contactInformation => contactInformation.person)
|
||||
contactInformation: ContactInformation;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import { Lockable } from './CargoBike';
|
||||
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
|
||||
import { Workshop } from './Workshop';
|
||||
|
||||
@Entity()
|
||||
export class WorkshopType implements Lockable {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@OneToMany(type => Workshop, workshop => workshop.workshopTypeId)
|
||||
workshopIds: number[];
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: 'timestamp'
|
||||
})
|
||||
lockedUntil: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
}
|
Loading…
Reference in New Issue