|
|
First slice of the v5.0.0 god-file decomposition. DomainViewModel.swift is a
single ~4.9k-line class body; this begins splitting it into focused
`DomainViewModel+<Concern>.swift` extensions, one cohesive concern at a time,
with each move behavior-preserving and verified by build + the test net.
- Moves the audit read/CRUD/export surface (audits/auditSession/auditTimeline,
updateAuditStatus/Notes, toggleAuditChecklistItem, add/update/remove
AuditFinding, exportAuditData) into DomainViewModel+Audit.swift as an
extension. Pure move — no logic changes.
- `startAudit(for:)` intentionally stays on the main type: it drives a live
inspection to seed the session, so it belongs with the inspection pipeline
until that is extracted. `persistAuditSessions()` is promoted from private to
internal so both files can call it (its only cross-file dependency).
No project.pbxproj change is needed — DomainDig/ is a file-system-synchronized
group, so the new file is picked up automatically.
DomainViewModel.swift: 4864 -> 4761 lines. App builds clean; unit suite 58/58.
|