SCRAPE-5: Implement convertDataTypes() with type parsing helpers #10

Merged
stephen merged 1 commits from scraper/convert-types into dev 2026-02-05 21:33:58 -07:00
Owner

Summary

  • Implement convertDataTypes(unit) function and 7 helper functions in scraperService.js
  • parsePrice() handles currency formats ("$1,234"), "Call for pricing", negatives
  • parseInteger(), parsePositiveInteger(), parseIntegerOrString() for numeric fields
  • parseBoolean() for availability flags, parseFloat() for bath counts
  • trimString() for string fields with null coercion

Test plan

  • 74 unit tests covering all acceptance criteria
  • Edge cases: null, empty, undefined, invalid formats
  • Price parsing: currency symbols, commas, "Call for pricing", negatives
  • Boolean parsing: "true"/"false"/"1"/"0"/null
  • Full integration test through convertDataTypes()
  • All 182 existing scraper tests still passing
## Summary - Implement `convertDataTypes(unit)` function and 7 helper functions in `scraperService.js` - `parsePrice()` handles currency formats ("$1,234"), "Call for pricing", negatives - `parseInteger()`, `parsePositiveInteger()`, `parseIntegerOrString()` for numeric fields - `parseBoolean()` for availability flags, `parseFloat()` for bath counts - `trimString()` for string fields with null coercion ## Test plan - [x] 74 unit tests covering all acceptance criteria - [x] Edge cases: null, empty, undefined, invalid formats - [x] Price parsing: currency symbols, commas, "Call for pricing", negatives - [x] Boolean parsing: "true"/"false"/"1"/"0"/null - [x] Full integration test through convertDataTypes() - [x] All 182 existing scraper tests still passing
stephen added 1 commit 2026-02-05 21:23:06 -07:00
Implement convertDataTypes() with type parsing helpers
All checks were successful
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 13s
CI/CD Pipeline - Apartment API / Run Linting (pull_request) Successful in 9m37s
CI/CD Pipeline - Apartment API / Run Tests (pull_request) Successful in 9m43s
CI/CD Pipeline - Apartment API / Send Webhook Notification (pull_request) Successful in 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
2191a6d4f2
- Add parseInteger, parsePositiveInteger, parseIntegerOrString helpers
- Add parsePrice with currency format handling and validation
- Add parseBoolean, parseFloat, trimString helpers
- convertDataTypes() applies correct parser to each unit field
- Comprehensive test suite with 74 tests covering all edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
stephen merged commit 0cbeaaf9d5 into dev 2026-02-05 21:33:58 -07:00
stephen deleted branch scraper/convert-types 2026-02-05 21:33:58 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stephen/apartment-dashboard-api#10
No description provided.