src/model/*: added insuranceData and participants

pull/7/head
leonnicolas 4 years ago
parent be7c1a0d39
commit c06bb1d1f1
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -1,7 +1,10 @@
/* eslint no-unused-vars: "off" */ /* eslint no-unused-vars: "off" */
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm'; import { Entity, Column, PrimaryGeneratedColumn, OneToMany, ManyToOne, OneToOne } from 'typeorm';
import { Bike } from './BikeFeatures'; import { Bike } from './BikeFeatures';
import { ChainSwap } from './ChainSwap'; import { ChainSwap } from './ChainSwap';
import { Provider } from './Provider';
import { Participant } from './Participant';
import { InsuranceData } from './InsuranceData';
export enum Group { export enum Group {
KL, KL,
@ -64,4 +67,13 @@ export class CargoBike extends Bike {
@Column() @Column()
note: string; note: string;
@ManyToOne(type => Provider)
provider: Provider;
@ManyToOne(type => Participant, participant => participant.cargoBikes)
coordinator: Participant;
@OneToOne(type => InsuranceData)
insuranceData: InsuranceData;
} }

@ -0,0 +1,48 @@
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
@Entity()
export class InsuranceData {
@PrimaryGeneratedColumn()
id: number
@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;
}

@ -1,5 +1,6 @@
import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'; import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn, OneToMany } from 'typeorm';
import { ContactInformation } from './ContactInformation'; import { ContactInformation } from './ContactInformation';
import { CargoBike } from './CargoBike';
@Entity() @Entity()
export class Participant { export class Participant {
@ -34,6 +35,9 @@ export class Participant {
}) })
locationZIPs: string[]; locationZIPs: string[];
@OneToMany(type => CargoBike, cargoBike => cargoBike.coordinator)
cargoBikes: CargoBike[];
@Column() @Column()
roleCoreTeam: boolean; roleCoreTeam: boolean;

@ -38,9 +38,9 @@ type CargoBike {
stickerBikeNameState: StickerBikeNameState stickerBikeNameState: StickerBikeNameState
note: String note: String
provider: Provider provider: Provider
coordinator: Participants coordinator: Participant
insuranceData: InsuranceData insuranceData: InsuranceData!
loantimes: [LoanTimes] lendingstation: LendingStation
"null if not locked by other user" "null if not locked by other user"
lockedBy: ID lockedBy: ID
} }
@ -49,8 +49,19 @@ type InsuranceData {
""" """
Eventuelly, this field will become an enum or a seperate data table and user can choose from a pool of insurance companies. Eventuelly, this field will become an enum or a seperate data table and user can choose from a pool of insurance companies.
""" """
name: String name: String!
benefactor: String!
billing: String!
noPnP: String!
"eg. Anbieter, flotte, eigenleistung"
maintananceResponsible: String!
maintanceBenefector: String!
maintananceAgreement: String
hasFixedRate: Boolean!
fixedRate: Float
"Projektzuschuss"
projectAllowance: Float
notes: String
} }
enum Group{ enum Group{
@ -76,7 +87,7 @@ type BikeModel {
technicalEquipment: TechnicalEquipment! technicalEquipment: TechnicalEquipment!
} }
type Participants { type Participant {
id: ID! id: ID!
start: Date! start: Date!
end: Date! end: Date!
@ -273,6 +284,20 @@ type LendingStation {
"(dt. Ausleihzeiten)" "(dt. Ausleihzeiten)"
type LoanTimes { type LoanTimes {
notes: String notes: String
mof: String
mot: String
tuf: String
tut: String
wef: String
wet: String
thf: String
tht: String
frf: String
frt: String
saf: String
sat: String
suf: String
sut: String
} }
"(dt. Zeitscheibe)" "(dt. Zeitscheibe)"
@ -297,8 +322,8 @@ type Query {
CargobikesByProvider(token:String!,providerId:ID!): [CargoBike]! CargobikesByProvider(token:String!,providerId:ID!): [CargoBike]!
ProviderById(token:String!,id:ID!): Provider ProviderById(token:String!,id:ID!): Provider
Providers(token:String!): [Provider]! Providers(token:String!): [Provider]!
ParticipantsById(token:String!,id:ID!): Participants ParticipantById(token:String!,id:ID!): Participant
Participantss(token:String!): [ Participants]! Participants(token:String!): [ Participant]!
lendingStationById(token:String!, id:ID!): LendingStation lendingStationById(token:String!, id:ID!): LendingStation
lendingStations(token:String!): [LendingStation]! lendingStations(token:String!): [LendingStation]!
contactInformation(token:String!): [ContactInformation]! contactInformation(token:String!): [ContactInformation]!

Loading…
Cancel
Save