Skip to content

Commit a7a927c

Browse files
committed
chore: minor changes
1 parent a81d465 commit a7a927c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Unicorn.Contracts/ContractsService.Test/ContractEventHandlerTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ await mockDynamoDbClient.Received(1)
109109
.UpdateItemAsync(Arg.Any<UpdateItemRequest>());
110110
}
111111
}
112+
112113
public class ApiGwSqsPayload
113114
{
114115
public string property_id { get; set; }

Unicorn.Contracts/ContractsService/ContractEventHandler.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ public ContractEventHandler(AmazonDynamoDBClient dynamoDbClient)
6868
public async Task FunctionHandler(SQSEvent sqsEvent, ILambdaContext context)
6969
{
7070
// Multiple records can be delivered in a single event
71-
Logger.LogInformation($"Beginning to process {sqsEvent.Records.Count} records...");
71+
Logger.LogInformation("Beginning to process {sqsEvent.Records.Count} records...", sqsEvent.Records.Count);
7272

73-
foreach (var record in sqsEvent.Records)
73+
foreach (SQSEvent.SQSMessage? record in sqsEvent.Records)
7474
{
75-
var method = record.MessageAttributes["HttpMethod"].StringValue; //?? "No attribute with HttpMethod";
76-
Logger.LogInformation($"Identified HTTP Method : {method}");
75+
var method = record.MessageAttributes["HttpMethod"].StringValue;
76+
Logger.LogInformation("Identified HTTP Method : {method}", method);
7777

7878
switch (method)
7979
{
@@ -124,8 +124,7 @@ private async Task CreateContractAsync(SQSEvent.SQSMessage sqsMessage)
124124

125125
try
126126
{
127-
Logger.LogInformation(
128-
$"Creating new contract for Property ID: {contract.PropertyId} in table '{_dynamodbTable}' ");
127+
Logger.LogInformation("Creating new contract for Property ID: {contract.PropertyId} in table '{_dynamodbTable}' ", contract.PropertyId, _dynamodbTable);
129128

130129
var request = new PutItemRequest()
131130
{
@@ -169,7 +168,7 @@ private async Task CreateContractAsync(SQSEvent.SQSMessage sqsMessage)
169168
}
170169
catch (ConditionalCheckFailedException e)
171170
{
172-
Logger.LogError($"Unable to create new contract, because `{e.Message}`. Perhaps you are trying to add a contract that already has an active status?");
171+
Logger.LogError("Unable to create new contract, because `{e.Message}`. Perhaps you are trying to add a contract that already has an active status?", e.Message);
173172
}
174173
catch (Exception e)
175174
{

Unicorn.Contracts/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ Resources:
392392
Properties:
393393
RetentionInDays: !FindInMap [LogsRetentionPeriodMap, !Ref Stage, Days]
394394

395-
# IAM Role for Event Bridge Pipe
395+
# IAM Role for EventBridge Pipe
396396
ContractsTableStreamToEventPipeRole:
397397
Type: AWS::IAM::Role
398398
Properties:

0 commit comments

Comments
 (0)