-
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.
- Loading branch information
1 parent
f34215b
commit 7ef71f2
Showing
5 changed files
with
46 additions
and
2 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
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 |
---|---|---|
|
@@ -83,6 +83,33 @@ public async Task<ActionResult<TrustDto>> GetTrustByCompaniesHouseNumber(string | |
return Ok(trust); | ||
} | ||
|
||
/// <summary> | ||
/// Retrieves a Trust by its Companies House Number. | ||
/// </summary> | ||
/// <param name="companiesHouseNumber">The Companies House Number identifier.</param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns>A Trust or NotFound if not available.</returns> | ||
[HttpGet] | ||
[Route("trust/trustReferenceNumber/{trustReferenceNumber}")] | ||
[SwaggerOperation(Summary = "Retrieve Trust by Trust Reference Number also know as the GIAS Group ID", Description = "Retrieve Trust by Trust Reference Number also know as the GIAS Group ID.")] | ||
[SwaggerResponse(200, "Successfully found and returned the Trust.")] | ||
[SwaggerResponse(404, "Trust with specified Trust Reference Number not found.")] | ||
public async Task<ActionResult<TrustDto>> GetTrustByTrustReferenceNumber(string trustReferenceNumber, CancellationToken cancellationToken) | ||
{ | ||
_logger.LogInformation($"Attempting to get trust by Trust Reference Number {trustReferenceNumber}"); | ||
Check notice Code scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarCloud
|
||
var trust = await _trustQueries.GetByTrustReferenceNumber(trustReferenceNumber, cancellationToken).ConfigureAwait(false); | ||
|
||
if (trust == null) | ||
{ | ||
_logger.LogInformation($"No trust found for Trust Reference Number {trustReferenceNumber}"); | ||
Check notice Code scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarCloud
|
||
return NotFound(); | ||
} | ||
|
||
_logger.LogInformation($"Returning trust found by Trust Reference Number {trustReferenceNumber}"); | ||
Check notice Code scanning / SonarCloud Logging should not be vulnerable to injection attacks Low
Change this code to not log user-controlled data. See more on SonarCloud
|
||
_logger.LogDebug(JsonSerializer.Serialize(trust)); | ||
return Ok(trust); | ||
} | ||
|
||
/// <summary> | ||
/// Searches for Trusts based on query parameters. | ||
/// </summary> | ||
|