generated from UK-Export-Finance/nestjs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(APIM-96): added GET
/yield-rates
endpoint (#50)
### Introduction - New endpoint GET /yield-rates. It calculates UKEF exposure in months for EW and BS Facilities Query parameters: searchDate (optional) ### Resolution - GET /exposure-period uses TypeORM to get data from table DWR_YIELD_RATE - Old endpoint had query parameter searchDatetime, I changed it to searchDate - Old endpoint had field short_name, I renamed to shortName ### Miscellaneous - Removed @ApiParam from all modules because Swagger module can generate URL and Query parameter documentation from DTO class. We need URL and Query parameters in DTO for validation, so we also keep it there for documentation. - Change MAXIMUM_TIMEZONE_LIMIT format to better match what DB response looks, and this allows to use it for testing. - Changed GET /exposure-period Query parameter type from date to string date, it allows easier way to stop time input.
- Loading branch information
Showing
27 changed files
with
440 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const DATE = { | ||
MAXIMUM_LIMIT: '9999-12-31 00:00:00.000', | ||
MAXIMUM_TIMEZONE_LIMIT: '9999-12-31 00:00:00.000Z', | ||
MAXIMUM_TIMEZONE_LIMIT: '9999-12-31T00:00:00.000Z', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 17 additions & 7 deletions
24
src/modules/exposure-period/dto/get-exposure-period-query.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsEnum, IsOptional } from 'class-validator'; | ||
|
||
import { QueryParamActiveEnum } from './query-param-active-enum'; | ||
|
||
export class MarketsQueryDto { | ||
@IsEnum(QueryParamActiveEnum) | ||
@IsOptional() | ||
@ApiProperty({ | ||
required: false, | ||
example: 'Y', | ||
description: 'Optional filtering by field "active". If parameter is not provided result will include active and not active markets', | ||
enum: QueryParamActiveEnum, | ||
}) | ||
public active: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsInt, IsNotEmpty, IsString, Matches, Max } from 'class-validator'; | ||
import { IsInt, IsNotEmpty, IsString, Matches, Max, Min } from 'class-validator'; | ||
|
||
export class GetNumbersQueryDto { | ||
@IsInt() | ||
@IsNotEmpty() | ||
@Min(1) | ||
@Max(9) | ||
@ApiProperty({ example: 1 }) | ||
@ApiProperty({ example: 1, description: 'Id of UKEF ID type. Common types are: 1 for Deal/Facility, 2 for Party, 8 for Covenant' }) | ||
public type: number; | ||
|
||
@IsString() | ||
@IsNotEmpty() | ||
@ApiProperty({ example: '0030052431' }) | ||
@ApiProperty({ example: '0030052431', description: 'UKEF ID to check' }) | ||
@Matches(/^\d{10}$/) | ||
public ukefId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.