CodeLiturgy.Dashboard/BlueWest.Api/Controllers/FinanceController.cs

68 lines
1.8 KiB
C#
Raw Normal View History

2022-08-18 22:59:13 +03:00
using System;
using BlueWest.Data;
using BlueWest.WebApi.MySQL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace BlueWest.WebApi.Controllers;
/// <summary>
/// The controller responsible to fetch currency data
/// </summary>
[ApiController]
[Route("[controller]")]
public 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();
}
}