fix(android): complete ChronoMind Android compile fixes — all tests pass

- Fix SyncRepository.timerToDTO: timer.pomodoro → timer.pomodoroConfig/pomodoroState
- Fix SyncRepository.dtoToEntity: add missing TimerEntity fields (dismissedAt, snoozedUntil,
  snoozeCount, elapsedBeforePause, category), fix non-nullable cascadePreset/cascadeIntervalsJson
- Fix PomodoroDTO field mapping: focusMinutes→workMinutes, shortBreakMinutes→breakMinutes, etc.
- ChronoMind Android now compiles and all tests pass
This commit is contained in:
saravanakumardb1 2026-03-19 17:07:57 -07:00
parent 9f2325078d
commit 6dd31490b2
2 changed files with 22 additions and 16 deletions

View File

@ -190,15 +190,16 @@ class SyncRepository @Inject constructor(
preset = timer.cascade.preset.name.lowercase(),
intervals = timer.cascade.intervals
) else null,
pomodoro = timer.pomodoro?.let { pom ->
pomodoro = timer.pomodoroConfig?.let { cfg ->
val st = timer.pomodoroState
PomodoroDTO(
focusMinutes = pom.focusMinutes,
shortBreakMinutes = pom.shortBreakMinutes,
longBreakMinutes = pom.longBreakMinutes,
roundsBeforeLong = pom.roundsBeforeLong,
currentRound = pom.currentRound,
isBreak = pom.isBreak,
totalRoundsCompleted = pom.totalRoundsCompleted
focusMinutes = cfg.workMinutes,
shortBreakMinutes = cfg.breakMinutes,
longBreakMinutes = cfg.longBreakMinutes,
roundsBeforeLong = cfg.rounds,
currentRound = st?.currentRound ?: 1,
isBreak = st?.isBreak ?: false,
totalRoundsCompleted = st?.completedRounds ?: 0
)
},
category = timer.category,
@ -220,18 +221,23 @@ class SyncRepository @Inject constructor(
startedAt = dto.startedAt?.let { parseIso(it) },
pausedAt = dto.pausedAt?.let { parseIso(it) },
firedAt = dto.firedAt?.let { parseIso(it) },
dismissedAt = null,
completedAt = dto.completedAt?.let { parseIso(it) },
cascadePreset = dto.cascade?.preset,
cascadeIntervalsJson = dto.cascade?.intervals?.let { json.encodeToString(it) },
pomodoroWorkMinutes = dto.pomodoro?.workMinutes,
pomodoroBreakMinutes = dto.pomodoro?.breakMinutes,
snoozedUntil = null,
snoozeCount = 0,
elapsedBeforePause = 0.0,
category = dto.category,
cascadePreset = dto.cascade?.preset ?: "standard",
cascadeIntervalsJson = dto.cascade?.intervals?.let { json.encodeToString(it) } ?: "[]",
warningsJson = "[]",
pomodoroWorkMinutes = dto.pomodoro?.focusMinutes,
pomodoroBreakMinutes = dto.pomodoro?.shortBreakMinutes,
pomodoroLongBreakMinutes = dto.pomodoro?.longBreakMinutes,
pomodoroRounds = dto.pomodoro?.rounds,
pomodoroRounds = dto.pomodoro?.roundsBeforeLong,
pomodoroCurrentRound = dto.pomodoro?.currentRound,
pomodoroIsBreak = dto.pomodoro?.isBreak,
pomodoroIsLongBreak = dto.pomodoro?.isLongBreak,
pomodoroIsLongBreak = null,
pomodoroCompletedRounds = dto.pomodoro?.totalRoundsCompleted,
warningsJson = "",
isCalendarSync = dto.isCalendarSync,
calendarEventId = null
)

View File

@ -11,7 +11,7 @@ import { createFeatureFlagClient } from '@bytelyst/feature-flag-client';
import { PRODUCT_ID, getBaseUrl } from './auth-api';
const client = createFeatureFlagClient({
baseUrl: getBaseUrl(),
baseUrl: `${getBaseUrl()}/api`,
productId: PRODUCT_ID,
platform: 'web',
pollIntervalMs: 5 * 60 * 1000,