leafittome/lib/features/today/domain/due_task.dart
cschlaefke 81d990dd7e V3: Umtopf-Erinnerungen (opt-in, Intervall in Monaten)
Dritter Aufgabentyp repotting im Intervall-Modell: optionales
repottingIntervalMonths + lastRepotted/By am Pflanzenprofil, Formular
mit Intervall-Feld und Datums-Auswahl, Umtopf-Zeile im Detail,
Aufgaben in Checkliste und Sammel-Push (reminders.ts gespiegelt),
Sitter dürfen bestätigen (Rules-Allowlist). Monats-Arithmetik kürzt
den 31. auf den Monatsletzten. Ende-zu-Ende-Widget-Test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 23:40:21 +02:00

32 lines
930 B
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/foundation.dart';
import '../../plants/domain/plant.dart';
enum CareTaskType { watering, fertilizing, repotting }
/// Eine heute fällige (oder überfällige) Pflegeaufgabe.
///
/// Aufgaben werden nicht gespeichert, sondern aus den Pflanzen berechnet:
/// Fälligkeit = letzte Erledigung + Intervall (Intervall-Modell).
@immutable
class DueTask {
const DueTask({
required this.plant,
required this.type,
required this.dueDate,
required this.householdId,
required this.householdName,
});
final Plant plant;
final CareTaskType type;
final DateTime dueDate;
/// Aus welchem Haushalt die Aufgabe stammt die Checkliste sammelt
/// Aufgaben aus allen Haushalten des Nutzers.
final String householdId;
final String householdName;
/// 0 = heute fällig, 1 = seit gestern überfällig, usw.
int overdueDays(DateTime today) => today.difference(dueDate).inDays;
}