Skip to content

Commit

Permalink
fix: use dateonly
Browse files Browse the repository at this point in the history
  • Loading branch information
ahanoff committed Sep 13, 2024
1 parent 8320394 commit f647615
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/AEMO.MDFF/NEM12/IntervalDataRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ namespace AEMO.MDFF.NEM12;
public sealed class IntervalDataRecord : IMdffRecord
{
public string RecordIndicator => "300";
public DateTime IntervalDate { get; set; }
public DateOnly IntervalDate { get; set; }
public IReadOnlyCollection<decimal> IntervalValues { get; set; }

Check warning on line 9 in src/AEMO.MDFF/NEM12/IntervalDataRecord.cs

View workflow job for this annotation

GitHub Actions / build (8.x)

Non-nullable property 'IntervalValues' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public string QualityMethod { get; set; }
public string ReasonCode { get; set; }
public string ReasonDescription { get; set; }
public string UpdateDateTime { get; set; }
public string MSATSLoadDateTime { get; set; }
public DateTime MSATSLoadDateTime { get; set; }
}
2 changes: 1 addition & 1 deletion src/AEMO.MDFF/NEM12/NMIDataDetailsRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace AEMO.MDFF.NEM12;
public sealed class NMIDataDetailsRecord : IMdffRecord
{
public string RecordIndicator => "200";
public string NMI { get; set; }
public required string NMI { get; set; }
public string NMIConfiguration { get; set; }

Check warning on line 9 in src/AEMO.MDFF/NEM12/NMIDataDetailsRecord.cs

View workflow job for this annotation

GitHub Actions / build (8.x)

Non-nullable property 'NMIConfiguration' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public string RegisterId { get; set; }

Check warning on line 10 in src/AEMO.MDFF/NEM12/NMIDataDetailsRecord.cs

View workflow job for this annotation

GitHub Actions / build (8.x)

Non-nullable property 'RegisterId' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
public string NMISuffix { get; set; }

Check warning on line 11 in src/AEMO.MDFF/NEM12/NMIDataDetailsRecord.cs

View workflow job for this annotation

GitHub Actions / build (8.x)

Non-nullable property 'NMISuffix' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
Expand Down
2 changes: 1 addition & 1 deletion src/AEMO.MDFF/NEM12/Nem12Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private NMIDataDetailsRecord ParseNMIDataDetailsRecord(CsvDataReader csv)
private IntervalDataRecord ParseIntervalDataRecord(CsvDataReader csv, string currentNMI)
{
var dateString = csv.GetString(1);
var date = DateTime.ParseExact(dateString, "yyyyMMdd", CultureInfo.InvariantCulture);
var date = DateOnly.ParseExact(dateString, "yyyyMMdd", CultureInfo.InvariantCulture);
int intervalLength = _nmiIntervalLengths[currentNMI];
int expectedIntervals = 1440 / intervalLength; // 1440 minutes in a day

Expand Down

0 comments on commit f647615

Please sign in to comment.