added invariant exports to get methods.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-12-03 13:40:57 -07:00
parent 0380382c47
commit 0e49497da1
5 changed files with 129 additions and 14 deletions

View File

@@ -24,7 +24,8 @@ namespace CarCareTracker.Helper
bool GetServerEnableShopSupplies();
string GetServerPostgresConnection();
string GetAllowedFileUploadExtensions();
public bool DeleteUserConfig(int userId);
bool DeleteUserConfig(int userId);
bool GetInvariantApi();
}
public class ConfigHelper : IConfigHelper
{
@@ -51,6 +52,10 @@ namespace CarCareTracker.Helper
{
return CheckBool(CheckString("LUBELOGGER_CUSTOM_WIDGETS"));
}
public bool GetInvariantApi()
{
return CheckBool(CheckString("LUBELOGGER_INVARIANT_API"));
}
public string GetMOTD()
{
var motd = CheckString("LUBELOGGER_MOTD");

View File

@@ -1,6 +1,7 @@
using CarCareTracker.Models;
using CsvHelper;
using System.Globalization;
using System.Text.Json;
namespace CarCareTracker.Helper
{
@@ -622,6 +623,12 @@ namespace CarCareTracker.Helper
return string.IsNullOrWhiteSpace(decorations) ? input.ToString("C2") : $"{input.ToString("C2")}{decorations}";
}
}
public static JsonSerializerOptions GetInvariantOption()
{
var serializerOption = new JsonSerializerOptions();
serializerOption.Converters.Add(new InvariantConverter());
return serializerOption;
}
public static void WriteGasRecordExportModel(CsvWriter _csv, IEnumerable<GasRecordExportModel> genericRecords)
{
var extraHeaders = genericRecords.SelectMany(x => x.ExtraFields).Select(y => y.Name).Distinct();