feat: add verification status and amendment tracking to institution contract models
This commit is contained in:
@@ -77,5 +77,5 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
Task<List<InstitutionContractPrintViewModel>> PrintAllAsync(List<long> ids);
|
||||
Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request);
|
||||
Task<GetInstitutionVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId);
|
||||
Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ public class GetInstitutionVerificationDetailsWorkshopsViewModel
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int PersonnelCount { get; set; }
|
||||
|
||||
public WorkshopServicesViewModel OldServices { get; set; }
|
||||
public WorkshopServicesViewModel Services { get; set; }
|
||||
public string Price { get; set; }
|
||||
}
|
||||
@@ -260,6 +260,15 @@ public class GetInstitutionAmendmentVerificationDetailsViewModel
|
||||
public InstitutionContratVerificationParty FirstParty { get; set; }
|
||||
public InstitutionContratVerificationParty SecondParty { get; set; }
|
||||
public string ContractNo { get; set; }
|
||||
public string AmendmentCreationDate { get; set; }
|
||||
public string AmendmentStart { get; set; }
|
||||
public string AmendmentEnd { get; set; }
|
||||
public List<GetInstitutionVerificationDetailsWorkshopsViewModel> Workshops { get; set; }
|
||||
public string TotalPrice { get; set; }
|
||||
public string TaxPrice { get; set; }
|
||||
public string PaymentPrice { get; set; }
|
||||
public List<InstitutionContractInstallmentViewModel> Installments { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1387,9 +1387,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return (await _institutionContractRepository.PrintAllAsync([id])).FirstOrDefault();
|
||||
}
|
||||
|
||||
public Task<GetInstitutionVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId)
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId)
|
||||
{
|
||||
return _institutionContractRepository.GetAmendmentVerificationDetails(id,amendmentId);
|
||||
return await _institutionContractRepository.GetAmendmentVerificationDetails(id,amendmentId);
|
||||
}
|
||||
|
||||
public async Task AmendmentComplete(InstitutionContractAmendmentCompleteRequest request)
|
||||
|
||||
@@ -14,6 +14,8 @@ public class InstitutionContractAmendmentMapping:IEntityTypeConfiguration<Instit
|
||||
builder.Property(x => x.VerifyCode).HasMaxLength(10);
|
||||
builder.Property(x => x.VerifierFullName).HasMaxLength(100);
|
||||
builder.Property(x => x.VerifierPhoneNumber).HasMaxLength(20);
|
||||
|
||||
builder.Property(x=>x.VerificationStatus).HasConversion<string>().HasMaxLength(50);
|
||||
|
||||
builder.HasOne(x => x.InstitutionContract)
|
||||
.WithMany(x => x.Amendments)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddIsAmendmentininstitutioncontractWorkshopDetials : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "WorkshopDetailsId",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
newName: "CurrentWorkshopId");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopInitials",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopCurrents",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "VerificationStatus",
|
||||
table: "InstitutionContractAmendments",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "HasRollCallInPerson",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
type: "bit",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PersonnelCountDifference",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopInitials");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAmendment",
|
||||
table: "InstitutionContractWorkshopCurrents");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VerificationStatus",
|
||||
table: "InstitutionContractAmendments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HasRollCallInPerson",
|
||||
table: "InstitutionContractAmendmentChange");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PersonnelCountDifference",
|
||||
table: "InstitutionContractAmendmentChange");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "CurrentWorkshopId",
|
||||
table: "InstitutionContractAmendmentChange",
|
||||
newName: "WorkshopDetailsId");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3255,6 +3255,11 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("VerificationCreation")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("VerificationStatus")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("VerifierFullName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -3294,6 +3299,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long?>("CurrentWorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool?>("HasContractPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -3309,6 +3317,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool?>("HasInsurancePlanInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool?>("HasRollCallInPerson")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool?>("HasRollCallPlan")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -3318,8 +3329,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<int?>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long?>("WorkshopDetailsId")
|
||||
.HasColumnType("bigint");
|
||||
b.Property<int>("PersonnelCountDifference")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
@@ -3386,6 +3397,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractWorkshopGroupId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsAmendment")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -3451,6 +3465,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractWorkshopGroupId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("IsAmendment")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PersonnelCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
|
||||
@@ -2888,7 +2888,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
}
|
||||
|
||||
public async Task<GetInstitutionVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id, long amendmentId)
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id,
|
||||
long amendmentId)
|
||||
{
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x => x.Amendments)
|
||||
@@ -2904,10 +2905,10 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
if (amendment.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify)
|
||||
throw new BadRequestException("این ارتقا قبلا تایید شده است");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
throw new NotImplementedException();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -573,7 +573,7 @@ public class institutionContractController : AdminBaseController
|
||||
/// <returns></returns>
|
||||
[HttpGet("/api/institutionContract/amendment-Verification/{id:guid}/{amendmentId:long}")]
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<GetInstitutionVerificationDetailsViewModel>> GetAmendmentVerificationDetails(Guid id,long amendmentId)
|
||||
public async Task<GetInstitutionAmendmentVerificationDetailsViewModel> GetAmendmentVerificationDetails(Guid id,long amendmentId)
|
||||
{
|
||||
return await _institutionContractApplication.GetAmendmentVerificationDetails(id,amendmentId);
|
||||
}
|
||||
@@ -582,10 +582,11 @@ public class institutionContractController : AdminBaseController
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<OperationResult>> VerifyAmendment([FromBody] InstitutionVerificationRequest command)
|
||||
{
|
||||
var res = await _institutionContractApplication.AmendmentVerifyOtp(command.Id, command.Code);
|
||||
return res;
|
||||
throw new NotImplementedException();
|
||||
//var res = await _institutionContractApplication.AmendmentVerifyOtp(command.Id, command.Code);
|
||||
//return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
[HttpGet("edit-old/{id}")]
|
||||
|
||||
@@ -737,7 +737,7 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
x.PersonnelCount,
|
||||
x.Price, x.InstitutionContractWorkshopGroupId,
|
||||
group,
|
||||
x.WorkshopId.Value);
|
||||
x.WorkshopId.Value,false);
|
||||
entity.SetEmployers(x.Employers.Select(e => e.EmployerId).ToList());
|
||||
|
||||
return entity;
|
||||
|
||||
Reference in New Issue
Block a user