Initial commit
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using ExpenseTracker.Api.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ExpenseTracker.Api.Controllers;
|
||||
|
||||
/// <summary>Endpoints for managing expense categories.</summary>
|
||||
[ApiController]
|
||||
[Route("api/categories")]
|
||||
[Produces("application/json")]
|
||||
public class CategoriesController : ControllerBase
|
||||
{
|
||||
private readonly AppDbContext _db;
|
||||
private readonly ILogger<CategoriesController> _logger;
|
||||
|
||||
public CategoriesController(AppDbContext db, ILogger<CategoriesController> logger)
|
||||
{
|
||||
_db = db;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// ── GET /api/categories ───────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Returns all categories sorted by name ascending.</summary>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(typeof(List<CategoryDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAll()
|
||||
{
|
||||
var categories = await _db.Categories
|
||||
.OrderBy(c => c.Name)
|
||||
.Select(c => new CategoryDto(c.Id, c.Name, c.Color))
|
||||
.ToListAsync();
|
||||
|
||||
return Ok(categories);
|
||||
}
|
||||
|
||||
// ── POST /api/categories ──────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Creates a new category.</summary>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(CategoryDto), StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
public async Task<IActionResult> Create([FromBody] CreateCategoryDto dto)
|
||||
{
|
||||
// FluentValidation auto-validation handles 400 before we get here.
|
||||
|
||||
var category = new Category
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Name = dto.Name,
|
||||
Color = dto.Color
|
||||
};
|
||||
|
||||
_db.Categories.Add(category);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Category '{Name}' created with id {Id}.", category.Name, category.Id);
|
||||
|
||||
var result = new CategoryDto(category.Id, category.Name, category.Color);
|
||||
return CreatedAtAction(nameof(GetAll), null, result);
|
||||
}
|
||||
|
||||
// ── DELETE /api/categories/{id} ───────────────────────────────────────────
|
||||
|
||||
/// <summary>Deletes a category. Returns 409 Conflict if entries reference it.</summary>
|
||||
[HttpDelete("{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status409Conflict)]
|
||||
public async Task<IActionResult> Delete(Guid id)
|
||||
{
|
||||
var category = await _db.Categories.FindAsync(id);
|
||||
|
||||
if (category is null)
|
||||
{
|
||||
_logger.LogWarning("Delete category: id {Id} not found.", id);
|
||||
return NotFound(new { error = "Category not found." });
|
||||
}
|
||||
|
||||
bool hasEntries = await _db.Entries.AnyAsync(e => e.CategoryId == id);
|
||||
|
||||
if (hasEntries)
|
||||
{
|
||||
_logger.LogWarning("Delete category {Id} refused: entries still reference it.", id);
|
||||
return Conflict(new { error = "This category is referenced by one or more entries and cannot be deleted." });
|
||||
}
|
||||
|
||||
_db.Categories.Remove(category);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Category {Id} deleted.", id);
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using ExpenseTracker.Api.Models;
|
||||
using ExpenseTracker.Api.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ExpenseTracker.Api.Controllers;
|
||||
|
||||
/// <summary>Endpoints for managing entries (saisies) within a month.</summary>
|
||||
[ApiController]
|
||||
[Produces("application/json")]
|
||||
public class EntriesController : ControllerBase
|
||||
{
|
||||
private readonly AppDbContext _db;
|
||||
private readonly CsvImportService _csvImportService;
|
||||
private readonly ExportService _exportService;
|
||||
private readonly ILogger<EntriesController> _logger;
|
||||
|
||||
public EntriesController(
|
||||
AppDbContext db,
|
||||
CsvImportService csvImportService,
|
||||
ExportService exportService,
|
||||
ILogger<EntriesController> logger)
|
||||
{
|
||||
_db = db;
|
||||
_csvImportService = csvImportService;
|
||||
_exportService = exportService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// ── GET /api/months/{monthId}/entries ─────────────────────────────────────
|
||||
|
||||
/// <summary>Returns all entries for a month, sorted by date then creation time.</summary>
|
||||
[HttpGet("api/months/{monthId:guid}/entries")]
|
||||
[ProducesResponseType(typeof(List<EntryDto>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetAll(Guid monthId)
|
||||
{
|
||||
bool monthExists = await _db.Months.AnyAsync(m => m.Id == monthId);
|
||||
if (!monthExists)
|
||||
{
|
||||
_logger.LogWarning("GetAll entries: month {MonthId} not found.", monthId);
|
||||
return NotFound(new { error = "Month not found." });
|
||||
}
|
||||
|
||||
var entries = await _db.Entries
|
||||
.AsNoTracking()
|
||||
.Include(e => e.Category)
|
||||
.Where(e => e.MonthId == monthId)
|
||||
.OrderBy(e => e.EntryDate)
|
||||
.ThenBy(e => e.CreatedAt)
|
||||
.Select(e => new EntryDto(
|
||||
e.Id,
|
||||
e.MonthId,
|
||||
e.Type.ToString(),
|
||||
e.Amount,
|
||||
e.Label,
|
||||
e.CategoryId,
|
||||
e.Category != null ? e.Category.Name : null,
|
||||
e.EntryDate,
|
||||
e.CreatedAt))
|
||||
.ToListAsync();
|
||||
|
||||
return Ok(entries);
|
||||
}
|
||||
|
||||
// ── POST /api/months/{monthId}/entries ────────────────────────────────────
|
||||
|
||||
/// <summary>Creates a new entry in a month.</summary>
|
||||
[HttpPost("api/months/{monthId:guid}/entries")]
|
||||
[ProducesResponseType(typeof(EntryDto), StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Create(Guid monthId, [FromBody] CreateEntryDto dto)
|
||||
{
|
||||
// FluentValidation auto-validation handles 400 before we get here.
|
||||
|
||||
bool monthExists = await _db.Months.AnyAsync(m => m.Id == monthId);
|
||||
if (!monthExists)
|
||||
{
|
||||
_logger.LogWarning("Create entry: month {MonthId} not found.", monthId);
|
||||
return NotFound(new { error = "Month not found." });
|
||||
}
|
||||
|
||||
if (!Enum.TryParse<EntryType>(dto.Type, out var entryType))
|
||||
{
|
||||
return BadRequest(new { error = "Invalid entry type." });
|
||||
}
|
||||
|
||||
if (entryType == EntryType.EXPENSE && dto.CategoryId.HasValue)
|
||||
{
|
||||
bool categoryExists = await _db.Categories.AnyAsync(c => c.Id == dto.CategoryId.Value);
|
||||
if (!categoryExists)
|
||||
{
|
||||
return BadRequest(new { error = "Category not found." });
|
||||
}
|
||||
}
|
||||
|
||||
var entry = new Entry
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
MonthId = monthId,
|
||||
Type = entryType,
|
||||
Amount = dto.Amount,
|
||||
Label = dto.Label,
|
||||
CategoryId = dto.CategoryId,
|
||||
EntryDate = dto.EntryDate,
|
||||
CreatedAt = DateTime.UtcNow
|
||||
};
|
||||
|
||||
_db.Entries.Add(entry);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Entry {Id} created in month {MonthId}.", entry.Id, monthId);
|
||||
|
||||
// Reload with category name
|
||||
var categoryName = entry.CategoryId.HasValue
|
||||
? (await _db.Categories.FindAsync(entry.CategoryId.Value))?.Name
|
||||
: null;
|
||||
|
||||
var result = new EntryDto(
|
||||
entry.Id,
|
||||
entry.MonthId,
|
||||
entry.Type.ToString(),
|
||||
entry.Amount,
|
||||
entry.Label,
|
||||
entry.CategoryId,
|
||||
categoryName,
|
||||
entry.EntryDate,
|
||||
entry.CreatedAt);
|
||||
|
||||
return CreatedAtAction(nameof(GetAll), new { monthId }, result);
|
||||
}
|
||||
|
||||
// ── PUT /api/entries/{id} ─────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Updates an existing entry.</summary>
|
||||
[HttpPut("api/entries/{id:guid}")]
|
||||
[ProducesResponseType(typeof(EntryDto), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Update(Guid id, [FromBody] UpdateEntryDto dto)
|
||||
{
|
||||
// FluentValidation auto-validation handles 400 before we get here.
|
||||
|
||||
var entry = await _db.Entries.FindAsync(id);
|
||||
if (entry is null)
|
||||
{
|
||||
_logger.LogWarning("Update entry: entry {Id} not found.", id);
|
||||
return NotFound(new { error = "Entry not found." });
|
||||
}
|
||||
|
||||
if (!Enum.TryParse<EntryType>(dto.Type, out var entryType))
|
||||
{
|
||||
return BadRequest(new { error = "Invalid entry type." });
|
||||
}
|
||||
|
||||
if (entryType == EntryType.EXPENSE && dto.CategoryId.HasValue)
|
||||
{
|
||||
bool categoryExists = await _db.Categories.AnyAsync(c => c.Id == dto.CategoryId.Value);
|
||||
if (!categoryExists)
|
||||
{
|
||||
return BadRequest(new { error = "Category not found." });
|
||||
}
|
||||
}
|
||||
|
||||
entry.Type = entryType;
|
||||
entry.Amount = dto.Amount;
|
||||
entry.Label = dto.Label;
|
||||
entry.CategoryId = dto.CategoryId;
|
||||
entry.EntryDate = dto.EntryDate;
|
||||
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Entry {Id} updated.", id);
|
||||
|
||||
var categoryName = entry.CategoryId.HasValue
|
||||
? (await _db.Categories.FindAsync(entry.CategoryId.Value))?.Name
|
||||
: null;
|
||||
|
||||
var result = new EntryDto(
|
||||
entry.Id,
|
||||
entry.MonthId,
|
||||
entry.Type.ToString(),
|
||||
entry.Amount,
|
||||
entry.Label,
|
||||
entry.CategoryId,
|
||||
categoryName,
|
||||
entry.EntryDate,
|
||||
entry.CreatedAt);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
// ── DELETE /api/entries/{id} ──────────────────────────────────────────────
|
||||
|
||||
/// <summary>Deletes an entry.</summary>
|
||||
[HttpDelete("api/entries/{id:guid}")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> Delete(Guid id)
|
||||
{
|
||||
var entry = await _db.Entries.FindAsync(id);
|
||||
if (entry is null)
|
||||
{
|
||||
_logger.LogWarning("Delete entry: entry {Id} not found.", id);
|
||||
return NotFound(new { error = "Entry not found." });
|
||||
}
|
||||
|
||||
_db.Entries.Remove(entry);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Entry {Id} deleted.", id);
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
// ── POST /api/months/{monthId}/import-csv ─────────────────────────────────
|
||||
|
||||
/// <summary>Bulk-imports entries from a CSV file upload.</summary>
|
||||
[HttpPost("api/months/{monthId:guid}/import-csv")]
|
||||
[Consumes("multipart/form-data")]
|
||||
[ProducesResponseType(typeof(ImportResultDto), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> ImportCsv(Guid monthId, IFormFile? file)
|
||||
{
|
||||
bool monthExists = await _db.Months.AnyAsync(m => m.Id == monthId);
|
||||
if (!monthExists)
|
||||
{
|
||||
_logger.LogWarning("ImportCsv: month {MonthId} not found.", monthId);
|
||||
return NotFound(new { error = "Month not found." });
|
||||
}
|
||||
|
||||
if (file is null || file.Length == 0)
|
||||
{
|
||||
return BadRequest(new { error = "No file provided." });
|
||||
}
|
||||
|
||||
using var stream = file.OpenReadStream();
|
||||
var result = await _csvImportService.ImportAsync(monthId, stream, _db);
|
||||
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
// ── GET /api/months/{monthId}/export-excel ────────────────────────────────
|
||||
|
||||
/// <summary>Exports all entries for a month as an Excel .xlsx file.</summary>
|
||||
[HttpGet("api/months/{monthId:guid}/export-excel")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> ExportExcel(Guid monthId)
|
||||
{
|
||||
var month = await _db.Months
|
||||
.AsNoTracking()
|
||||
.FirstOrDefaultAsync(m => m.Id == monthId);
|
||||
|
||||
if (month is null)
|
||||
{
|
||||
_logger.LogWarning("ExportExcel: month {MonthId} not found.", monthId);
|
||||
return NotFound(new { error = "Month not found." });
|
||||
}
|
||||
|
||||
var bytes = await _exportService.ExportMonthAsync(monthId, _db);
|
||||
var fileName = ExportService.GetFileName(month.MonthNumber, month.Year);
|
||||
|
||||
return File(
|
||||
bytes,
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
fileName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using ExpenseTracker.Api.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ExpenseTracker.Api.Controllers;
|
||||
|
||||
/// <summary>Endpoints for managing budget months.</summary>
|
||||
[ApiController]
|
||||
[Route("api/months")]
|
||||
[Produces("application/json")]
|
||||
public class MonthsController : ControllerBase
|
||||
{
|
||||
private readonly AppDbContext _db;
|
||||
private readonly ILogger<MonthsController> _logger;
|
||||
|
||||
public MonthsController(AppDbContext db, ILogger<MonthsController> logger)
|
||||
{
|
||||
_db = db;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// ── GET /api/months ───────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Returns all months sorted by year then month number, descending.</summary>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(typeof(List<MonthDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAll()
|
||||
{
|
||||
var months = await _db.Months
|
||||
.OrderByDescending(m => m.Year)
|
||||
.ThenByDescending(m => m.MonthNumber)
|
||||
.Select(m => new MonthDto(m.Id, m.Year, m.MonthNumber, m.DefaultSalary, m.CreatedAt))
|
||||
.ToListAsync();
|
||||
|
||||
return Ok(months);
|
||||
}
|
||||
|
||||
// ── POST /api/months ──────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Creates a new month. Automatically inserts an INCOME entry for the salary if > 0.</summary>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(typeof(MonthDto), StatusCodes.Status201Created)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status409Conflict)]
|
||||
public async Task<IActionResult> Create([FromBody] CreateMonthDto dto)
|
||||
{
|
||||
// FluentValidation auto-validation handles 400 before we get here.
|
||||
|
||||
bool exists = await _db.Months
|
||||
.AnyAsync(m => m.Year == dto.Year && m.MonthNumber == dto.Month);
|
||||
|
||||
if (exists)
|
||||
{
|
||||
_logger.LogWarning("Conflict: month {Year}-{Month} already exists.", dto.Year, dto.Month);
|
||||
return Conflict(new { error = "A month with this year and month number already exists." });
|
||||
}
|
||||
|
||||
var month = new Month
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Year = dto.Year,
|
||||
MonthNumber = dto.Month,
|
||||
DefaultSalary = dto.DefaultSalary,
|
||||
CreatedAt = DateTime.UtcNow
|
||||
};
|
||||
|
||||
_db.Months.Add(month);
|
||||
|
||||
if (dto.DefaultSalary > 0)
|
||||
{
|
||||
var income = new Entry
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
MonthId = month.Id,
|
||||
Type = EntryType.INCOME,
|
||||
Amount = dto.DefaultSalary,
|
||||
Label = "Salaire",
|
||||
CategoryId = null,
|
||||
EntryDate = new DateOnly(dto.Year, dto.Month, 1),
|
||||
CreatedAt = DateTime.UtcNow
|
||||
};
|
||||
|
||||
_db.Entries.Add(income);
|
||||
}
|
||||
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Month {Year}-{Month} created with id {Id}.", month.Year, month.MonthNumber, month.Id);
|
||||
|
||||
var result = new MonthDto(month.Id, month.Year, month.MonthNumber, month.DefaultSalary, month.CreatedAt);
|
||||
return CreatedAtAction(nameof(GetSummary), new { id = month.Id }, result);
|
||||
}
|
||||
|
||||
// ── GET /api/months/{id}/summary ──────────────────────────────────────────
|
||||
|
||||
/// <summary>Returns the balance summary for a given month.</summary>
|
||||
[HttpGet("{id:guid}/summary")]
|
||||
[ProducesResponseType(typeof(MonthSummaryDto), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetSummary(Guid id)
|
||||
{
|
||||
var month = await _db.Months.FindAsync(id);
|
||||
|
||||
if (month is null)
|
||||
{
|
||||
_logger.LogWarning("GetSummary: month {Id} not found.", id);
|
||||
return NotFound(new { error = "Month not found." });
|
||||
}
|
||||
|
||||
var entries = await _db.Entries
|
||||
.Where(e => e.MonthId == id)
|
||||
.ToListAsync();
|
||||
|
||||
decimal totalIncome = entries.Where(e => e.Type == EntryType.INCOME).Sum(e => e.Amount);
|
||||
decimal totalExpense = entries.Where(e => e.Type == EntryType.EXPENSE).Sum(e => e.Amount);
|
||||
decimal balance = totalIncome - totalExpense;
|
||||
|
||||
var summary = new MonthSummaryDto(
|
||||
MonthId: month.Id,
|
||||
Year: month.Year,
|
||||
MonthNumber: month.MonthNumber,
|
||||
TotalIncome: totalIncome,
|
||||
TotalExpense: totalExpense,
|
||||
Balance: balance);
|
||||
|
||||
return Ok(summary);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ExpenseTracker.Api.Controllers;
|
||||
|
||||
/// <summary>Endpoints for managing global application settings.</summary>
|
||||
[ApiController]
|
||||
[Route("api/settings")]
|
||||
[Produces("application/json")]
|
||||
public class SettingsController : ControllerBase
|
||||
{
|
||||
private readonly AppDbContext _db;
|
||||
private readonly ILogger<SettingsController> _logger;
|
||||
|
||||
public SettingsController(AppDbContext db, ILogger<SettingsController> logger)
|
||||
{
|
||||
_db = db;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// ── GET /api/settings ─────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Returns all application settings.</summary>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(typeof(List<SettingsDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetAll()
|
||||
{
|
||||
var settings = await _db.AppSettings
|
||||
.OrderBy(s => s.Key)
|
||||
.Select(s => new SettingsDto(s.Key, s.Value))
|
||||
.ToListAsync();
|
||||
|
||||
return Ok(settings);
|
||||
}
|
||||
|
||||
// ── PUT /api/settings/default-salary ──────────────────────────────────────
|
||||
|
||||
/// <summary>Updates the default salary setting.</summary>
|
||||
[HttpPut("default-salary")]
|
||||
[ProducesResponseType(typeof(SettingsDto), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> UpdateDefaultSalary([FromBody] UpdateDefaultSalaryDto dto)
|
||||
{
|
||||
// FluentValidation auto-validation handles 400 before we get here.
|
||||
|
||||
var setting = await _db.AppSettings
|
||||
.FirstOrDefaultAsync(s => s.Key == "default_salary");
|
||||
|
||||
if (setting is null)
|
||||
{
|
||||
_logger.LogWarning("UpdateDefaultSalary: key 'default_salary' not found in app_settings.");
|
||||
return NotFound(new { error = "Setting 'default_salary' not found." });
|
||||
}
|
||||
|
||||
setting.Value = dto.Value.ToString(System.Globalization.CultureInfo.InvariantCulture);
|
||||
await _db.SaveChangesAsync();
|
||||
|
||||
_logger.LogInformation("Setting 'default_salary' updated to {Value}.", setting.Value);
|
||||
|
||||
return Ok(new SettingsDto(setting.Key, setting.Value));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ExpenseTracker.Api.DTOs;
|
||||
|
||||
public record CategoryDto(
|
||||
Guid Id,
|
||||
string Name,
|
||||
string Color);
|
||||
|
||||
public record CreateCategoryDto(
|
||||
string Name,
|
||||
string Color);
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace ExpenseTracker.Api.DTOs;
|
||||
|
||||
public record EntryDto(
|
||||
Guid Id,
|
||||
Guid MonthId,
|
||||
string Type,
|
||||
decimal Amount,
|
||||
string Label,
|
||||
Guid? CategoryId,
|
||||
string? CategoryName,
|
||||
DateOnly EntryDate,
|
||||
DateTime CreatedAt);
|
||||
|
||||
public record CreateEntryDto(
|
||||
string Type,
|
||||
decimal Amount,
|
||||
string Label,
|
||||
Guid? CategoryId,
|
||||
DateOnly EntryDate);
|
||||
|
||||
public record UpdateEntryDto(
|
||||
string Type,
|
||||
decimal Amount,
|
||||
string Label,
|
||||
Guid? CategoryId,
|
||||
DateOnly EntryDate);
|
||||
|
||||
public record ImportErrorDto(
|
||||
int Line,
|
||||
string Message);
|
||||
|
||||
public record ImportResultDto(
|
||||
int ImportedCount,
|
||||
int ErrorCount,
|
||||
List<ImportErrorDto> Errors);
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace ExpenseTracker.Api.DTOs;
|
||||
|
||||
public record MonthDto(
|
||||
Guid Id,
|
||||
int Year,
|
||||
int MonthNumber,
|
||||
decimal DefaultSalary,
|
||||
DateTime CreatedAt);
|
||||
|
||||
public record CreateMonthDto(
|
||||
int Year,
|
||||
int Month,
|
||||
decimal DefaultSalary);
|
||||
|
||||
public record MonthSummaryDto(
|
||||
Guid MonthId,
|
||||
int Year,
|
||||
int MonthNumber,
|
||||
decimal TotalIncome,
|
||||
decimal TotalExpense,
|
||||
decimal Balance);
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ExpenseTracker.Api.DTOs;
|
||||
|
||||
public record SettingsDto(
|
||||
string Key,
|
||||
string Value);
|
||||
|
||||
public record UpdateDefaultSalaryDto(
|
||||
decimal Value);
|
||||
@@ -0,0 +1,143 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ExpenseTracker.Api.Models;
|
||||
|
||||
namespace ExpenseTracker.Api.Data;
|
||||
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
||||
|
||||
public DbSet<Month> Months => Set<Month>();
|
||||
public DbSet<Entry> Entries => Set<Entry>();
|
||||
public DbSet<Category> Categories => Set<Category>();
|
||||
public DbSet<AppSetting> AppSettings => Set<AppSetting>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
// ── Month ────────────────────────────────────────────────────────────
|
||||
modelBuilder.Entity<Month>(e =>
|
||||
{
|
||||
e.ToTable("months");
|
||||
e.HasKey(m => m.Id);
|
||||
e.Property(m => m.Id).HasColumnName("id");
|
||||
e.Property(m => m.Year).HasColumnName("year").IsRequired();
|
||||
e.Property(m => m.MonthNumber).HasColumnName("month").IsRequired();
|
||||
e.Property(m => m.DefaultSalary)
|
||||
.HasColumnName("default_salary")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.IsRequired();
|
||||
e.Property(m => m.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
|
||||
e.HasIndex(m => new { m.Year, m.MonthNumber })
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_months_year_month_unique");
|
||||
});
|
||||
|
||||
// ── Category ─────────────────────────────────────────────────────────
|
||||
modelBuilder.Entity<Category>(e =>
|
||||
{
|
||||
e.ToTable("categories");
|
||||
e.HasKey(c => c.Id);
|
||||
e.Property(c => c.Id).HasColumnName("id");
|
||||
e.Property(c => c.Name)
|
||||
.HasColumnName("name")
|
||||
.HasMaxLength(100)
|
||||
.IsRequired();
|
||||
e.Property(c => c.Color)
|
||||
.HasColumnName("color")
|
||||
.HasMaxLength(7)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
// ── Entry ─────────────────────────────────────────────────────────────
|
||||
modelBuilder.Entity<Entry>(e =>
|
||||
{
|
||||
e.ToTable("entries");
|
||||
e.HasKey(en => en.Id);
|
||||
e.Property(en => en.Id).HasColumnName("id");
|
||||
e.Property(en => en.MonthId).HasColumnName("month_id").IsRequired();
|
||||
e.Property(en => en.Type)
|
||||
.HasColumnName("type")
|
||||
.HasConversion<string>()
|
||||
.IsRequired();
|
||||
e.Property(en => en.Amount)
|
||||
.HasColumnName("amount")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.IsRequired();
|
||||
e.Property(en => en.Label)
|
||||
.HasColumnName("label")
|
||||
.HasMaxLength(200)
|
||||
.IsRequired();
|
||||
e.Property(en => en.CategoryId).HasColumnName("category_id");
|
||||
e.Property(en => en.EntryDate).HasColumnName("entry_date").IsRequired();
|
||||
e.Property(en => en.CreatedAt).HasColumnName("created_at").IsRequired();
|
||||
|
||||
e.HasOne(en => en.Month)
|
||||
.WithMany(m => m.Entries)
|
||||
.HasForeignKey(en => en.MonthId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
e.HasOne(en => en.Category)
|
||||
.WithMany(c => c.Entries)
|
||||
.HasForeignKey(en => en.CategoryId)
|
||||
.IsRequired(false)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
e.HasIndex(en => en.MonthId).HasDatabaseName("ix_entries_month_id");
|
||||
e.HasIndex(en => en.CategoryId).HasDatabaseName("ix_entries_category_id");
|
||||
});
|
||||
|
||||
// ── AppSetting ────────────────────────────────────────────────────────
|
||||
modelBuilder.Entity<AppSetting>(e =>
|
||||
{
|
||||
e.ToTable("app_settings");
|
||||
e.HasKey(s => s.Id);
|
||||
e.Property(s => s.Id).HasColumnName("id");
|
||||
e.Property(s => s.Key)
|
||||
.HasColumnName("key")
|
||||
.HasMaxLength(100)
|
||||
.IsRequired();
|
||||
e.Property(s => s.Value).HasColumnName("value").IsRequired();
|
||||
|
||||
e.HasIndex(s => s.Key)
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_app_settings_key_unique");
|
||||
});
|
||||
|
||||
// ── Seed data ─────────────────────────────────────────────────────────
|
||||
// Category names are derived from bank-export "Sous categorie" values:
|
||||
// everything after " - " is stripped and the result is trimmed, so that
|
||||
// the import matching (Contains) can resolve e.g. "Banque et assurance - autre"
|
||||
// against the stored name "Banque et assurance".
|
||||
modelBuilder.Entity<Category>().HasData(
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000001"), Name = "Ameublement et appareil", Color = "#f97316" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000002"), Name = "Banque et assurance", Color = "#6b7280" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000003"), Name = "Credit", Color = "#22c55e" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000004"), Name = "Energie", Color = "#eab308" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000005"), Name = "Frais bancaires", Color = "#ef4444" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000006"), Name = "Hygiene", Color = "#ec4899" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000007"), Name = "Impots et taxes", Color = "#dc2626" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000008"), Name = "Internet et telephonie", Color = "#3b82f6" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000009"), Name = "Juridique et administratif", Color = "#8b5cf6" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000010"), Name = "Prelevement", Color = "#64748b" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000011"), Name = "Salaires", Color = "#16a34a" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000012"), Name = "Shopping et services", Color = "#a855f7" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000013"), Name = "Sport, Gym et Equipement", Color = "#0ea5e9" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000014"), Name = "Transaction differee", Color = "#94a3b8" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000015"), Name = "Virement emis", Color = "#f59e0b" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000016"), Name = "Virement recu", Color = "#10b981" },
|
||||
new Category { Id = new Guid("10000000-0000-0000-0000-000000000017"), Name = "Autre", Color = "#6b7280" }
|
||||
);
|
||||
|
||||
modelBuilder.Entity<AppSetting>().HasData(
|
||||
new AppSetting
|
||||
{
|
||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||
Key = "default_salary",
|
||||
Value = "0"
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
|
||||
namespace ExpenseTracker.Api.Data;
|
||||
|
||||
/// <summary>
|
||||
/// Provides a design-time AppDbContext instance for EF Core tooling (migrations).
|
||||
/// Uses a dummy connection string — no live database connection is required.
|
||||
/// </summary>
|
||||
public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
|
||||
{
|
||||
public AppDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<AppDbContext>();
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Database=expensetracker_design;Username=postgres;Password=postgres");
|
||||
return new AppDbContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
# Stage build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["ExpenseTracker.Api.csproj", "."]
|
||||
RUN dotnet restore
|
||||
COPY . .
|
||||
RUN dotnet publish -c Release -o /app/publish --no-restore
|
||||
|
||||
# Stage runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
||||
WORKDIR /app
|
||||
RUN addgroup --gid 1001 appgroup && adduser --uid 1001 --ingroup appgroup --disabled-password --no-create-home appuser
|
||||
COPY --from=build --chown=appuser:appgroup /app/publish .
|
||||
USER 1001
|
||||
EXPOSE 5000
|
||||
# ASPNETCORE_URLS overrides the UseUrls("http://127.0.0.1:5000") in Program.cs
|
||||
# so Kestrel binds on all container interfaces (needed for Docker networking).
|
||||
# This is NOT a public 0.0.0.0 binding — the container port is not exposed to the host.
|
||||
ENV ASPNETCORE_URLS=http://+:5000
|
||||
ENTRYPOINT ["dotnet", "ExpenseTracker.Api.dll"]
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EPPlus" Version="8.7.0" />
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.30" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.11" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
@ExpenseTracker.Api_HostAddress = http://localhost:5189
|
||||
|
||||
GET {{ExpenseTracker.Api_HostAddress}}/weatherforecast/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
+242
@@ -0,0 +1,242 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ExpenseTracker.Api.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20260902125250_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.AppSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("key");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_app_settings_key_unique");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||
Key = "default_salary",
|
||||
Value = "0"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Color")
|
||||
.IsRequired()
|
||||
.HasMaxLength(7)
|
||||
.HasColumnType("character varying(7)")
|
||||
.HasColumnName("color");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("categories", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
Color = "#ef4444",
|
||||
Name = "Alimentation"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
Color = "#f97316",
|
||||
Name = "Transport"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
Color = "#eab308",
|
||||
Name = "Logement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
Color = "#22c55e",
|
||||
Name = "Santé"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
Color = "#3b82f6",
|
||||
Name = "Loisirs"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
Color = "#a855f7",
|
||||
Name = "Abonnements"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
Color = "#6b7280",
|
||||
Name = "Autre"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("amount");
|
||||
|
||||
b.Property<Guid?>("CategoryId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("category_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("EntryDate")
|
||||
.HasColumnType("date")
|
||||
.HasColumnName("entry_date");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasColumnName("label");
|
||||
|
||||
b.Property<Guid>("MonthId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("month_id");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CategoryId")
|
||||
.HasDatabaseName("ix_entries_category_id");
|
||||
|
||||
b.HasIndex("MonthId")
|
||||
.HasDatabaseName("ix_entries_month_id");
|
||||
|
||||
b.ToTable("entries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<decimal>("DefaultSalary")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("default_salary");
|
||||
|
||||
b.Property<int>("MonthNumber")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("month");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Year", "MonthNumber")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_months_year_month_unique");
|
||||
|
||||
b.ToTable("months", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.HasOne("ExpenseTracker.Api.Models.Category", "Category")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ExpenseTracker.Api.Models.Month", "Month")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("MonthId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Category");
|
||||
|
||||
b.Navigation("Month");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "app_settings",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
key = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
value = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_app_settings", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "categories",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
name = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
color = table.Column<string>(type: "character varying(7)", maxLength: 7, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_categories", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "months",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
year = table.Column<int>(type: "integer", nullable: false),
|
||||
month = table.Column<int>(type: "integer", nullable: false),
|
||||
default_salary = table.Column<decimal>(type: "numeric(12,2)", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_months", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "entries",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
month_id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
type = table.Column<string>(type: "text", nullable: false),
|
||||
amount = table.Column<decimal>(type: "numeric(12,2)", nullable: false),
|
||||
label = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
category_id = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
entry_date = table.Column<DateOnly>(type: "date", nullable: false),
|
||||
created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_entries", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_entries_categories_category_id",
|
||||
column: x => x.category_id,
|
||||
principalTable: "categories",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "FK_entries_months_month_id",
|
||||
column: x => x.month_id,
|
||||
principalTable: "months",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "app_settings",
|
||||
columns: new[] { "id", "key", "value" },
|
||||
values: new object[] { new Guid("20000000-0000-0000-0000-000000000001"), "default_salary", "0" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "categories",
|
||||
columns: new[] { "id", "color", "name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("10000000-0000-0000-0000-000000000001"), "#ef4444", "Alimentation" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000002"), "#f97316", "Transport" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000003"), "#eab308", "Logement" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000004"), "#22c55e", "Santé" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000005"), "#3b82f6", "Loisirs" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000006"), "#a855f7", "Abonnements" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000007"), "#6b7280", "Autre" }
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_app_settings_key_unique",
|
||||
table: "app_settings",
|
||||
column: "key",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_entries_category_id",
|
||||
table: "entries",
|
||||
column: "category_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_entries_month_id",
|
||||
table: "entries",
|
||||
column: "month_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_months_year_month_unique",
|
||||
table: "months",
|
||||
columns: new[] { "year", "month" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "app_settings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "entries");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "categories");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "months");
|
||||
}
|
||||
}
|
||||
}
|
||||
+296
@@ -0,0 +1,296 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ExpenseTracker.Api.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20260907094513_UpdateCategories")]
|
||||
partial class UpdateCategories
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.AppSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("key");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_app_settings_key_unique");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||
Key = "default_salary",
|
||||
Value = "0"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Color")
|
||||
.IsRequired()
|
||||
.HasMaxLength(7)
|
||||
.HasColumnType("character varying(7)")
|
||||
.HasColumnName("color");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("categories", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
Color = "#f97316",
|
||||
Name = "Ameublement et appareil"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
Color = "#6b7280",
|
||||
Name = "Banque et assurance"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
Color = "#22c55e",
|
||||
Name = "Credit"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
Color = "#eab308",
|
||||
Name = "Energie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
Color = "#ef4444",
|
||||
Name = "Frais bancaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
Color = "#ec4899",
|
||||
Name = "Hygiene"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
Color = "#dc2626",
|
||||
Name = "Impots et taxes"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000008"),
|
||||
Color = "#3b82f6",
|
||||
Name = "Internet et telephonie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000009"),
|
||||
Color = "#8b5cf6",
|
||||
Name = "Juridique et administratif"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000010"),
|
||||
Color = "#64748b",
|
||||
Name = "Prelevement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000011"),
|
||||
Color = "#16a34a",
|
||||
Name = "Salaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000012"),
|
||||
Color = "#a855f7",
|
||||
Name = "Shopping et services"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000013"),
|
||||
Color = "#0ea5e9",
|
||||
Name = "Sport, Gym et Equipement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000014"),
|
||||
Color = "#94a3b8",
|
||||
Name = "Transaction differee"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000015"),
|
||||
Color = "#f59e0b",
|
||||
Name = "Virement emis"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000016"),
|
||||
Color = "#10b981",
|
||||
Name = "Virement recu"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("amount");
|
||||
|
||||
b.Property<Guid?>("CategoryId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("category_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("EntryDate")
|
||||
.HasColumnType("date")
|
||||
.HasColumnName("entry_date");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasColumnName("label");
|
||||
|
||||
b.Property<Guid>("MonthId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("month_id");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CategoryId")
|
||||
.HasDatabaseName("ix_entries_category_id");
|
||||
|
||||
b.HasIndex("MonthId")
|
||||
.HasDatabaseName("ix_entries_month_id");
|
||||
|
||||
b.ToTable("entries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<decimal>("DefaultSalary")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("default_salary");
|
||||
|
||||
b.Property<int>("MonthNumber")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("month");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Year", "MonthNumber")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_months_year_month_unique");
|
||||
|
||||
b.ToTable("months", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.HasOne("ExpenseTracker.Api.Models.Category", "Category")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ExpenseTracker.Api.Models.Month", "Month")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("MonthId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Category");
|
||||
|
||||
b.Navigation("Month");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class UpdateCategories : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#f97316", "Ameublement et appareil" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#6b7280", "Banque et assurance" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#22c55e", "Credit" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#eab308", "Energie" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#ef4444", "Frais bancaires" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#ec4899", "Hygiene" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#dc2626", "Impots et taxes" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "categories",
|
||||
columns: new[] { "id", "color", "name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("10000000-0000-0000-0000-000000000008"), "#3b82f6", "Internet et telephonie" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000009"), "#8b5cf6", "Juridique et administratif" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000010"), "#64748b", "Prelevement" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000011"), "#16a34a", "Salaires" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000012"), "#a855f7", "Shopping et services" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000013"), "#0ea5e9", "Sport, Gym et Equipement" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000014"), "#94a3b8", "Transaction differee" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000015"), "#f59e0b", "Virement emis" },
|
||||
{ new Guid("10000000-0000-0000-0000-000000000016"), "#10b981", "Virement recu" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000008"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000009"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000010"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000011"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000012"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000013"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000014"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000015"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000016"));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#ef4444", "Alimentation" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#f97316", "Transport" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#eab308", "Logement" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#22c55e", "Santé" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#3b82f6", "Loisirs" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#a855f7", "Abonnements" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
columns: new[] { "color", "name" },
|
||||
values: new object[] { "#6b7280", "Autre" });
|
||||
}
|
||||
}
|
||||
}
|
||||
+302
@@ -0,0 +1,302 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ExpenseTracker.Api.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20260907100011_AddAutreCategory")]
|
||||
partial class AddAutreCategory
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.AppSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("key");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_app_settings_key_unique");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||
Key = "default_salary",
|
||||
Value = "0"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Color")
|
||||
.IsRequired()
|
||||
.HasMaxLength(7)
|
||||
.HasColumnType("character varying(7)")
|
||||
.HasColumnName("color");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("categories", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
Color = "#f97316",
|
||||
Name = "Ameublement et appareil"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
Color = "#6b7280",
|
||||
Name = "Banque et assurance"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
Color = "#22c55e",
|
||||
Name = "Credit"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
Color = "#eab308",
|
||||
Name = "Energie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
Color = "#ef4444",
|
||||
Name = "Frais bancaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
Color = "#ec4899",
|
||||
Name = "Hygiene"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
Color = "#dc2626",
|
||||
Name = "Impots et taxes"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000008"),
|
||||
Color = "#3b82f6",
|
||||
Name = "Internet et telephonie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000009"),
|
||||
Color = "#8b5cf6",
|
||||
Name = "Juridique et administratif"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000010"),
|
||||
Color = "#64748b",
|
||||
Name = "Prelevement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000011"),
|
||||
Color = "#16a34a",
|
||||
Name = "Salaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000012"),
|
||||
Color = "#a855f7",
|
||||
Name = "Shopping et services"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000013"),
|
||||
Color = "#0ea5e9",
|
||||
Name = "Sport, Gym et Equipement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000014"),
|
||||
Color = "#94a3b8",
|
||||
Name = "Transaction differee"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000015"),
|
||||
Color = "#f59e0b",
|
||||
Name = "Virement emis"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000016"),
|
||||
Color = "#10b981",
|
||||
Name = "Virement recu"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000017"),
|
||||
Color = "#6b7280",
|
||||
Name = "Autre"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("amount");
|
||||
|
||||
b.Property<Guid?>("CategoryId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("category_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("EntryDate")
|
||||
.HasColumnType("date")
|
||||
.HasColumnName("entry_date");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasColumnName("label");
|
||||
|
||||
b.Property<Guid>("MonthId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("month_id");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CategoryId")
|
||||
.HasDatabaseName("ix_entries_category_id");
|
||||
|
||||
b.HasIndex("MonthId")
|
||||
.HasDatabaseName("ix_entries_month_id");
|
||||
|
||||
b.ToTable("entries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<decimal>("DefaultSalary")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("default_salary");
|
||||
|
||||
b.Property<int>("MonthNumber")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("month");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Year", "MonthNumber")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_months_year_month_unique");
|
||||
|
||||
b.ToTable("months", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.HasOne("ExpenseTracker.Api.Models.Category", "Category")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ExpenseTracker.Api.Models.Month", "Month")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("MonthId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Category");
|
||||
|
||||
b.Navigation("Month");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddAutreCategory : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "categories",
|
||||
columns: new[] { "id", "color", "name" },
|
||||
values: new object[] { new Guid("10000000-0000-0000-0000-000000000017"), "#6b7280", "Autre" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "categories",
|
||||
keyColumn: "id",
|
||||
keyValue: new Guid("10000000-0000-0000-0000-000000000017"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using ExpenseTracker.Api.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ExpenseTracker.Api.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
partial class AppDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.AppSetting", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("key");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("value");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Key")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_app_settings_key_unique");
|
||||
|
||||
b.ToTable("app_settings", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("20000000-0000-0000-0000-000000000001"),
|
||||
Key = "default_salary",
|
||||
Value = "0"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<string>("Color")
|
||||
.IsRequired()
|
||||
.HasMaxLength(7)
|
||||
.HasColumnType("character varying(7)")
|
||||
.HasColumnName("color");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("character varying(100)")
|
||||
.HasColumnName("name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("categories", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000001"),
|
||||
Color = "#f97316",
|
||||
Name = "Ameublement et appareil"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000002"),
|
||||
Color = "#6b7280",
|
||||
Name = "Banque et assurance"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000003"),
|
||||
Color = "#22c55e",
|
||||
Name = "Credit"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000004"),
|
||||
Color = "#eab308",
|
||||
Name = "Energie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000005"),
|
||||
Color = "#ef4444",
|
||||
Name = "Frais bancaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000006"),
|
||||
Color = "#ec4899",
|
||||
Name = "Hygiene"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000007"),
|
||||
Color = "#dc2626",
|
||||
Name = "Impots et taxes"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000008"),
|
||||
Color = "#3b82f6",
|
||||
Name = "Internet et telephonie"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000009"),
|
||||
Color = "#8b5cf6",
|
||||
Name = "Juridique et administratif"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000010"),
|
||||
Color = "#64748b",
|
||||
Name = "Prelevement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000011"),
|
||||
Color = "#16a34a",
|
||||
Name = "Salaires"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000012"),
|
||||
Color = "#a855f7",
|
||||
Name = "Shopping et services"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000013"),
|
||||
Color = "#0ea5e9",
|
||||
Name = "Sport, Gym et Equipement"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000014"),
|
||||
Color = "#94a3b8",
|
||||
Name = "Transaction differee"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000015"),
|
||||
Color = "#f59e0b",
|
||||
Name = "Virement emis"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000016"),
|
||||
Color = "#10b981",
|
||||
Name = "Virement recu"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = new Guid("10000000-0000-0000-0000-000000000017"),
|
||||
Color = "#6b7280",
|
||||
Name = "Autre"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<decimal>("Amount")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("amount");
|
||||
|
||||
b.Property<Guid?>("CategoryId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("category_id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<DateOnly>("EntryDate")
|
||||
.HasColumnType("date")
|
||||
.HasColumnName("entry_date");
|
||||
|
||||
b.Property<string>("Label")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("character varying(200)")
|
||||
.HasColumnName("label");
|
||||
|
||||
b.Property<Guid>("MonthId")
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("month_id");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("type");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CategoryId")
|
||||
.HasDatabaseName("ix_entries_category_id");
|
||||
|
||||
b.HasIndex("MonthId")
|
||||
.HasDatabaseName("ix_entries_month_id");
|
||||
|
||||
b.ToTable("entries", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid")
|
||||
.HasColumnName("id");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasColumnName("created_at");
|
||||
|
||||
b.Property<decimal>("DefaultSalary")
|
||||
.HasColumnType("DECIMAL(12,2)")
|
||||
.HasColumnName("default_salary");
|
||||
|
||||
b.Property<int>("MonthNumber")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("month");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("year");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Year", "MonthNumber")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_months_year_month_unique");
|
||||
|
||||
b.ToTable("months", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Entry", b =>
|
||||
{
|
||||
b.HasOne("ExpenseTracker.Api.Models.Category", "Category")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("ExpenseTracker.Api.Models.Month", "Month")
|
||||
.WithMany("Entries")
|
||||
.HasForeignKey("MonthId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Category");
|
||||
|
||||
b.Navigation("Month");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Category", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ExpenseTracker.Api.Models.Month", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ExpenseTracker.Api.Models;
|
||||
|
||||
public class AppSetting
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Key { get; set; } = string.Empty;
|
||||
public string Value { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ExpenseTracker.Api.Models;
|
||||
|
||||
public class Category
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Color { get; set; } = string.Empty;
|
||||
|
||||
public ICollection<Entry> Entries { get; set; } = new List<Entry>();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace ExpenseTracker.Api.Models;
|
||||
|
||||
public class Entry
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid MonthId { get; set; }
|
||||
public EntryType Type { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
public string Label { get; set; } = string.Empty;
|
||||
public Guid? CategoryId { get; set; }
|
||||
public DateOnly EntryDate { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public Month Month { get; set; } = null!;
|
||||
public Category? Category { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ExpenseTracker.Api.Models;
|
||||
|
||||
public enum EntryType
|
||||
{
|
||||
INCOME,
|
||||
EXPENSE
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ExpenseTracker.Api.Models;
|
||||
|
||||
public class Month
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public int Year { get; set; }
|
||||
public int MonthNumber { get; set; }
|
||||
public decimal DefaultSalary { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
public ICollection<Entry> Entries { get; set; } = new List<Entry>();
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.Services;
|
||||
using FluentValidation;
|
||||
using FluentValidation.AspNetCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OfficeOpenXml;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// ── Kestrel: bind only on localhost ─────────────────────────────────────────
|
||||
builder.WebHost.UseUrls("http://127.0.0.1:5000");
|
||||
|
||||
// ── CORS ─────────────────────────────────────────────────────────────────────
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("AllowAngularDev", policy =>
|
||||
policy.WithOrigins("http://localhost:4200")
|
||||
.AllowAnyHeader()
|
||||
.AllowAnyMethod());
|
||||
});
|
||||
|
||||
// ── Controllers ───────────────────────────────────────────────────────────────
|
||||
builder.Services.AddControllers();
|
||||
|
||||
// ── Swagger / OpenAPI ─────────────────────────────────────────────────────────
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("v1", new() { Title = "ExpenseTracker API", Version = "v1" });
|
||||
});
|
||||
|
||||
// ── EF Core + PostgreSQL ──────────────────────────────────────────────────────
|
||||
// Connection string is read from the environment variable
|
||||
// "ConnectionStrings__DefaultConnection" (set in Docker or local env).
|
||||
builder.Services.AddDbContext<AppDbContext>(options =>
|
||||
options.UseNpgsql(
|
||||
builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
|
||||
// ── FluentValidation ─────────────────────────────────────────────────────────
|
||||
builder.Services.AddValidatorsFromAssemblyContaining<Program>();
|
||||
builder.Services.AddFluentValidationAutoValidation();
|
||||
|
||||
// ── Application Services ──────────────────────────────────────────────────────
|
||||
builder.Services.AddScoped<CsvImportService>();
|
||||
builder.Services.AddScoped<ExportService>();
|
||||
|
||||
// ── EPPlus licence (NonCommercial) ────────────────────────────────────────────
|
||||
ExcelPackage.License.SetNonCommercialPersonal("ExpenseTracker");
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
var app = builder.Build();
|
||||
|
||||
// ── Swagger UI (all environments for now; restrict in production if needed) ──
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI(c =>
|
||||
{
|
||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "ExpenseTracker API v1");
|
||||
c.RoutePrefix = "swagger";
|
||||
});
|
||||
|
||||
// ── Auto-migrate + seed on startup ───────────────────────────────────────────
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var db = scope.ServiceProvider.GetRequiredService<AppDbContext>();
|
||||
await db.Database.MigrateAsync();
|
||||
}
|
||||
|
||||
// ── Pipeline ──────────────────────────────────────────────────────────────────
|
||||
app.UseCors("AllowAngularDev");
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
|
||||
// Health check endpoint — used by Docker Compose healthcheck
|
||||
app.MapGet("/health", () => Results.Ok(new { status = "healthy" }));
|
||||
|
||||
app.Run();
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:15070",
|
||||
"sslPort": 44382
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5189",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7187;http://localhost:5189",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
using System.Globalization;
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using ExpenseTracker.Api.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ExpenseTracker.Api.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Parses a bank-export CSV (semicolon-separated, French locale) and imports
|
||||
/// the rows as <see cref="Entry"/> records for the given month.
|
||||
///
|
||||
/// Expected columns (1-based):
|
||||
/// 1 Date de comptabilisation → EntryDate (dd/MM/yyyy)
|
||||
/// 2 Libelle simplifie → (ignored)
|
||||
/// 3 Libelle operation → Label
|
||||
/// 4 Reference → (ignored)
|
||||
/// 5 Informations complementaires → (ignored)
|
||||
/// 6 Type operation → (ignored)
|
||||
/// 7 Categorie → (ignored)
|
||||
/// 8 Sous categorie → Category name (optional lookup)
|
||||
/// 9 Debit → Amount when negative → EntryType.EXPENSE
|
||||
/// 10 Credit → Amount when present → EntryType.INCOME
|
||||
/// 11+ (remaining columns ignored)
|
||||
///
|
||||
/// Amount values use a comma as the decimal separator (French locale).
|
||||
/// Rows whose Debit and Credit are both empty are silently skipped.
|
||||
/// </summary>
|
||||
public class CsvImportService
|
||||
{
|
||||
private const int ColDate = 0; // Date de comptabilisation
|
||||
private const int ColLabel = 2; // Libelle operation
|
||||
private const int ColSousCategorie = 7; // Sous categorie
|
||||
private const int ColDebit = 8; // Debit (negative value or empty)
|
||||
private const int ColCredit = 9; // Credit (positive value or empty)
|
||||
private const int MinColumns = 10;
|
||||
|
||||
private static readonly CultureInfo FrenchCulture =
|
||||
CultureInfo.GetCultureInfo("fr-FR");
|
||||
|
||||
private readonly ILogger<CsvImportService> _logger;
|
||||
|
||||
public CsvImportService(ILogger<CsvImportService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<ImportResultDto> ImportAsync(Guid monthId, Stream csvStream, AppDbContext db)
|
||||
{
|
||||
var errors = new List<ImportErrorDto>();
|
||||
var validEntries = new List<Entry>();
|
||||
|
||||
// Load all categories once for case-insensitive lookup.
|
||||
// "Autre" is the fallback category used when no Sous categorie matches.
|
||||
var categories = await db.Categories
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
|
||||
var fallbackCategory = categories.FirstOrDefault(c =>
|
||||
c.Name.Equals("Autre", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
using var reader = new StreamReader(csvStream);
|
||||
|
||||
// Skip header line
|
||||
var header = await reader.ReadLineAsync();
|
||||
if (header is null)
|
||||
return new ImportResultDto(0, 0, errors);
|
||||
|
||||
int lineNumber = 1; // header is line 1
|
||||
string? line;
|
||||
|
||||
while ((line = await reader.ReadLineAsync()) is not null)
|
||||
{
|
||||
lineNumber++;
|
||||
|
||||
// Skip blank lines and lines that contain only semicolons (bank file padding)
|
||||
if (string.IsNullOrWhiteSpace(line) || line.Replace(";", "").Trim().Length == 0)
|
||||
continue;
|
||||
|
||||
var columns = line.Split(';');
|
||||
|
||||
if (columns.Length < MinColumns)
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber,
|
||||
$"La ligne ne contient pas les {MinColumns} colonnes attendues."));
|
||||
continue;
|
||||
}
|
||||
|
||||
var dateRaw = columns[ColDate].Trim();
|
||||
var labelRaw = columns[ColLabel].Trim();
|
||||
var sousCategorieRaw = columns[ColSousCategorie].Trim();
|
||||
var debitRaw = columns[ColDebit].Trim();
|
||||
var creditRaw = columns[ColCredit].Trim();
|
||||
|
||||
// Determine type and raw amount string
|
||||
bool hasDebit = !string.IsNullOrEmpty(debitRaw);
|
||||
bool hasCredit = !string.IsNullOrEmpty(creditRaw);
|
||||
|
||||
if (!hasDebit && !hasCredit)
|
||||
{
|
||||
// Neither column filled — silently skip (padding row)
|
||||
continue;
|
||||
}
|
||||
|
||||
var entryType = hasCredit ? EntryType.INCOME : EntryType.EXPENSE;
|
||||
var amountRaw = hasCredit ? creditRaw : debitRaw;
|
||||
|
||||
// Parse date (dd/MM/yyyy)
|
||||
if (!DateOnly.TryParseExact(dateRaw, "dd/MM/yyyy", FrenchCulture,
|
||||
DateTimeStyles.None, out var entryDate))
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber,
|
||||
$"Date invalide '{dateRaw}'. Format attendu : JJ/MM/AAAA."));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Parse amount — French locale uses comma as decimal separator.
|
||||
// Debit values may carry a leading minus sign; we store the absolute value.
|
||||
if (!decimal.TryParse(amountRaw, NumberStyles.Number, FrenchCulture, out var amount))
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber,
|
||||
$"Montant invalide '{amountRaw}'."));
|
||||
continue;
|
||||
}
|
||||
|
||||
amount = Math.Abs(amount);
|
||||
|
||||
if (amount <= 0)
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber,
|
||||
$"Le montant doit être supérieur à zéro (valeur lue : '{amountRaw}')."));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Validate label
|
||||
if (string.IsNullOrWhiteSpace(labelRaw))
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber, "Le libellé de l'opération est vide."));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (labelRaw.Length > 200)
|
||||
{
|
||||
errors.Add(new ImportErrorDto(lineNumber,
|
||||
"Le libellé dépasse 200 caractères."));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Category lookup — the CSV "Sous categorie" value (e.g. "Banque et assurance - autre")
|
||||
// is matched against stored category names (e.g. "Banque et assurance") using a
|
||||
// Contains check: the stored name must appear as a substring of the CSV value.
|
||||
// This handles the " - <qualifier>" suffixes present in bank exports.
|
||||
// If no category matches, the entry falls back to the "Autre" category.
|
||||
Guid? categoryId = null;
|
||||
if (!string.IsNullOrWhiteSpace(sousCategorieRaw))
|
||||
{
|
||||
var category = categories.FirstOrDefault(c =>
|
||||
!c.Name.Equals("Autre", StringComparison.OrdinalIgnoreCase) &&
|
||||
sousCategorieRaw.Contains(c.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
categoryId = category?.Id ?? fallbackCategory?.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
categoryId = fallbackCategory?.Id;
|
||||
}
|
||||
|
||||
validEntries.Add(new Entry
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
MonthId = monthId,
|
||||
Type = entryType,
|
||||
Amount = amount,
|
||||
Label = labelRaw,
|
||||
CategoryId = categoryId,
|
||||
EntryDate = entryDate,
|
||||
CreatedAt = DateTime.UtcNow
|
||||
});
|
||||
}
|
||||
|
||||
if (validEntries.Count > 0)
|
||||
{
|
||||
db.Entries.AddRange(validEntries);
|
||||
await db.SaveChangesAsync();
|
||||
_logger.LogInformation(
|
||||
"Imported {Count} entries for month {MonthId}.", validEntries.Count, monthId);
|
||||
}
|
||||
|
||||
return new ImportResultDto(validEntries.Count, errors.Count, errors);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using ExpenseTracker.Api.Data;
|
||||
using ExpenseTracker.Api.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OfficeOpenXml;
|
||||
using OfficeOpenXml.Style;
|
||||
|
||||
namespace ExpenseTracker.Api.Services;
|
||||
|
||||
public class ExportService
|
||||
{
|
||||
private readonly ILogger<ExportService> _logger;
|
||||
|
||||
public ExportService(ILogger<ExportService> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exports all entries for the given month as an Excel workbook.
|
||||
/// Returns the raw bytes of the .xlsx file.
|
||||
/// </summary>
|
||||
public async Task<byte[]> ExportMonthAsync(Guid monthId, AppDbContext db)
|
||||
{
|
||||
var month = await db.Months
|
||||
.AsNoTracking()
|
||||
.FirstOrDefaultAsync(m => m.Id == monthId);
|
||||
|
||||
var entries = await db.Entries
|
||||
.AsNoTracking()
|
||||
.Include(e => e.Category)
|
||||
.Where(e => e.MonthId == monthId)
|
||||
.OrderBy(e => e.EntryDate)
|
||||
.ThenBy(e => e.CreatedAt)
|
||||
.ToListAsync();
|
||||
|
||||
_logger.LogInformation("Exporting {Count} entries for month {MonthId}.", entries.Count, monthId);
|
||||
|
||||
using var package = new ExcelPackage();
|
||||
var ws = package.Workbook.Worksheets.Add("Saisies");
|
||||
|
||||
// ── Headers ──────────────────────────────────────────────────────────
|
||||
ws.Cells[1, 1].Value = "Date";
|
||||
ws.Cells[1, 2].Value = "Type";
|
||||
ws.Cells[1, 3].Value = "Libellé";
|
||||
ws.Cells[1, 4].Value = "Catégorie";
|
||||
ws.Cells[1, 5].Value = "Montant (€)";
|
||||
|
||||
using (var headerRange = ws.Cells[1, 1, 1, 5])
|
||||
{
|
||||
headerRange.Style.Font.Bold = true;
|
||||
headerRange.Style.Fill.PatternType = ExcelFillStyle.Solid;
|
||||
headerRange.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(59, 130, 212));
|
||||
headerRange.Style.Font.Color.SetColor(System.Drawing.Color.White);
|
||||
}
|
||||
|
||||
// ── Data rows ─────────────────────────────────────────────────────────
|
||||
int row = 2;
|
||||
foreach (var entry in entries)
|
||||
{
|
||||
ws.Cells[row, 1].Value = entry.EntryDate.ToString("yyyy-MM-dd");
|
||||
ws.Cells[row, 2].Value = entry.Type.ToString();
|
||||
ws.Cells[row, 3].Value = entry.Label;
|
||||
ws.Cells[row, 4].Value = entry.Category?.Name ?? string.Empty;
|
||||
ws.Cells[row, 5].Value = entry.Amount;
|
||||
ws.Cells[row, 5].Style.Numberformat.Format = "#,##0.00 [$€-40C]";
|
||||
row++;
|
||||
}
|
||||
|
||||
// ── Totals ────────────────────────────────────────────────────────────
|
||||
int totalRow = row + 1;
|
||||
|
||||
decimal totalIncome = entries.Where(e => e.Type == EntryType.INCOME).Sum(e => e.Amount);
|
||||
decimal totalExpense = entries.Where(e => e.Type == EntryType.EXPENSE).Sum(e => e.Amount);
|
||||
|
||||
ws.Cells[totalRow, 3].Value = "Total Entrées";
|
||||
ws.Cells[totalRow, 5].Value = totalIncome;
|
||||
ws.Cells[totalRow, 5].Style.Numberformat.Format = "#,##0.00 [$€-40C]";
|
||||
ws.Cells[totalRow, 3, totalRow, 5].Style.Font.Bold = true;
|
||||
|
||||
int expenseRow = totalRow + 1;
|
||||
ws.Cells[expenseRow, 3].Value = "Total Dépenses";
|
||||
ws.Cells[expenseRow, 5].Value = totalExpense;
|
||||
ws.Cells[expenseRow, 5].Style.Numberformat.Format = "#,##0.00 [$€-40C]";
|
||||
ws.Cells[expenseRow, 3, expenseRow, 5].Style.Font.Bold = true;
|
||||
|
||||
// ── Auto-fit columns ─────────────────────────────────────────────────
|
||||
ws.Cells[ws.Dimension?.Address ?? "A1:E1"].AutoFitColumns();
|
||||
|
||||
return await package.GetAsByteArrayAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the suggested filename for the export, e.g. "suivi-01-2024.xlsx".
|
||||
/// </summary>
|
||||
public static string GetFileName(int monthNumber, int year)
|
||||
=> $"suivi-{monthNumber:00}-{year}.xlsx";
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ExpenseTracker.Api.Validators;
|
||||
|
||||
public class CreateCategoryDtoValidator : AbstractValidator<CreateCategoryDto>
|
||||
{
|
||||
public CreateCategoryDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Name)
|
||||
.NotEmpty()
|
||||
.WithMessage("Name is required.")
|
||||
.MaximumLength(100)
|
||||
.WithMessage("Name must not exceed 100 characters.");
|
||||
|
||||
RuleFor(x => x.Color)
|
||||
.NotEmpty()
|
||||
.WithMessage("Color is required.")
|
||||
.Matches(@"^#[0-9A-Fa-f]{6}$")
|
||||
.WithMessage("Color must be a valid hex color in the format #RRGGBB.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ExpenseTracker.Api.Validators;
|
||||
|
||||
public class CreateEntryDtoValidator : AbstractValidator<CreateEntryDto>
|
||||
{
|
||||
public CreateEntryDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Type)
|
||||
.NotEmpty()
|
||||
.WithMessage("Type is required.")
|
||||
.Must(t => t == "INCOME" || t == "EXPENSE")
|
||||
.WithMessage("Type must be INCOME or EXPENSE.");
|
||||
|
||||
RuleFor(x => x.Amount)
|
||||
.GreaterThan(0)
|
||||
.WithMessage("Amount must be greater than 0.");
|
||||
|
||||
RuleFor(x => x.Label)
|
||||
.NotEmpty()
|
||||
.WithMessage("Label is required.")
|
||||
.MaximumLength(200)
|
||||
.WithMessage("Label must not exceed 200 characters.");
|
||||
|
||||
RuleFor(x => x.EntryDate)
|
||||
.NotEqual(default(DateOnly))
|
||||
.WithMessage("EntryDate is required.");
|
||||
|
||||
RuleFor(x => x.CategoryId)
|
||||
.NotNull()
|
||||
.WithMessage("CategoryId is required for EXPENSE entries.")
|
||||
.When(x => x.Type == "EXPENSE");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ExpenseTracker.Api.Validators;
|
||||
|
||||
public class CreateMonthDtoValidator : AbstractValidator<CreateMonthDto>
|
||||
{
|
||||
public CreateMonthDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Year)
|
||||
.GreaterThanOrEqualTo(2000)
|
||||
.WithMessage("Year must be 2000 or later.");
|
||||
|
||||
RuleFor(x => x.Month)
|
||||
.InclusiveBetween(1, 12)
|
||||
.WithMessage("Month must be between 1 and 12.");
|
||||
|
||||
RuleFor(x => x.DefaultSalary)
|
||||
.GreaterThanOrEqualTo(0)
|
||||
.WithMessage("DefaultSalary must be zero or positive.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ExpenseTracker.Api.Validators;
|
||||
|
||||
public class UpdateDefaultSalaryDtoValidator : AbstractValidator<UpdateDefaultSalaryDto>
|
||||
{
|
||||
public UpdateDefaultSalaryDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Value)
|
||||
.GreaterThanOrEqualTo(0)
|
||||
.WithMessage("Value must be greater than or equal to 0.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using ExpenseTracker.Api.DTOs;
|
||||
using FluentValidation;
|
||||
|
||||
namespace ExpenseTracker.Api.Validators;
|
||||
|
||||
public class UpdateEntryDtoValidator : AbstractValidator<UpdateEntryDto>
|
||||
{
|
||||
public UpdateEntryDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Type)
|
||||
.NotEmpty()
|
||||
.WithMessage("Type is required.")
|
||||
.Must(t => t == "INCOME" || t == "EXPENSE")
|
||||
.WithMessage("Type must be INCOME or EXPENSE.");
|
||||
|
||||
RuleFor(x => x.Amount)
|
||||
.GreaterThan(0)
|
||||
.WithMessage("Amount must be greater than 0.");
|
||||
|
||||
RuleFor(x => x.Label)
|
||||
.NotEmpty()
|
||||
.WithMessage("Label is required.")
|
||||
.MaximumLength(200)
|
||||
.WithMessage("Label must not exceed 200 characters.");
|
||||
|
||||
RuleFor(x => x.EntryDate)
|
||||
.NotEqual(default(DateOnly))
|
||||
.WithMessage("EntryDate is required.");
|
||||
|
||||
RuleFor(x => x.CategoryId)
|
||||
.NotNull()
|
||||
.WithMessage("CategoryId is required for EXPENSE entries.")
|
||||
.When(x => x.Type == "EXPENSE");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=localhost;Port=5432;Database=expensedb;Username=expenseuser;Password=changeme"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,950 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v8.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v8.0": {
|
||||
"ExpenseTracker.Api/1.0.0": {
|
||||
"dependencies": {
|
||||
"EPPlus": "8.7.0",
|
||||
"FluentValidation.AspNetCore": "11.3.1",
|
||||
"Microsoft.AspNetCore.OpenApi": "8.0.30",
|
||||
"Microsoft.EntityFrameworkCore.Design": "8.0.11",
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.11",
|
||||
"Swashbuckle.AspNetCore": "10.2.3"
|
||||
},
|
||||
"runtime": {
|
||||
"ExpenseTracker.Api.dll": {}
|
||||
}
|
||||
},
|
||||
"EPPlus/8.7.0": {
|
||||
"dependencies": {
|
||||
"EPPlus.Interfaces": "8.6.2",
|
||||
"Microsoft.Extensions.Configuration.Json": "8.0.1",
|
||||
"Microsoft.IO.RecyclableMemoryStream": "3.0.1",
|
||||
"System.Security.Cryptography.Pkcs": "8.0.1",
|
||||
"System.Security.Cryptography.Xml": "8.0.4"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/EPPlus.dll": {
|
||||
"assemblyVersion": "8.7.0.0",
|
||||
"fileVersion": "8.7.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"EPPlus.Interfaces/8.6.2": {
|
||||
"runtime": {
|
||||
"lib/net8.0/EPPlus.Interfaces.dll": {
|
||||
"assemblyVersion": "8.6.2.0",
|
||||
"fileVersion": "8.6.2.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"FluentValidation/11.11.0": {
|
||||
"runtime": {
|
||||
"lib/net8.0/FluentValidation.dll": {
|
||||
"assemblyVersion": "11.0.0.0",
|
||||
"fileVersion": "11.11.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"FluentValidation.AspNetCore/11.3.1": {
|
||||
"dependencies": {
|
||||
"FluentValidation": "11.11.0",
|
||||
"FluentValidation.DependencyInjectionExtensions": "11.11.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/FluentValidation.AspNetCore.dll": {
|
||||
"assemblyVersion": "11.0.0.0",
|
||||
"fileVersion": "11.3.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"FluentValidation.DependencyInjectionExtensions/11.11.0": {
|
||||
"dependencies": {
|
||||
"FluentValidation": "11.11.0",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/FluentValidation.DependencyInjectionExtensions.dll": {
|
||||
"assemblyVersion": "11.0.0.0",
|
||||
"fileVersion": "11.11.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Humanizer.dll": {
|
||||
"assemblyVersion": "2.14.0.0",
|
||||
"fileVersion": "2.14.1.48190"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi/8.0.30": {
|
||||
"dependencies": {
|
||||
"Microsoft.OpenApi": "2.7.5"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.AspNetCore.OpenApi.dll": {
|
||||
"assemblyVersion": "8.0.30.0",
|
||||
"fileVersion": "8.0.3026.37304"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Bcl.AsyncInterfaces/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Common/4.5.0": {
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.5.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.CodeAnalysis.CSharp": "4.5.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0",
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common": "4.5.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
|
||||
"Microsoft.CodeAnalysis.Common": "4.5.0",
|
||||
"System.Composition": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netcoreapp3.1/Microsoft.CodeAnalysis.Workspaces.dll": {
|
||||
"assemblyVersion": "4.5.0.0",
|
||||
"fileVersion": "4.500.23.10905"
|
||||
}
|
||||
},
|
||||
"resources": {
|
||||
"lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "cs"
|
||||
},
|
||||
"lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "de"
|
||||
},
|
||||
"lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "es"
|
||||
},
|
||||
"lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "fr"
|
||||
},
|
||||
"lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "it"
|
||||
},
|
||||
"lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ja"
|
||||
},
|
||||
"lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ko"
|
||||
},
|
||||
"lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pl"
|
||||
},
|
||||
"lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "pt-BR"
|
||||
},
|
||||
"lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "ru"
|
||||
},
|
||||
"lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "tr"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hans"
|
||||
},
|
||||
"lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll": {
|
||||
"locale": "zh-Hant"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore/8.0.11": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.11",
|
||||
"Microsoft.Extensions.Caching.Memory": "8.0.1",
|
||||
"Microsoft.Extensions.Logging": "8.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.dll": {
|
||||
"assemblyVersion": "8.0.11.0",
|
||||
"fileVersion": "8.0.1124.52104"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Abstractions/8.0.11": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.11.0",
|
||||
"fileVersion": "8.0.1124.52104"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Design/8.0.11": {
|
||||
"dependencies": {
|
||||
"Humanizer.Core": "2.14.1",
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces": "4.5.0",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "8.0.11",
|
||||
"Microsoft.Extensions.DependencyModel": "8.0.2",
|
||||
"Mono.TextTemplating": "2.2.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Design.dll": {
|
||||
"assemblyVersion": "8.0.11.0",
|
||||
"fileVersion": "8.0.1124.52104"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Relational/8.0.11": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "8.0.11"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.EntityFrameworkCore.Relational.dll": {
|
||||
"assemblyVersion": "8.0.11.0",
|
||||
"fileVersion": "8.0.1124.52104"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Memory/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Options": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Caching.Memory.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/8.0.1": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.724.31311"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Configuration.FileExtensions": "8.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Configuration.Json.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel/8.0.2": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.DependencyModel.dll": {
|
||||
"assemblyVersion": "8.0.0.2",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection": "8.0.1",
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2",
|
||||
"Microsoft.Extensions.Options": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.2": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.Extensions.Options.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.224.6711"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.IO.RecyclableMemoryStream/3.0.1": {
|
||||
"runtime": {
|
||||
"lib/net6.0/Microsoft.IO.RecyclableMemoryStream.dll": {
|
||||
"assemblyVersion": "3.0.1.0",
|
||||
"fileVersion": "3.0.1.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Microsoft.OpenApi/2.7.5": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Microsoft.OpenApi.dll": {
|
||||
"assemblyVersion": "2.7.5.0",
|
||||
"fileVersion": "2.7.5.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Mono.TextTemplating/2.2.1": {
|
||||
"dependencies": {
|
||||
"System.CodeDom": "4.4.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/Mono.TextTemplating.dll": {
|
||||
"assemblyVersion": "2.2.0.0",
|
||||
"fileVersion": "2.2.1.1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Npgsql/8.0.6": {
|
||||
"dependencies": {
|
||||
"Microsoft.Extensions.Logging.Abstractions": "8.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Npgsql.dll": {
|
||||
"assemblyVersion": "8.0.6.0",
|
||||
"fileVersion": "8.0.6.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL/8.0.11": {
|
||||
"dependencies": {
|
||||
"Microsoft.EntityFrameworkCore": "8.0.11",
|
||||
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.11",
|
||||
"Microsoft.EntityFrameworkCore.Relational": "8.0.11",
|
||||
"Npgsql": "8.0.6"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll": {
|
||||
"assemblyVersion": "8.0.11.0",
|
||||
"fileVersion": "8.0.11.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore/10.2.3": {
|
||||
"dependencies": {
|
||||
"Swashbuckle.AspNetCore.Swagger": "10.2.3",
|
||||
"Swashbuckle.AspNetCore.SwaggerGen": "10.2.3",
|
||||
"Swashbuckle.AspNetCore.SwaggerUI": "10.2.3"
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.Swagger/10.2.3": {
|
||||
"dependencies": {
|
||||
"Microsoft.OpenApi": "2.7.5"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Swashbuckle.AspNetCore.Swagger.dll": {
|
||||
"assemblyVersion": "10.2.3.0",
|
||||
"fileVersion": "10.2.3.2721"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerGen/10.2.3": {
|
||||
"dependencies": {
|
||||
"Swashbuckle.AspNetCore.Swagger": "10.2.3"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/Swashbuckle.AspNetCore.SwaggerGen.dll": {
|
||||
"assemblyVersion": "10.2.3.0",
|
||||
"fileVersion": "10.2.3.2721"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerUI/10.2.3": {
|
||||
"runtime": {
|
||||
"lib/net8.0/Swashbuckle.AspNetCore.SwaggerUI.dll": {
|
||||
"assemblyVersion": "10.2.3.0",
|
||||
"fileVersion": "10.2.3.2721"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.CodeDom/4.4.0": {
|
||||
"runtime": {
|
||||
"lib/netstandard2.0/System.CodeDom.dll": {
|
||||
"assemblyVersion": "4.0.0.0",
|
||||
"fileVersion": "4.6.25519.3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0",
|
||||
"System.Composition.Convention": "6.0.0",
|
||||
"System.Composition.Hosting": "6.0.0",
|
||||
"System.Composition.Runtime": "6.0.0",
|
||||
"System.Composition.TypedParts": "6.0.0"
|
||||
}
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.AttributedModel.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Convention/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Convention.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Hosting/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Hosting.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.Runtime.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Composition.TypedParts/6.0.0": {
|
||||
"dependencies": {
|
||||
"System.Composition.AttributedModel": "6.0.0",
|
||||
"System.Composition.Hosting": "6.0.0",
|
||||
"System.Composition.Runtime": "6.0.0"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/System.Composition.TypedParts.dll": {
|
||||
"assemblyVersion": "6.0.0.0",
|
||||
"fileVersion": "6.0.21.52210"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.Cryptography.Pkcs/8.0.1": {
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Security.Cryptography.Pkcs.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
},
|
||||
"runtimeTargets": {
|
||||
"runtimes/win/lib/net8.0/System.Security.Cryptography.Pkcs.dll": {
|
||||
"rid": "win",
|
||||
"assetType": "runtime",
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.1024.46610"
|
||||
}
|
||||
}
|
||||
},
|
||||
"System.Security.Cryptography.Xml/8.0.4": {
|
||||
"dependencies": {
|
||||
"System.Security.Cryptography.Pkcs": "8.0.1"
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0/System.Security.Cryptography.Xml.dll": {
|
||||
"assemblyVersion": "8.0.0.0",
|
||||
"fileVersion": "8.0.2926.32403"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"ExpenseTracker.Api/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
},
|
||||
"EPPlus/8.7.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-aNxtQ2O/zdt7aljXatMe2Oj7ez4j7fIYltR6/+TxMlBobD1aYnMf3QGGHxaE7kpdEeX/zadm3nilHHGK5LVZYg==",
|
||||
"path": "epplus/8.7.0",
|
||||
"hashPath": "epplus.8.7.0.nupkg.sha512"
|
||||
},
|
||||
"EPPlus.Interfaces/8.6.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-Xl1ncbV84UCz7QxcHuWjGa6PKXnOTwbC+y2ZdDqe5Zt5MbozWQINOwchcKW+agqx9Rybl2SQ3GdN1fbPIbjVOA==",
|
||||
"path": "epplus.interfaces/8.6.2",
|
||||
"hashPath": "epplus.interfaces.8.6.2.nupkg.sha512"
|
||||
},
|
||||
"FluentValidation/11.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-cyIVdQBwSipxWG8MA3Rqox7iNbUNUTK5bfJi9tIdm4CAfH71Oo5ABLP4/QyrUwuakqpUEPGtE43BDddvEehuYw==",
|
||||
"path": "fluentvalidation/11.11.0",
|
||||
"hashPath": "fluentvalidation.11.11.0.nupkg.sha512"
|
||||
},
|
||||
"FluentValidation.AspNetCore/11.3.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-FjkfrGGwC+25oH8QpX1ti3gxkFjDDtotkAQWyQz2CkwQwEfRKTANjhh77I79kY8dov2ydK1SY+e4jiOWsbbDdQ==",
|
||||
"path": "fluentvalidation.aspnetcore/11.3.1",
|
||||
"hashPath": "fluentvalidation.aspnetcore.11.3.1.nupkg.sha512"
|
||||
},
|
||||
"FluentValidation.DependencyInjectionExtensions/11.11.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-viTKWaMbL3yJYgGI0DiCeavNbE9UPMWFVK2XS9nYXGbm3NDMd0/L5ER4wBzmTtW3BYh3SrlSXm9RACiKZ6stlA==",
|
||||
"path": "fluentvalidation.dependencyinjectionextensions/11.11.0",
|
||||
"hashPath": "fluentvalidation.dependencyinjectionextensions.11.11.0.nupkg.sha512"
|
||||
},
|
||||
"Humanizer.Core/2.14.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw==",
|
||||
"path": "humanizer.core/2.14.1",
|
||||
"hashPath": "humanizer.core.2.14.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.AspNetCore.OpenApi/8.0.30": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-SkplhD18TzruiyyQ6JdI2+letDOhQ/1Zo4dGlsx2qp7o7lO44jPg2Yw/U4U3vZZFe3ae3JJav3Fm8lc1EFXqIg==",
|
||||
"path": "microsoft.aspnetcore.openapi/8.0.30",
|
||||
"hashPath": "microsoft.aspnetcore.openapi.8.0.30.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Bcl.AsyncInterfaces/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==",
|
||||
"path": "microsoft.bcl.asyncinterfaces/6.0.0",
|
||||
"hashPath": "microsoft.bcl.asyncinterfaces.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Common/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==",
|
||||
"path": "microsoft.codeanalysis.common/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.common.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==",
|
||||
"path": "microsoft.codeanalysis.csharp/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.CSharp.Workspaces/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-h74wTpmGOp4yS4hj+EvNzEiPgg/KVs2wmSfTZ81upJZOtPkJsVkgfsgtxxqmAeapjT/vLKfmYV0bS8n5MNVP+g==",
|
||||
"path": "microsoft.codeanalysis.csharp.workspaces/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.csharp.workspaces.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.CodeAnalysis.Workspaces.Common/4.5.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-l4dDRmGELXG72XZaonnOeORyD/T5RpEu5LGHOUIhnv+MmUWDY/m1kWXGwtcgQ5CJ5ynkFiRnIYzTKXYjUs7rbw==",
|
||||
"path": "microsoft.codeanalysis.workspaces.common/4.5.0",
|
||||
"hashPath": "microsoft.codeanalysis.workspaces.common.4.5.0.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore/8.0.11": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-stbjWBTtpQ1HtqXMFyKnXFTr76PvaOHI2b2h85JqBi3eZr00nspvR/a90Zwh8CQ4rVawqLiTG0+0yZQWaav+sQ==",
|
||||
"path": "microsoft.entityframeworkcore/8.0.11",
|
||||
"hashPath": "microsoft.entityframeworkcore.8.0.11.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Abstractions/8.0.11": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-++zY0Ea724ku1jptWJmF7jm3I4IXTexfT4qi1ETcSFFF7qj+qm6rRgN7mTuKkwIETuXk0ikfzudryRjUGrrNKQ==",
|
||||
"path": "microsoft.entityframeworkcore.abstractions/8.0.11",
|
||||
"hashPath": "microsoft.entityframeworkcore.abstractions.8.0.11.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Design/8.0.11": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KxOvpbaKiUmbLvenr0T/4F1Vdm0Sq+iajLbesQK7/WKB/Dx+FQHCZ0f5jCXrVWK2QKF9eHzQ5JPA1L6hcb25FQ==",
|
||||
"path": "microsoft.entityframeworkcore.design/8.0.11",
|
||||
"hashPath": "microsoft.entityframeworkcore.design.8.0.11.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.EntityFrameworkCore.Relational/8.0.11": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3TuuW3i5I4Ro0yoaHmi2MqEDGObOVuhLaMEnd/heaLB1fcvm4fu4PevmC4BOWnI0vo176AIlV5o4rEQciLoohw==",
|
||||
"path": "microsoft.entityframeworkcore.relational/8.0.11",
|
||||
"hashPath": "microsoft.entityframeworkcore.relational.8.0.11.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Caching.Memory/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-HFDnhYLccngrzyGgHkjEDU5FMLn4MpOsr5ElgsBMC4yx6lJh4jeWO7fHS8+TXPq+dgxCmUa/Trl8svObmwW4QA==",
|
||||
"path": "microsoft.extensions.caching.memory/8.0.1",
|
||||
"hashPath": "microsoft.extensions.caching.memory.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.FileExtensions/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-EJzSNO9oaAXnTdtdNO6npPRsIIeZCBSNmdQ091VDO7fBiOtJAAeEq6dtrVXIi3ZyjC5XRSAtVvF8SzcneRHqKQ==",
|
||||
"path": "microsoft.extensions.configuration.fileextensions/8.0.1",
|
||||
"hashPath": "microsoft.extensions.configuration.fileextensions.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Configuration.Json/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-L89DLNuimOghjV3tLx0ArFDwVEJD6+uGB3BMCMX01kaLzXkaXHb2021xOMl2QOxUxbdePKUZsUY7n2UUkycjRg==",
|
||||
"path": "microsoft.extensions.configuration.json/8.0.1",
|
||||
"hashPath": "microsoft.extensions.configuration.json.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-BmANAnR5Xd4Oqw7yQ75xOAYODybZQRzdeNucg7kS5wWKd2PNnMdYtJ2Vciy0QLylRmv42DGl5+AFL9izA6F1Rw==",
|
||||
"path": "microsoft.extensions.dependencyinjection/8.0.1",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==",
|
||||
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2",
|
||||
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.DependencyModel/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-mUBDZZRgZrSyFOsJ2qJJ9fXfqd/kXJwf3AiDoqLD9m6TjY5OO/vLNOb9fb4juC0487eq4hcGN/M2Rh/CKS7QYw==",
|
||||
"path": "microsoft.extensions.dependencymodel/8.0.2",
|
||||
"hashPath": "microsoft.extensions.dependencymodel.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-4x+pzsQEbqxhNf1QYRr5TDkLP9UsLT3A6MdRKDDEgrW7h1ljiEPgTNhKYUhNCCAaVpQECVQ+onA91PTPnIp6Lw==",
|
||||
"path": "microsoft.extensions.logging/8.0.1",
|
||||
"hashPath": "microsoft.extensions.logging.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==",
|
||||
"path": "microsoft.extensions.logging.abstractions/8.0.2",
|
||||
"hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.Extensions.Options/8.0.2": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-dWGKvhFybsaZpGmzkGCbNNwBD1rVlWzrZKANLW/CcbFJpCEceMCGzT7zZwHOGBCbwM0SzBuceMj5HN1LKV1QqA==",
|
||||
"path": "microsoft.extensions.options/8.0.2",
|
||||
"hashPath": "microsoft.extensions.options.8.0.2.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.IO.RecyclableMemoryStream/3.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==",
|
||||
"path": "microsoft.io.recyclablememorystream/3.0.1",
|
||||
"hashPath": "microsoft.io.recyclablememorystream.3.0.1.nupkg.sha512"
|
||||
},
|
||||
"Microsoft.OpenApi/2.7.5": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-0FA67RSnRM4tcBKqiqVu/HPdZ9+QOKbmeRjxRUGTCjPU4C0bmUhd97Dso7Yild5P7nOV6GxJ2xrK0Kv/O9xp0w==",
|
||||
"path": "microsoft.openapi/2.7.5",
|
||||
"hashPath": "microsoft.openapi.2.7.5.nupkg.sha512"
|
||||
},
|
||||
"Mono.TextTemplating/2.2.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==",
|
||||
"path": "mono.texttemplating/2.2.1",
|
||||
"hashPath": "mono.texttemplating.2.2.1.nupkg.sha512"
|
||||
},
|
||||
"Npgsql/8.0.6": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-KaS6CY5kY2Sd0P00MSeFcOI3t2DiQ4UWG8AuRpVOUeDWITOKfoEEG91DP3cmT6aerixPkjwKgXxnpDxIkDpO6g==",
|
||||
"path": "npgsql/8.0.6",
|
||||
"hashPath": "npgsql.8.0.6.nupkg.sha512"
|
||||
},
|
||||
"Npgsql.EntityFrameworkCore.PostgreSQL/8.0.11": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-leShR/O/nSIS3Jpj8yUBmkzaXzBbtlV326+MYkX2BwAj2qSNrUv/H6m8G9Hnv2zUkQYccTpmV5jIVq5vdciEUA==",
|
||||
"path": "npgsql.entityframeworkcore.postgresql/8.0.11",
|
||||
"hashPath": "npgsql.entityframeworkcore.postgresql.8.0.11.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore/10.2.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-8KNh1RWvofdU6DVLyBs4Z/OpUMnmf8oNvJQc0QxpwySRbi42bwLfdVMMrXZWANg5U5KQGQq1xW6r/hlcqw99tQ==",
|
||||
"path": "swashbuckle.aspnetcore/10.2.3",
|
||||
"hashPath": "swashbuckle.aspnetcore.10.2.3.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.Swagger/10.2.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1jUUs3WQnrS0FUtaZPLSy1yYMEwS1zlvDmvQ2/eldPHUANX0LJSLVZecCMgSMdeGiRqeaRrIXLtSz++TCiTMww==",
|
||||
"path": "swashbuckle.aspnetcore.swagger/10.2.3",
|
||||
"hashPath": "swashbuckle.aspnetcore.swagger.10.2.3.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerGen/10.2.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-y7t4coDRAeFYChmvlMRiH2OjbiRrm9AVIDgt17fQfs3x9PVAI5PiwWYOhg+4F13R4Q36WDc9lqfoOnNa3tNbGg==",
|
||||
"path": "swashbuckle.aspnetcore.swaggergen/10.2.3",
|
||||
"hashPath": "swashbuckle.aspnetcore.swaggergen.10.2.3.nupkg.sha512"
|
||||
},
|
||||
"Swashbuckle.AspNetCore.SwaggerUI/10.2.3": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-nthWONRs/FJ4yyG206g1cC52WEG8EqrjuMWjGdR+5XG7lbjFto6NqcI9EMICgVFom/UivIjUVwI76ZHbHwTPfQ==",
|
||||
"path": "swashbuckle.aspnetcore.swaggerui/10.2.3",
|
||||
"hashPath": "swashbuckle.aspnetcore.swaggerui.10.2.3.nupkg.sha512"
|
||||
},
|
||||
"System.CodeDom/4.4.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-2sCCb7doXEwtYAbqzbF/8UAeDRMNmPaQbU2q50Psg1J9KzumyVVCgKQY8s53WIPTufNT0DpSe9QRvVjOzfDWBA==",
|
||||
"path": "system.codedom/4.4.0",
|
||||
"hashPath": "system.codedom.4.4.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-d7wMuKQtfsxUa7S13tITC8n1cQzewuhD5iDjZtK2prwFfKVzdYtgrTHgjaV03Zq7feGQ5gkP85tJJntXwInsJA==",
|
||||
"path": "system.composition/6.0.0",
|
||||
"hashPath": "system.composition.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.AttributedModel/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-WK1nSDLByK/4VoC7fkNiFuTVEiperuCN/Hyn+VN30R+W2ijO1d0Z2Qm0ScEl9xkSn1G2MyapJi8xpf4R8WRa/w==",
|
||||
"path": "system.composition.attributedmodel/6.0.0",
|
||||
"hashPath": "system.composition.attributedmodel.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Convention/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-XYi4lPRdu5bM4JVJ3/UIHAiG6V6lWWUlkhB9ab4IOq0FrRsp0F4wTyV4Dj+Ds+efoXJ3qbLqlvaUozDO7OLeXA==",
|
||||
"path": "system.composition.convention/6.0.0",
|
||||
"hashPath": "system.composition.convention.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Hosting/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-w/wXjj7kvxuHPLdzZ0PAUt++qJl03t7lENmb2Oev0n3zbxyNULbWBlnd5J5WUMMv15kg5o+/TCZFb6lSwfaUUQ==",
|
||||
"path": "system.composition.hosting/6.0.0",
|
||||
"hashPath": "system.composition.hosting.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.Runtime/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-qkRH/YBaMPTnzxrS5RDk1juvqed4A6HOD/CwRcDGyPpYps1J27waBddiiq1y93jk2ZZ9wuA/kynM+NO0kb3PKg==",
|
||||
"path": "system.composition.runtime/6.0.0",
|
||||
"hashPath": "system.composition.runtime.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Composition.TypedParts/6.0.0": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-iUR1eHrL8Cwd82neQCJ00MpwNIBs4NZgXzrPqx8NJf/k4+mwBO0XCRmHYJT4OLSwDDqh5nBLJWkz5cROnrGhRA==",
|
||||
"path": "system.composition.typedparts/6.0.0",
|
||||
"hashPath": "system.composition.typedparts.6.0.0.nupkg.sha512"
|
||||
},
|
||||
"System.Security.Cryptography.Pkcs/8.0.1": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-CoCRHFym33aUSf/NtWSVSZa99dkd0Hm7OCZUxORBjRB16LNhIEOf8THPqzIYlvKM0nNDAPTRBa1FxEECrgaxxA==",
|
||||
"path": "system.security.cryptography.pkcs/8.0.1",
|
||||
"hashPath": "system.security.cryptography.pkcs.8.0.1.nupkg.sha512"
|
||||
},
|
||||
"System.Security.Cryptography.Xml/8.0.4": {
|
||||
"type": "package",
|
||||
"serviceable": true,
|
||||
"sha512": "sha512-1y+ROEEmEOACrQWqRi37GkGHOThPc31m7vezOySpPE9xXN2nTN6ndLYjylvy42aCtQq4owlYhcqaKpQKMDFKFg==",
|
||||
"path": "system.security.cryptography.xml/8.0.4",
|
||||
"hashPath": "system.security.cryptography.xml.8.0.4.nupkg.sha512"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"frameworks": [
|
||||
{
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
{
|
||||
"name": "Microsoft.AspNetCore.App",
|
||||
"version": "8.0.0"
|
||||
}
|
||||
],
|
||||
"configProperties": {
|
||||
"System.GC.Server": true,
|
||||
"System.Reflection.NullabilityInfoContext.IsSupported": true,
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"Version":1,"ManifestType":"Build","Endpoints":[]}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=localhost;Port=5432;Database=expensedb;Username=expenseuser;Password=changeme"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user