2023-03-26 21:48:25 +01:00
|
|
|
using System;
|
2016-05-17 18:22:18 +02:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
2025-06-13 15:22:02 +01:00
|
|
|
namespace Yavsc.Abstract.Models.Messaging
|
2016-05-17 18:22:18 +02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A Notification, that mocks the one sent to Google,
|
|
|
|
|
/// since it fits my needs
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class Notification
|
|
|
|
|
{
|
|
|
|
|
[Key, DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
|
|
|
|
|
public long Id { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The title.
|
|
|
|
|
/// </summary>
|
2017-02-20 15:53:25 +01:00
|
|
|
[Required, Display(Name = "Titre")]
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(1024)]
|
2016-05-17 18:22:18 +02:00
|
|
|
public string title { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The body.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2017-02-20 15:53:25 +01:00
|
|
|
[Required, Display(Name = "Corps")]
|
2016-05-17 18:22:18 +02:00
|
|
|
public string body { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The icon.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2017-02-20 15:53:25 +01:00
|
|
|
[Display(Name = "Icône")]
|
2025-06-13 15:22:02 +01:00
|
|
|
public string? icon { get; set; }
|
2016-05-17 18:22:18 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The sound.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2017-02-20 15:53:25 +01:00
|
|
|
[Display(Name = "Son")]
|
2025-06-13 15:22:02 +01:00
|
|
|
public string? sound { get; set; }
|
2016-05-17 18:22:18 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The tag.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2016-05-17 18:22:18 +02:00
|
|
|
[Display(Name = "Tag")]
|
2025-06-13 15:22:02 +01:00
|
|
|
public string? tag { get; set; }
|
2016-05-17 18:22:18 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The color.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2017-02-20 15:53:25 +01:00
|
|
|
[Display(Name = "Couleur")]
|
2025-06-13 15:22:02 +01:00
|
|
|
public string? color { get; set; }
|
2016-05-17 18:22:18 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// The click action.
|
|
|
|
|
/// </summary>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2017-02-20 15:53:25 +01:00
|
|
|
[Required, Display(Name = "Label du click")]
|
2016-05-17 18:22:18 +02:00
|
|
|
public string click_action { get; set; }
|
2017-05-17 10:41:29 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// When null, this must be seen by everynone.
|
|
|
|
|
/// <c>user/{UserId}<c> : it's for this user, and only this one, specified by ID,
|
|
|
|
|
/// <c>pub/cga</c> : the public "cga" topic
|
|
|
|
|
/// <c>administration</c> : for admins ...
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2023-03-26 21:48:25 +01:00
|
|
|
[StringLength(512)]
|
2025-06-13 15:22:02 +01:00
|
|
|
public string? Target { get; set; }
|
2017-09-24 23:42:41 +02:00
|
|
|
|
|
|
|
|
public Notification()
|
|
|
|
|
{
|
|
|
|
|
icon = "exclam";
|
|
|
|
|
}
|
2016-05-17 18:22:18 +02:00
|
|
|
}
|
2017-05-17 10:41:29 +02:00
|
|
|
}
|