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:
@@ -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))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user