feat(programmer): day rows builder + work-log workDate

- Add workDate field to ProgrammerTaskWorkLog (defaults to Manila day of createdAt)
- Add deltaJsonToPlainText function to quill_field.dart for Delta/plain text conversion
- Implement buildDayRows function to generate day sheet rows with proper sorting
- Implement DaySheetRow serialization and deserialization
- Add comprehensive tests for day rows builder and workDate field
- Verify backward compatibility via existing programmer_task_ledger_test
Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-09-27 21:04:23 +08:00
parent f071cc722d
commit f9b8831c71
4 changed files with 591 additions and 2 deletions
+10 -2
View File
@@ -1,4 +1,5 @@
import '../utils/app_time.dart';
import '../utils/programmer_daily_time.dart';
/// A work-log entry on a programmer task (plain, online-first model).
///
@@ -13,6 +14,7 @@ class ProgrammerTaskWorkLog {
final String description;
final int? minutes;
final DateTime createdAt;
final DateTime workDate;
ProgrammerTaskWorkLog({
required this.id,
@@ -21,16 +23,22 @@ class ProgrammerTaskWorkLog {
required this.description,
this.minutes,
required this.createdAt,
});
DateTime? workDate,
}) : workDate = workDate ?? manilaDay(createdAt);
factory ProgrammerTaskWorkLog.fromMap(Map<String, dynamic> map) {
final createdAt = AppTime.parse(map['created_at'] as String);
final workDate = map['work_date'] != null
? parseDayKey(map['work_date'] as String)
: manilaDay(createdAt);
return ProgrammerTaskWorkLog(
id: map['id'].toString(),
taskId: map['task_id'].toString(),
authorId: map['author_id'].toString(),
description: map['description'] as String? ?? '',
minutes: (map['minutes'] as num?)?.toInt(),
createdAt: AppTime.parse(map['created_at'] as String),
createdAt: createdAt,
workDate: workDate,
);
}
}