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" */
import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
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';
export enum Group {
KL,
@ -64,4 +67,13 @@ export class CargoBike extends Bike {
@Column()
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 { CargoBike } from './CargoBike';
@Entity()
export class Participant {
@ -34,6 +35,9 @@ export class Participant {
})
locationZIPs: string[];
@OneToMany(type => CargoBike, cargoBike => cargoBike.coordinator)
cargoBikes: CargoBike[];
@Column()
roleCoreTeam: boolean;

@ -38,9 +38,9 @@ type CargoBike {
stickerBikeNameState: StickerBikeNameState
note: String
provider: Provider
coordinator: Participants
insuranceData: InsuranceData
loantimes: [LoanTimes]
coordinator: Participant
insuranceData: InsuranceData!
lendingstation: LendingStation
"null if not locked by other user"
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.
"""
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{
@ -76,7 +87,7 @@ type BikeModel {
technicalEquipment: TechnicalEquipment!
}
type Participants {
type Participant {
id: ID!
start: Date!
end: Date!
@ -273,6 +284,20 @@ type LendingStation {
"(dt. Ausleihzeiten)"
type LoanTimes {
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)"
@ -297,8 +322,8 @@ type Query {
CargobikesByProvider(token:String!,providerId:ID!): [CargoBike]!
ProviderById(token:String!,id:ID!): Provider
Providers(token:String!): [Provider]!
ParticipantsById(token:String!,id:ID!): Participants
Participantss(token:String!): [ Participants]!
ParticipantById(token:String!,id:ID!): Participant
Participants(token:String!): [ Participant]!
lendingStationById(token:String!, id:ID!): LendingStation
lendingStations(token:String!): [LendingStation]!
contactInformation(token:String!): [ContactInformation]!

Loading…
Cancel
Save