Converting server to dotnet

This commit is contained in:
Zeeshaun
2026-05-05 16:22:37 +00:00
parent 74d2170880
commit 095eb4b50d
21 changed files with 636 additions and 296 deletions
+56
View File
@@ -0,0 +1,56 @@
using RanazePos.Api.Models;
namespace RanazePos.Api.Configuration;
public static class Defaults
{
public static readonly PosSettings Settings = new()
{
SizeOptions =
[
new() { Name = "Regular", Delta = 0m },
new() { Name = "Large", Delta = 1m }
],
SweetnessOptions = ["0%", "25%", "50%", "75%", "100%"],
IceOptions = ["No Ice", "Less Ice", "Regular Ice"],
Toppings =
[
new() { Name = "Boba", Price = 0.75m },
new() { Name = "Pudding", Price = 0.85m },
new() { Name = "Cheese Foam", Price = 1.25m },
new() { Name = "Lychee Jelly", Price = 0.75m }
]
};
public static readonly IReadOnlyList<MenuItemDocument> Menu =
[
new()
{
Name = "Classic Milk Tea",
Category = "Milk Tea",
Description = "Black tea, milk, and brown sugar tapioca.",
BasePrice = 5.5m
},
new()
{
Name = "Taro Milk Tea",
Category = "Milk Tea",
Description = "Creamy taro with optional boba or pudding.",
BasePrice = 6m
},
new()
{
Name = "Mango Green Tea",
Category = "Fruit Tea",
Description = "Bright green tea with mango puree.",
BasePrice = 5.75m
},
new()
{
Name = "Strawberry Yakult",
Category = "Specialty",
Description = "Strawberry fruit tea with probiotic yogurt.",
BasePrice = 6.25m
}
];
}
+10
View File
@@ -0,0 +1,10 @@
namespace RanazePos.Api.Configuration;
public sealed class MongoDbOptions
{
public const string SectionName = "MongoDb";
public string ConnectionString { get; set; } = "mongodb://127.0.0.1:27017";
public string DatabaseName { get; set; } = "ranaze-pos";
}
+36
View File
@@ -0,0 +1,36 @@
using System.Text.Json.Serialization;
namespace RanazePos.Api.Configuration;
public sealed class PosSettings
{
[JsonPropertyName("sizeOptions")]
public required IReadOnlyList<SizeOption> SizeOptions { get; init; }
[JsonPropertyName("sweetnessOptions")]
public required IReadOnlyList<string> SweetnessOptions { get; init; }
[JsonPropertyName("iceOptions")]
public required IReadOnlyList<string> IceOptions { get; init; }
[JsonPropertyName("toppings")]
public required IReadOnlyList<ToppingOption> Toppings { get; init; }
}
public sealed class SizeOption
{
[JsonPropertyName("name")]
public required string Name { get; init; }
[JsonPropertyName("delta")]
public decimal Delta { get; init; }
}
public sealed class ToppingOption
{
[JsonPropertyName("name")]
public required string Name { get; init; }
[JsonPropertyName("price")]
public decimal Price { get; init; }
}