# Packages Database Questa cartella contiene la documentazione di tutti i 17 packages del database. ## Packages Business | Package | Descrizione | |---------|-------------| | [MAIL_PKG](MAIL_PKG.md) | Gestione invio email automatiche (solleciti, reminder) | ## Packages Utility | Package | Descrizione | |---------|-------------| | [UTL_BASE64](UTL_BASE64.md) | Encoding/decoding Base64 | ## Packages JasperReports (XLIB) | Package | Descrizione | |---------|-------------| | [XLIB_JASPERREPORTS](XLIB_JASPERREPORTS.md) | Integrazione con JasperReports server | | [XLIB_JASPERREPORTS_IMG](XLIB_JASPERREPORTS_IMG.md) | Gestione immagini nei report | | [XLIB_HTTP](XLIB_HTTP.md) | Chiamate HTTP/REST | | [XLIB_COMPONENT](XLIB_COMPONENT.md) | Gestione componenti | | [XLIB_LOG](XLIB_LOG.md) | Sistema di logging | ## Packages JSON (PLJSON Library) Libreria esterna per parsing e generazione JSON. In .NET può essere sostituita con `System.Text.Json` o `Newtonsoft.Json`. | Package | Descrizione | |---------|-------------| | [PLJSON_DYN](PLJSON_DYN.md) | Query dinamiche JSON | | [PLJSON_EXT](PLJSON_EXT.md) | Estensioni JSON | | [PLJSON_HELPER](PLJSON_HELPER.md) | Helper functions | | [PLJSON_ML](PLJSON_ML.md) | Multi-line JSON | | [PLJSON_OBJECT_CACHE](PLJSON_OBJECT_CACHE.md) | Cache oggetti JSON | | [PLJSON_PARSER](PLJSON_PARSER.md) | Parser JSON | | [PLJSON_PRINTER](PLJSON_PRINTER.md) | Output JSON formattato | | [PLJSON_UT](PLJSON_UT.md) | Unit test JSON | | [PLJSON_UTIL_PKG](PLJSON_UTIL_PKG.md) | Utility JSON | | [PLJSON_XML](PLJSON_XML.md) | Conversione JSON ↔ XML | ## Dettaglio Package MAIL_PKG ### Procedures Disponibili | Procedura | Descrizione | |-----------|-------------| | `send_custom_mail` | Invio email generica | | `send_richiesta_riscontro_preventivo` | Sollecito per preventivi in stato 100/200 | | `send_richiesta_riscontro_preventivo_job` | Job: 10 giorni dopo DATA_DOC | | `send_richiesta_riscontro_post_degustazione` | Sollecito post-degustazione | | `send_richiesta_riscontro_post_degustazione_job` | Job: 15 giorni dopo prima degustazione | | `send_reminder_seconda_caparra` | Reminder pagamento seconda caparra | | `send_reminder_seconda_caparra_job` | Job: ogni 5 giorni da 65gg prima evento | ### Configurazione Email - **From**: `noreply@apollinarecatering.it` - **BCC**: `monia@apollinarecatering.it, matrimonio@apollinarecatering.it` - Usa `APEX_MAIL` per invio - Richiede `CMN_MAIL_HTMLUTILS` per costruzione body HTML ### Migrazione .NET ```csharp // Esempio implementazione con SendGrid o SMTP public interface IMailService { Task SendCustomMailAsync(string recipients, string subject, string body); Task SendRichiestaRiscontroPreventivo(int eventoId); Task SendReminderSecondaCaparra(int eventoId); } // Jobs con Hangfire [RecurringJob("0 9 * * *")] public async Task SendReminderSecondaCaparraJob() { var eventi = await GetEventiDaPagareEntro65gg(); foreach (var evento in eventi.Where(e => ShouldSendReminder(e))) { await _mailService.SendReminderSecondaCaparra(evento.Id); } } ``` ## Note per Migrazione 1. **MAIL_PKG**: Sostituire con servizio email .NET (SendGrid, SMTP, Azure Communication Services) 2. **PLJSON_***: Non necessari in .NET, usare `System.Text.Json` 3. **XLIB_JASPERREPORTS**: Valutare alternative: - SSRS (SQL Server Reporting Services) - DevExpress Reports - Telerik Reporting - QuestPDF / iTextSharp per PDF 4. **XLIB_HTTP**: Sostituire con `HttpClient` 5. **UTL_BASE64**: Usare `Convert.ToBase64String` / `Convert.FromBase64String`