Initial commit: Domain model, Infrastructure, and Database setup
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class Event
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public string Location { get; set; } = string.Empty;
|
||||
public List<Group> Groups { get; set; } = new();
|
||||
public List<Product> Products { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class Group
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid EventId { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? ContactPersonName { get; set; }
|
||||
public string? ContactEmail { get; set; }
|
||||
|
||||
public Event Event { get; set; } = null!;
|
||||
public List<Person> People { get; set; } = new();
|
||||
public List<QuotaDefinition> DefaultQuotas { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class Person
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid GroupId { get; set; }
|
||||
public Guid QrCode { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Email { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
public Group Group { get; set; } = null!;
|
||||
public List<PersonQuota> Quotas { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class PersonQuota
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PersonId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public int InitialAmount { get; set; }
|
||||
public int UsedAmount { get; set; }
|
||||
|
||||
public int RemainingAmount => InitialAmount - UsedAmount;
|
||||
|
||||
public Person Person { get; set; } = null!;
|
||||
public Product Product { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Hospitality.Domain.Enums;
|
||||
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class Product
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid EventId { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public ProductType Type { get; set; }
|
||||
public Event Event { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class QuotaDefinition
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid GroupId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public int InitialAmount { get; set; }
|
||||
|
||||
public Group Group { get; set; } = null!;
|
||||
public Product Product { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace Hospitality.Domain.Entities;
|
||||
|
||||
public class Transaction
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid PersonId { get; set; }
|
||||
public Guid ProductId { get; set; }
|
||||
public int Amount { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public Guid? StaffId { get; set; }
|
||||
|
||||
public Person Person { get; set; } = null!;
|
||||
public Product Product { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Hospitality.Domain.Enums;
|
||||
|
||||
public enum ProductType
|
||||
{
|
||||
Access,
|
||||
Drink,
|
||||
Meal,
|
||||
Special
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user