Files

73 lines
3.9 KiB
C#
Raw Permalink Normal View History

2024-01-19 17:25:56 +01:00
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SecureBank.Website.API
{
public class APIEndpointsConfiguration
{
#region PROPERTIES
public string Base { get; private set; }
// Accounts
public string AccountsBase { get; private set; }
public string AccountsCreateAccount { get; private set; }
2024-01-23 15:41:59 +01:00
public string AccountsChangePassword { get; private set; }
2024-01-19 17:25:56 +01:00
public string AccountsGetPasswordVariant { get; private set; }
public string AccountsAuthentication { get; private set; }
public string AccountsAuthenticationRefresh { get; private set; }
2024-01-23 15:41:59 +01:00
public string AccountsGetAccounts { get; private set; }
public string AccountsResetPassword { get; private set; }
public string AccountsUnlockAccount { get; private set; }
// Balance
public string BalanceBase { get; private set; }
public string BalanceGetAccountBalance { get; private set; }
public string BalanceGetBalance { get; private set; }
// Transfers
public string TransfersBase { get; private set; }
public string TransfersGetUserTransfers { get; private set; }
public string TransfersGetTransfers { get; private set; }
public string TransfersCreateAdminTransfer { get; private set; }
public string TransfersCreateUserTransfer { get; private set; }
2024-01-19 17:25:56 +01:00
#endregion
#region CONSTRUCTORS
public APIEndpointsConfiguration(IConfiguration configuration)
{
Base = configuration.GetSection("Endpoints")["Base"];
AccountsBase = $"{Base}{configuration.GetSection("Endpoints").GetSection("Accounts")["Base"]}";
AccountsCreateAccount = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["CreateAccount"]}";
2024-01-23 15:41:59 +01:00
AccountsChangePassword = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["ChangePassword"]}";
2024-01-19 17:25:56 +01:00
AccountsGetPasswordVariant = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["GetPasswordVariant"]}";
AccountsAuthentication = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["Authentication"]}";
AccountsAuthenticationRefresh = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["AuthenticationRefresh"]}";
2024-01-23 15:41:59 +01:00
AccountsGetAccounts = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["GetAccounts"]}";
AccountsResetPassword = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["ResetPassword"]}";
AccountsUnlockAccount = $"{AccountsBase}{configuration.GetSection("Endpoints").GetSection("Accounts")["UnlockAccount"]}";
BalanceBase = $"{Base}{configuration.GetSection("Endpoints").GetSection("Balance")["Base"]}";
BalanceGetAccountBalance = $"{BalanceBase}{configuration.GetSection("Endpoints").GetSection("Balance")["GetAccountBalance"]}";
BalanceGetBalance = $"{BalanceBase}{configuration.GetSection("Endpoints").GetSection("Balance")["GetBalance"]}";
TransfersBase = $"{Base}{configuration.GetSection("Endpoints").GetSection("Transfers")["Base"]}";
TransfersGetTransfers = $"{TransfersBase}{configuration.GetSection("Endpoints").GetSection("Transfers")["GetTransfers"]}";
TransfersGetUserTransfers = $"{TransfersBase}{configuration.GetSection("Endpoints").GetSection("Transfers")["GetUserTransfers"]}";
TransfersCreateAdminTransfer = $"{TransfersBase}{configuration.GetSection("Endpoints").GetSection("Transfers")["CreateAdminTransfer"]}";
TransfersCreateUserTransfer = $"{TransfersBase}{configuration.GetSection("Endpoints").GetSection("Transfers")["CreateUserTransfer"]}";
2024-01-19 17:25:56 +01:00
}
#endregion
}
}