From c9362d2d825a11fb2f6189430edbb54cebf6bb65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C2=A8Rafael?= <¨rafaelkaua97@gmail.com¨>
Date: Sun, 5 Oct 2025 23:42:31 -0300
Subject: [PATCH 01/11] FIN-34 wip wallet crud
---
Fin.Domain/Wallets/Dtos/WalletInput.cs | 20 ++++++++
Fin.Domain/Wallets/Dtos/WalletOutput.cs | 15 ++++++
Fin.Domain/Wallets/Entities/Wallet.cs | 48 +++++++++++++++++++
.../Seeders/Seeders/DefaultMenusSeeder.cs | 11 +++++
4 files changed, 94 insertions(+)
create mode 100644 Fin.Domain/Wallets/Dtos/WalletInput.cs
create mode 100644 Fin.Domain/Wallets/Dtos/WalletOutput.cs
create mode 100644 Fin.Domain/Wallets/Entities/Wallet.cs
diff --git a/Fin.Domain/Wallets/Dtos/WalletInput.cs b/Fin.Domain/Wallets/Dtos/WalletInput.cs
new file mode 100644
index 0000000..76be974
--- /dev/null
+++ b/Fin.Domain/Wallets/Dtos/WalletInput.cs
@@ -0,0 +1,20 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace Fin.Domain.Wallets.Dtos;
+
+public class WalletInput
+{
+ [Required]
+ public string Name { get; set; }
+
+ [Required]
+ public string Color { get; set; }
+
+ [Required]
+ public string Icon { get; set; }
+
+ public Guid? FinancialInstitutionId { get; set; }
+
+ [Required]
+ public decimal InitialBalance { get; set; }
+}
\ No newline at end of file
diff --git a/Fin.Domain/Wallets/Dtos/WalletOutput.cs b/Fin.Domain/Wallets/Dtos/WalletOutput.cs
new file mode 100644
index 0000000..76b8e54
--- /dev/null
+++ b/Fin.Domain/Wallets/Dtos/WalletOutput.cs
@@ -0,0 +1,15 @@
+using Fin.Domain.Wallets.Entities;
+
+namespace Fin.Domain.Wallets.Dtos;
+
+public class WalletOutput(Wallet wallet)
+{
+ public Guid Id { get; set; } = wallet.Id;
+ public string Name { get; set; } = wallet.Name;
+ public string Color { get; set; } = wallet.Color;
+ public string Icon { get; set; } = wallet.Icon;
+ public bool Inactivated { get; set; } = wallet.Inactivated;
+ public Guid? FinancialInstitutionId { get; set; } = wallet.FinancialInstitutionId;
+ public decimal InitialBalance { get; set; } = wallet.InitialBalance;
+ public decimal CurrentBalance { get; set; } = wallet.CurrentBalance;
+}
\ No newline at end of file
diff --git a/Fin.Domain/Wallets/Entities/Wallet.cs b/Fin.Domain/Wallets/Entities/Wallet.cs
new file mode 100644
index 0000000..86b6180
--- /dev/null
+++ b/Fin.Domain/Wallets/Entities/Wallet.cs
@@ -0,0 +1,48 @@
+using Fin.Domain.Global.Interfaces;
+using Fin.Domain.Wallets.Dtos;
+
+namespace Fin.Domain.Wallets.Entities;
+
+public class Wallet: IAuditedTenantEntity
+{
+ 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 Guid TenantId { get; set; }
+
+ public string Name { get; private set; }
+ public string Color { get; private set; }
+ public string Icon { get; private set; }
+ public bool Inactivated { get; private set; }
+
+ public Guid? FinancialInstitutionId { get; private set; }
+
+ public decimal InitialBalance { get; private set; }
+ public decimal CurrentBalance { get; set; }
+
+ public Wallet()
+ {
+ }
+
+ public Wallet(WalletInput wallet)
+ {
+ Name = wallet.Name;
+ Color = wallet.Color;
+ Icon = wallet.Icon;
+ FinancialInstitutionId = wallet.FinancialInstitutionId;
+ InitialBalance = wallet.InitialBalance;
+ }
+
+ public void Update(WalletInput wallet)
+ {
+ Name = wallet.Name;
+ Color = wallet.Color;
+ Icon = wallet.Icon;
+ FinancialInstitutionId = wallet.FinancialInstitutionId;
+ InitialBalance = wallet.InitialBalance;
+ }
+
+ public void ToggleInactivated() => Inactivated = !Inactivated;
+}
\ No newline at end of file
diff --git a/Fin.Infrastructure/Seeders/Seeders/DefaultMenusSeeder.cs b/Fin.Infrastructure/Seeders/Seeders/DefaultMenusSeeder.cs
index 9478140..ae28fd5 100644
--- a/Fin.Infrastructure/Seeders/Seeders/DefaultMenusSeeder.cs
+++ b/Fin.Infrastructure/Seeders/Seeders/DefaultMenusSeeder.cs
@@ -18,6 +18,17 @@ public async Task SeedAsync()
var defaultMenus = new List