File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
src/endpoints/substrate-endpoint Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 11export interface RequestsByCountry {
2+ countryId : string ;
23 country : string ;
34 totalRequests : number ;
4- totalValue : string ;
5+ totalValue : CurrencyValueInterface ;
56 services : Array < ServiceInterface > ;
67}
78export interface CurrencyValueInterface {
89 dbio : number ;
9- dai : number ;
10- usd : number ;
10+ dai : number | string ;
11+ usd : number | string ;
1112}
1213export interface ServiceInterface {
1314 countryId : string ;
@@ -19,7 +20,7 @@ export interface ServiceInterface {
1920}
2021export interface RequestByCountryDictInterface {
2122 totalRequests : number ;
22- totalValue : string | number ;
23+ totalValue : number ;
2324 services : {
2425 [ id : string ] : ServiceInterface ;
2526 } ;
Original file line number Diff line number Diff line change @@ -138,10 +138,15 @@ export class ServiceRequestService {
138138 } ) ) ;
139139
140140 const requestByCountry : RequestsByCountry = {
141+ countryId : countryCode ,
141142 country : name ,
142143 services : servicesArr ,
143144 totalRequests : totalRequests ,
144- totalValue : totalValue as string ,
145+ totalValue : {
146+ dbio : totalValue ,
147+ dai : totalValue * oneDbioEqualToDai || 'Conversion Error' ,
148+ usd : totalValue * oneDbioEqualToUsd || 'Conversion Error' ,
149+ } ,
145150 } ;
146151
147152 requestByCountryList . push ( requestByCountry ) ;
You can’t perform that action at this time.
0 commit comments