Skip to content

Commit

Permalink
Add CreatedAt
Browse files Browse the repository at this point in the history
  • Loading branch information
gocampo committed Jul 28, 2023
1 parent 012e822 commit 9e6a3f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/Dtos/CalculationResultDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public record CalculationResultDTO
public decimal TotalAmount { get; set; }
public decimal TotalWeight { get; set; }
public int TotalCount { get; internal set; }

public DateTime CreatedAt { get; set; }
public CalculationResultDTO()
{
CoinPredictions = new List<CoinPredictionDto>();
Expand Down
5 changes: 3 additions & 2 deletions backend/Services/AuditService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public AuditService(IConfiguration configuration, ILogger<AuditService> logger)
configuration["DBSettings:Collection"]);
}

public async Task CreateAsync(CalculationResultDTO calculationResultDTO) =>
public async Task CreateAsync(CalculationResultDTO calculationResultDTO){
calculationResultDTO.CreatedAt = DateTime.Now;
await _auditCollection.InsertOneAsync(calculationResultDTO);

}
}

0 comments on commit 9e6a3f5

Please sign in to comment.