feat(data): édition ponctuelle des séries en séance (ticket #21)
Étend le modèle Drift (tables.dart, app_database.dart/.g.dart) et la couche application (entités, use cases, repositories) pour supporter l'édition ponctuelle des séries pendant l'exécution d'une séance, sans modifier le modèle/séance-modèle. build_runner OK, flutter analyze propre, 30/30 tests verts, build APK debug validé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -244,6 +244,7 @@ class ActiveSetResults extends SyncableTable {
|
||||
TextColumn get scoreLabelSnapshot => text().nullable()();
|
||||
TextColumn get scoreUnitSnapshot => text().nullable()();
|
||||
TextColumn get note => text().nullable()();
|
||||
TextColumn get status => text().withDefault(const Constant('completed'))();
|
||||
|
||||
@override
|
||||
List<String> get customConstraints => [
|
||||
@ -255,6 +256,9 @@ class ActiveSetResults extends SyncableTable {
|
||||
'CHECK (actual_time_ms IS NULL OR actual_time_ms >= 0)',
|
||||
'CHECK (actual_reps IS NULL OR actual_reps >= 0)',
|
||||
'CHECK (actual_score IS NULL OR actual_score >= 0)',
|
||||
"CHECK (status IN ('completed', 'skipped'))",
|
||||
'CHECK (status != \'skipped\' OR (actual_time_ms IS NULL '
|
||||
'AND actual_reps IS NULL AND actual_score IS NULL))',
|
||||
'CHECK (actual_score IS NULL OR (score_label_snapshot IS NOT NULL '
|
||||
'AND length(trim(score_label_snapshot)) > 0 '
|
||||
'AND score_unit_snapshot IS NOT NULL '
|
||||
@ -332,6 +336,7 @@ class WorkoutHistorySetResults extends SyncableTable {
|
||||
TextColumn get scoreUnitSnapshot => text().nullable()();
|
||||
DateTimeColumn get startedAt => dateTime().nullable()();
|
||||
DateTimeColumn get completedAt => dateTime().nullable()();
|
||||
TextColumn get status => text().withDefault(const Constant('completed'))();
|
||||
|
||||
@override
|
||||
List<String> get customConstraints => [
|
||||
@ -349,6 +354,9 @@ class WorkoutHistorySetResults extends SyncableTable {
|
||||
'CHECK (actual_time_ms IS NULL OR actual_time_ms >= 0)',
|
||||
'CHECK (actual_reps IS NULL OR actual_reps >= 0)',
|
||||
'CHECK (actual_score IS NULL OR actual_score >= 0)',
|
||||
"CHECK (status IN ('completed', 'skipped'))",
|
||||
'CHECK (status != \'skipped\' OR (actual_time_ms IS NULL '
|
||||
'AND actual_reps IS NULL AND actual_score IS NULL))',
|
||||
'CHECK (actual_score IS NULL OR (score_label_snapshot IS NOT NULL '
|
||||
'AND length(trim(score_label_snapshot)) > 0 '
|
||||
'AND score_unit_snapshot IS NOT NULL '
|
||||
|
||||
Reference in New Issue
Block a user