Restore legacy parity gaps lost in the VB.NET → C# migration
Close functional regressions found by comparing the legacy applications (Intranet_Legacy/) against their C# counterparts: - ProcessWebComService: send attachments inline (base64) with the push_com POST so invoice/reminder PDFs are attached again. - FuchsPdf: wire GetPaycode into ApplyInvoice/ApplyReminder to restore the SEPA giro-code payment QR, and restore the full standard invoice text block (§35a labor-cost note, Akonto text, §14/§48 notes, AGB, Steuernummer, Verrechnungssätze, etc.). - IntranetController: restore changepassword validation (password strength, confirmation match, current-password verification) and the mfr empty-id OData $metadata response. - Reports: port the ocms_visualization engine to C# (FuchsVisualization) and wire FuchsReports.ProcessFdsRequest to render generic/ generic_content/chart reports instead of returning an empty OK stub. Adds smoke tests for the giro QR generator and report page builder. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -66,14 +66,30 @@ public class ProcessWebComService : IComService
|
||||
|
||||
try
|
||||
{
|
||||
// Attachments are transmitted inline as base64 in the same push_com POST.
|
||||
// Each entry: { filename, mimeType, contentBase64 }.
|
||||
var attachmentPayload = (attachments ?? new Dictionary<string, byte[]>())
|
||||
.Where(kv => kv.Value is { Length: > 0 })
|
||||
.Select(kv => new
|
||||
{
|
||||
filename = kv.Key,
|
||||
mimeType = GuessMimeType(kv.Key),
|
||||
contentBase64 = Convert.ToBase64String(kv.Value)
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
var payload = new
|
||||
{
|
||||
comType = "email",
|
||||
recipient = email,
|
||||
comType = "email",
|
||||
recipient = email,
|
||||
subject,
|
||||
body
|
||||
body,
|
||||
attachments = attachmentPayload
|
||||
};
|
||||
|
||||
_logger.LogDebug("SendEmailAsync ref={Reference} to={Email} attachments={Count}",
|
||||
reference, email, attachmentPayload.Length);
|
||||
|
||||
var (ok, responseBody) = await PostToApiAsync("push_com", payload);
|
||||
if (ok)
|
||||
{
|
||||
@@ -190,6 +206,24 @@ public class ProcessWebComService : IComService
|
||||
return "";
|
||||
}
|
||||
|
||||
private static string GuessMimeType(string filename) =>
|
||||
Path.GetExtension(filename).ToLowerInvariant() switch
|
||||
{
|
||||
".pdf" => "application/pdf",
|
||||
".png" => "image/png",
|
||||
".jpg" or ".jpeg" => "image/jpeg",
|
||||
".gif" => "image/gif",
|
||||
".txt" => "text/plain",
|
||||
".csv" => "text/csv",
|
||||
".xml" => "application/xml",
|
||||
".zip" => "application/zip",
|
||||
".doc" => "application/msword",
|
||||
".docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
".xls" => "application/vnd.ms-excel",
|
||||
".xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
_ => "application/octet-stream"
|
||||
};
|
||||
|
||||
private static bool IsValidEmail(string email)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user