commit
711fd2c56b
@ -0,0 +1,36 @@
|
||||
/* 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({
|
||||
nullable: true
|
||||
})
|
||||
note: string;
|
||||
|
||||
@Column({
|
||||
type: 'date'
|
||||
})
|
||||
date: Date;
|
||||
|
||||
@Column('simple-array', {
|
||||
nullable: true
|
||||
})
|
||||
documents: string[];
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: BikeEventType
|
||||
})
|
||||
eventType: BikeEventType
|
||||
}
|
@ -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;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import { PrimaryGeneratedColumn, Column, Entity } from 'typeorm';
|
||||
import { Bike } from './BikeFeatures';
|
||||
|
||||
@Entity()
|
||||
export class BikeModel extends Bike {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
}
|
@ -1,13 +1,122 @@
|
||||
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
|
||||
/* eslint no-unused-vars: "off" */
|
||||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany, ManyToOne, OneToOne } from 'typeorm';
|
||||
import { Bike } from './BikeFeatures';
|
||||
import { ChainSwap } from './ChainSwap';
|
||||
import { Provider } from './Provider';
|
||||
import { Participant } from './Participant';
|
||||
import { InsuranceData } from './InsuranceData';
|
||||
import { LoanPeriod } from './LoanPeriod';
|
||||
import { LendingStation } from './LendingStation';
|
||||
import { Taxes } from './Taxes';
|
||||
import { Equipment } from './Equipment';
|
||||
|
||||
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 => Equipment, equipment => equipment.cargoBike, {
|
||||
nullable: true
|
||||
})
|
||||
equipment: Equipment[];
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
otherEquipment: string;
|
||||
|
||||
@OneToMany(type => ChainSwap, chainSwap => chainSwap.cargoBike, {
|
||||
nullable: true
|
||||
})
|
||||
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;
|
||||
|
||||
@ManyToOne(type => Provider, {
|
||||
nullable: true
|
||||
})
|
||||
provider: Provider;
|
||||
|
||||
@ManyToOne(type => Participant, participant => participant.cargoBikes)
|
||||
coordinator: Participant;
|
||||
|
||||
@Column(type => InsuranceData)
|
||||
insuranceData: InsuranceData;
|
||||
|
||||
@OneToMany(type => LoanPeriod, loanPeriod => loanPeriod.cargoBike, {
|
||||
nullable: true
|
||||
})
|
||||
loanPeriods: LoanPeriod[];
|
||||
|
||||
// This relation is a little redundant because one could also check all LoanPeriods for current station
|
||||
@ManyToOne(type => LendingStation, lendingStation => lendingStation.cargoBikes, {
|
||||
nullable: true
|
||||
})
|
||||
lendingStation: LendingStation;
|
||||
|
||||
@Column(type => Taxes)
|
||||
taxes: Taxes;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
lockedBy: number;
|
||||
|
||||
@Column({
|
||||
type: 'date',
|
||||
nullable: true
|
||||
})
|
||||
lockedUntil: Date;
|
||||
}
|
||||
|
@ -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,16 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
|
||||
import { CargoBike } from './CargoBike';
|
||||
|
||||
@Entity()
|
||||
export class Equipment {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
serialNo: string;
|
||||
|
||||
@OneToMany(type => CargoBike, cargoBike => cargoBike.equipment, {
|
||||
nullable: true
|
||||
})
|
||||
cargoBike: CargoBike;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
import { Column } from 'typeorm';
|
||||
|
||||
export class InsuranceData {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
benefector: string;
|
||||
|
||||
@Column()
|
||||
noPnP: string;
|
||||
|
||||
@Column()
|
||||
maintananceResponisble: string;
|
||||
|
||||
@Column()
|
||||
maintanceBenfector: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
maintanceAgreement: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
hasFixedRate: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
fixedRate: number;
|
||||
|
||||
@Column({
|
||||
type: 'money',
|
||||
nullable: true
|
||||
})
|
||||
projectAllowance: number;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
note: string;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable, OneToMany, ManyToOne } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
import { LoanPeriod } from './LoanPeriod';
|
||||
import { CargoBike } from './CargoBike';
|
||||
import { Organization } from './Organization';
|
||||
|
||||
@Entity()
|
||||
export class LendingStation {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@ManyToMany(type => ContactInformation)
|
||||
@JoinTable()
|
||||
contactInformation: ContactInformation[];
|
||||
|
||||
@Column()
|
||||
addressStreet: string;
|
||||
|
||||
@Column()
|
||||
addressStreetNo: string;
|
||||
|
||||
@Column()
|
||||
addressZip: string;
|
||||
|
||||
@OneToMany(type => LoanPeriod, loanPeriod => loanPeriod.lendingStation)
|
||||
loanPeriods: LoanPeriod[];
|
||||
|
||||
@OneToMany(type => CargoBike, cargoBike => cargoBike.lendingStation)
|
||||
cargoBikes: CargoBike[];
|
||||
|
||||
@ManyToOne(type => Organization, organization => organization.lendingStations)
|
||||
organization: Organization;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
|
||||
import { LendingStation } from './LendingStation';
|
||||
import { CargoBike } from './CargoBike';
|
||||
|
||||
@Entity()
|
||||
export class LoanPeriod {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
// I have to find out how typorm will map the datetange data type.
|
||||
@Column({
|
||||
type: 'daterange'
|
||||
})
|
||||
dateRange: Date[];
|
||||
|
||||
@ManyToOne(type => LendingStation, lendingStation => lendingStation.loanPeriods)
|
||||
lendingStation: LendingStation;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
note: string;
|
||||
|
||||
@ManyToOne(type => CargoBike, cargoBike => cargoBike.loanPeriods)
|
||||
cargoBike: CargoBike;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import { PrimaryGeneratedColumn, OneToOne, OneToMany, Column } from 'typeorm';
|
||||
import { LendingStation } from './LendingStation';
|
||||
import { Provider } from './Provider';
|
||||
|
||||
export class Organization {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@OneToMany(type => LendingStation, lendingStation => lendingStation.organization)
|
||||
lendingStations: LendingStation[];
|
||||
|
||||
@OneToOne(type => Provider, provider => provider.organization, {
|
||||
nullable: true
|
||||
})
|
||||
provider: Provider;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
registerdAt: string;
|
||||
|
||||
@Column({
|
||||
nullable: true
|
||||
})
|
||||
registerNo: string;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn, OneToMany } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
import { CargoBike } from './CargoBike';
|
||||
|
||||
@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[];
|
||||
|
||||
@OneToMany(type => CargoBike, cargoBike => cargoBike.coordinator)
|
||||
cargoBikes: CargoBike[];
|
||||
|
||||
@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,40 @@
|
||||
/* eslint no-unused-vars: "off" */
|
||||
|
||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity, OneToOne } from 'typeorm';
|
||||
import { ContactInformation } from './ContactInformation';
|
||||
import { LendingStation } from './LendingStation';
|
||||
import { Organization } from './Organization';
|
||||
|
||||
@Entity()
|
||||
export class Provider {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: false
|
||||
})
|
||||
formularName: String;
|
||||
|
||||
@Column()
|
||||
street: string;
|
||||
|
||||
@Column()
|
||||
number: string;
|
||||
|
||||
@Column()
|
||||
zip: string;
|
||||
|
||||
@OneToMany(type => ContactInformation, contactInformation => contactInformation.provider)
|
||||
contactInformation: ContactInformation[];
|
||||
|
||||
@Column()
|
||||
isPrivatePerson: boolean;
|
||||
|
||||
@OneToOne(type => Organization, organization => organization.provider, {
|
||||
nullable: true
|
||||
})
|
||||
organization: Organization;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
/* eslint no-unused-vars: "off" */
|
||||
import { Column } from 'typeorm';
|
||||
|
||||
export enum OrganizationArea {
|
||||
IB,
|
||||
ZB
|
||||
}
|
||||
export class Taxes {
|
||||
@Column()
|
||||
costCenter: string;
|
||||
|
||||
@Column({
|
||||
type: 'enum',
|
||||
enum: OrganizationArea,
|
||||
nullable: true
|
||||
})
|
||||
organizationArea: OrganizationArea;
|
||||
}
|
Loading…
Reference in New Issue