diff --git a/.idea/.idea.Fin-Backend/.idea/data_source_mapping.xml b/.idea/.idea.Fin-Backend/.idea/data_source_mapping.xml
deleted file mode 100644
index c970994..0000000
--- a/.idea/.idea.Fin-Backend/.idea/data_source_mapping.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Fin.Api/CardBrands/CardBrandController.cs b/Fin.Api/CardBrands/CardBrandController.cs
new file mode 100644
index 0000000..3ae78bb
--- /dev/null
+++ b/Fin.Api/CardBrands/CardBrandController.cs
@@ -0,0 +1,52 @@
+using Fin.Application.CardBrands;
+using Fin.Domain.Global.Classes;
+using Fin.Domain.CardBrands.Dtos;
+using Fin.Infrastructure.Authentications.Constants;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Fin.Api.CardBrands;
+
+[Route("card-brand")]
+[Authorize]
+public class CardBrandController(ICardBrandService service): ControllerBase
+{
+ [HttpGet]
+ public async Task> GetList([FromQuery] PagedFilteredAndSortedInput input)
+ {
+ return await service.GetList(input);
+ }
+
+
+ [HttpGet("{id:guid}")]
+ [Authorize(Roles = AuthenticationRoles.Admin)]
+ public async Task> Get([FromRoute] Guid id)
+ {
+ var menu = await service.Get(id);
+ return menu != null ? Ok(menu) : NotFound();
+ }
+
+ [HttpPost]
+ [Authorize(Roles = AuthenticationRoles.Admin)]
+ public async Task> Create([FromBody] CardBrandInput input)
+ {
+ var menu = await service.Create(input, autoSave: true);
+ return menu != null ? Created($"card-brand/{menu.Id}", menu) : UnprocessableEntity();
+ }
+
+ [HttpPut("{id:guid}")]
+ [Authorize(Roles = AuthenticationRoles.Admin)]
+ public async Task Update([FromRoute] Guid id, [FromBody] CardBrandInput input)
+ {
+ var updated = await service.Update(id, input, autoSave: true);
+ return updated ? Ok() : UnprocessableEntity();
+ }
+
+ [HttpDelete("{id:guid}")]
+ [Authorize(Roles = AuthenticationRoles.Admin)]
+ public async Task Delete([FromRoute] Guid id)
+ {
+ var deleted = await service.Delete(id, autoSave: true);
+ return deleted ? Ok() : UnprocessableEntity();
+ }
+}
\ No newline at end of file
diff --git a/Fin.Application/CardBrands/CardBrandService.cs b/Fin.Application/CardBrands/CardBrandService.cs
new file mode 100644
index 0000000..fdf84a6
--- /dev/null
+++ b/Fin.Application/CardBrands/CardBrandService.cs
@@ -0,0 +1,91 @@
+using Fin.Application.CardBrands;
+using Fin.Domain.Global.Classes;
+using Fin.Domain.CardBrands.Dtos;
+using Fin.Domain.CardBrands.Entities;
+using Fin.Infrastructure.AmbientDatas;
+using Fin.Infrastructure.AutoServices.Interfaces;
+using Fin.Infrastructure.Database.Extensions;
+using Fin.Infrastructure.Database.Repositories;
+using Microsoft.AspNetCore.Http;
+using Microsoft.EntityFrameworkCore;
+
+namespace Fin.Application.CardBrands;
+
+public interface ICardBrandService
+{
+ public Task Get(Guid id);
+ public Task> GetList(PagedFilteredAndSortedInput input);
+ public Task Create(CardBrandInput input, bool autoSave = false);
+ public Task Update(Guid id, CardBrandInput input, bool autoSave = false);
+ public Task Delete(Guid id, bool autoSave = false);
+ public Task> GetListForSideNav();
+}
+
+public class CardBrandService(
+ IRepository repository,
+ IAmbientData ambientData
+ ) : ICardBrandService, IAutoTransient
+{
+ public async Task Get(Guid id)
+ {
+ var entity = await repository.Query()
+ .FirstOrDefaultAsync(n => n.Id == id);
+ return entity != null ? new CardBrandOutput(entity) : null;
+ }
+
+ public async Task> GetList(PagedFilteredAndSortedInput input)
+ {
+ return await repository.Query(false)
+ .OrderBy(m => m.Name)
+ .ApplyFilterAndSorter(input)
+ .Select(n => new CardBrandOutput(n))
+ .ToPagedResult(input);
+ }
+
+ public async Task> GetListForSideNav()
+ {
+ return await repository.Query(false)
+ .OrderBy(m => m.Name)
+ .Select(m => new CardBrandOutput(m))
+ .ToListAsync();
+ }
+
+ public async Task Create(CardBrandInput input, bool autoSave = false)
+ {
+ ValidarInput(input);
+ var cardBrand = new CardBrand(input);
+ await repository.AddAsync(cardBrand, autoSave);
+ return new CardBrandOutput(cardBrand);
+ }
+
+ public async Task Update(Guid id, CardBrandInput input, bool autoSave = false)
+ {
+ ValidarInput(input);
+ var cardBrand = await repository.Query()
+ .FirstOrDefaultAsync(u => u.Id == id);
+ if (cardBrand == null) return false;
+
+ cardBrand.Update(input);
+ await repository.UpdateAsync(cardBrand, autoSave);
+
+ return true;
+ }
+
+ public async Task Delete(Guid id, bool autoSave = false)
+ {
+ var cardBrand = await repository.Query()
+ .FirstOrDefaultAsync(u => u.Id == id);
+ if (cardBrand == null) return false;
+
+ await repository.DeleteAsync(cardBrand, autoSave);
+ return true;
+ }
+
+ private static void ValidarInput(CardBrandInput input)
+ {
+ if (string.IsNullOrWhiteSpace(input.Name))
+ throw new BadHttpRequestException("Name is required");
+ if (string.IsNullOrWhiteSpace(input.Icon))
+ throw new BadHttpRequestException("Icon is required");
+ }
+}
\ No newline at end of file
diff --git a/Fin.Domain/CardBrands/Dtos/CardBrandInput.cs b/Fin.Domain/CardBrands/Dtos/CardBrandInput.cs
new file mode 100644
index 0000000..e0855e4
--- /dev/null
+++ b/Fin.Domain/CardBrands/Dtos/CardBrandInput.cs
@@ -0,0 +1,15 @@
+using System.ComponentModel.DataAnnotations;
+using Fin.Domain.Menus.Enums;
+
+namespace Fin.Domain.CardBrands.Dtos;
+
+public class CardBrandInput
+{
+ [Required]
+ public string Name { get; set; }
+
+ [Required]
+ public string Icon { get; set; }
+ public string Color { get; set; }
+
+}
\ No newline at end of file
diff --git a/Fin.Domain/CardBrands/Dtos/CardBrandOutput.cs b/Fin.Domain/CardBrands/Dtos/CardBrandOutput.cs
new file mode 100644
index 0000000..beb7243
--- /dev/null
+++ b/Fin.Domain/CardBrands/Dtos/CardBrandOutput.cs
@@ -0,0 +1,23 @@
+
+using Fin.Domain.CardBrands.Entities;
+
+public class CardBrandOutput
+{
+ public Guid Id { get; set; }
+ public string Name { get; set; }
+ public string Icon { get; set; }
+ public string Color { get; set; }
+
+
+ public CardBrandOutput()
+ {
+ }
+
+ public CardBrandOutput(CardBrand input)
+ {
+ Id = input.Id;
+ Name = input.Name;
+ Icon = input.Icon;
+ Color = input.Color;
+ }
+}
\ No newline at end of file
diff --git a/Fin.Domain/CardBrands/Entities/CardBrand.cs b/Fin.Domain/CardBrands/Entities/CardBrand.cs
new file mode 100644
index 0000000..64e951d
--- /dev/null
+++ b/Fin.Domain/CardBrands/Entities/CardBrand.cs
@@ -0,0 +1,36 @@
+using Fin.Domain.CardBrands.Dtos;
+using Fin.Domain.Global.Interfaces;
+
+namespace Fin.Domain.CardBrands.Entities;
+
+public class CardBrand: IAuditedEntity
+{
+ public string Name { get; set; }
+ public string Icon { get; set; }
+ public string Color { get; set; }
+
+ public Guid Id { get; set; }
+ public Guid CreatedBy { get; set; }
+ public Guid UpdatedBy { get; set; }
+ public DateTime CreatedAt { get; set; }
+ public DateTime UpdatedAt { get; set; }
+
+ public CardBrand()
+ {
+ }
+
+ public CardBrand(CardBrandInput input)
+ {
+ Name = input.Name;
+ Icon = input.Icon;
+ Color = input.Color;
+ }
+
+ public void Update(CardBrandInput input)
+ {
+ Name = input.Name;
+ Icon = input.Icon;
+ Color = input.Color;
+
+ }
+}
diff --git a/Fin.Domain/Fin.Domain.csproj b/Fin.Domain/Fin.Domain.csproj
index 7b8dbdc..6005f43 100644
--- a/Fin.Domain/Fin.Domain.csproj
+++ b/Fin.Domain/Fin.Domain.csproj
@@ -5,4 +5,8 @@
enable
+
+
+
+
diff --git a/Fin.Infrastructure/Database/Configurations/CardBrands/CardBrandConfiguration.cs b/Fin.Infrastructure/Database/Configurations/CardBrands/CardBrandConfiguration.cs
new file mode 100644
index 0000000..0735b7e
--- /dev/null
+++ b/Fin.Infrastructure/Database/Configurations/CardBrands/CardBrandConfiguration.cs
@@ -0,0 +1,16 @@
+using Fin.Domain.CardBrands.Entities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace Fin.Infrastructure.Database.Configurations.CardBrands;
+
+public class CardBrandConfiguration: IEntityTypeConfiguration
+{
+ public void Configure(EntityTypeBuilder builder)
+ {
+ builder.HasKey(x => x.Id);
+ builder.Property(x => x.Name).HasMaxLength(100).IsRequired();
+ builder.Property(x => x.Icon).HasMaxLength(20).IsRequired();
+ builder.Property(x => x.Color).HasMaxLength(20);
+ }
+}
\ No newline at end of file
diff --git a/Fin.Infrastructure/Database/FinDbContext.cs b/Fin.Infrastructure/Database/FinDbContext.cs
index eb8edbf..9b268d0 100644
--- a/Fin.Infrastructure/Database/FinDbContext.cs
+++ b/Fin.Infrastructure/Database/FinDbContext.cs
@@ -1,4 +1,5 @@
using System.Reflection;
+using Fin.Domain.CardBrands.Entities;
using Fin.Domain.Global.Interfaces;
using Fin.Domain.Menus.Entities;
using Fin.Domain.Notifications;
@@ -30,8 +31,8 @@ public class FinDbContext : DbContext
public DbSet