Skip to content

Commit c1b03f7

Browse files
committed
Updated to version 3.10.0.
1 parent 83c62f2 commit c1b03f7

File tree

38 files changed

+1645
-39
lines changed

38 files changed

+1645
-39
lines changed

MyGeotabAPIAdapter.Configuration/AdapterConfiguration.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ public class AdapterConfiguration : IAdapterConfiguration
128128
// > AppSettings:Feeds:FaultData
129129
const string ArgNameEnableFaultDataFeed = "AppSettings:Feeds:FaultData:EnableFaultDataFeed";
130130
const string ArgNameFaultDataFeedIntervalSeconds = "AppSettings:Feeds:FaultData:FaultDataFeedIntervalSeconds";
131+
const string ArgNamePopulateEffectOnComponentAndRecommendation = "AppSettings:Feeds:FaultData:PopulateEffectOnComponentAndRecommendation";
132+
// > AppSettings:Feeds:FuelAndEnergyUsed
133+
const string ArgNameEnableFuelAndEnergyUsedFeed = "AppSettings:Feeds:FuelAndEnergyUsed:EnableFuelAndEnergyUsedFeed";
134+
const string ArgNameFuelAndEnergyUsedFeedIntervalSeconds = "AppSettings:Feeds:FuelAndEnergyUsed:FuelAndEnergyUsedFeedIntervalSeconds";
131135
// > AppSettings:Feeds:LogRecord
132136
const string ArgNameEnableLogRecordFeed = "AppSettings:Feeds:LogRecord:EnableLogRecordFeed";
133137
const string ArgNameLogRecordFeedIntervalSeconds = "AppSettings:Feeds:LogRecord:LogRecordFeedIntervalSeconds";
@@ -356,6 +360,9 @@ public class AdapterConfiguration : IAdapterConfiguration
356360
/// <inheritdoc/>
357361
public bool EnableFaultDataLocationService { get; private set; }
358362

363+
/// <inheritdoc/>
364+
public bool EnableFuelAndEnergyUsedFeed { get; private set; }
365+
359366
/// <inheritdoc/>
360367
public bool EnableGroupCache { get; private set; }
361368

@@ -458,6 +465,9 @@ public class AdapterConfiguration : IAdapterConfiguration
458465
/// <inheritdoc/>
459466
public DateTime FeedStartSpecificTimeUTC { get; private set; }
460467

468+
/// <inheritdoc/>
469+
public int FuelAndEnergyUsedFeedIntervalSeconds { get; private set; }
470+
461471
/// <inheritdoc/>
462472
public DateTime GroupCacheIntervalDailyReferenceStartTimeUTC { get; private set; }
463473

@@ -503,6 +513,9 @@ public class AdapterConfiguration : IAdapterConfiguration
503513
/// <inheritdoc/>
504514
public string MyGeotabUser { get; private set; }
505515

516+
/// <inheritdoc/>
517+
public bool PopulateEffectOnComponentAndRecommendation { get; private set; }
518+
506519
/// <inheritdoc/>
507520
public DateTime RuleCacheIntervalDailyReferenceStartTimeUTC { get; private set; }
508521

@@ -792,6 +805,11 @@ public void ProcessConfigItems()
792805
// AppSettings:Feeds:FaultData:
793806
EnableFaultDataFeed = configurationHelper.GetConfigKeyValueBoolean(ArgNameEnableFaultDataFeed);
794807
FaultDataFeedIntervalSeconds = configurationHelper.GetConfigKeyValueInt(ArgNameFaultDataFeedIntervalSeconds, null, false, MinFeedIntervalSeconds, MaxFeedIntervalSeconds, DefaultFeedIntervalSeconds);
808+
PopulateEffectOnComponentAndRecommendation = configurationHelper.GetConfigKeyValueBoolean(ArgNamePopulateEffectOnComponentAndRecommendation);
809+
810+
// AppSettings:Feeds:FuelAndEnergyUsed:
811+
EnableFuelAndEnergyUsedFeed = configurationHelper.GetConfigKeyValueBoolean(ArgNameEnableFuelAndEnergyUsedFeed);
812+
FuelAndEnergyUsedFeedIntervalSeconds = configurationHelper.GetConfigKeyValueInt(ArgNameFuelAndEnergyUsedFeedIntervalSeconds, null, false, MinFeedIntervalSeconds, MaxFeedIntervalSeconds, DefaultFeedIntervalSeconds);
795813

796814
// AppSettings:Feeds:LogRecord:
797815
EnableLogRecordFeed = configurationHelper.GetConfigKeyValueBoolean(ArgNameEnableLogRecordFeed);

MyGeotabAPIAdapter.Configuration/IAdapterConfiguration.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ public interface IAdapterConfiguration
222222
/// </summary>
223223
bool EnableFaultDataLocationService { get; }
224224

225+
/// <summary>
226+
/// Indicates whether a <see cref="FuelAndEnergyUsed"/> data feed should be enabled.
227+
/// </summary>
228+
bool EnableFuelAndEnergyUsedFeed { get; }
229+
225230
/// <summary>
226231
/// Indicates whether a <see cref="Group"/> cache should be enabled.
227232
/// </summary>
@@ -392,6 +397,11 @@ public interface IAdapterConfiguration
392397
/// </summary>
393398
DateTime FeedStartSpecificTimeUTC { get; }
394399

400+
/// <summary>
401+
/// The minimum number of seconds to wait between GetFeed() calls for <see cref="FuelAndEnergyUsed"/> objects.
402+
/// </summary>
403+
int FuelAndEnergyUsedFeedIntervalSeconds { get; }
404+
395405
/// <summary>
396406
/// The <see cref="DateTime"/> of which the time of day portion will be used as the basis for calculation of cache update and refresh intervals for the <see cref="Group"/> cache.
397407
/// </summary>
@@ -467,6 +477,11 @@ public interface IAdapterConfiguration
467477
/// </summary>
468478
string MyGeotabUser { get; }
469479

480+
/// <summary>
481+
/// If <see cref="EnableFaultDataFeed"/> is <c>true</c>, indicates whether the EffectOnComponent and Recommendation columns in the associated adapter database table will be populated. Setting this property to <c>false</c> will result in the EffectOnComponent and Recommendation columns being set to <c>null</c> for all records in the associated adapter database table, thereby potentially saving on disk space if these property values are not of interest. WARNING: There is no way to update these columns for records that have already been downloaded.
482+
/// </summary>
483+
bool PopulateEffectOnComponentAndRecommendation { get; }
484+
470485
/// <summary>
471486
/// The <see cref="DateTime"/> of which the time of day portion will be used as the basis for calculation of cache update and refresh intervals for the <see cref="Rule"/> cache.
472487
/// </summary>

MyGeotabAPIAdapter.Configuration/MyGeotabAPIAdapter.Configuration.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
8+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
99
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
10-
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.1" />
10+
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.2" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

MyGeotabAPIAdapter.DataOptimizer/MyGeotabAPIAdapter.DataOptimizer.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Authors>Geotab Inc.</Authors>
77
<Company>Geotab Inc.</Company>
88
<Product>MyGeotab API Adapter - DataOptimizer</Product>
9-
<AssemblyVersion>3.9.0.0</AssemblyVersion>
10-
<FileVersion>3.9.0.0</FileVersion>
9+
<AssemblyVersion>3.10.0.0</AssemblyVersion>
10+
<FileVersion>3.10.0.0</FileVersion>
1111
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
1212
<Description>A worker service designed to migrate data from the MyGeotab API Adapter database into another set of tables that are optimized for use by applications and data analysis tools. Additional columns are added to some of the tables and these are populated via interpolation or other query-based procedues.</Description>
1313
</PropertyGroup>
@@ -17,10 +17,10 @@
1717
</ItemGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
20+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
2121
<PackageReference Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
2222
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
23-
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.1" />
23+
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.2" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

MyGeotabAPIAdapter.Database.EntityPersisters/MyGeotabAPIAdapter.Database.EntityPersisters.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.1" />
8+
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.2" />
99
</ItemGroup>
1010

1111
<ItemGroup>

MyGeotabAPIAdapter.Database/AdapterDatabaseObjectNames.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ public class AdapterDatabaseObjectNames : IAdapterDatabaseObjectNames
110110
/// <inheritdoc/>
111111
public string DbFaultDataLocation2TrackingTableName => "FaultDataLocations2Tracking";
112112

113+
/// <inheritdoc/>
114+
public string DbFuelAndEnergyUsed2TableName => "FuelAndEnergyUsed2";
115+
113116
/// <inheritdoc/>
114117
public string DbGroupTableName => "Groups";
115118

@@ -178,6 +181,9 @@ public class AdapterDatabaseObjectNames : IAdapterDatabaseObjectNames
178181
/// <inheritdoc/>
179182
public string DbStgExceptionEvent2TableName => "stg_ExceptionEvents2";
180183

184+
/// <inheritdoc/>
185+
public string DbStgFuelAndEnergyUsed2TableName => "stg_FuelAndEnergyUsed2";
186+
181187
/// <inheritdoc/>
182188
public string DbStgGroup2TableName => "stg_Groups2";
183189

@@ -253,6 +259,9 @@ public class AdapterDatabaseObjectNames : IAdapterDatabaseObjectNames
253259
/// <inheritdoc/>
254260
public string MergeStagingExceptionEventsProcedureName => "spMerge_stg_ExceptionEvents2";
255261

262+
/// <inheritdoc/>
263+
public string MergeStagingFuelAndEnergyUsedProcedureName => "spMerge_stg_FuelAndEnergyUsed2";
264+
256265
/// <inheritdoc/>
257266
public string MergeStagingGroupsProcedureName => "spMerge_stg_Groups2";
258267

MyGeotabAPIAdapter.Database/DatabaseValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class DatabaseValidator : IDatabaseValidator
1717
// The required version of the middleware database for the current version of the middleware application. Any time the middleware database is updated as part of an application update:
1818
// 1. This value should be updated to reflect the application version at the time.
1919
// 2. Database changes should be included in a single script file and the filename should be formatted as "prefix_version_suffix.sql" (e.g. "MSSQL_3.0.0.0_InitialSchemaCreation.sql") where the version portion of the filename is equal to the value of this constant.
20-
const string RequiredDatabaseVersion = "3.9.0.0";
20+
const string RequiredDatabaseVersion = "3.10.0.0";
2121

2222
readonly IExceptionHelper exceptionHelper;
2323
readonly Logger logger = LogManager.GetCurrentClassLogger();

MyGeotabAPIAdapter.Database/IAdapterDatabaseObjectNames.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ public interface IAdapterDatabaseObjectNames
183183
/// </summary>
184184
string DbFaultDataLocation2TrackingTableName { get; }
185185

186+
/// <summary>
187+
/// The name of the database table associated with <see cref="DbFuelAndEnergyUsed"/> entities.
188+
/// </summary>
189+
string DbFuelAndEnergyUsed2TableName { get; }
190+
186191
/// <summary>
187192
/// The name of the database table associated with <see cref="DbGroup"/> entities.
188193
/// </summary>
@@ -298,6 +303,11 @@ public interface IAdapterDatabaseObjectNames
298303
/// </summary>
299304
string DbStgExceptionEvent2TableName { get; }
300305

306+
/// <summary>
307+
/// The name of the database table associated with <see cref="DbStgFuelAndEnergyUsed2"/> entities.
308+
/// </summary>
309+
string DbStgFuelAndEnergyUsed2TableName { get; }
310+
301311
/// <summary>
302312
/// The name of the database table associated with <see cref="DbStgGroup2"/> entities.
303313
/// </summary>
@@ -423,6 +433,11 @@ public interface IAdapterDatabaseObjectNames
423433
/// </summary>
424434
string MergeStagingExceptionEventsProcedureName { get; }
425435

436+
/// <summary>
437+
/// The name of the stored procedure or function responsible for merging staging FuelAndEnergyUsed records into the main FuelAndEnergyUsed2 table.
438+
/// </summary>
439+
string MergeStagingFuelAndEnergyUsedProcedureName { get; }
440+
426441
/// <summary>
427442
/// The name of the stored procedure or function responsible for merging staging Groups into the main Groups2 table.
428443
/// </summary>

MyGeotabAPIAdapter.Database/Models/DbFaultData2.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ public class DbFaultData2 : IDbEntity
2727
public long DiagnosticId { get; set; }
2828
public DateTime? DismissDateTime { get; set; }
2929
public long? DismissUserId { get; set; }
30+
public string EffectOnComponent { get; set; }
3031
public int? FailureModeCode { get; set; }
3132
public string FailureModeId { get; set; }
3233
public string FailureModeName { get; set; }
34+
public string FaultDescription { get; set; }
3335
public string FaultLampState { get; set; }
3436
public string FaultState { get; set; }
37+
public string FlashCodeId { get; set; }
38+
public string FlashCodeName { get; set; }
3539
public bool? MalfunctionLamp { get; set; }
3640
public bool? ProtectWarningLamp { get; set; }
41+
public string Recommendation { get; set; }
3742
public bool? RedStopLamp { get; set; }
43+
public double? RiskOfBreakdown { get; set; }
3844
public string Severity { get; set; }
3945
public int? SourceAddress { get; set; }
4046
[ChangeTracker]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Dapper.Contrib.Extensions;
2+
using System;
3+
4+
namespace MyGeotabAPIAdapter.Database.Models
5+
{
6+
[Table("FuelAndEnergyUsed2")]
7+
public class DbFuelAndEnergyUsed2 : IDbEntity
8+
{
9+
/// <inheritdoc/>
10+
[Write(false)]
11+
public string DatabaseTableName => "FuelAndEnergyUsed2";
12+
13+
/// <inheritdoc/>
14+
[Write(false)]
15+
public Common.DatabaseWriteOperationType DatabaseWriteOperationType { get; set; }
16+
17+
[ExplicitKey]
18+
public Guid id { get; set; }
19+
public string GeotabId { get; set; }
20+
public DateTime? DateTime { get; set; }
21+
public long DeviceId { get; set; }
22+
public double? TotalEnergyUsedKwh { get; set; }
23+
public double? TotalFuelUsed { get; set; }
24+
public double? TotalIdlingEnergyUsedKwh { get; set; }
25+
public double? TotalIdlingFuelUsedL { get; set; }
26+
public long Version { get; set; }
27+
[ChangeTracker]
28+
public DateTime RecordLastChangedUtc { get; set; }
29+
}
30+
}

0 commit comments

Comments
 (0)