add InstitutionContractContactInfoTemp entity and repository
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public interface IInstitutionContractContactInfoTempRepository : IRepository<long, InstitutionContractContactInfoTemp>
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.TemporaryClientRegistrationAgg;
|
||||
|
||||
public class InstitutionContractContactInfoTemp : EntityBase
|
||||
{
|
||||
public InstitutionContractContactInfoTemp(string phoneType, string position, string phoneNumber,
|
||||
string fullName, long institutionContractTempId, bool sendSms)
|
||||
{
|
||||
PhoneType = phoneType;
|
||||
Position = position;
|
||||
PhoneNumber = phoneNumber;
|
||||
FullName = fullName;
|
||||
InstitutionContractTempId = institutionContractTempId;
|
||||
SendSms = sendSms;
|
||||
}
|
||||
|
||||
public string PhoneType { get; private set; }
|
||||
public long InstitutionContractTempId { get; private set; }
|
||||
public string Position { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
public bool SendSms { get; private set; }
|
||||
public InstitutionContractTemp InstitutionContractTemp { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.Domain;
|
||||
@@ -104,6 +105,8 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// </summary>
|
||||
public DateTime? VerifyCodeEndTime{ get; private set; }
|
||||
|
||||
public List<InstitutionContractContactInfoTemp> ContactInfoList { get; set; }
|
||||
|
||||
|
||||
public void Edit(long contractingPartyTempId, string paymentModel, string periodModel, double totalPayment, DateTime contractStartGr, DateTime contractEndGr, string officialCompany, double valueAddedTax, string verifyCode, string registrationStatus, int messageId, DateTime? sendVerifyCodeTime, DateTime? verifyCodeEndTime)
|
||||
{
|
||||
|
||||
@@ -195,6 +195,8 @@ public class CompanyContext : DbContext
|
||||
public DbSet<PaymentInstrument> PaymentInstruments { get; set; }
|
||||
public DbSet<PaymentInstrumentGroup> PaymentInstrumentGroups { get; set; }
|
||||
|
||||
public DbSet<InstitutionContractContactInfoTemp> InstitutionContractContactInfoTemps { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class InstitutionContractContactInfoTempMapping : IEntityTypeConfiguration<InstitutionContractContactInfoTemp>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<InstitutionContractContactInfoTemp> builder)
|
||||
{
|
||||
builder.ToTable("InstitutionContractContactInfoTemp");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.FullName).HasMaxLength(50);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
builder.Property(x => x.PhoneType).HasMaxLength(20);
|
||||
builder.Property(x => x.Position).HasMaxLength(50);
|
||||
builder.HasOne(x => x.InstitutionContractTemp)
|
||||
.WithMany(x => x.ContactInfoList)
|
||||
.HasForeignKey(x => x.InstitutionContractTempId);
|
||||
}
|
||||
}
|
||||
10262
CompanyManagment.EFCore/Migrations/20250812101131_AddInstitutionContractContactInfoTemp.Designer.cs
generated
Normal file
10262
CompanyManagment.EFCore/Migrations/20250812101131_AddInstitutionContractContactInfoTemp.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 AddInstitutionContractContactInfoTemp : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InstitutionContractContactInfoTemp",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
PhoneType = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
InstitutionContractTempId = table.Column<long>(type: "bigint", nullable: false),
|
||||
Position = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
SendSms = table.Column<bool>(type: "bit", nullable: false),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InstitutionContractContactInfoTemp", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_InstitutionContractContactInfoTemp_InstitutionContractTemps_InstitutionContractTempId",
|
||||
column: x => x.InstitutionContractTempId,
|
||||
principalTable: "InstitutionContractTemps",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InstitutionContractContactInfoTemp_InstitutionContractTempId",
|
||||
table: "InstitutionContractContactInfoTemp",
|
||||
column: "InstitutionContractTempId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "InstitutionContractContactInfoTemp");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5386,6 +5386,46 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<long>("InstitutionContractTempId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("PhoneType")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Position")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("SendSms")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InstitutionContractTempId");
|
||||
|
||||
b.ToTable("InstitutionContractContactInfoTemp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -9739,6 +9779,17 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkCategory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractContactInfoTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", "InstitutionContractTemp")
|
||||
.WithMany("ContactInfoList")
|
||||
.HasForeignKey("InstitutionContractTempId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("InstitutionContractTemp");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopServicesTemp", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", "WorkshopTemp")
|
||||
@@ -10122,6 +10173,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("TaxLeftWorkItemList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.InstitutionContractTemp", b =>
|
||||
{
|
||||
b.Navigation("ContactInfoList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.TemporaryClientRegistrationAgg.WorkshopTemp", b =>
|
||||
{
|
||||
b.Navigation("WorkshopServicesTemps");
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.TemporaryClientRegistrationAgg;
|
||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class InstitutionContractContactInfoTempRepository : RepositoryBase<long, InstitutionContractContactInfoTemp>, IInstitutionContractContactInfoTempRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
public InstitutionContractContactInfoTempRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user