41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace RanazePos.Api.Models;
|
|
|
|
public sealed class MenuItemDocument
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
[JsonPropertyName("_id")]
|
|
public string? Id { get; set; }
|
|
|
|
[BsonElement("name")]
|
|
[JsonPropertyName("name")]
|
|
public required string Name { get; set; }
|
|
|
|
[BsonElement("category")]
|
|
[JsonPropertyName("category")]
|
|
public required string Category { get; set; }
|
|
|
|
[BsonElement("description")]
|
|
[JsonPropertyName("description")]
|
|
public string Description { get; set; } = "";
|
|
|
|
[BsonElement("basePrice")]
|
|
[BsonRepresentation(BsonType.Decimal128)]
|
|
[JsonPropertyName("basePrice")]
|
|
public decimal BasePrice { get; set; }
|
|
|
|
[BsonElement("createdAt")]
|
|
[BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
|
|
[JsonPropertyName("createdAt")]
|
|
public DateTime CreatedAt { get; set; }
|
|
|
|
[BsonElement("updatedAt")]
|
|
[BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
|
|
[JsonPropertyName("updatedAt")]
|
|
public DateTime UpdatedAt { get; set; }
|
|
}
|