Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
feat(back-end): Implement notification logic
Browse files Browse the repository at this point in the history
Add models, repository, controller, hub and migration to implement the logic of notifications
  • Loading branch information
CarlosPavajeau committed Jan 31, 2021
1 parent d02d851 commit 58b6651
Show file tree
Hide file tree
Showing 14 changed files with 4,029 additions and 169 deletions.
2 changes: 2 additions & 0 deletions Domain/Data/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ protected override void OnModelCreating(ModelBuilder builder)
public DbSet<DayStatistics> DayStatistics { get; set; }
public DbSet<MonthStatistics> MonthStatistics { get; set; }
public DbSet<YearStatistics> YearStatistics { get; set; }

public DbSet<Notification> Notifications { get; set; }
}
}
28 changes: 28 additions & 0 deletions Domain/Entities/Notification.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Kaizen.Domain.Entities
{
public enum NotificationState
{
Pending,
View
}

public class Notification
{
[Key]
public int Id { get; set; }

public string Title { get; set; }
public string Message { get; set; }
public string Icon { get; set; }

public NotificationState State { get; set; } = NotificationState.Pending;

[ForeignKey("UserId")]
public ApplicationUser User { get; set; }

public string UserId { get; set; }
}
}
Loading

0 comments on commit 58b6651

Please sign in to comment.