add financialInvoice Module
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="CheckoutAgg\ValueObjects\" />
|
||||
<Folder Include="FinancialInvoiceAgg\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.FinancialStatmentAgg;
|
||||
using CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
|
||||
namespace Company.Domain.FinancialInvoiceAgg;
|
||||
|
||||
@@ -55,10 +56,3 @@ public class FinancialInvoice:EntityBase
|
||||
|
||||
}
|
||||
|
||||
public enum FinancialInvoiceStatus
|
||||
{
|
||||
Unpaid = 0, // پرداخت نشده
|
||||
Paid = 1, // پرداخت شده کامل
|
||||
Cancelled = 4, // فاکتور لغو شده
|
||||
Refunded = 5, // بازپرداخت شده (در صورت برگشت وجه)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.FinancialInvoiceAgg;
|
||||
|
||||
public interface IFinancialInvoiceRepository:IRepository<long,FinancialInvoice>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
|
||||
public enum FinancialInvoiceStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// پرداخت نشده
|
||||
/// </summary>
|
||||
Unpaid = 0,
|
||||
/// <summary>
|
||||
/// پرداخت شده کامل
|
||||
/// </summary>
|
||||
Paid = 1,
|
||||
/// <summary>
|
||||
/// فاکتور لغو شده
|
||||
/// </summary>
|
||||
Cancelled = 4,
|
||||
/// <summary>
|
||||
/// // بازپرداخت شده (در صورت برگشت وجه)
|
||||
/// </summary>
|
||||
Refunded = 5,
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
|
||||
public interface IFinancialInvoiceApplication
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class FinancialInvoiceApplication:IFinancialInvoiceApplication
|
||||
{
|
||||
|
||||
}
|
||||
19
CompanyManagment.EFCore/Mapping/FinancialInvoiceMapping.cs
Normal file
19
CompanyManagment.EFCore/Mapping/FinancialInvoiceMapping.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Company.Domain.FinancialInvoiceAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class FinancialInvoiceMapping:IEntityTypeConfiguration<FinancialInvoice>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<FinancialInvoice> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.Status).HasConversion<string>().HasMaxLength(20);
|
||||
builder.Property(x => x.PaidAt).IsRequired(false);
|
||||
builder.Property(x => x.SmsCode).HasMaxLength(122);
|
||||
builder.HasOne(x => x.FinancialStatement).WithMany(x => x.FinancialInvoices)
|
||||
.HasForeignKey(x => x.FinancialStatementId).IsRequired(false);
|
||||
}
|
||||
}
|
||||
10013
CompanyManagment.EFCore/Migrations/20250715100203_Add financialInvoiceTable.Designer.cs
generated
Normal file
10013
CompanyManagment.EFCore/Migrations/20250715100203_Add financialInvoiceTable.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddfinancialInvoiceTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FinancialInvoice",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Month = table.Column<int>(type: "int", nullable: false),
|
||||
Year = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
|
||||
PaidAt = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Amount = table.Column<double>(type: "float", nullable: false),
|
||||
SmsCode = table.Column<string>(type: "nvarchar(122)", maxLength: 122, nullable: true),
|
||||
FinancialStatementId = table.Column<long>(type: "bigint", nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FinancialInvoice", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_FinancialInvoice_FinancialStatments_FinancialStatementId",
|
||||
column: x => x.FinancialStatementId,
|
||||
principalTable: "FinancialStatments",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FinancialInvoice_FinancialStatementId",
|
||||
table: "FinancialInvoice",
|
||||
column: "FinancialStatementId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FinancialInvoice");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2567,6 +2567,48 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("File_Titles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.FinancialInvoiceAgg.FinancialInvoice", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("FinancialStatementId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("PaidAt")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("SmsCode")
|
||||
.HasMaxLength(122)
|
||||
.HasColumnType("nvarchar(122)");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("FinancialStatementId");
|
||||
|
||||
b.ToTable("FinancialInvoice");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.FinancialStatmentAgg.FinancialStatment", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -9090,6 +9132,15 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("FileTiming");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.FinancialInvoiceAgg.FinancialInvoice", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.FinancialStatmentAgg.FinancialStatment", "FinancialStatement")
|
||||
.WithMany("FinancialInvoices")
|
||||
.HasForeignKey("FinancialStatementId");
|
||||
|
||||
b.Navigation("FinancialStatement");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.FinancialTransactionAgg.FinancialTransaction", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.FinancialStatmentAgg.FinancialStatment", "FinancialStatment")
|
||||
@@ -9769,6 +9820,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
modelBuilder.Entity("Company.Domain.FinancialStatmentAgg.FinancialStatment", b =>
|
||||
{
|
||||
b.Navigation("FinancialInvoices");
|
||||
|
||||
b.Navigation("FinancialTransactionList");
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.FinancialInvoiceAgg;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class FinancialInvoiceRepository:RepositoryBase<long,FinancialInvoice>,IFinancialInvoiceRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
public FinancialInvoiceRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,9 @@ using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.FinancialInvoiceAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using CompanyManagment.App.Contracts.FinancialInvoice;
|
||||
|
||||
namespace PersonalContractingParty.Config;
|
||||
|
||||
@@ -431,6 +433,9 @@ public class PersonalBootstrapper
|
||||
|
||||
services.AddTransient<IAdminMonthlyOverviewRepository, AdminMonthlyOverviewRepository>();
|
||||
services.AddTransient<IAdminMonthlyOverviewApplication, AdminMonthlyOverviewApplication>();
|
||||
|
||||
services.AddTransient<IFinancialInvoiceRepository, FinancialInvoiceRepository>();
|
||||
services.AddTransient<IFinancialInvoiceApplication, FinancialInvoiceApplication>();
|
||||
#endregion
|
||||
#region Pooya
|
||||
|
||||
|
||||
Reference in New Issue
Block a user