This commit is contained in:
2022-12-10 12:06:16 -07:00
commit a3938d1916
116 changed files with 17236 additions and 0 deletions

View File

@ -0,0 +1,7 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record AdditionalData(
[property: JsonPropertyName("ServiceId")] string ServiceId
);

View File

@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record AllowedActions(
[property: JsonPropertyName("Incident")] bool Incident,
[property: JsonPropertyName("Accept")] bool Accept,
[property: JsonPropertyName("Reorder")] bool Reorder
);

18
Shared/Models/Booking.cs Normal file
View File

@ -0,0 +1,18 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Booking(
[property: JsonPropertyName("Catalog")] Catalog Catalog,
[property: JsonPropertyName("Name")] string Name,
[property: JsonPropertyName("Description")] string Description,
[property: JsonPropertyName("PaymentMethod")] int PaymentMethod,
[property: JsonPropertyName("Service")] Service Service,
[property: JsonPropertyName("Order")] Order Order,
[property: JsonPropertyName("ApprovalStatus")] int ApprovalStatus,
[property: JsonPropertyName("AllowedActions")] AllowedActions AllowedActions,
[property: JsonPropertyName("ObjectId")] string ObjectId,
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("Quantity")] int Quantity,
[property: JsonPropertyName("AdditionalData")] AdditionalData AdditionalData
);

9
Shared/Models/Catalog.cs Normal file
View File

@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Catalog(
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("Name")] string Name,
[property: JsonPropertyName("CurrencyCode")] string CurrencyCode
);

View File

@ -0,0 +1,11 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface IServiceShopOrderController
{
enum Action : int
{
All = 0
}
}

View File

@ -0,0 +1,11 @@
namespace Expose.MyIT.Shared.Models.Stateless;
public interface ISsaOrderController
{
enum Action : int
{
All = 0
}
}

View File

@ -0,0 +1,9 @@
namespace Expose.MyIT.Shared.Models.Methods;
public interface IServiceShopOrderRepository
{
Task<ViewModels.ServiceShopOrder[]> GetAllServiceShopOrders();
Task<ViewModels.ServiceShopOrder[]> GetServiceShopOrders(string id);
}

View File

@ -0,0 +1,9 @@
namespace Expose.MyIT.Shared.Models.Methods;
public interface ISsaOrderRepository
{
Task<ViewModels.SsaOrder[]> GetAllSsaOrders();
Task<ViewModels.SsaOrder[]> GetSsaOrders(string id);
}

26
Shared/Models/Order.cs Normal file
View File

@ -0,0 +1,26 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Order(
[property: JsonPropertyName("Bookings")] IReadOnlyList<Booking> Bookings,
[property: JsonPropertyName("AllowedActions")] AllowedActions AllowedActions,
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("ObjectId")] string ObjectId,
[property: JsonPropertyName("Name")] string Name,
[property: JsonPropertyName("Type")] string Type,
[property: JsonPropertyName("TypeId")] int TypeId,
[property: JsonPropertyName("State")] string State,
[property: JsonPropertyName("StateId")] int StateId,
[property: JsonPropertyName("StateIcon")] string StateIcon,
[property: JsonPropertyName("StateColor")] string StateColor,
[property: JsonPropertyName("ItemNumber")] string ItemNumber,
[property: JsonPropertyName("CreatedDate")] DateTime CreatedDate,
[property: JsonPropertyName("DecidedDate")] DateTime DecidedDate,
[property: JsonPropertyName("CostCenterId")] string CostCenterId,
[property: JsonPropertyName("CostCenterName")] string CostCenterName,
[property: JsonPropertyName("Recipient")] string Recipient,
[property: JsonPropertyName("RecipientId")] string RecipientId,
[property: JsonPropertyName("Requestor")] string Requestor,
[property: JsonPropertyName("RequestorId")] string RequestorId
);

9
Shared/Models/Order2.cs Normal file
View File

@ -0,0 +1,9 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Order2(
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("Name")] string Name,
[property: JsonPropertyName("TypeId")] int TypeId
);

7
Shared/Models/Price.cs Normal file
View File

@ -0,0 +1,7 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Price(
[property: JsonPropertyName("CC")] string CC
);

8
Shared/Models/SSA.cs Normal file
View File

@ -0,0 +1,8 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record SSA(
[property: JsonPropertyName("Orders")] IReadOnlyList<Order> Orders,
[property: JsonPropertyName("Total")] int Total
);

20
Shared/Models/Service.cs Normal file
View File

@ -0,0 +1,20 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record Service(
[property: JsonPropertyName("Id")] string Id,
[property: JsonPropertyName("Quantity")] int Quantity,
[property: JsonPropertyName("PaymentMethod")] int PaymentMethod,
[property: JsonPropertyName("Price")] Price Price,
[property: JsonPropertyName("ObjectId")] string ObjectId,
[property: JsonPropertyName("ConfigurationItemType")] int ConfigurationItemType,
[property: JsonPropertyName("ConfigurationItemTypeName")] string ConfigurationItemTypeName,
[property: JsonPropertyName("ServiceType")] int ServiceType,
[property: JsonPropertyName("CustomFormEntityId")] string CustomFormEntityId,
[property: JsonPropertyName("CustomFormEntityName")] string CustomFormEntityName,
[property: JsonPropertyName("CreateMultipleBookings")] bool CreateMultipleBookings,
[property: JsonPropertyName("AllowIdenticalInstances")] bool AllowIdenticalInstances,
[property: JsonPropertyName("Catalog")] Catalog Catalog,
[property: JsonPropertyName("UninstallationMode")] int? UninstallationMode
);

View File

@ -0,0 +1,8 @@
using System.Text.Json.Serialization;
namespace Expose.MyIT.Shared.Models;
public record ServiceShop(
[property: JsonPropertyName("Orders")] IReadOnlyList<Order> Orders,
[property: JsonPropertyName("Total")] int Total
);

View File

@ -0,0 +1,9 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IAppSettingsController
{
static string GetRouteName() => nameof(IAppSettingsController)[1..^10];
string[] GetAppSettings();
}

View File

@ -0,0 +1,10 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IClientSettingsController
{
static string GetRouteName() => nameof(IClientSettingsController)[1..^10];
string[] GetClientSettings();
string GetIpAddress();
}

View File

@ -0,0 +1,10 @@
using System.Runtime.CompilerServices;
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IMethodName
{
static string? GetActualAsyncMethodName([CallerMemberName] string? name = null) => name;
}

View File

@ -0,0 +1,11 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IServiceShopOrder
{
ViewModels.ServiceShopOrder[] TestStatic_GetServiceShopOrders(ServiceShop? serviceShop) =>
GetServiceShopOrders(serviceShop);
static ViewModels.ServiceShopOrder[] GetServiceShopOrders(ServiceShop? serviceShop) =>
ServiceShopOrder.GetServiceShopOrders(serviceShop);
}

View File

@ -0,0 +1,10 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IServiceShopOrderController
{
static string GetRouteName() => nameof(IServiceShopOrderController)[1..^10];
Task<ViewModels.ServiceShopOrder[]> GetAllServiceShopOrders();
Task<ViewModels.ServiceShopOrder[]> GetServiceShopOrders(string id);
}

View File

@ -0,0 +1,11 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface ISsaOrder
{
ViewModels.SsaOrder[] TestStatic_GetSsaOrders(SSA? ssa) =>
GetSsaOrders(ssa);
static ViewModels.SsaOrder[] GetSsaOrders(SSA? ssa) =>
SsaOrder.GetSsaOrders(ssa);
}

View File

@ -0,0 +1,10 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface ISsaOrderController
{
static string GetRouteName() => nameof(ISsaOrderController)[1..^10];
Task<ViewModels.SsaOrder[]> GetAllSsaOrders();
Task<ViewModels.SsaOrder[]> GetSsaOrders(string id);
}

View File

@ -0,0 +1,9 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
public interface IWeatherForecastController
{
static string GetRouteName() => nameof(IWeatherForecastController)[1..^10];
Task<ViewModels.WeatherForecast[]> Get();
}

View File

@ -0,0 +1,16 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
internal class ServiceShopOrder
{
internal static ViewModels.ServiceShopOrder[] GetServiceShopOrders(ServiceShop? serviceShop)
{
ViewModels.ServiceShopOrder[] results;
if (serviceShop is null || !serviceShop.Orders.Any())
results = Array.Empty<ViewModels.ServiceShopOrder>();
else
results = serviceShop.Orders.Select(l => new ViewModels.ServiceShopOrder(l)).ToArray();
return results;
}
}

View File

@ -0,0 +1,16 @@
namespace Expose.MyIT.Shared.Models.Stateless.Methods;
internal class SsaOrder
{
internal static ViewModels.SsaOrder[] GetSsaOrders(SSA? ssa)
{
ViewModels.SsaOrder[] results;
if (ssa is null || !ssa.Orders.Any())
results = Array.Empty<ViewModels.SsaOrder>();
else
results = ssa.Orders.Select(l => new ViewModels.SsaOrder(l)).ToArray();
return results;
}
}

View File

@ -0,0 +1,12 @@
namespace Expose.MyIT.Shared.Models;
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}