Anul 3 Semestrul 2

This commit is contained in:
2025-07-03 20:56:38 +03:00
parent 184f3bd92e
commit 3b7fb85767
269 changed files with 20955 additions and 0 deletions
@@ -0,0 +1,46 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace OrderService.Models;
public enum OrderStatus
{
Pending,
Processing,
PaymentReceived
}
[Table("Orders")]
public class Order
{
[Key]
[Column("hmy")]
public int Id { get; set; }
[Column("hCustomer")]
public required string CustomerId { get; set; }
[Column("sStatus")]
public OrderStatus Status { get; set; } = OrderStatus.Pending;
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
}
[Table("OrderItems")]
public class OrderItem
{
[Key]
[Column("hmy")]
public int Id { get; set; }
[ForeignKey("Orders")]
[Column("hOrder")]
public int OrderId { get; set; }
[Column("hProduct")]
public int ProductId { get; set; }
[Column("iQuantity")]
public int Quantity { get; set; } = 1;
[Column("dPrice")]
public decimal Price { get; set; }
[Column("sProductName")]
public required string ProductName { get; set; }
}