초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
namespace BrokerCore.Services;
using Common;
using DbEntity;
using Entity;
using Repository;
// 화폐(Currency) 주문 완료 전략
public class CurrencyOrderCompletionStrategy : IOrderCompletionStrategy
{
private readonly PlanetItemExchangeOrderRepo m_planet_item_exchange_repo;
public CurrencyOrderCompletionStrategy(PlanetItemExchangeOrderRepo planetItemExchangeOrderRepo)
{
m_planet_item_exchange_repo = planetItemExchangeOrderRepo;
}
public async Task<PlanetItemExchangeOrder> completeOrder(PlanetUserEntity planetUserEntity,
PlanetItemExchangeOrder orderCreated,
CancellationToken cancellationToken = default)
{
var (result, order_completed) =
await m_planet_item_exchange_repo.findAndUpdateStatus(orderCreated.OrderId, ExchangeOrderStatus.Completed, cancellationToken);
Guard.Against.resultFail(result);
Guard.Against.isNull(order_completed, ServerErrorCode.InvalidRequest,
()=>"CurrencyOrderCompletionStrategy => Order not found");
return order_completed;
}
}