File tree 4 files changed +10
-8
lines changed
4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,15 @@ import { httpTransport } from '../transport/rate'
6
6
7
7
export const inputParameters = new InputParameters (
8
8
{
9
- rate : {
9
+ symbol : {
10
10
required : true ,
11
11
type : 'string' ,
12
12
description : 'Symbol of the rate you are looking for' ,
13
13
} ,
14
14
} ,
15
15
[
16
16
{
17
- rate : 'SOFR' ,
17
+ symbol : 'SOFR' ,
18
18
} ,
19
19
] ,
20
20
)
Original file line number Diff line number Diff line change @@ -41,13 +41,13 @@ export const httpTransport = new HttpTransport<HttpTransportTypes>({
41
41
42
42
return params . map ( ( param ) => {
43
43
const result = response . data . refRates . find (
44
- ( d ) => d . type . toUpperCase ( ) == param . rate . toUpperCase ( ) ,
44
+ ( d ) => d . type . toUpperCase ( ) == param . symbol . toUpperCase ( ) ,
45
45
)
46
- if ( result == undefined || result . percentRate == undefined ) {
46
+ if ( result ? .percentRate == undefined ) {
47
47
return {
48
48
params : param ,
49
49
response : {
50
- errorMessage : `The data provider didn't return any value for ${ param . rate } ` ,
50
+ errorMessage : `The data provider didn't return any value for ${ param . symbol } ` ,
51
51
statusCode : 502 ,
52
52
} ,
53
53
}
@@ -60,7 +60,9 @@ export const httpTransport = new HttpTransport<HttpTransportTypes>({
60
60
result : result . percentRate ,
61
61
} ,
62
62
timestamps : {
63
- providerIndicatedTimeUnixMs : new Date ( result . effectiveDate ) . getTime ( ) ,
63
+ providerIndicatedTimeUnixMs : result . effectiveDate
64
+ ? new Date ( result . effectiveDate ) . getTime ( )
65
+ : undefined ,
64
66
} ,
65
67
} ,
66
68
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"requests" : [{
3
- "rate " : " SOFR"
3
+ "symbol " : " SOFR"
4
4
}]
5
5
}
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ describe('execute', () => {
36
36
it ( 'should return success' , async ( ) => {
37
37
mockResponseSuccess ( )
38
38
const response = await testAdapter . request ( {
39
- rate : 'SOFR' ,
39
+ symbol : 'SOFR' ,
40
40
} )
41
41
expect ( response . statusCode ) . toBe ( 200 )
42
42
expect ( response . json ( ) ) . toMatchSnapshot ( )
You can’t perform that action at this time.
0 commit comments