Skip to content

Commit

Permalink
fix: default timezone to CET
Browse files Browse the repository at this point in the history
ref: #17577
  • Loading branch information
jacopocinaark committed Jun 20, 2024
1 parent 6503db2 commit 2ef0123
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DeleteCurveData(MarketDataIdentifier id, LocalDateTime version)
/// </summary>
[Required]
[MessagePack.Key(2)]
public string Timezone { get; set; } = "CET";
public string Timezone { get; set; }

/// <summary>
/// Start date of range to be deleted
Expand Down
8 changes: 4 additions & 4 deletions Artesian/Artesian.SDK/Factory/ActualTimeSerie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,20 @@ public async Task Save(Instant downloadedAt, bool deferCommandExecution = false,
/// </remarks>
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
{
Ensure.Any.IsNotNull(_entity);

var tz = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone;
var timeZone = DateTimeZoneProviders.Tzdb[tz];
var timeZone = DateTimeZoneProviders.Tzdb[timezone];

var data = new DeleteCurveData(_identifier)
{
Timezone = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone,
Timezone = timezone,
// LocalDate.MinIsoValue has year -9998 and yearOfEra 9999. Using it without any string formatting, we got date 01-01-9999.
// So we use default(LocalDateTime) 01/01/0001
RangeStart = rangeStart ?? default(LocalDateTime),
Expand Down
8 changes: 4 additions & 4 deletions Artesian/Artesian.SDK/Factory/AuctionTimeSerie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,20 @@ public async Task Save(Instant downloadedAt, bool deferCommandExecution = false,
/// </remarks>
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
{
Ensure.Any.IsNotNull(_entity);

var tz = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone;
var timeZone = DateTimeZoneProviders.Tzdb[tz];
var timeZone = DateTimeZoneProviders.Tzdb[timezone];

var data = new DeleteCurveData(_identifier)
{
Timezone = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone,
Timezone = timezone,
// LocalDate.MinIsoValue has year -9998 and yearOfEra 9999. Using it without any string formatting, we got date 01-01-9999.
// So we use default(LocalDateTime) 01/01/0001
RangeStart = rangeStart ?? default(LocalDateTime),
Expand Down
8 changes: 4 additions & 4 deletions Artesian/Artesian.SDK/Factory/BidAsk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,20 @@ public async Task Save(Instant downloadedAt, bool deferCommandExecution = false,
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="product">Product of the BidAsk Time Serie</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
public async Task Delete(LocalDateTime? rangeStart, LocalDateTime? rangeEnd, List<string> product = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
public async Task Delete(LocalDateTime? rangeStart, LocalDateTime? rangeEnd, List<string> product = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
{
Ensure.Any.IsNotNull(_entity);

var tz = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone;
var timeZone = DateTimeZoneProviders.Tzdb[tz];
var timeZone = DateTimeZoneProviders.Tzdb[timezone];

var data = new DeleteCurveData(_identifier)
{
Timezone = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone,
Timezone = timezone,
// LocalDate.MinIsoValue has year -9998 and yearOfEra 9999. Using it without any string formatting, we got date 01-01-9999.
// So we use default(LocalDateTime) 01/01/0001
RangeStart = rangeStart ?? default(LocalDateTime),
Expand Down
9 changes: 5 additions & 4 deletions Artesian/Artesian.SDK/Factory/IMarketData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ public interface IMarketAssessmentWritable
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="product">Product of the MarketAssessment Time Serie</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);
}

/// <summary>
Expand Down Expand Up @@ -237,7 +238,7 @@ public interface IBidAskWritable
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);

Check warning on line 241 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IBidAskWritable.Delete(LocalDateTime?, LocalDateTime?, List<string>, string, bool, bool, CancellationToken)' (but other parameters do)

Check warning on line 241 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IBidAskWritable.Delete(LocalDateTime?, LocalDateTime?, List<string>, string, bool, bool, CancellationToken)' (but other parameters do)

Check warning on line 241 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IBidAskWritable.Delete(LocalDateTime?, LocalDateTime?, List<string>, string, bool, bool, CancellationToken)' (but other parameters do)
}
/// <summary>
/// Interface for Auction Bid Write
Expand Down Expand Up @@ -299,7 +300,7 @@ public interface IAuctionMarketDataWritable
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default); }
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default); }

Check warning on line 303 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IAuctionMarketDataWritable.Delete(LocalDateTime?, LocalDateTime?, string, bool, bool, CancellationToken)' (but other parameters do)

Check warning on line 303 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IAuctionMarketDataWritable.Delete(LocalDateTime?, LocalDateTime?, string, bool, bool, CancellationToken)' (but other parameters do)

Check warning on line 303 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'IAuctionMarketDataWritable.Delete(LocalDateTime?, LocalDateTime?, string, bool, bool, CancellationToken)' (but other parameters do)

/// <summary>
/// Interface for timeserie write
Expand Down Expand Up @@ -367,6 +368,6 @@ public interface ITimeserieWritable
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);
Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default);

Check warning on line 371 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'ITimeserieWritable.Delete(LocalDateTime?, LocalDateTime?, string, bool, bool, CancellationToken)' (but other parameters do)

Check warning on line 371 in Artesian/Artesian.SDK/Factory/IMarketData.cs

View workflow job for this annotation

GitHub Actions / Build

Parameter 'timezone' has no matching param tag in the XML comment for 'ITimeserieWritable.Delete(LocalDateTime?, LocalDateTime?, string, bool, bool, CancellationToken)' (but other parameters do)
}
}
8 changes: 4 additions & 4 deletions Artesian/Artesian.SDK/Factory/MarketAssessment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,20 @@ public async Task Save(Instant downloadedAt, bool deferCommandExecution = false,
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="product">Product of the MarketAssessment Time Serie</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, List<string> product = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
{
Ensure.Any.IsNotNull(_entity);

var tz = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone;
var timeZone = DateTimeZoneProviders.Tzdb[tz];
var timeZone = DateTimeZoneProviders.Tzdb[timezone];

var data = new DeleteCurveData(_identifier)
{
Timezone = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone,
Timezone = timezone,
// LocalDate.MinIsoValue has year -9998 and yearOfEra 9999. Using it without any string formatting, we got date 01-01-9999.
// So we use default(LocalDateTime) 01/01/0001
RangeStart = rangeStart ?? default(LocalDateTime),
Expand Down
8 changes: 4 additions & 4 deletions Artesian/Artesian.SDK/Factory/VersionedTimeSerie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,20 @@ public async Task Save(Instant downloadedAt, bool deferCommandExecution = false,
/// </remarks>
/// <param name="rangeStart">LocalDateTime start of range to be deleted (in case of null, LocalDateTime MinIso value will be used)</param>
/// <param name="rangeEnd">LocalDateTime end of range to be deleted (in case of null, LocalDateTime MaxIso value will be used)</param>
/// <param name="timezone">Timezone of the delete range. Default is CET</param>
/// <param name="deferCommandExecution">DeferCommandExecution</param>
/// <param name="deferDataGeneration">DeferDataGeneration</param>
/// <param name="ctk">The Cancellation Token</param>
/// <returns></returns>
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
public async Task Delete(LocalDateTime? rangeStart = null, LocalDateTime? rangeEnd = null, string timezone = "CET", bool deferCommandExecution = false, bool deferDataGeneration = true, CancellationToken ctk = default)
{
Ensure.Any.IsNotNull(_entity);

var tz = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone;
var timeZone = DateTimeZoneProviders.Tzdb[tz];
var timeZone = DateTimeZoneProviders.Tzdb[timezone];

var data = new DeleteCurveData(_identifier)
{
Timezone = _entity.OriginalGranularity.IsTimeGranularity() ? "UTC" : _entity.OriginalTimezone,
Timezone = timezone,
// LocalDate.MinIsoValue has year -9998 and yearOfEra 9999. Using it without any string formatting, we got date 01-01-9999.
// So we use default(LocalDateTime) 01/01/0001
RangeStart = rangeStart ?? default(LocalDateTime),
Expand Down

0 comments on commit 2ef0123

Please sign in to comment.