# Daily Cloudbeds Occupancy Report Workflow ## Objective Send a daily occupancy report email at **7:55 AM America/Chicago** to: - `bill@titangeneralcontractors.com` CC: - `bob.eagle.suites@gmail.com` The workflow should: 1. find the latest Cloudbeds occupancy email 2. extract the latest report/download link 3. resolve the link destination 4. generate an operator-friendly summary 5. send the report by email every morning 6. degrade gracefully if parsing is partial ## Delivery philosophy This workflow is designed to be **robust before perfect**. That means: - if full parsing succeeds, send the richer analysis - if full parsing fails, still send a useful morning email with: - report freshness - latest Cloudbeds subject/date - resolved report link - fallback operational note ## Recipients Primary: - `bill@titangeneralcontractors.com` CC: - `bob.eagle.suites@gmail.com` ## Daily schedule - Time: **7:55 AM** - Timezone: **America/Chicago** ## Inputs ### Required live inputs - Gmail readonly access - latest Cloudbeds occupancy email - latest Cloudbeds report link ### Local dependencies - `scripts/latest_cloudbeds_occupancy.py` - `scripts/resolve_cloudbeds_link.py` - `scripts/send_gmail.py` - daily orchestration script ## Output email structure ### Subject `Daily Eagle Suites Occupancy Report — YYYY-MM-DD` ### Body sections 1. Executive summary 2. Report freshness check 3. Latest Cloudbeds report details 4. Link to report 5. Parsed analysis if available 6. Fallback note if parsing is partial 7. Suggested attention items / anomalies ## Fallback behavior If report parsing is partial or unavailable, the script should still send the email and clearly label the status as: - `Partial` The email should still include: - latest email date/time - latest Cloudbeds subject - primary report link - resolved destination if available - note that deeper parsing is pending or incomplete ## Suggested future upgrades - browser-style Cloudbeds page extraction - attachment or PDF brief generation - daily trend comparison versus prior report - anomaly detection on occupancy changes - property-level highlights once report structure is understood ## Robustness notes - do not silently fail - always send a daily email if a current Cloudbeds email exists - include clear status markers: `Success`, `Partial`, or `Failure` - keep Bob copied for audit and refinement