68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
using System;
|
|
using BlueWest.Data;
|
|
using BlueWest.WebApi.EF;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BlueWest.WebApi.Controllers;
|
|
|
|
/// <summary>
|
|
/// The controller responsible to fetch currency data
|
|
/// </summary>
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
internal class FinanceController : ControllerBase
|
|
{
|
|
private readonly FinanceDbContext _dbContext;
|
|
|
|
public FinanceController(FinanceDbContext dbContext)
|
|
{
|
|
_dbContext = dbContext;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Returns a transaction by the provided id
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <param name="transactionId"></param>
|
|
/// <returns></returns>
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
[HttpGet("{userId}/transactions/{transactionId}")]
|
|
public ActionResult GetTransactionsById(int userId, TimeSpan transactionId)
|
|
{
|
|
return new NotFoundResult();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Posts a finance transaction
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <param name="financeTransaction"></param>
|
|
/// <returns></returns>
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
[HttpPost("{userId}/transactions")]
|
|
public ActionResult PostTransaction(int userId, FinanceOpCreate financeTransaction)
|
|
{
|
|
return new BadRequestResult();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Get Transactions
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <returns></returns>
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
|
[HttpGet("{userId}/transactions")]
|
|
public ActionResult GetTransactions(int userId)
|
|
{
|
|
return Ok();
|
|
}
|
|
|
|
|
|
} |