From 1b7a178f4ed80c9aa11032c0453a4f51c70b8e73 Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Mon, 16 Nov 2020 09:54:46 +0100 Subject: [PATCH] src/schema/*: changed type of projectAllowance to string --- src/model/InsuranceData.ts | 2 +- src/schema/type-defs.ts | 32 ++++++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/model/InsuranceData.ts b/src/model/InsuranceData.ts index efc556c..ef7c0fd 100644 --- a/src/model/InsuranceData.ts +++ b/src/model/InsuranceData.ts @@ -57,7 +57,7 @@ export class InsuranceData { type: 'money', nullable: true }) - projectAllowance: number; + projectAllowance: string; @Column({ nullable: true diff --git a/src/schema/type-defs.ts b/src/schema/type-defs.ts index abaa587..5907eb1 100644 --- a/src/schema/type-defs.ts +++ b/src/schema/type-defs.ts @@ -163,8 +163,15 @@ type InsuranceData { maintenanceAgreement: String hasFixedRate: Boolean! fixedRate: Float - "Projektzuschuss" - projectAllowance: Float + """ + Projektzuschuss: + is of american format [-]$[0-9]+.[0-9][0-9] + commas every three digits and . for decimals with 2 digits after the . + There can be a leading -. + There is a currency signe at the first position or second position if - is set. + The kind of currency depends on the database. + """ + projectAllowance: String notes: String } @@ -182,8 +189,15 @@ input InsuranceDataCreateInput { maintenanceAgreement: String hasFixedRate: Boolean! fixedRate: Float - "Projektzuschuss" - projectAllowance: Float + """ + Projektzuschuss: + must be of format [+|-][$][0-9]*[.[0-9]*] + commas are ignored, non numeric values except , and . lead to errors + There can be a leading + or -. + You can pass a currency signe at the first position or second position of + or - is set. + The kind of currency depends on the database. + """ + projectAllowance: String notes: String } @@ -201,8 +215,14 @@ input InsuranceDataUpdateInput { maintenanceAgreement: String hasFixedRate: Boolean fixedRate: Float - "Projektzuschuss" - projectAllowance: Float + Projektzuschuss: + must be of format [+|-][$][0-9]*[.[0-9]*] + commas are ignored, non numeric values except , and . lead to errors + There can be a leading + or -. + You can pass a currency signe at the first position or second position of + or - is set. + The kind of currency depends on the database. + """ + projectAllowance: String notes: String }