Add - operator into basecalc

This commit is contained in:
Michał Zieliński
2025-03-24 16:34:56 +01:00
parent 3387013d60
commit a6ac91305e
8 changed files with 181 additions and 6 deletions

View File

@@ -16,16 +16,18 @@ public class DataInboxController : Controller
private readonly AppDbContext _db;
private readonly IConfiguration _configuration;
private readonly LogsController _logsController;
private readonly LayersController _layersController;
public DataInboxController(
AppDbContext db,
GoogleSheetsHelper googleSheetsHelper,
IConfiguration configuration,
FirestoreDb firestoreDb)
FirestoreDb firestoreDb,
LayersController layersController)
{
_db = db;
_configuration = configuration;
_logsController = new LogsController(firestoreDb);
_layersController = layersController;
}
[HttpPut]
@@ -115,6 +117,11 @@ public class DataInboxController : Controller
CreatedAt = DateTime.UtcNow
});
if (dataInbox.Name == "morska.d3.importer")
{
// TODO: import dataInbox as Layer
}
return Ok();
}
catch (Exception e)

View File

@@ -369,6 +369,21 @@ public class LayersController : Controller
{
var type = importWorker.Records!.FirstOrDefault(x => x.Code == "ImportType")?.Desc1 ??
"Standard";
var source = importWorker.Records!.FirstOrDefault(x => x.Code == "Source")?.Desc1 ??
"GoogleSheet";
if (source == "DataInbox" && type == "Import-D3") {
var d3Importer = new MorskaD3Importer(_db, this);
d3Importer.Import(importWorker);
_logsController.AddEntry(new LogEntry
{
Title = $"{importWorker.Name}, {importWorker.Id}",
Type = LogEntryType.Info,
LogType = LogType.Import,
Message = "Success",
CreatedAt = DateTime.UtcNow
});
continue;
}
switch (type)
{
case "D1":