Files
barkman/barkmanAPI/barkDbModel.cs
T
2026-07-15 20:51:03 -05:00

75 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore;
namespace barkmanapi;
public class BarkContext(DbContextOptions<BarkContext> options) : DbContext(options)
{
public DbSet<InventoryItems> Inventory { get; set; }
public DbSet<ItemStatus> ItemStatus { get; set; }
public DbSet<Customers> Customers { get; set; }
}
[Index(nameof(Barcode), IsUnique = true)]
public class InventoryItems
{
public int Id {get; set;}
public string Barcode {get; set;}
public string Name { get; set; }
public string Brand { get; set; }
public string? SerialNumber { get; set; }
public ItemStatus Status { get; set; }
public string? StatusId { get; set; }
public float? Weight { get; set; }
public float? RentalPrice { get; set; }
public float? ReplacementCost { get; set; }
public string? Notes { get; set; }
}
public class ItemStatus
{
public string Id { get; set; }
public string Name { get; set; }
}
public class Customers
{
public int Id { get; set; }
public required string Name { get; set; }
public string? Company { get; set; }
public required string Email { get; set; }
public string? PhoneNumber { get; set; }
public string? Address { get; set; }
public string? BillingTerms { get; set; }
public string? Notes { get; set; }
}
public class Orders
{
public int Id { get; set; }
public required string CustomerId { get; set; }
public required string Name { get; set; }
public OrderStatus Status { get; set; }
public string? StatusId { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public float TotalPrice { get; set; }
public string? Venue { get; set; }
public string? Address { get; set; }
public OrderItems[] Items { get; set; }
public string? Notes { get; set; }
}
public class OrderItems
{
public int Id { get; set; }
public required string OrderId { get; set; }
public required string ItemId { get; set; }
public int Quantity { get; set; }
}
public class OrderStatus
{
public string Id { get; set; }
public string Name { get; set; }
}