Update Kotlin models and iOS Swift to align with new Go API format

- Update all Kotlin API models to match Go API response structures
- Fix Swift type aliases (TaskDetail→TaskResponse, Residence→ResidenceResponse, etc.)
- Update TaskCompletionCreateRequest to simplified Go API format (taskId, notes, actualCost, photoUrl)
- Fix optional handling for frequency, priority, category, status in task models
- Replace isPrimaryOwner with ownerId comparison against current user
- Update ResidenceUsersResponse to use owner.id instead of ownerId
- Fix non-optional String fields to use isEmpty checks instead of optional binding
- Add type aliases for backwards compatibility in Kotlin models

🤖 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-27 11:03:00 -06:00
parent d3e77326aa
commit 60c824447d
48 changed files with 923 additions and 846 deletions

View File

@@ -2,7 +2,7 @@ import SwiftUI
import ComposeApp
struct CompletionCardView: View {
let completion: TaskCompletion
let completion: TaskCompletionResponse
@State private var showPhotoSheet = false
var body: some View {
@@ -64,15 +64,16 @@ struct CompletionCardView: View {
.fontWeight(.medium)
}
if let notes = completion.notes {
Text(notes)
if !completion.notes.isEmpty {
Text(completion.notes)
.font(.caption2)
.foregroundColor(Color.appTextSecondary)
.lineLimit(2)
}
// Show button to view photos if images exist
if let images = completion.images, !images.isEmpty {
if !completion.images.isEmpty {
let images = completion.images
Button(action: {
showPhotoSheet = true
}) {
@@ -95,9 +96,7 @@ struct CompletionCardView: View {
.background(Color.appBackgroundSecondary.opacity(0.5))
.cornerRadius(8)
.sheet(isPresented: $showPhotoSheet) {
if let images = completion.images {
PhotoViewerSheet(images: images)
}
PhotoViewerSheet(images: completion.images)
}
}