From 0841ca1aa8543c46c0b31b10f929b46aa0460d71 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Thu, 10 Apr 2025 12:20:03 +0500 Subject: [PATCH] common: add gift card model --- Streetwriters.Common/Models/GiftCard.cs | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Streetwriters.Common/Models/GiftCard.cs diff --git a/Streetwriters.Common/Models/GiftCard.cs b/Streetwriters.Common/Models/GiftCard.cs new file mode 100644 index 0000000..108e35e --- /dev/null +++ b/Streetwriters.Common/Models/GiftCard.cs @@ -0,0 +1,29 @@ +using System.Text.Json.Serialization; +using MongoDB.Bson; +using MongoDB.Bson.Serialization.Attributes; +using Streetwriters.Common.Interfaces; + +namespace Streetwriters.Common.Models +{ + public class GiftCard : IDocument + { + public GiftCard() + { + Id = ObjectId.GenerateNewId().ToString(); + } + + public string Code { get; set; } + public string OrderId { get; set; } + public string OrderIdType { get; set; } + public string ProductId { get; set; } + public string RedeemedBy { get; set; } + public long RedeemedAt { get; set; } + public long Timestamp { get; set; } + public long Term { get; set; } + + [BsonId] + [BsonRepresentation(BsonType.ObjectId)] + [JsonIgnore] + public string Id { get; set; } + } +}