[PM-10560] Create notification database storage (#4688)

* Add new tables

* Add stored procedures

* Add core entities and models

* Setup EF

* Add repository interfaces

* Add dapper repos

* Add EF repos

* Add order by

* EF updates

* PM-10560: Notifications repository matching requirements.

* PM-10560: Notifications repository matching requirements.

* PM-10560: Migration scripts

* PM-10560: EF index optimizations

* PM-10560: Cleanup

* PM-10560: Priority in natural order, Repository, sql simplifications

* PM-10560: Title column update

* PM-10560: Incorrect EF migration removal

* PM-10560: EF migrations

* PM-10560: Added views, SP naming simplification

* PM-10560: Notification entity Title update, EF migrations

* PM-10560: Removing Notification_ReadByUserId

* PM-10560: Notification ReadByUserIdAndStatus fix

* PM-10560: Notification ReadByUserIdAndStatus fix to be in line with requirements and EF

---------

Co-authored-by: Maciej Zieniuk <mzieniuk@bitwarden.com>
Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
Thomas Avery
2024-09-09 14:52:12 -05:00
committed by GitHub
parent 55bf815050
commit 4c0f8d54f3
39 changed files with 9983 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
using AutoMapper;
using Bit.Infrastructure.EntityFramework.AdminConsole.Models;
using Bit.Infrastructure.EntityFramework.Models;
namespace Bit.Infrastructure.EntityFramework.NotificationCenter.Models;
public class Notification : Core.NotificationCenter.Entities.Notification
{
public virtual User User { get; set; }
public virtual Organization Organization { get; set; }
}
public class NotificationMapperProfile : Profile
{
public NotificationMapperProfile()
{
CreateMap<Core.NotificationCenter.Entities.Notification, Notification>()
.PreserveReferences()
.ReverseMap();
}
}

View File

@@ -0,0 +1,20 @@
using AutoMapper;
using Bit.Infrastructure.EntityFramework.Models;
namespace Bit.Infrastructure.EntityFramework.NotificationCenter.Models;
public class NotificationStatus : Core.NotificationCenter.Entities.NotificationStatus
{
public virtual Notification Notification { get; set; }
public virtual User User { get; set; }
}
public class NotificationStatusMapperProfile : Profile
{
public NotificationStatusMapperProfile()
{
CreateMap<Core.NotificationCenter.Entities.NotificationStatus, NotificationStatus>()
.PreserveReferences()
.ReverseMap();
}
}