Some checks failed
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 13s
CI/CD Pipeline - Apartment API / Run Linting (pull_request) Successful in 9m36s
CI/CD Pipeline - Apartment API / Run Tests (pull_request) Successful in 9m51s
CI/CD Pipeline - Apartment API / Send Webhook Notification (pull_request) Failing after 2s
CI/CD Pipeline - Apartment API / Build & Push Image (pull_request) Has been skipped
CI/CD Pipeline - Apartment API / Deploy to Production (pull_request) Has been skipped
Add recordScraperRun(db, runData) to scraperService that persists scraper execution history to the scraper_runs collection. The function inserts a document containing all run metadata (jobId, trigger, status, duration, unit metrics, timing, errors) along with a recordedAt timestamp. Designed for use in finally blocks: errors during recording are caught, logged, and swallowed so they never interrupt the scraper pipeline. Returns the insertOne result on success or null on failure. Includes 17 tests covering insertion behavior, field preservation, graceful error handling, return values, and recordedAt semantics.