fix
This commit is contained in:
@@ -3,7 +3,6 @@ namespace MyOffice.Web.Controllers;
|
||||
using AutoMapper;
|
||||
using Core;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -38,15 +37,15 @@ public class AccountController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpGet("~/api/accounts")]
|
||||
public List<AccountDetailedViewModel> AccountsGet(string category)
|
||||
public ObjectResult AccountsGet(string category)
|
||||
{
|
||||
var list = _accountService.GetByCategoryDetailed(UserId, category!.AsGuid());
|
||||
|
||||
return _mapper.Map<List<AccountDetailedViewModel>>(list.OrderBy(x => x.Account.Name).ToList());
|
||||
return OkResponse(_mapper.Map<List<AccountDetailedViewModel>>(list.OrderBy(x => x.Account.Name).ToList()));
|
||||
}
|
||||
|
||||
[HttpGet("~/api/accounts/{id}")]
|
||||
public object AccountGet(string id)
|
||||
public ObjectResult AccountGet(string id)
|
||||
{
|
||||
var exec = _accountService.GetByIdDetailed(UserId, id!.AsGuid());
|
||||
|
||||
@@ -54,10 +53,10 @@ public class AccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return _mapper.Map<AccountDetailedViewModel>(exec.Result);
|
||||
return OkResponse(_mapper.Map<AccountDetailedViewModel>(exec.Result));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -65,7 +64,7 @@ public class AccountController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpGet("~/api/accounts/{id}/motions")]
|
||||
public object MotionsGet(string id, [FromQuery] MotionsGetModel request)
|
||||
public ObjectResult MotionsGet(string id, [FromQuery] MotionsGetRequest request)
|
||||
{
|
||||
var exec = _accountService.GetMotions(UserId, id!.AsGuid(), request.From.StartOfDay(), request.To.EndOfDay());
|
||||
|
||||
@@ -73,11 +72,10 @@ public class AccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
//return exec.Result!.Select(x => x.ToModel());
|
||||
return _mapper.Map<MotionViewModel[]>(exec.Result!);
|
||||
return OkResponse(_mapper.Map<List<MotionViewModel>>(exec.Result!));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -92,30 +90,30 @@ public class AccountController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case MotionAddStatus.account_not_found:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
case MotionAddStatus.failure:
|
||||
return ProblemBadRequest("Adding motion failed.");
|
||||
return ProblemBadResponse("Adding motion failed.");
|
||||
case MotionAddStatus.success:
|
||||
return _mapper.Map<MotionViewModel[]>(exec.Result!);
|
||||
|
||||
default:
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPut("~/api/accounts/{id}/motions/{motionId}")]
|
||||
public object MotionsPut(string id, string motionId, MotionRequest motion)
|
||||
public ObjectResult MotionsPut(string id, string motionId, MotionRequest motion)
|
||||
{
|
||||
var exec = _accountService.MotionUpdate(UserId, id.AsGuid(), motionId.AsGuid(), _mapper.Map<MotionAddUpdate>(motion));
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case MotionUpdateStatus.not_found:
|
||||
return ProblemBadRequest("Motion not found.");
|
||||
return ProblemBadResponse("Motion not found.");
|
||||
case MotionUpdateStatus.failure:
|
||||
return ProblemBadRequest("Updating motion failed.");
|
||||
return ProblemBadResponse("Updating motion failed.");
|
||||
case MotionUpdateStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
return OkResponse(_mapper.Map<List<MotionViewModel>>(exec.Result!));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -123,18 +121,18 @@ public class AccountController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpDelete("~/api/accounts/{id}/motions/{motionId}")]
|
||||
public object MotionsDelete(string id, string motionId)
|
||||
public ObjectResult MotionsDelete(string id, string motionId)
|
||||
{
|
||||
var exec = _accountService.MotionRemove(UserId, id.AsGuid(), motionId.AsGuid());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case MotionDeleteStatus.not_found:
|
||||
return ProblemBadRequest("Motion not found.");
|
||||
return ProblemBadResponse("Motion not found.");
|
||||
case MotionDeleteStatus.failure:
|
||||
return ProblemBadRequest("Deliting motion failed.");
|
||||
return ProblemBadResponse("Deliting motion failed.");
|
||||
case MotionDeleteStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
return OkResponse(_mapper.Map<MotionViewModel>(exec.Result!));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -142,16 +140,18 @@ public class AccountController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpGet("~/api/items")]
|
||||
public object FindItems(string term)
|
||||
public ObjectResult FindItems(string term)
|
||||
{
|
||||
var items = _itemService
|
||||
.FindItems(UserId, term)
|
||||
.Select(x => x.ToModel())
|
||||
.ToList();
|
||||
var itemsDto = _itemService.FindItems(UserId, term);
|
||||
|
||||
var items = _mapper.Map<List<ItemViewModel>>(itemsDto);
|
||||
|
||||
if (term.StartsWith("+") && term.Length > 1)
|
||||
{
|
||||
var accounts = _accountService.FindAccounts(UserId, term.Substring(1));
|
||||
var accounts = _accountService
|
||||
.FindAccounts(UserId, term.Substring(1))
|
||||
.OrderByDescending(x => x.Name);
|
||||
|
||||
foreach (var account in accounts)
|
||||
{
|
||||
var accountName = $"+{account.Name}";
|
||||
@@ -172,8 +172,10 @@ public class AccountController : BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
return items
|
||||
return OkResponse(_mapper
|
||||
.Map<List<ItemViewModel>>(items)
|
||||
.OrderBy(x => x.AccountId)
|
||||
.ThenBy(x => x.Name);
|
||||
.ThenBy(x => x.Name)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using System.Security.Authentication;
|
||||
using Core.Extensions;
|
||||
using IdentityModel;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MyOffice.Web.Models;
|
||||
using static IdentityServer4.Models.IdentityResources;
|
||||
|
||||
public class BaseApiController : ControllerBase
|
||||
@@ -19,8 +20,18 @@ public class BaseApiController : ControllerBase
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectResult ProblemBadRequest(string? detail = null)
|
||||
public ObjectResult ProblemBadResponse(string? detail = null)
|
||||
{
|
||||
return Problem(detail, statusCode: StatusCodes.Status400BadRequest);
|
||||
}
|
||||
|
||||
public ObjectResult OkResponse(IResponseModel response)
|
||||
{
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
public ObjectResult OkResponse<T>(IEnumerable<T> response) where T : IResponseModel
|
||||
{
|
||||
return Ok(response);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
namespace MyOffice.Web.Controllers;
|
||||
|
||||
using AutoMapper;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Currencies;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Data.Repositories.Currency;
|
||||
using Models.Currency;
|
||||
using Services.Currency;
|
||||
using Services.Currency.Domain;
|
||||
using MyOffice.Core;
|
||||
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
@@ -17,30 +16,31 @@ public class CurrencyController : BaseApiController
|
||||
{
|
||||
private readonly CurrencyService _currencyService;
|
||||
private readonly ILogger<CurrencyController> _logger;
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public CurrencyController(
|
||||
CurrencyService currencyService,
|
||||
ILogger<CurrencyController> logger
|
||||
ILogger<CurrencyController> logger,
|
||||
IMapper mapper
|
||||
)
|
||||
{
|
||||
_currencyService = currencyService;
|
||||
_logger = logger;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
[HttpGet("~/api/settings/currencies")]
|
||||
public object Get()
|
||||
public ObjectResult Get()
|
||||
{
|
||||
var list = _currencyService.GetAllWithRates(UserId);
|
||||
|
||||
return list
|
||||
.OrderBy(x => x.Key.CurrencyGlobalId)
|
||||
.Select(x => x.Key.ToModel(x.Value));
|
||||
return OkResponse(_mapper.Map<List<CurrencyViewModel>>(list).OrderBy(x => x.Id));
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/currencies")]
|
||||
public object Post(CurrencyAddModel currency)
|
||||
public ObjectResult Post(CurrencyAddModel currency)
|
||||
{
|
||||
var exec = _currencyService.CurrencyAdd(UserId, new Currency
|
||||
var exec = _currencyService.CurrencyAdd(UserId, new CurrencyDto
|
||||
{
|
||||
UserId = UserId,
|
||||
CurrencyGlobalId = currency.Id,
|
||||
@@ -52,17 +52,17 @@ public class CurrencyController : BaseApiController
|
||||
{
|
||||
case CurrencyAddStatus.success:
|
||||
case CurrencyAddStatus.exists:
|
||||
_currencyService.CurrencyRateAdd(UserId, exec.Result!.Id, new CurrencyRate()
|
||||
_currencyService.CurrencyRateAdd(UserId, exec.Result!.Id, new CurrencyRateDto
|
||||
{
|
||||
CurrencyId = exec.Result!.Id,
|
||||
Rate = currency.Rate,
|
||||
Quantity = currency.Quantity,
|
||||
DateTime = currency.RateDate.Date,
|
||||
});
|
||||
return currency;
|
||||
return OkResponse(_mapper.Map<CurrencyViewModel>(exec.Result!));
|
||||
|
||||
case CurrencyAddStatus.failed:
|
||||
return ProblemBadRequest("Adding currency failed.");
|
||||
return ProblemBadResponse("Adding currency failed.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -70,7 +70,7 @@ public class CurrencyController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpPut("~/api/settings/currencies/{id}")]
|
||||
public object Put(string id, CurrencyEditModel currency)
|
||||
public ObjectResult Update(string id, CurrencyEditModel currency)
|
||||
{
|
||||
var exec = _currencyService.CurrencyUpdate(
|
||||
UserId,
|
||||
@@ -81,11 +81,11 @@ public class CurrencyController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case CurrencyEditStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
return OkResponse(_mapper.Map<CurrencyViewModel>(exec.Result!));
|
||||
|
||||
case CurrencyEditStatus.not_found:
|
||||
case CurrencyEditStatus.failed:
|
||||
return ProblemBadRequest("Currency not found.");
|
||||
return ProblemBadResponse("Currency not found.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -93,9 +93,9 @@ public class CurrencyController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/currencies/{id}/rate")]
|
||||
public object Post(string id, CurrencyRateModel currencyRate)
|
||||
public ObjectResult Add(string id, CurrencyRateModel currencyRate)
|
||||
{
|
||||
var exec = _currencyService.CurrencyRateAdd(UserId, id.AsGuid(), new CurrencyRate()
|
||||
var exec = _currencyService.CurrencyRateAdd(UserId, id.AsGuid(), new CurrencyRateDto
|
||||
{
|
||||
CurrencyId = id.AsGuid(),
|
||||
Quantity = currencyRate.Quantity,
|
||||
@@ -106,12 +106,12 @@ public class CurrencyController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case CurrencyAddRateStatus.failed:
|
||||
return ProblemBadRequest("Adding currency rate failed.");
|
||||
return ProblemBadResponse("Adding currency rate failed.");
|
||||
case CurrencyAddRateStatus.not_found:
|
||||
return ProblemBadRequest("Currency not found.");
|
||||
return ProblemBadResponse("Currency not found.");
|
||||
|
||||
case CurrencyAddRateStatus.success:
|
||||
return exec.Result!;
|
||||
return OkResponse(_mapper.Map<CurrencyRateViewModel>(exec.Result!));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace MyOffice.Web.Controllers;
|
||||
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Data.Repositories.Currency;
|
||||
using Models.Currency;
|
||||
using Services.Currency;
|
||||
|
||||
@@ -12,19 +12,22 @@ using Services.Currency;
|
||||
public class GeneralController : BaseApiController
|
||||
{
|
||||
private readonly CurrencyService _currencyService;
|
||||
private readonly IMapper _mapper;
|
||||
|
||||
public GeneralController(
|
||||
CurrencyService currencyService
|
||||
CurrencyService currencyService,
|
||||
IMapper mapper
|
||||
)
|
||||
{
|
||||
_currencyService = currencyService;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
[HttpGet("~/api/general/currencies")]
|
||||
public object Get()
|
||||
public ObjectResult Get()
|
||||
{
|
||||
var list = _currencyService.GetGlobalAll();
|
||||
|
||||
return list.Select(x => x.ToModel());
|
||||
return Ok(_mapper.Map<List<CurrencyGlobalViewModel>>(list));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace MyOffice.Web.Controllers;
|
||||
|
||||
using AutoMapper;
|
||||
using Core;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
using Core;
|
||||
using Core.Extensions;
|
||||
using Models.Account;
|
||||
using Services.Account;
|
||||
using Services.Account.Domain;
|
||||
using MyOffice.Web.Infrastructure.Attributes;
|
||||
using Infrastructure.Attributes;
|
||||
using Services.Identity;
|
||||
|
||||
[Authorize]
|
||||
@@ -52,7 +52,7 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account category not found.");
|
||||
return ProblemBadResponse("Account category not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return _mapper.Map<AccountCategoryViewModel>(exec.Result!);
|
||||
@@ -65,7 +65,7 @@ public class SettingsAccountController : BaseApiController
|
||||
[HttpPost("~/api/settings/account-categories")]
|
||||
public object AccountCategoriesAdd(AccountCategoryViewModel request)
|
||||
{
|
||||
var exec = _accountService.CategoryAdd(UserId, new AccountCategory { Name = request.Name! });
|
||||
var exec = _accountService.CategoryAdd(UserId, new AccountCategoryDto { Name = request.Name! });
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.success:
|
||||
@@ -73,7 +73,7 @@ public class SettingsAccountController : BaseApiController
|
||||
|
||||
case GeneralExecStatus.failure:
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Adding account category failed.");
|
||||
return ProblemBadResponse("Adding account category failed.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -83,7 +83,7 @@ public class SettingsAccountController : BaseApiController
|
||||
[HttpPut("~/api/settings/account-categories/{id}")]
|
||||
public object AccountCategoriesEdit([AsGuid] string id, AccountCategoryViewModel request)
|
||||
{
|
||||
var exec = _accountService.CategoryUpdate(UserId, id.AsGuid(), new AccountCategory { Name = request.Name! });
|
||||
var exec = _accountService.CategoryUpdate(UserId, id.AsGuid(), new AccountCategoryDto { Name = request.Name! });
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.success:
|
||||
@@ -91,7 +91,7 @@ public class SettingsAccountController : BaseApiController
|
||||
|
||||
case GeneralExecStatus.failure:
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Update account category failed.");
|
||||
return ProblemBadResponse("Update account category failed.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -108,11 +108,11 @@ public class SettingsAccountController : BaseApiController
|
||||
return exec.Result!;
|
||||
|
||||
case AccountCategoryRemoveResult.failure:
|
||||
return ProblemBadRequest("Remove account category failed.");
|
||||
return ProblemBadResponse("Remove account category failed.");
|
||||
case AccountCategoryRemoveResult.not_found:
|
||||
return ProblemBadRequest("Account category not found.");
|
||||
return ProblemBadResponse("Account category not found.");
|
||||
case AccountCategoryRemoveResult.accounts_exists:
|
||||
return ProblemBadRequest("Account category have accounts.");
|
||||
return ProblemBadResponse("Account category have accounts.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -143,11 +143,11 @@ public class SettingsAccountController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case AccountAddStatus.category_not_found:
|
||||
return ProblemBadRequest("Category not found.");
|
||||
return ProblemBadResponse("Category not found.");
|
||||
case AccountAddStatus.currency_not_found:
|
||||
return ProblemBadRequest("Currency not found.");
|
||||
return ProblemBadResponse("Currency not found.");
|
||||
case AccountAddStatus.failure:
|
||||
return ProblemBadRequest("Adding account failed.");
|
||||
return ProblemBadResponse("Adding account failed.");
|
||||
case AccountAddStatus.success:
|
||||
return exec.Result!;
|
||||
|
||||
@@ -172,13 +172,13 @@ public class SettingsAccountController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case AccountEditStatus.not_found:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
case AccountEditStatus.category_not_found:
|
||||
return ProblemBadRequest("Category not found.");
|
||||
return ProblemBadResponse("Category not found.");
|
||||
case AccountEditStatus.currency_not_found:
|
||||
return ProblemBadRequest("Currency not found.");
|
||||
return ProblemBadResponse("Currency not found.");
|
||||
case AccountEditStatus.failure:
|
||||
return ProblemBadRequest("Adding account failed.");
|
||||
return ProblemBadResponse("Adding account failed.");
|
||||
case AccountEditStatus.success:
|
||||
return exec.Result!;
|
||||
|
||||
@@ -194,7 +194,7 @@ public class SettingsAccountController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!;
|
||||
|
||||
@@ -212,7 +212,7 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Category not found.");
|
||||
return ProblemBadResponse("Category not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!;
|
||||
@@ -233,7 +233,7 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
break;
|
||||
@@ -252,7 +252,7 @@ public class SettingsAccountController : BaseApiController
|
||||
switch (inviteExec.Status)
|
||||
{
|
||||
case AccessInviteStatus.account_not_found:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case AccessInviteStatus.access_exists:
|
||||
case AccessInviteStatus.invite_exists:
|
||||
@@ -273,7 +273,7 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!;
|
||||
@@ -299,9 +299,9 @@ public class SettingsAccountController : BaseApiController
|
||||
switch (exec.Status)
|
||||
{
|
||||
case InviteAcceptStatus.invite_not_found:
|
||||
return ProblemBadRequest("Invite not found.");
|
||||
return ProblemBadResponse("Invite not found.");
|
||||
case InviteAcceptStatus.account_not_found:
|
||||
return ProblemBadRequest("Account not found.");
|
||||
return ProblemBadResponse("Account not found.");
|
||||
|
||||
case InviteAcceptStatus.already_accepted:
|
||||
case InviteAcceptStatus.success:
|
||||
@@ -321,7 +321,7 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Invite not found.");
|
||||
return ProblemBadResponse("Invite not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return _mapper.Map<AccountAccessInviteViewModel>(exec.Result!);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
namespace MyOffice.Web.Controllers;
|
||||
|
||||
using Data.Models.Items;
|
||||
using Data.Repositories.Account;
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Models.Item;
|
||||
using MyOffice.Core.Extensions;
|
||||
using MyOffice.Core;
|
||||
using MyOffice.Services.Account;
|
||||
using MyOffice.Services.Account.Domain;
|
||||
using Core.Extensions;
|
||||
using Core;
|
||||
using Infrastructure.Attributes;
|
||||
using Services.Item;
|
||||
using Services.Item.Domain;
|
||||
|
||||
@@ -18,42 +17,43 @@ using Services.Item.Domain;
|
||||
public class SettingsItemController : BaseApiController
|
||||
{
|
||||
private ILogger<SettingsItemController> _logger;
|
||||
|
||||
private IMapper _mapper;
|
||||
private ItemService _itemService;
|
||||
|
||||
public SettingsItemController(
|
||||
ILogger<SettingsItemController> logger,
|
||||
ItemService itemService
|
||||
ItemService itemService,
|
||||
IMapper mapper
|
||||
)
|
||||
{
|
||||
_itemService = itemService;
|
||||
_logger = logger;
|
||||
_mapper = mapper;
|
||||
}
|
||||
|
||||
[HttpGet("~/api/settings/item-categories")]
|
||||
public object ItemsCategories()
|
||||
public ObjectResult ItemsCategories()
|
||||
{
|
||||
var list = _itemService.GetAllCategories(UserId);
|
||||
|
||||
return list
|
||||
.Select(x => x.ToModel())
|
||||
return Ok(_mapper.Map<List<ItemCategoryViewModel>>(list)
|
||||
.OrderByDescending(x => x.SortOrder)
|
||||
.ThenBy(x => x.Name);
|
||||
.ThenBy(x => x.Name));
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/item-categories")]
|
||||
public object ItemCategoriesAdd(ItemCategoryViewModel request)
|
||||
public ObjectResult ItemCategoriesAdd(ItemCategoryViewModel request)
|
||||
{
|
||||
var exec = _itemService.CategoryAdd(UserId, request.FromModel());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
return Ok(_mapper.Map<ItemCategoryViewModel>(exec.Result!));
|
||||
|
||||
case GeneralExecStatus.failure:
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Adding item category failed.");
|
||||
return ProblemBadResponse("Adding item category failed.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -61,18 +61,18 @@ public class SettingsItemController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpPut("~/api/settings/item-categories/{id}")]
|
||||
public object ItemCategoriesEdit(string id, ItemCategoryViewModel request)
|
||||
public ObjectResult ItemCategoriesUpdate([AsGuid] string id, ItemCategoryViewModel request)
|
||||
{
|
||||
var exec = _itemService.CategoryUpdate(UserId, id.AsGuid(), request.FromModel());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
return Ok(_mapper.Map<ItemCategoryViewModel>(exec.Result!));
|
||||
|
||||
case GeneralExecStatus.failure:
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Update item category failed.");
|
||||
return ProblemBadResponse("Update item category failed.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -80,20 +80,20 @@ public class SettingsItemController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpDelete("~/api/settings/item-categories/{id}")]
|
||||
public object ItemCategoriesDelete(string id)
|
||||
public ObjectResult ItemCategoriesDelete([AsGuid] string id)
|
||||
{
|
||||
var exec = _itemService.CategoryRemove(UserId, id.AsGuid());
|
||||
switch (exec.Status)
|
||||
{
|
||||
case ItemCategoryRemoveResult.success:
|
||||
return exec.Result!;
|
||||
return Ok(_mapper.Map<ItemCategoryViewModel>(exec.Result!));
|
||||
|
||||
case ItemCategoryRemoveResult.failure:
|
||||
return ProblemBadRequest("Remove item category failed.");
|
||||
return ProblemBadResponse("Remove item category failed.");
|
||||
case ItemCategoryRemoveResult.not_found:
|
||||
return ProblemBadRequest("Account item not found.");
|
||||
return ProblemBadResponse("Account item not found.");
|
||||
case ItemCategoryRemoveResult.accounts_exists:
|
||||
return ProblemBadRequest("Account motion have accounts.");
|
||||
return ProblemBadResponse("Account motion have accounts.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
@@ -101,29 +101,28 @@ public class SettingsItemController : BaseApiController
|
||||
}
|
||||
|
||||
[HttpGet("~/api/settings/items")]
|
||||
public object Items(string? category)
|
||||
public ObjectResult Items([AsGuid] string? category)
|
||||
{
|
||||
var list = category.IsMissing()
|
||||
? _itemService.GetAll(UserId)
|
||||
: _itemService.GetByCategory(UserId, category!.AsGuid());
|
||||
|
||||
return list
|
||||
.OrderBy(x => x.ItemGlobal.Name)
|
||||
.Select(x => x.ToModel());
|
||||
return Ok(_mapper.Map<List<ItemViewModel>>(list.OrderBy(x => x.Name)));
|
||||
}
|
||||
|
||||
[HttpPut("~/api/settings/items/{id}")]
|
||||
public object Items(string id, ItemEditModel request)
|
||||
public ObjectResult Items([AsGuid] string id, ItemEditModel request)
|
||||
{
|
||||
var exec = _itemService.Update(UserId, id.AsGuid(), request.Category.AsGuid());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
return ProblemBadRequest("Item not found.");
|
||||
return ProblemBadResponse("Item not found.");
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Item update failed.");
|
||||
return ProblemBadResponse("Item update failed.");
|
||||
case GeneralExecStatus.success:
|
||||
return Ok(exec.Result!.ToModel());
|
||||
return Ok(_mapper.Map<ItemViewModel>(exec.Result!));
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
|
||||
@@ -84,10 +84,10 @@ public class UserController : BaseApiController
|
||||
public async Task<object> AttachProvider([FromBody] AttachModel model)
|
||||
{
|
||||
var validator = _externalProviderValidators.FirstOrDefault(x => x.Provider.EqualsIgnoreCase(model.Provider));
|
||||
if (validator == null) return ProblemBadRequest("Provider not supported");
|
||||
if (validator == null) return ProblemBadResponse("Provider not supported");
|
||||
|
||||
var result = await validator.ValidateAsync(model.Token);
|
||||
if (!result.IsSuccessed) return ProblemBadRequest("Token not valid");
|
||||
if (!result.IsSuccessed) return ProblemBadResponse("Token not valid");
|
||||
|
||||
var execResult = _userService.AddUserExternal(UserId, model.Provider, result.ExternalId!, result.Email!);
|
||||
switch (execResult.Status)
|
||||
@@ -100,7 +100,7 @@ public class UserController : BaseApiController
|
||||
|
||||
case AddUserExternalStatusEnum.externalid_used:
|
||||
case AddUserExternalStatusEnum.user_not_valid:
|
||||
return ProblemBadRequest("Provider already connected");
|
||||
return ProblemBadResponse("Provider already connected");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(execResult.Status.ToString());
|
||||
@@ -113,7 +113,7 @@ public class UserController : BaseApiController
|
||||
{
|
||||
var exec = await _userService.RemoveUserExternal(UserId, model.Provider);
|
||||
|
||||
if (exec.Status == GeneralExecStatus.not_found) return ProblemBadRequest("Provider not connected");
|
||||
if (exec.Status == GeneralExecStatus.not_found) return ProblemBadResponse("Provider not connected");
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ public class UserStore :
|
||||
|
||||
public async Task<IdentityResult> CreateAsync(ApplicationUser<Guid> user, CancellationToken cancellationToken)
|
||||
{
|
||||
var result = await _userRepository.AddUserAsync(new User
|
||||
var result = _userRepository.AddUser(new User
|
||||
{
|
||||
Id = user.Id,
|
||||
UserName = user.UserName,
|
||||
@@ -83,7 +83,7 @@ public class UserStore :
|
||||
IsEmailConfirmed = user.IsEmailConfirmed
|
||||
};
|
||||
|
||||
var result = await _userRepository.UpdateUserAsync(userDb);
|
||||
var result = _userRepository.UpdateUser(userDb);
|
||||
return result == 1 ? IdentityResult.Success : IdentityResult.Failed();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,7 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using Data.Models.Accounts;
|
||||
using Services.Account.Domain;
|
||||
|
||||
public class AccountDetailedViewModel
|
||||
public class AccountDetailedViewModel: BaseViewModel
|
||||
{
|
||||
public AccountViewModel Account { get; set; } = null!;
|
||||
public decimal Rest { get; set; }
|
||||
}
|
||||
|
||||
/*public static class AccountDetailedViewModelExtensions
|
||||
{
|
||||
public static AccountDetailedViewModel ToModel(this AccountDetailedDto input)
|
||||
{
|
||||
return new AccountDetailedViewModel
|
||||
{
|
||||
Account = input.Account.ToModel(),
|
||||
Rest = input.Rest,
|
||||
};
|
||||
}
|
||||
}*/
|
||||
@@ -1,7 +1,12 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
using MyOffice.Services.Currency.Domain;
|
||||
using MyOffice.Services.Identity;
|
||||
using Currency;
|
||||
using Item;
|
||||
using Motion;
|
||||
using Services.Account.Domain;
|
||||
using User;
|
||||
|
||||
@@ -67,5 +72,35 @@ public class AccountViewModelProfile : Profile
|
||||
CreateMap<AccountAccessInviteDto, AccountAccessInviteViewModel>()
|
||||
.ForMember(x => x.AllowWrite, o => o.MapFrom(x => x.IsAllowWrite))
|
||||
;
|
||||
|
||||
CreateMap<MotionDto, MotionViewModel>()
|
||||
;
|
||||
|
||||
CreateMap<ItemDto, ItemViewModel>()
|
||||
.ForMember(x => x.Category, o => o.MapFrom(x => x.Category!.Name))
|
||||
;
|
||||
|
||||
CreateMap<ItemCategoryDto, ItemCategoryViewModel>()
|
||||
.ForMember(x => x.Internal, o => o.MapFrom(x => x.IsInternal))
|
||||
.ForMember(x => x.AllowDelete, o => o.MapFrom(x => !x.Items.Any() && x.Id != x.UserId))
|
||||
.ForMember(x => x.SortOrder, o => o.MapFrom(x => x.Id == x.UserId ? 1 : 0))
|
||||
;
|
||||
|
||||
CreateMap<CurrencyGlobalDto, CurrencyGlobalViewModel>();
|
||||
|
||||
CreateMap<CurrencyDto, CurrencyViewModel>();
|
||||
|
||||
CreateMap<CurrencyRateDto, CurrencyRateViewModel>();
|
||||
|
||||
CreateMap<CurrencyWithRateDto, CurrencyViewModel>()
|
||||
.ForMember(x => x.Id, o => o.MapFrom(x => x.Currency.Id))
|
||||
.ForMember(x => x.Code, o => o.MapFrom(x => x.Currency.CurrencyGlobalId))
|
||||
.ForMember(x => x.Name, o => o.MapFrom(x => x.Currency.Name))
|
||||
.ForMember(x => x.ShortName, o => o.MapFrom(x => x.Currency.ShortName))
|
||||
.ForMember(x => x.Rate, o => o.MapFrom(x => x.Rate == null ? (decimal?)null : x.Rate.Rate))
|
||||
.ForMember(x => x.IsPrimary, o => o.MapFrom(x => x.Currency.IsPrimary))
|
||||
.ForMember(x => x.Quantity, o => o.MapFrom(x => x.Rate == null ? (int?)null : x.Rate.Quantity))
|
||||
.ForMember(x => x.RateDate, o => o.MapFrom(x => x.Rate == null ? (DateTime?)null : x.Rate.DateTime))
|
||||
;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
public class MotionsGetModel
|
||||
public class MotionsGetRequest
|
||||
{
|
||||
[Required]
|
||||
public DateTime From { get; set; }
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace MyOffice.Web.Models;
|
||||
|
||||
public class BaseViewModel : IResponseModel
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MyOffice.Web.Models.Currency;
|
||||
|
||||
public class CurrencyRateViewModel: BaseViewModel
|
||||
{
|
||||
public string Currency { get; set; }
|
||||
public DateTime DateTime { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public decimal Rate { get; set; }
|
||||
}
|
||||
@@ -1,38 +1,14 @@
|
||||
namespace MyOffice.Web.Models.Currency
|
||||
namespace MyOffice.Web.Models.Currency;
|
||||
|
||||
public class CurrencyViewModel: BaseViewModel
|
||||
{
|
||||
using Core.Extensions;
|
||||
using Data.Models.Currencies;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
|
||||
|
||||
public class CurrencyViewModel
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public string Code { get; set; } = null!;
|
||||
public string Symbol { get; set; } = null!;
|
||||
public string Name { get; set; } = null!;
|
||||
public string ShortName { get; set; } = null!;
|
||||
public decimal? Rate { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public DateTime? RateDate { get; set; }
|
||||
public bool IsPrimary { get; set; }
|
||||
}
|
||||
|
||||
public static class CurrencyViewModelExtensions
|
||||
{
|
||||
public static CurrencyViewModel ToModel(this Currency input, CurrencyRate? rate = null)
|
||||
{
|
||||
return new CurrencyViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Code = input.CurrencyGlobal!.Id,
|
||||
Symbol = input.CurrencyGlobal!.Symbol,
|
||||
Name = input.Name,
|
||||
ShortName = input.ShortName,
|
||||
Quantity = input.CurrentRate?.Quantity ?? rate?.Quantity,
|
||||
Rate = input.CurrentRate?.Rate ?? rate?.Rate,
|
||||
RateDate = input.CurrentRate?.DateTime ?? rate?.DateTime,
|
||||
IsPrimary = input.IsPrimary,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Id { get; set; } = null!;
|
||||
public string Code { get; set; } = null!;
|
||||
public string Symbol { get; set; } = null!;
|
||||
public string Name { get; set; } = null!;
|
||||
public string ShortName { get; set; } = null!;
|
||||
public decimal? Rate { get; set; }
|
||||
public int? Quantity { get; set; }
|
||||
public DateTime? RateDate { get; set; }
|
||||
public bool IsPrimary { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace MyOffice.Web.Models;
|
||||
|
||||
public interface IRequestModel
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace MyOffice.Web.Models;
|
||||
|
||||
public interface IResponseModel
|
||||
{
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
namespace MyOffice.Web.Models.Item
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using MyOffice.Core.Extensions;
|
||||
using MyOffice.Data.Models.Items;
|
||||
using MyOffice.Migrations.Postgres.Migrations;
|
||||
using Services.Account.Domain;
|
||||
|
||||
public class ItemCategoryViewModel
|
||||
{
|
||||
@@ -14,32 +12,20 @@
|
||||
|
||||
public bool AllowDelete { get; set; }
|
||||
public int SortOrder { get; set; }
|
||||
public bool IsInternal { get; set; }
|
||||
public bool Internal { get; set; }
|
||||
}
|
||||
|
||||
public static class ItemCategoryViewModelExtensions
|
||||
{
|
||||
public static ItemCategoryViewModel ToModel(this ItemCategory input)
|
||||
{
|
||||
return new ItemCategoryViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Name = input.Name,
|
||||
AllowDelete = !input.Items.Any() && input.Id != input.UserId,
|
||||
IsInternal = input.IsInternal,
|
||||
SortOrder = input.Id == input.UserId ? 1 : 0
|
||||
};
|
||||
}
|
||||
|
||||
public static ItemCategory FromModel(this ItemCategoryViewModel input)
|
||||
public static ItemCategoryDto FromModel(this ItemCategoryViewModel input)
|
||||
{
|
||||
if (input == null)
|
||||
throw new ArgumentNullException(nameof(input));
|
||||
|
||||
return new ItemCategory
|
||||
return new ItemCategoryDto
|
||||
{
|
||||
Name = input.Name,
|
||||
IsInternal = input.IsInternal,
|
||||
IsInternal = input.Internal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,17 @@
|
||||
namespace MyOffice.Web.Models.Item
|
||||
namespace MyOffice.Web.Models.Item;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
public class ItemViewModel : BaseViewModel
|
||||
{
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Data.Models.Accounts;
|
||||
using MyOffice.Core.Extensions;
|
||||
using MyOffice.Data.Models.Items;
|
||||
public string? Id { get; set; }
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
|
||||
public class ItemViewModel
|
||||
{
|
||||
public string? Id { get; set; }
|
||||
public bool AllowDelete { get; set; }
|
||||
|
||||
public string CategoryId { get; set; } = null!;
|
||||
public string? Category { get; set; } = null!;
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
public string CategoryId { get; set; } = null!;
|
||||
public string? Category { get; set; } = null!;
|
||||
|
||||
public bool AllowDelete { get; set; }
|
||||
public string? AccountId { get; set; }
|
||||
}
|
||||
|
||||
public static class ItemViewModelExtensions
|
||||
{
|
||||
public static ItemViewModel ToModel(this Item input, Account? account = null)
|
||||
{
|
||||
return new ItemViewModel
|
||||
{
|
||||
Id = input.ItemGlobal.Id.ToShort(),
|
||||
CategoryId = input.CategoryId.ToShort(),
|
||||
Category = input.Category?.Name,
|
||||
Name = input.ItemGlobal.Name,
|
||||
AllowDelete = input.Motions != null && !input.Motions.Any(),
|
||||
AccountId = account?.Id.ToShort(),
|
||||
};
|
||||
}
|
||||
}
|
||||
public string? AccountId { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
namespace MyOffice.Web.Models.Motion
|
||||
{
|
||||
using Core.Extensions;
|
||||
using Data.Models.Accounts;
|
||||
|
||||
public class MotionViewModel
|
||||
public class MotionViewModel: BaseViewModel
|
||||
{
|
||||
public string Id { get; set; } = null!;
|
||||
public DateTime Date { get; set; }
|
||||
@@ -13,20 +10,4 @@
|
||||
public decimal Plus { get; set; }
|
||||
public decimal Minus { get; set; }
|
||||
}
|
||||
|
||||
public static class MotionViewModelExtensions
|
||||
{
|
||||
public static MotionViewModel ToModel(this Motion input)
|
||||
{
|
||||
return new MotionViewModel
|
||||
{
|
||||
Id = input.Id.ToShort(),
|
||||
Date = input.DateTime,
|
||||
Item = input.Item.ItemGlobal.Name,
|
||||
Description = input.Description,
|
||||
Plus = input.AmountPlus,
|
||||
Minus = input.AmountMinus,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace MyOffice.Web.Models.Account;
|
||||
namespace MyOffice.Web.Models;
|
||||
|
||||
using AutoMapper;
|
||||
using Core.Extensions;
|
||||
@@ -44,8 +44,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MyOffice.Core\MyOffice.Core.csproj" />
|
||||
<ProjectReference Include="..\MyOffice.Data.Models\MyOffice.Data.Models.csproj" />
|
||||
<ProjectReference Include="..\MyOffice.Data.Repositories\MyOffice.Data.Repositories.csproj" />
|
||||
<ProjectReference Include="..\MyOffice.DbContext\MyOffice.DbContext.csproj" />
|
||||
<ProjectReference Include="..\MyOffice.Migration.Postgres\MyOffice.Migrations.Postgres.csproj" />
|
||||
<ProjectReference Include="..\MyOffice.Migration.Sqlite\MyOffice.Migrations.Sqlite.csproj" />
|
||||
|
||||
+11
-13
@@ -2,7 +2,6 @@ namespace MyOffice.Web;
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Core.Extensions;
|
||||
using System.Collections.Concurrent;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.FileProviders.Physical;
|
||||
@@ -13,19 +12,22 @@ using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Identity;
|
||||
using Identity.Domain;
|
||||
using Identity.ExternalProviders;
|
||||
using Identity.Repositories;
|
||||
using IdentityServer4.AccessTokenValidation;
|
||||
using IdentityServer4.Configuration;
|
||||
using IdentityServer4.Extensions;
|
||||
using IdentityServer4.Models;
|
||||
using IdentityServer4.Services;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.Extensions.Logging.Console;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
using Identity;
|
||||
using Identity.Domain;
|
||||
using Identity.ExternalProviders;
|
||||
using Identity.Repositories;
|
||||
using Core.Identity;
|
||||
using Core.Extensions;
|
||||
using Data.Repositories.Account;
|
||||
using Data.Repositories.Currency;
|
||||
using Data.Repositories.Item;
|
||||
@@ -35,17 +37,12 @@ using Services.Users;
|
||||
using Shared;
|
||||
using Identity.Configure;
|
||||
using Infrastructure;
|
||||
using Microsoft.Extensions.Logging.Console;
|
||||
using IdentityServer4.Services;
|
||||
using Models.Account;
|
||||
using MyOffice.Services.Currency;
|
||||
using Services.Account;
|
||||
using Services.Item;
|
||||
using MyOffice.Services.Dashboard;
|
||||
using MyOffice.Services.Identity;
|
||||
using AutoMapper;
|
||||
using Models.Motion;
|
||||
using MyOffice.Services.Account.Domain;
|
||||
using MyOffice.Services.Mapper;
|
||||
|
||||
//TODO: Data.Model only Repository and Service, response <-> mapper <-> web <-> mapper <-> service <-> repository
|
||||
@@ -68,9 +65,10 @@ using MyOffice.Services.Mapper;
|
||||
//TODO: Services auto registration
|
||||
//TODO: openid-configuration failed - lock login
|
||||
//TODO: BUG some times after login redirect to dashboard but exists return url
|
||||
//TODO: email confirmation
|
||||
//TODO: email password reset
|
||||
//TODO: automapper -> Extension ToModel() ToDbo() FromModel() FromDbo()
|
||||
//TODO: SPA all http requests -> services
|
||||
//TODO: Items, select category -> save url to allow refresh
|
||||
//TODO: Accounts, select category -> save url to allow refresh
|
||||
|
||||
public class Program
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user