src/model/*: applied more changes from flotte

pull/14/head
leonnicolas 4 years ago
parent e92d379a53
commit 037cd06651
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -9,7 +9,6 @@ import express from 'express';
import { requiredPermissions } from './datasources/userserver/permission'; import { requiredPermissions } from './datasources/userserver/permission';
import { CargoBike } from './model/CargoBike'; import { CargoBike } from './model/CargoBike';
import { BikeEvent } from './model/BikeEvent'; import { BikeEvent } from './model/BikeEvent';
import { BikeModel } from './model/BikeModel';
import { ContactInformation } from './model/ContactInformation'; import { ContactInformation } from './model/ContactInformation';
import { Equipment } from './model/Equipment'; import { Equipment } from './model/Equipment';
import { LendingStation } from './model/LendingStation'; import { LendingStation } from './model/LendingStation';
@ -69,7 +68,6 @@ createConnection({
CargoBike, CargoBike,
BikeEvent, BikeEvent,
BikeEventType, BikeEventType,
BikeModel,
ContactInformation, ContactInformation,
Equipment, Equipment,
EquipmentType, EquipmentType,

@ -1,109 +0,0 @@
import { Column } from 'typeorm';
export class TechnicalEquipment {
@Column()
bicycleShift: string;
@Column()
isEBike: boolean;
@Column()
hasLightSystem: boolean;
@Column({
nullable: true
})
specialFeatures: string;
}
export class DimensionsAndLoad {
@Column()
hasCoverBox: boolean;
@Column()
lockable:boolean;
@Column({
type: 'decimal'
})
boxLength: number;
@Column({
type: 'decimal'
})
boxWidth: number;
@Column({
type: 'decimal'
})
boxHeight: number;
@Column({
type: 'decimal'
})
maxWeightBox: number;
@Column({
type: 'decimal'
})
maxWeightLuggageRack: number;
@Column({
type: 'decimal'
})
maxWeightTotal: number;
@Column({
type: 'decimal'
})
bikeLength: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeWidth: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeHeight: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeWeight: number;
}
export abstract class Bike {
@Column({
nullable: true
})
description: string;
@Column()
modelName: string;
@Column()
numberOfWheels: number;
@Column()
forCargo: boolean;
@Column()
forChildren: boolean;
@Column()
numberOfChildren: number;
@Column(type => TechnicalEquipment)
technicalEquipment: TechnicalEquipment;
@Column(type => DimensionsAndLoad)
dimensionsAndLoad: DimensionsAndLoad;
}

@ -1,11 +0,0 @@
import { PrimaryGeneratedColumn, Column, Entity } from 'typeorm';
import { Bike } from './BikeFeatures';
@Entity()
export class BikeModel extends Bike {
@PrimaryGeneratedColumn()
id: number;
@Column()
name: string;
}

@ -1,6 +1,5 @@
/* eslint no-unused-vars: "off" */ /* eslint no-unused-vars: "off" */
import { Entity, Column, PrimaryGeneratedColumn, OneToMany, ManyToOne, JoinColumn, ManyToMany } from 'typeorm'; import { Entity, Column, PrimaryGeneratedColumn, OneToMany, ManyToOne, JoinColumn, ManyToMany } from 'typeorm';
import { Bike } from './BikeFeatures';
import { Provider } from './Provider'; import { Provider } from './Provider';
import { Participant } from './Participant'; import { Participant } from './Participant';
import { InsuranceData } from './InsuranceData'; import { InsuranceData } from './InsuranceData';
@ -61,9 +60,88 @@ export class Security {
}) })
adfcCoding: string; adfcCoding: string;
} }
export class TechnicalEquipment {
@Column()
bicycleShift: string;
@Column()
isEBike: boolean;
@Column()
hasLightSystem: boolean;
@Column({
nullable: true
})
specialFeatures: string;
}
export class DimensionsAndLoad {
@Column()
hasCoverBox: boolean;
@Column()
lockable:boolean;
@Column({
type: 'decimal'
})
boxLength: number;
@Column({
type: 'decimal'
})
boxWidth: number;
@Column({
type: 'decimal'
})
boxHeight: number;
@Column({
type: 'decimal'
})
maxWeightBox: number;
@Column({
type: 'decimal'
})
maxWeightLuggageRack: number;
@Column({
type: 'decimal'
})
maxWeightTotal: number;
@Column({
type: 'decimal'
})
bikeLength: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeWidth: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeHeight: number;
@Column({
nullable: true,
type: 'decimal'
})
bikeWeight: number;
}
@Entity() @Entity()
export class CargoBike extends Bike implements Lockable { export class CargoBike implements Lockable {
@PrimaryGeneratedColumn() @PrimaryGeneratedColumn()
id: number; id: number;
@ -133,6 +211,32 @@ export class CargoBike extends Bike implements Lockable {
@Column(type => Taxes) @Column(type => Taxes)
taxes: Taxes; taxes: Taxes;
@Column({
nullable: true
})
description: string;
@Column()
modelName: string;
@Column()
numberOfWheels: number;
@Column()
forCargo: boolean;
@Column()
forChildren: boolean;
@Column()
numberOfChildren: number;
@Column(type => TechnicalEquipment)
technicalEquipment: TechnicalEquipment;
@Column(type => DimensionsAndLoad)
dimensionsAndLoad: DimensionsAndLoad;
@Column({ @Column({
nullable: true nullable: true
}) })

Loading…
Cancel
Save