// Build appointment object.
return AppointmentData(
result.id ?: 0,
status,
time,
result.location?.name,
result.windowStart,
result.windowEnd,
result.location?.id,
result.location?.address?.street,
result.location?.address?.city,
result.location?.address?.state,
result.location?.address?.postalCode,
result.location?.lat,
result.location?.lon,
result.location?.distance,
result.job?.type,
result.job?.number,
result.job?.jobDescription,
result.job?.id,
result.job?.jobTypeWeight,
result.job?.dueBy,
result.techs?.map { tech -> tech.id ?: 0L }
existing.copy(status = pending.status)
Do the bottom instead of the top