Commit Graph

8 Commits

Author SHA1 Message Date
sas.fajri
6dec35217f Align status flow: D=Draft S=Sending P=Process R=Received E=Error C=Cancel
Script picks S, locks to P, sets R on success.
On failure: back to S for retry; after max retry (3) sets E and logs to one_lab_log.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 22:07:51 +07:00
sas.fajri
409c156310 Set status P (processing) before send, revert to S on failure
Prevents UI re-trigger while email is in flight. Status flow:
S (scheduled) → P (processing) → D (delivered) / S (failed, retryable)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 22:04:06 +07:00
sas.fajri
d83f0f303b Insert send log to one_lab_log.t_send_email_log with correct schema
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:59:42 +07:00
sas.fajri
1c588f1d7d Build T_SendEmailReports from qr_printout with id/url/result format
Done.php send_email_v2: query qr_printout to build structured reports
array [{"id","url","result"}] using QR_PrintOutGroup_ResultName instead
of relying on client-supplied reports param.

send_email.php: parse both old (URL string) and new (object) formats;
use result field as PDF attachment filename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:52:31 +07:00
sas.fajri
69772125b5 Insert delivery record to t_send_email_log on successful send
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:48:06 +07:00
sas.fajri
81b699db01 Add PDF validation in email script; add Nat_SubSubGroupSequence column
- Skip attachment if downloaded content is not a valid PDF (HTML error response)
- Add Nat_SubSubGroupSequence to nat_subsubgroup table (missing column
  referenced by sp_rpt_hasil_lab in SELECT and ORDER BY)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:37:50 +07:00
sas.fajri
1be2531f82 Fix PHP 7.4 compatibility: remove union return types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:29:09 +07:00
sas.fajri
96a245322d Add PHP email queue processor script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 21:28:01 +07:00