Skip to content

Promotion Caregiver Analytics Gap Mining

Scope: appended source-mining queue for legacy promotion/shop operations, caregiver profile credential dossier, care-delivery report/service/attendance obligations, push/notify flows, and admin analytics report catalog. This page keeps new hotspots separate so settlement and branch pages do not get rewritten.

flowchart LR
  AdminPromotion[Admin Promotion.php]
  CouponModel[Coupon_model.php]
  PromotionModel[Promotion_model.php]
  MomfirstModel[Momfirst_model.php]

  AdminManager[Admin Manager.php]
  AdminManagerModel[Admin Manager_model.php]
  ManagerPortal[Manager User.php]
  ManagerUserModel[Manager User_model.php]

  ReportController[Report.php]
  ServiceController[Service.php]
  AttendanceController[Attendance.php]
  NotifyModel[Notify_model.php]

  StatisticsModel[Statistics_model.php]

  PromotionEntitlement[PromotionEntitlement]
  GiftFulfillment[GiftFulfillment]
  MomfirstDelivery[MomfirstDelivery]
  CaregiverDossier[CaregiverCredentialDossier]
  CareDeliveryObligation[CareDeliveryObligation]
  AnalyticsCatalog[AdminAnalyticsCatalog]

  AdminPromotion --> CouponModel --> PromotionEntitlement
  AdminPromotion --> PromotionModel --> GiftFulfillment
  AdminPromotion --> MomfirstModel --> MomfirstDelivery

  AdminManager --> AdminManagerModel --> CaregiverDossier
  ManagerPortal --> ManagerUserModel --> CaregiverDossier

  NotifyModel --> CareDeliveryObligation
  ReportController --> CareDeliveryObligation
  ServiceController --> CareDeliveryObligation
  AttendanceController --> CareDeliveryObligation

  StatisticsModel --> AnalyticsCatalog
  • Promotion entitlement lifecycle. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Promotion.php:293-307, source-refs/sanmopia-admin/application/models/Coupon_model.php:10-23, source-refs/sanmopia-admin/application/models/Coupon_model.php:33-160, and source-refs/sanmopia-admin/application/models/Coupon_model.php:240-323. Source behavior: coupon screens are HQ-only, source coupon types include PRODUCT1 and PRODUCT2, service interruption/cancel can hard-delete existing coupon rows, reissue 1-week or 2-week gift coupon by real attendance count, and publish USER coupon rows with six-month expiry. Modern gap: PromotionEntitlement must keep immutable entitlement rule version, reservation source, service-day evidence, cancellation/interruption reason, replacement/reissue lineage, expiry, and settlement participation. Hard delete cannot be target behavior.

  • Gift fulfillment operations. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Promotion.php:312-340, source-refs/sanmopia-admin/application/controllers/Promotion.php:533-542, and source-refs/sanmopia-admin/application/models/Promotion_model.php:18-55. Source behavior: gift detail edits product application contact, address, complete date, shipper, tracking number, and memo directly on PRODUCT_APPLY_TB. Modern gap: GiftFulfillmentRequest needs recipient snapshot, address version, shipment carrier/tracking, fulfillment status, operator memo, status timeline, and audit. It should link to promotion entitlement, not mutate application row as current truth.

  • Momfirst DB send and result-file delivery. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Promotion.php:345-397, source-refs/sanmopia-admin/application/controllers/Promotion.php:486-564, source-refs/sanmopia-admin/application/models/Momfirst_model.php:12-68, source-refs/sanmopia-admin/application/models/Momfirst_model.php:70-183, and source-refs/sanmopia-admin/application/models/Momfirst_model.php:198-272. Source behavior: LOVEBOX/MILK filters, branch filter, DB-send date, service-start date, not-send log, PDF-only file upload, push notification, public OPENURL, and force-download all live in admin source. Modern gap: MomfirstDelivery must split DB-send export, no-send reason log, uploaded analysis artifact, recipient notification, download grant, and branch/HQ visibility. Result files need Storage keys, checksum, result type, uploaded by, previous artifact supersession, signed download, and customer-safe access audit.

  • Caregiver profile credential dossier. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Manager.php:47-106, source-refs/sanmopia-admin/application/controllers/Manager.php:133-252, source-refs/sanmopia-admin/application/controllers/Manager.php:340-544, source-refs/sanmopia-admin/application/models/Manager_model.php:116-238, source-refs/sanmopia-admin/application/models/Manager_model.php:1530-1695, source-refs/sanmopia-admin/application/models/Manager_model.php:1698-1799, source-refs/sanmopia-admin/application/models/Manager_model.php:1802-2144, source-refs/sanmopia-manager/application/controllers/User.php:242-379, source-refs/sanmopia-manager/application/controllers/User.php:441-740, and source-refs/sanmopia-manager/application/models/User_model.php:157-247. Source behavior: admin and manager portal both mutate profile image, sign image, account, career, education, health, denied days, greeting, FCM token, address, and password. Images are uploaded to legacy folders and previous files are deleted. Modern gap: CaregiverCredentialDossier should hold versioned profile facts, account references, credential documents, education records, health documents, signed image asset, profile image asset, address coordinates, and actor/source channel. Self-service and admin changes require separate command origins, review state, supersession, retention policy, and Storage audit.

  • Credential admission and public-rating moderation. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Manager.php:1013-1021, source-refs/sanmopia-admin/application/controllers/Manager.php:1378-1425, source-refs/sanmopia-admin/application/controllers/Manager.php:1981-2078, source-refs/sanmopia-admin/application/models/Manager_model.php:2194-2242, source-refs/sanmopia-admin/application/models/Manager_model.php:2244-2278, and source-refs/sanmopia-admin/application/models/Manager_model.php:2280-2295. Source behavior: admin toggles SHOW_FL for main/sub caregiver user comments, toggles ADMISSION_FL for education and career records, and edits recommended manager branch/contact data. Modern gap: CaregiverCredentialReview and CaregiverPublicFeedbackModeration need reviewer, reason, before/after visibility, linked document id, approval status, and audit timeline. Recommendation intake should be its own CaregiverReferralCandidate, not mixed with credential dossier rows.

  • Caregiver self-service security and device tokens. Status: Pending. Evidence: source-refs/sanmopia-manager/application/controllers/User.php:787-854, source-refs/sanmopia-manager/application/models/User_model.php:866-917, and source-refs/sanmopia-manager/application/models/User_model.php:919-1005. Source behavior: self-service FCM token, address geocoding, password rotation, and credential deletes are direct row updates/deletes. Modern gap: CaregiverAccountSecurityEvent must record password verification result, new session/auth token, device token lifecycle, address geocoding result, and delete/supersede events for credentials instead of physical deletion. 2026-07-06 backend foundation bf38296 covers the address/device-token subset with caregiver_management/features/caregiver_profile_contact_revision; password rotation and credential delete/supersede events remain pending in this broader gap.

  • Care-delivery obligation scheduler. Status: Pending. Evidence: source-refs/sanmopia-manager/application/models/Notify_model.php:70-164, source-refs/sanmopia-manager/application/models/Notify_model.php:166-354, and source-refs/sanmopia-manager/application/models/Notify_model.php:354-448. Source behavior: notify rows use REPORT_FIRST, REPORT_PROGRESS, REPORT_LAST, and SERVICE; some legacy helper paths hardcode historical CREATED_DT values; current report/service queries include statuses 0,3,4,5,6,11,12 and exclude status 13, while historical repair helpers include 13 and hardcode 2021-08-31 07:00:00 / 2021-09-01 07:00:00; read-notify can create attendance rows. Modern gap: CareDeliveryObligation should be generated from service calendar, assignment role, report kind, service date, obligation due time, assignee, read/submitted status, and retry policy. CareDeliveryNotificationWorkQueue now owns retry/dead-letter/suppress/repair action vocabulary; remaining proof is persistence and worker/operator wiring. Attendance creation must not be a hidden side effect of reading notification state.

  • Daily caregiver report submission. Status: Pending. Evidence: source-refs/sanmopia-manager/application/controllers/Report.php:1-106 and source-refs/sanmopia-manager/application/models/Report_model.php:11-100. Source behavior: controller checks notify ownership, blocks already-read notify, loads question set by 첫째날, 진행중, or 마지막날, then stores objective answers and essay answers in separate tables. Modern gap: DailyCareReportSubmission needs obligation id, question-set version, structured answers, essay answers, caregiver role, reservation id, service date, submitted-at, and idempotency key. Read-notify is not enough as submission status.

  • Service record and attendance submit flow. Status: Pending. Evidence: source-refs/sanmopia-manager/application/controllers/Service.php:1-254, source-refs/sanmopia-manager/application/models/Service_model.php:10-135, and source-refs/sanmopia-manager/application/controllers/Attendance.php:1-80. Source behavior: service record supports main/sub caregiver ownership, primary table MANAGER_SERVICE_TB, sub table MANAGER_SUB_SERVICE_TB, duplicate check by reservation/date only, mother/baby/caregiver health fields, respiratory symptoms, retroactive payment note, newborn name/weight bootstrap, and main-caregiver notify read. Schedule UI has route/date mismatch, hardcoded sub visibility through manager id 1, and SUB_READ_FL without a matching writer. Attendance blocks duplicate same-day check-in and sends mother push about no fever/respiratory abnormality. Modern replacement: CaregiverServiceRecordSubmission now owns role/handoff identity, service date access window, duplicate replay, correction revision, route date, sequential writable action, and explicit attendance outbox key. Remaining proof: Supabase persistence/API, newborn bootstrap facts, FCM delivery attempt storage, mother-visible notification audit, and printable snapshot integration for document ids 6 and 20.

  • Admin analytics report catalog. Status: Pending. Evidence: source-refs/sanmopia-admin/application/models/Statistics_model.php:10-163, source-refs/sanmopia-admin/application/models/Statistics_model.php:238-360, source-refs/sanmopia-admin/application/models/Statistics_model.php:760-1044, source-refs/sanmopia-admin/application/models/Statistics_model.php:1062-1216, and source-refs/sanmopia-admin/application/models/Statistics_model.php:1971-2137. Source behavior: one model routes performance, sales, user-connect, evaluation, user, branch connect, and detail datatables. It embeds status ids, branch exclusions, payment-date rules, service-day filters, coupon/fee math, and total-row aggregation. Modern gap: AdminAnalyticsCatalog should declare each report id, audience, filters, metric definitions, source fact tables, branch visibility, export support, freshness, and row-level authorization. SQL-specific status ids and branch exclusions become adapter evidence, not product vocabulary.

  • Analytics/export snapshot reproducibility. Status: Pending. Evidence: source-refs/sanmopia-admin/application/controllers/Promotion.php:545-564, source-refs/sanmopia-admin/application/models/Statistics_model.php:1271-1295, and source-refs/sanmopia-admin/application/models/Statistics_model.php:1971-2025. Source behavior: list/export paths build current SQL rows on demand and recompute totals in PHP. Modern gap: AdminReportExportRequest should freeze filter input, query version, generated columns, row count, totals, artifact key, signed download state, and operator audit. Report exports need column tests so performance/sales/branch connect metrics do not drift when reservation/payment adapters change.

  • Add PromotionEntitlement, GiftFulfillmentRequest, and MomfirstDelivery under customer engagement commerce.
  • Add CaregiverCredentialDossier, CaregiverCredentialReview, CaregiverPublicFeedbackModeration, CaregiverReferralCandidate, and CaregiverAccountSecurityEvent under caregiver profile operations.
  • Add CareDeliveryObligation, DailyCareReportSubmission, ServiceRecordSubmission, and CaregiverAttendanceCheckIn under care delivery documents and notifications.
  • Add AdminAnalyticsCatalog and AdminReportExportRequest under admin analytics/reporting.