Fix iOS build errors - Update TaskDetail model usage for Double cost fields

Fixed type conversion issues in iOS Swift files to handle KotlinDouble for
cost fields instead of String. Updated all task-related views to properly
convert between String (for TextField input) and KotlinDouble (for API calls).

Changes:
- TaskCard.swift: Updated preview data with new TaskDetail signature (added
  residenceName, createdBy, createdByUsername, intervalDays; changed
  estimatedCost from String to Double; removed actualCost and notes)
- TasksSection.swift: Updated two preview TaskDetail instances with new signature
- CompleteTaskView.swift: Convert actualCost String to KotlinDouble for API
- EditTaskView.swift: Convert estimatedCost between KotlinDouble and String
  for display and API calls
- TaskFormView.swift: Convert estimatedCost String to KotlinDouble for API

Pattern used:
- Display: KotlinDouble -> String using .doubleValue
- API: String -> Double -> KotlinDouble using KotlinDouble(double:)

Build now succeeds with all type conversions properly handling Decimal/Double
values from backend instead of String.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-15 23:12:57 -06:00
parent b9c82ffc37
commit d777880d2b
5 changed files with 19 additions and 13 deletions

View File

@@ -308,7 +308,7 @@ struct CompleteTaskView: View {
completedByEmail: "",
companyName: selectedContractor?.company ?? "",
completionDate: currentDate,
actualCost: actualCost.isEmpty ? nil : actualCost,
actualCost: actualCost.isEmpty ? nil : KotlinDouble(double: Double(actualCost) ?? 0.0),
notes: notes.isEmpty ? nil : notes,
rating: KotlinInt(int: Int32(rating))
)