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:
parent
9f2325078d
commit
6dd31490b2
@ -190,15 +190,16 @@ class SyncRepository @Inject constructor(
|
|||||||
preset = timer.cascade.preset.name.lowercase(),
|
preset = timer.cascade.preset.name.lowercase(),
|
||||||
intervals = timer.cascade.intervals
|
intervals = timer.cascade.intervals
|
||||||
) else null,
|
) else null,
|
||||||
pomodoro = timer.pomodoro?.let { pom ->
|
pomodoro = timer.pomodoroConfig?.let { cfg ->
|
||||||
|
val st = timer.pomodoroState
|
||||||
PomodoroDTO(
|
PomodoroDTO(
|
||||||
focusMinutes = pom.focusMinutes,
|
focusMinutes = cfg.workMinutes,
|
||||||
shortBreakMinutes = pom.shortBreakMinutes,
|
shortBreakMinutes = cfg.breakMinutes,
|
||||||
longBreakMinutes = pom.longBreakMinutes,
|
longBreakMinutes = cfg.longBreakMinutes,
|
||||||
roundsBeforeLong = pom.roundsBeforeLong,
|
roundsBeforeLong = cfg.rounds,
|
||||||
currentRound = pom.currentRound,
|
currentRound = st?.currentRound ?: 1,
|
||||||
isBreak = pom.isBreak,
|
isBreak = st?.isBreak ?: false,
|
||||||
totalRoundsCompleted = pom.totalRoundsCompleted
|
totalRoundsCompleted = st?.completedRounds ?: 0
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
category = timer.category,
|
category = timer.category,
|
||||||
@ -220,18 +221,23 @@ class SyncRepository @Inject constructor(
|
|||||||
startedAt = dto.startedAt?.let { parseIso(it) },
|
startedAt = dto.startedAt?.let { parseIso(it) },
|
||||||
pausedAt = dto.pausedAt?.let { parseIso(it) },
|
pausedAt = dto.pausedAt?.let { parseIso(it) },
|
||||||
firedAt = dto.firedAt?.let { parseIso(it) },
|
firedAt = dto.firedAt?.let { parseIso(it) },
|
||||||
|
dismissedAt = null,
|
||||||
completedAt = dto.completedAt?.let { parseIso(it) },
|
completedAt = dto.completedAt?.let { parseIso(it) },
|
||||||
cascadePreset = dto.cascade?.preset,
|
snoozedUntil = null,
|
||||||
cascadeIntervalsJson = dto.cascade?.intervals?.let { json.encodeToString(it) },
|
snoozeCount = 0,
|
||||||
pomodoroWorkMinutes = dto.pomodoro?.workMinutes,
|
elapsedBeforePause = 0.0,
|
||||||
pomodoroBreakMinutes = dto.pomodoro?.breakMinutes,
|
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,
|
pomodoroLongBreakMinutes = dto.pomodoro?.longBreakMinutes,
|
||||||
pomodoroRounds = dto.pomodoro?.rounds,
|
pomodoroRounds = dto.pomodoro?.roundsBeforeLong,
|
||||||
pomodoroCurrentRound = dto.pomodoro?.currentRound,
|
pomodoroCurrentRound = dto.pomodoro?.currentRound,
|
||||||
pomodoroIsBreak = dto.pomodoro?.isBreak,
|
pomodoroIsBreak = dto.pomodoro?.isBreak,
|
||||||
pomodoroIsLongBreak = dto.pomodoro?.isLongBreak,
|
pomodoroIsLongBreak = null,
|
||||||
pomodoroCompletedRounds = dto.pomodoro?.totalRoundsCompleted,
|
pomodoroCompletedRounds = dto.pomodoro?.totalRoundsCompleted,
|
||||||
warningsJson = "",
|
|
||||||
isCalendarSync = dto.isCalendarSync,
|
isCalendarSync = dto.isCalendarSync,
|
||||||
calendarEventId = null
|
calendarEventId = null
|
||||||
)
|
)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { createFeatureFlagClient } from '@bytelyst/feature-flag-client';
|
|||||||
import { PRODUCT_ID, getBaseUrl } from './auth-api';
|
import { PRODUCT_ID, getBaseUrl } from './auth-api';
|
||||||
|
|
||||||
const client = createFeatureFlagClient({
|
const client = createFeatureFlagClient({
|
||||||
baseUrl: getBaseUrl(),
|
baseUrl: `${getBaseUrl()}/api`,
|
||||||
productId: PRODUCT_ID,
|
productId: PRODUCT_ID,
|
||||||
platform: 'web',
|
platform: 'web',
|
||||||
pollIntervalMs: 5 * 60 * 1000,
|
pollIntervalMs: 5 * 60 * 1000,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user