src/model/*: added some orm entities
parent
c8ad2badc2
commit
be7c1a0d39
@ -0,0 +1,30 @@
|
||||
/* eslint no-unused-vars: "off" */
|
||||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
export enum BikeEventType {
|
||||
KAUF = 'Kauf',
|
||||
INBETRIEBNAHME = 'Inbetriebnahme',
|
||||
AUSFALL = 'Ausfall',
|
||||
WARTUNG = 'Wartung'
|
||||
}
|
||||
|
||||
@Entity()
|
||||
export class BikeEvent {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
note: string;
|
||||
|
||||
@Column('simple-array')
|
||||
documents: string[];
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: BikeEventType
|
||||
})
|
||||
type: BikeEventType
|
||||
|
||||
@Column()
|
||||
otherEquipment: string;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
import { Column } from 'typeorm';
|
||||
|
||||
export abstract class Bike {
|
||||
@Column()
|
||||
description: string;
|
||||
|
||||
@Column()
|
||||
modelName: string;
|
||||
|
||||
@Column()
|
||||
numerOfWheels: number;
|
||||
|
||||
@Column()
|
||||
forCargo: boolean;
|
||||
|
||||
@Column()
|
||||
forChildren: boolean;
|
||||
|
||||
@Column()
|
||||
numberOfChildren: number;
|
||||
|
||||
// technical Information
|
||||
@Column()
|
||||
bicycleShift: string;
|
||||
|
||||
@Column()
|
||||
isEBike: boolean;
|
||||
|
||||
@Column()
|
||||
hasLightSystem: boolean;
|
||||
|
||||
@Column()
|
||||
specialFeatures: string;
|
||||
|
||||
// dimensions and load
|
||||
@Column()
|
||||
hasCoverBox: boolean;
|
||||
|
||||
@Column()
|
||||
lockable:boolean;
|
||||
|
||||
@Column()
|
||||
boxLength: number;
|
||||
|
||||
@Column()
|
||||
boxWidth: number;
|
||||
|
||||
@Column()
|
||||
boxHeight: number;
|
||||
|
||||
@Column()
|
||||
maxWeightBox: number;
|
||||
|
||||
@Column()
|
||||
maxWeightLuggageRack: number;
|
||||
|
||||
@Column()
|
||||
maxWeightTotal: number;
|
||||
|
||||
@Column()
|
||||
bikeLength: number;
|
||||
|
||||
@Column()
|
||||
bikeWidth: number;
|
||||
|
||||
@Column()
|
||||
bikeHeight: number;
|
||||
|
||||
@Column()
|
||||
bikeWeight: number;
|
||||
}
|
@ -1,13 +1,67 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
|
||||
/* eslint no-unused-vars: "off" */
|
||||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
|
||||
import { Bike } from './BikeFeatures';
|
||||
import { ChainSwap } from './ChainSwap';
|
||||
|
||||
export enum Group {
|
||||
KL,
|
||||
LI,
|
||||
SP,
|
||||
FK,
|
||||
MH,
|
||||
SZ,
|
||||
TS,
|
||||
TK
|
||||
}
|
||||
|
||||
export enum StickerBikeNameState {
|
||||
OK,
|
||||
IMPROVE,
|
||||
PRODUCED,
|
||||
NONEED,
|
||||
MISSING,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
@Entity()
|
||||
export class CargoBike {
|
||||
export class CargoBike extends Bike {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
group: Group;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
description: string;
|
||||
serialNo: string;
|
||||
|
||||
@OneToMany(type => ChainSwap, chainSwap => chainSwap.cargoBike)
|
||||
chainSwaps: ChainSwap[]
|
||||
|
||||
// Security information
|
||||
@Column()
|
||||
frameNumber: string;
|
||||
|
||||
@Column()
|
||||
keyNoFrameLock: string;
|
||||
|
||||
@Column()
|
||||
keyNoAXAChain: string;
|
||||
|
||||
@Column()
|
||||
policeCodeing: string;
|
||||
|
||||
@Column()
|
||||
adfsCoding: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: StickerBikeNameState
|
||||
})
|
||||
stickerBikeNameState: StickerBikeNameState;
|
||||
|
||||
@Column()
|
||||
note: string;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
|
||||
import { CargoBike } from './CargoBike';
|
||||
|
||||
@Entity()
|
||||
export class ChainSwap {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
mechanic: string;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
time: Date;
|
||||
|
||||
@Column()
|
||||
kexNoOldAXAChain: string;
|
||||
|
||||
@ManyToOne(type => CargoBike, cargoBike => cargoBike.chainSwaps)
|
||||
cargoBike: CargoBike;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
import { PrimaryGeneratedColumn, Column, ManyToOne, Entity } from 'typeorm';
|
||||
import { Provider } from './Provider';
|
||||
|
||||
@Entity()
|
||||
export class ContactInformation {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
firstName: string;
|
||||
|
||||
@Column({
|
||||
type: 'date',
|
||||
nullable: true
|
||||
})
|
||||
retiredAt: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phoneExtern: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phone2Extern: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phoneIntern: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
phone2Intern: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
emailExtern: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
emailIntern: string;
|
||||
|
||||
@Column()
|
||||
note: string;
|
||||
|
||||
@ManyToOne(type => Provider, provider => provider.contactInformation)
|
||||
provider: Provider;
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
|
||||
@Entity()
|
||||
export class Participant {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
start: Date;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
end: Date;
|
||||
|
||||
@OneToOne(type => ContactInformation)
|
||||
@JoinColumn()
|
||||
contactInformation: ContactInformation;
|
||||
|
||||
@Column()
|
||||
usernameflotte: string;
|
||||
|
||||
@Column()
|
||||
usernameSlack: string;
|
||||
|
||||
@Column()
|
||||
memberADFC: boolean;
|
||||
|
||||
@Column({
|
||||
type: 'simple-array'
|
||||
})
|
||||
locationZIPs: string[];
|
||||
|
||||
@Column()
|
||||
roleCoreTeam: boolean;
|
||||
|
||||
@Column()
|
||||
roleCoordinator: boolean;
|
||||
|
||||
@Column()
|
||||
roleEmployeADFC: boolean;
|
||||
|
||||
@Column()
|
||||
roleMentor: boolean;
|
||||
|
||||
@Column()
|
||||
roleAmbulance: boolean;
|
||||
|
||||
@Column()
|
||||
roleBringer: boolean;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
workshopMentor: Date;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
workshopAmbulance: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
reserve: string;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
/* eslint no-unused-vars: "off" */
|
||||
|
||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
|
||||
@Entity()
|
||||
export class Provider {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
formularName: String;
|
||||
|
||||
@Column()
|
||||
street: string;
|
||||
|
||||
@Column()
|
||||
number: string;
|
||||
|
||||
@Column()
|
||||
zip: string;
|
||||
|
||||
@Column()
|
||||
registerdAt: string;
|
||||
|
||||
@Column()
|
||||
registerNo: string;
|
||||
|
||||
@OneToMany(type => ContactInformation, contactInformation => contactInformation.provider)
|
||||
contactInformation: ContactInformation[];
|
||||
}
|
Loading…
Reference in New Issue