feat(notificaion): add notificaion for last day

This commit is contained in:
mso7nueh
2025-07-14 17:08:53 +03:00
parent 452c603b95
commit 09c53a6492
5 changed files with 34 additions and 7 deletions

View File

@@ -106,8 +106,7 @@ class DiaryReminderNotification implements BaseNotificationModel {
final NotificationType type;
@override
final bool isRead;
DiaryReminderNotification({required this.type, required this.isRead});
factory DiaryReminderNotification.fromJson(Map<String, dynamic> json, NotificationType type, {bool? isRead}) {
@@ -297,6 +296,25 @@ class ChosenPlanFinishedToConsultantNotification implements BaseNotificationMode
}
}
class ChosenPlanLastDayFinishedForUser implements BaseNotificationModel {
@override
final NotificationType type;
@override
final bool isRead;
ChosenPlanLastDayFinishedForUser({
required this.type,
required this.isRead,
});
factory ChosenPlanLastDayFinishedForUser.fromJson(Map<String, dynamic> json, NotificationType type, {bool? isRead}) {
return ChosenPlanLastDayFinishedForUser(
type: type,
isRead: isRead ?? false,
);
}
}
class UnknownNotification implements BaseNotificationModel {
@override
final NotificationType type;
@@ -323,6 +341,7 @@ enum NotificationType {
chosenPlanTomorrowReminderToConsultantNotification,
planSubscriptionPaidToAuthor,
chosenPlanFinishedToConsultant,
chosenPlanLastDayFinishedForUser,
unknown;
static NotificationType getTypeFromString(String type) => switch (type) {
@@ -339,6 +358,7 @@ enum NotificationType {
'App\\Notifications\\Plan\\ChosenPlanTomorrowReminderToConsultantNotification' => NotificationType.chosenPlanTomorrowReminderToConsultantNotification,
'App\\Notifications\\Plan\\PlanSubscriptionPaidToAuthor' => NotificationType.planSubscriptionPaidToAuthor,
'App\\Notifications\\Plan\\ChosenPlanFinishedToConsultant' => NotificationType.chosenPlanFinishedToConsultant,
'App\\Notifications\\ChosenPlan\\LastDayFinishedForUser' => NotificationType.chosenPlanLastDayFinishedForUser,
_ => NotificationType.unknown,
};
}