Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
</ItemGroup>
<ItemGroup>
<None Update="events\DynamoDbStreamEvents\contract_status_changed_draft.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="events\DynamoDbStreamEvents\contract_status_draft_waiting_for_approval.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="events\DynamoDbStreamEvents\contract_status_changed_approved_waiting_for_approval.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="events\DynamoDbStreamEvents\contract_status_changed_approved.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="events\StreamEvents\contract_status_changed_approved.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
5 changes: 3 additions & 2 deletions Unicorn.Contracts/ContractsService/ContractEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

var contract = new Contract // ContractCreated and ContractLastModifiedOn set in constructor
{
PropertyId = createContractRequest.PropertyId,

Check warning on line 118 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 118 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 118 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 118 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
ContractId = Guid.NewGuid(),
Address = createContractRequest?.Address,
SellerName = createContractRequest?.SellerName,
Expand Down Expand Up @@ -146,7 +146,7 @@
{
{ "PropertyId", new AttributeValue { S = contract.PropertyId } },
{ "ContractId", new AttributeValue { S = contract.ContractId.ToString("D") } },
{ "Address", new AttributeValue { M = contract.Address.ToMap() } },

Check warning on line 149 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 149 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 149 in Unicorn.Contracts/ContractsService/ContractEventHandler.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
{ "SellerName", new AttributeValue { S = contract.SellerName } },
{ "ContractStatus", new AttributeValue { S = contract.ContractStatus } },
{ "ContractCreated", new AttributeValue { S = contract.ContractCreated.ToString("O") } },
Expand All @@ -164,7 +164,7 @@
Logger.LogInformation(response);

// Add custom metric for "New Contracts"
Metrics.AddMetric("NewContracts", 1, MetricUnit.Count, MetricResolution.Standard);
Metrics.AddMetric("ContractCreated", 1, MetricUnit.Count, MetricResolution.Standard);
}
catch (ConditionalCheckFailedException e)
{
Expand Down Expand Up @@ -222,8 +222,9 @@
};

var response = await _dynamoDbClient.UpdateItemAsync(request);

Logger.LogInformation(response);
Metrics.AddMetric("ContractUpdated", 1, MetricUnit.Count, MetricResolution.Standard);
}
catch (ConditionalCheckFailedException e)
{
Expand Down
Loading