b307f66f2c
Projects: Brick-backed model with list/detail screens and nav entry. Work Logs: per-contributor time ledger, assignee running-clock + helper logged minutes with Hours/Minutes input; pause-after-save and helper-deduct prompts. Comments: threaded comments with file attachments and Quill composer. Detail screen: tabbed layout (Work Log / Comments / Activity), editable title + description via edit dialog, Quill-rendered descriptions with legacy plain-text fallback. Create dialog: fixed-width (480px max), Quill description editor. Shared QuillFieldEditor + QuillReadOnly widgets extracted for reuse. RLS: hardened activity-log actor binding, immutable creator_id/ created_at triggers, SECURITY INVOKER visibility helper, append-only work-log and scoped comment policies. Brick migration for project_id FK on programmer_tasks. Co-Authored-By: claude-flow <ruv@ruv.net>
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import '../utils/app_time.dart';
|
|
|
|
/// A work-log entry on a programmer task (plain, online-first model).
|
|
///
|
|
/// The assignee logs progress notes with [minutes] == null (their time comes
|
|
/// from the running clock). A non-assignee "helper" logs with [minutes] set —
|
|
/// their contributed time, which feeds the per-contributor time ledger and can
|
|
/// be deducted from the helper's own running task.
|
|
class ProgrammerTaskWorkLog {
|
|
final String id;
|
|
final String taskId;
|
|
final String authorId;
|
|
final String description;
|
|
final int? minutes;
|
|
final DateTime createdAt;
|
|
|
|
ProgrammerTaskWorkLog({
|
|
required this.id,
|
|
required this.taskId,
|
|
required this.authorId,
|
|
required this.description,
|
|
this.minutes,
|
|
required this.createdAt,
|
|
});
|
|
|
|
factory ProgrammerTaskWorkLog.fromMap(Map<String, dynamic> map) {
|
|
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),
|
|
);
|
|
}
|
|
}
|