1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-27 15:52:13 -05:00
SmithThe4th bde11dae31
[PM-14590] Modify Notification database table (#5361)
* Added notification type enum

Added option type to entity

* created migration files

* made sprocs backward compatible

* made sprocs backward compatible

* Fixed linting

* Altered table to require an optional taskId

* formatted code

* Added foreignkey

* Formatted code

* fixed order
2025-02-10 11:39:48 -05:00

30 lines
835 B
C#

#nullable enable
using System.ComponentModel.DataAnnotations;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.NotificationCenter.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.NotificationCenter.Entities;
public class Notification : ITableObject<Guid>
{
public Guid Id { get; set; }
public Priority Priority { get; set; }
public bool Global { get; set; }
public ClientType ClientType { get; set; }
public Guid? UserId { get; set; }
public Guid? OrganizationId { get; set; }
[MaxLength(256)]
public string? Title { get; set; }
public string? Body { get; set; }
public DateTime CreationDate { get; set; }
public DateTime RevisionDate { get; set; }
public Guid? TaskId { get; set; }
public void SetNewId()
{
Id = CoreHelpers.GenerateComb();
}
}