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

@@ -289,7 +289,7 @@ fun App(
EditResidenceRoute(
residenceId = residence.id,
name = residence.name,
propertyType = residence.propertyType?.toInt(),
propertyType = residence.propertyTypeId,
streetAddress = residence.streetAddress,
apartmentUnit = residence.apartmentUnit,
city = residence.city,
@@ -297,16 +297,16 @@ fun App(
postalCode = residence.postalCode,
country = residence.country,
bedrooms = residence.bedrooms,
bathrooms = residence.bathrooms,
bathrooms = residence.bathrooms?.toFloat(),
squareFootage = residence.squareFootage,
lotSize = residence.lotSize,
lotSize = residence.lotSize?.toFloat(),
yearBuilt = residence.yearBuilt,
description = residence.description,
isPrimary = residence.isPrimary,
ownerUserName = residence.ownerUsername,
createdAt = residence.createdAt,
updatedAt = residence.updatedAt,
owner = residence.owner
owner = residence.ownerId
)
)
},
@@ -314,15 +314,15 @@ fun App(
navController.navigate(
EditTaskRoute(
taskId = task.id,
residenceId = task.residence,
residenceId = task.residenceId,
title = task.title,
description = task.description,
categoryId = task.category.id,
categoryName = task.category.name,
frequencyId = task.frequency.id,
frequencyName = task.frequency.name,
priorityId = task.priority.id,
priorityName = task.priority.name,
categoryId = task.category?.id ?: 0,
categoryName = task.category?.name ?: "",
frequencyId = task.frequency?.id ?: 0,
frequencyName = task.frequency?.name ?: "",
priorityId = task.priority?.id ?: 0,
priorityName = task.priority?.name ?: "",
statusId = task.status?.id,
statusName = task.status?.name,
dueDate = task.dueDate,
@@ -402,25 +402,24 @@ fun App(
EditResidenceScreen(
residence = Residence(
id = route.residenceId,
ownerId = route.owner ?: 0,
name = route.name,
propertyType = route.propertyType.toString(), // Will be fetched from lookups
streetAddress = route.streetAddress,
apartmentUnit = route.apartmentUnit,
city = route.city,
stateProvince = route.stateProvince,
postalCode = route.postalCode,
country = route.country,
propertyTypeId = route.propertyType,
streetAddress = route.streetAddress ?: "",
apartmentUnit = route.apartmentUnit ?: "",
city = route.city ?: "",
stateProvince = route.stateProvince ?: "",
postalCode = route.postalCode ?: "",
country = route.country ?: "",
bedrooms = route.bedrooms,
bathrooms = route.bathrooms,
bathrooms = route.bathrooms?.toDouble(),
squareFootage = route.squareFootage,
lotSize = route.lotSize,
lotSize = route.lotSize?.toDouble(),
yearBuilt = route.yearBuilt,
description = route.description,
description = route.description ?: "",
purchaseDate = null,
purchasePrice = null,
isPrimary = route.isPrimary,
ownerUsername = route.ownerUserName,
owner = route.owner,
createdAt = route.createdAt,
updatedAt = route.updatedAt
),
@@ -455,7 +454,7 @@ fun App(
EditResidenceRoute(
residenceId = residence.id,
name = residence.name,
propertyType = residence.propertyType?.toInt(),
propertyType = residence.propertyTypeId,
streetAddress = residence.streetAddress,
apartmentUnit = residence.apartmentUnit,
city = residence.city,
@@ -463,16 +462,16 @@ fun App(
postalCode = residence.postalCode,
country = residence.country,
bedrooms = residence.bedrooms,
bathrooms = residence.bathrooms,
bathrooms = residence.bathrooms?.toFloat(),
squareFootage = residence.squareFootage,
lotSize = residence.lotSize,
lotSize = residence.lotSize?.toFloat(),
yearBuilt = residence.yearBuilt,
description = residence.description,
isPrimary = residence.isPrimary,
ownerUserName = residence.ownerUsername,
createdAt = residence.createdAt,
updatedAt = residence.updatedAt,
owner = residence.owner
owner = residence.ownerId
)
)
},
@@ -480,15 +479,15 @@ fun App(
navController.navigate(
EditTaskRoute(
taskId = task.id,
residenceId = task.residence,
residenceId = task.residenceId,
title = task.title,
description = task.description,
categoryId = task.category.id,
categoryName = task.category.name,
frequencyId = task.frequency.id,
frequencyName = task.frequency.name,
priorityId = task.priority.id,
priorityName = task.priority.name,
categoryId = task.category?.id ?: 0,
categoryName = task.category?.name ?: "",
frequencyId = task.frequency?.id ?: 0,
frequencyName = task.frequency?.name ?: "",
priorityId = task.priority?.id ?: 0,
priorityName = task.priority?.name ?: "",
statusId = task.status?.id,
statusName = task.status?.name,
dueDate = task.dueDate,
@@ -506,25 +505,24 @@ fun App(
EditTaskScreen(
task = TaskDetail(
id = route.taskId,
residence = route.residenceId,
residenceId = route.residenceId,
createdById = 0,
title = route.title,
description = route.description,
category = TaskCategory(route.categoryId, route.categoryName),
description = route.description ?: "",
category = TaskCategory(id = route.categoryId, name = route.categoryName),
frequency = TaskFrequency(
route.frequencyId, route.frequencyName, "", route.frequencyName,
daySpan = 0,
notifyDays = 0
id = route.frequencyId,
name = route.frequencyName,
days = null
),
priority = TaskPriority(route.priorityId, route.priorityName, displayName = route.statusName ?: ""),
priority = TaskPriority(id = route.priorityId, name = route.priorityName),
status = route.statusId?.let {
TaskStatus(it, route.statusName ?: "", displayName = route.statusName ?: "")
TaskStatus(id = it, name = route.statusName ?: "")
},
dueDate = route.dueDate,
estimatedCost = route.estimatedCost?.toDoubleOrNull(),
createdAt = route.createdAt,
updatedAt = route.updatedAt,
nextScheduledDate = null,
showCompletedButton = false,
completions = emptyList()
),
onNavigateBack = { navController.popBackStack() },