mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Adds the persistence layer for UserAddress batches:
- Abstract UserAddressRepository with load_batch / save_batch.
- Concrete UserAddressCsvS3Repository over CsvS3Client:
- load_batch reads canonical upload columns (Address 1/2/3, Postcode,
Internal Reference), comma-joins non-empty address parts, and
passes Internal Reference through (None when missing/empty).
- save_batch writes a 3-column CSV (user_address,postcode,
internal_reference) to {path_prefix}/{ISO datetime}_{uuid8}.csv
and returns the s3://bucket/key URI.
- Postcode sanitisation flows through UserAddress.__post_init__; the
repo never calls sanitise_postcode directly.
Tests (moto-backed) cover: three-line address load, Address-1-only
load, missing Internal Reference, save->reload round trip, and
unique-filename-per-save. pyright --strict clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| domain | ||
| infrastructure | ||
| orchestration | ||
| repositories | ||
| utilities | ||
| __init__.py | ||