feature: Reconciliation Jobs
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
public enum Department
|
||||
{
|
||||
Icu,
|
||||
GeneralMedicine,
|
||||
Emergency,
|
||||
Cardiology,
|
||||
Surgery,
|
||||
Pediatrics
|
||||
}
|
||||
|
||||
public static class DepartmentExtensions
|
||||
{
|
||||
public static string ToDbString(this Department d) => d switch
|
||||
{
|
||||
Department.Icu => "ICU",
|
||||
Department.GeneralMedicine => "GENERAL_MEDICINE",
|
||||
Department.Emergency => "EMERGENCY",
|
||||
Department.Cardiology => "CARDIOLOGY",
|
||||
Department.Surgery => "SURGERY",
|
||||
Department.Pediatrics => "PEDIATRICS",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(d))
|
||||
};
|
||||
|
||||
public static Department FromDbString(string v) => v switch
|
||||
{
|
||||
"ICU" => Department.Icu,
|
||||
"GENERAL_MEDICINE" => Department.GeneralMedicine,
|
||||
"EMERGENCY" => Department.Emergency,
|
||||
"CARDIOLOGY" => Department.Cardiology,
|
||||
"SURGERY" => Department.Surgery,
|
||||
"PEDIATRICS" => Department.Pediatrics,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown department: '{v}'")
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
public enum OrderStatus { Pending, InProgress, Resulted, Cancelled }
|
||||
|
||||
public static class OrderStatusExtensions
|
||||
{
|
||||
public static string ToDbString(this OrderStatus s) => s switch
|
||||
{
|
||||
OrderStatus.Pending => "PENDING",
|
||||
OrderStatus.InProgress => "IN_PROGRESS",
|
||||
OrderStatus.Resulted => "RESULTED",
|
||||
OrderStatus.Cancelled => "CANCELLED",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(s))
|
||||
};
|
||||
|
||||
public static OrderStatus FromDbString(string v) => v switch
|
||||
{
|
||||
"PENDING" => OrderStatus.Pending,
|
||||
"IN_PROGRESS" => OrderStatus.InProgress,
|
||||
"RESULTED" => OrderStatus.Resulted,
|
||||
"CANCELLED" => OrderStatus.Cancelled,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown order status: '{v}'")
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user