Notification And Document Delivery Gap Mining
Notification And Document Delivery Gap Mining
Section titled “Notification And Document Delivery Gap Mining”This pass covers source-reference paths where browser, view, controller, or CLI code performs work that modern backend policies must own: notification routing, provider dispatch, document catalog selection, delivery attempts, signed access, and customer-visible action state.
Source Evidence And Migration Gaps
Section titled “Source Evidence And Migration Gaps”| Source evidence | Modern bounded context / feature | Gap |
|---|---|---|
source-refs/sanmopia_web/application/controllers/api/Reservation.php:115-227, source-refs/sanmopia_web/static/js/mypage/reservation.js:337-421, source-refs/sanmopia_web/application/controllers/api/Menu.php:26-72 | reservation_operations / CustomerReservationIntent, customer_engagement / CommunicationDispatchRequest, BranchNotificationRoutingPolicy | Customer request controllers mutate request state, choose branch recipients, send provider messages, send customer push, duplicate one branch recipient rule, and let browser success callbacks choose customer-visible completion copy. Backend must persist intent, route recipients, enqueue dispatch, record provider attempt state, and return one policy-owned result projection. |
source-refs/sanmopia_web/application/controllers/api/Payment.php:439-491, source-refs/sanmopia_web/application/controllers/api/Payment.php:598-643, source-refs/sanmopia_web/application/controllers/api/Payment.php:740-754 | pricing_settlement / CustomerPaymentInstruction, PaymentCommunicationWorkflow, customer_engagement / CommunicationDispatchRequest | Payment controller branches build customer payment messages, choose provider template/fallback, send branch completion notices, and special-case extra recipients inline. Backend must freeze payment purpose, amount, method, provider route, customer-visible message state, branch routing, idempotency, retry, and audit before any provider handoff. |
source-refs/sanmopia_web/application/views/mypage/reservation_document.php:45-123, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:19-129, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:158-225, source-refs/sanmopia_web/application/controllers/Notification.php:19-27 | document_reporting / ReservationDocumentCatalog, ReservationDocumentBundle, DocumentAccessGrant, DocumentDeliveryAttempt | Customer view hardcodes numeric document choices and token URLs. Scheduled CLI builds file lists from service/payment/status facts, sends email attachments, records send status, and deletes temporary files. Backend must own document catalog eligibility, artifact bundle state, scheduled/manual delivery attempts, signed grants, revocation, retry, and recipient-visible access history. |
source-refs/sanmopia_web/application/views/mypage/item/reservation_func_btn.php:1-190, source-refs/sanmopia_web/application/views/mypage/pre_reservation_detail.php:41-90, source-refs/sanmopia_web/application/views/mypage/reservation_detail.php:421-452, source-refs/sanmopia_web/static/js/mypage/reservation.js:337-421 | reservation_operations / CustomerActionAvailabilityPolicy, CustomerReservationLifecycleView, CustomerActionCommand | Customer views choose payment, delivery, report, cancel, continue, reschedule, conversion, and more-info actions from raw status and payment maps. Browser code decides route and success copy after command response. Backend must own action availability, disabled reasons, command target, customer-facing message, revision, and idempotency scope. |
source-refs/sanmopia_web/application/controllers/api/Shop.php:105-166, source-refs/sanmopia_web/application/controllers/management/Push.php:10-45, source-refs/sanmopia_web/application/controllers/management/Push.php:49-86, source-refs/sanmopia_web/application/models/Notification_model.php:16-68 | customer_engagement / PromotionDeliveryAttempt, CampaignDispatchSegment, NotificationInboxItem, CommunicationDispatchRequest | Customer-engagement code directly resends gift coupon SMS, manually segments campaign push recipients by raw reservation status and token rows, and inserts inbox rows from device tokens. Backend must use audience policies, recipient snapshots, inbox/action projections, dispatch attempts, provider results, suppression reasons, and repairable retries. |
source-refs/sanmopia_web/application/controllers/Momfirst.php:87-145, source-refs/sanmopia_web/application/controllers/Clean.php:67-125 | customer_engagement / PartnerBenefitResultArtifact, DocumentAccessGrant, PartnerBenefitDeliveryBatch | Partner-result downloads validate a document token, check reservation ownership, read an admin-root file path, and stream bytes directly. Backend must expose result artifacts through storage-backed grants, provider delivery batch state, checksum/content metadata, expiry, and access audit instead of filesystem reads from controllers. |
2026-07-05 Document Recipient Authority Edge Pass
Section titled “2026-07-05 Document Recipient Authority Edge Pass”| Priority | Missing backend-owned policy | Source evidence | Modern target |
|---|---|---|---|
| P0 | Notification document actions need document-scoped grants, not one page-level user token. Source notification controller generates a fresh user-scoped documentDownload token, the notification view appends ?token= client-side for any OPENURL action, and the document download API only checks token user ownership of the reservation plus numeric document type. | source-refs/sanmopia_web/application/controllers/Notification.php:19-27, source-refs/sanmopia_web/application/views/notification.php:91-94, source-refs/sanmopia_web/application/views/notification.php:135, source-refs/sanmopia_web/application/models/User_model.php:462-489, source-refs/sanmopia_web/application/controllers/api/ReservationDocument.php:21-54 | NotificationDocumentActionGrant, DocumentAccessGrant, DocumentRecipientAuthority, RecipientVisibleAccessHistory |
| P0 | Reservation document delivery recipient must be a backend decision. Source scheduled/manual document jobs choose reservation email, skip or send based on reservation status and payment facts, create temporary PDFs, insert notification actions back to the user, and include manual/hardcoded mail behaviors. | source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:254-364, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:461-543, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:621-694 | ReservationDocumentDeliveryRecipientDecision, DocumentDeliveryAttempt, DocumentArtifactVersion, DocumentRecipientAuthority |
| P1 | Partner benefit downloads share the same user token authority but serve different artifact classes. Source Momfirst and Clean downloads resolve the token to a user, verify that the user owns the linked reservation, then read files from admin-root paths and stream bytes. | source-refs/sanmopia_web/application/controllers/Momfirst.php:87-145, source-refs/sanmopia_web/application/controllers/Clean.php:67-125 | PartnerBenefitResultArtifact, PartnerBenefitDeliveryBatch, DocumentAccessGrant, RecipientVisibleAccessHistory |
2026-07-05 Refund Notification And Grant Pass
Section titled “2026-07-05 Refund Notification And Grant Pass”| Priority | Missing backend-owned policy | Source evidence | Modern target |
|---|---|---|---|
| P0 | Refund/cancellation notification recipient is separate from refund recipient and payer. Customer cancel checks reservation ownership from login user, immediate cancel refunds and then sends branch Kakao plus customer FCM to the login/user id with card-cancel timing copy. Admin cancellation refunds provider contexts but notification/document grant handling is not tied to refund result. | source-refs/sanmopia_web/application/controllers/api/Reservation.php:87-240, source-refs/sanmopia_web/application/models/Reservation_model.php:990-1066, source-refs/sanmopia-admin/application/models/Reservation_model.php:1769-1916 | RefundNotificationRecipientResolution, RefundCommunicationDispatchRequest, PaymentRefundResultProjection, RefundRecipientVisibleStatus |
| P0 | Notification action rows carry raw type/value, not grant-scoped actions. Source inserts DATA as JSON {TYPE, VALUE}, notification list chooses template data or row data, and notification view appends a page-level document token for OPENURL. Refund, cancellation, and settlement adjustment events therefore need backend-issued action grants instead of UI URL/token composition. | source-refs/sanmopia_web/application/models/Notification_model.php:16-68, source-refs/sanmopia_web/application/controllers/Notification.php:19-27, source-refs/sanmopia_web/application/views/notification.php:91-94, source-refs/sanmopia_web/application/views/notification.php:135 | NotificationActionGrant, NotificationDocumentActionGrant, RefundActionAvailabilityProjection, RecipientVisibleAccessHistory |
| P1 | Cancellation/refund should revoke or supersede document and partner-benefit grants. Source cancellation can delete Momfirst rows, product coupons, and payment rows, while existing document/partner downloads only validate user token plus reservation ownership. Modern grants need revocation reason, replacement artifact, and access-history visibility after cancellation, stop, refund, or settlement adjustment. | source-refs/sanmopia_web/application/models/Reservation_model.php:1027-1048, source-refs/sanmopia-admin/application/models/Reservation_model.php:1875-1889, source-refs/sanmopia-admin/application/models/Reservation_model.php:5876-5900, source-refs/sanmopia_web/application/controllers/api/ReservationDocument.php:21-54, source-refs/sanmopia_web/application/controllers/Momfirst.php:87-145, source-refs/sanmopia_web/application/controllers/Clean.php:67-125 | DocumentGrantRevocationPolicy, PartnerBenefitGrantRevocationPolicy, DocumentArtifactSupersessionEvent, RecipientVisibleAccessHistory |
2026-07-05 CaveCrew Explorer A Document Delivery Delta
Section titled “2026-07-05 CaveCrew Explorer A Document Delivery Delta”| Priority | Missing backend-owned policy | Source evidence | Modern target |
|---|---|---|---|
| P0 | Contract/notice document delivery schedule is payment-date and status dependent. Source start-date mail sends only paid deposit reservations, skips draft/consult/cancel/stop statuses into RESERVATION_SEND_MAIL_TB, and changes document bundle by service type plus 2023-04-11 payment-date cutoff. Yesterday-paid notice mail uses voucher/normal payment rows with payment type 1 and paid status 1. | source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:19-130, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:139-226, source-refs/sanmopia-admin/application/models/Reservation_model.php:4387-4408, source-refs/sanmopia-admin/application/models/Reservation_model.php:5915-5945 | ReservationDocumentDeliverySchedulePolicy, DocumentDeliveryEligibilityDecision, DocumentDeliveryOutcomeLedger, PaymentDatedDocumentBundlePolicy |
| P0 | Voucher service-end document delivery has two trigger paths: scheduled upcoming end and yesterday stop. Source sends document id 21 for voucher reservations ending in two days, also sends for reservations changed to status 13 yesterday, writes END_DOCUMENT notification rows, and logs send progress through ym_log. | source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:249-364, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:369-457, source-refs/sanmopia-admin/application/models/Reservation_model.php:4322-4385 | VoucherServiceEndDocumentDeliveryPolicy, ServiceEndDocumentReadinessDecision, DocumentDeliveryNotificationGrant, DocumentDeliveryRunAudit |
| P0 | Render/provider boundary is hidden inside mail generation. Source converts generated XLSX to PDF through http://convert.sanmopiaapp.com with a static authorization header, copies static PDF templates for already-PDF documents, writes temp files, returns file paths, and callers delete files after mail send. | source-refs/sanmopia-admin/application/models/Spreadsheet_model.php:4435-4500, source-refs/sanmopia-admin/application/models/Spreadsheet_model.php:4510-4600, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:104-130, source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:201-226 | DocumentRenderProviderAdapter, DocumentRenderAttemptArtifact, StaticPdfTemplateArtifact, TemporaryArtifactRetentionPolicy |
| P1 | Manual document resend has hidden observer/BCC behavior and weak audit. Source manual start-mail path checks reservation/user match, reuses the payment-date bundle policy, sends mail with hardcoded BCC, does not insert the normal send-mail ledger row, and echoes completion text. | source-refs/sanmopia-admin/application/controllers/cli/ReservationDocument.php:620-695 | ManualDocumentDeliveryOverrideCommand, DocumentDeliveryObserverRecipientPolicy, ManualDeliveryAuditEntry |
Remaining Backend Gaps
Section titled “Remaining Backend Gaps”- Bind existing communication dispatch foundations to reservation intents, payment instructions, campaign segments, gift-coupon resend, partner benefit delivery, and customer inquiry events.
- Persist recipient routing policy and branch override rules as versioned configuration, not inline controller conditions.
- Add worker/retry/dead-letter processing for provider sends, including suppression reasons and operator repair commands.
- Connect document catalog, bundle readiness, render artifacts, signed access, scheduled delivery, manual resend, revoke, and recipient-visible access history through runtime API routes.
- Replace customer UI status switches with backend action availability and lifecycle projections, then keep frontend as projection rendering plus explicit commands only.