fix creation for institutioncontract on Not Authorized contracting party
This commit is contained in:
@@ -324,6 +324,7 @@ public class InstitutionContractCreationWorkshopsResponse
|
|||||||
{
|
{
|
||||||
public List<WorkshopTempViewModel> WorkshopTemps { get; set; }
|
public List<WorkshopTempViewModel> WorkshopTemps { get; set; }
|
||||||
public string TotalAmount { get; set; }
|
public string TotalAmount { get; set; }
|
||||||
|
public Guid TempId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstitutionContractCreationWorkshopsRequest
|
public class InstitutionContractCreationWorkshopsRequest
|
||||||
|
|||||||
@@ -4363,10 +4363,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
var creationTemp = await _institutionContractCreationTemp.Find(x => x.Id == request.TempId)
|
var creationTemp = await _institutionContractCreationTemp.Find(x => x.Id == request.TempId)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
// creationTemp.SetContractingPartyInfo(request.LegalType,request.RealParty,request.LegalParty);
|
// creationTemp.SetContractingPartyInfo(request.LegalType,request.RealParty,request.LegalParty);
|
||||||
|
bool tempCreated = false;
|
||||||
if (creationTemp == null)
|
if (creationTemp == null)
|
||||||
{
|
{
|
||||||
throw new BadRequestException("دیتای درخواست شده نامعتبر است");
|
creationTemp = new InstitutionContractCreationTemp();
|
||||||
|
await _institutionContractCreationTemp.InsertOneAsync(creationTemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<WorkshopTempViewModel> workshopDetails = [];
|
List<WorkshopTempViewModel> workshopDetails = [];
|
||||||
@@ -4460,7 +4461,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
|||||||
var res = new InstitutionContractCreationWorkshopsResponse()
|
var res = new InstitutionContractCreationWorkshopsResponse()
|
||||||
{
|
{
|
||||||
TotalAmount = workshopDetails.Sum(x => x.WorkshopServicesAmount).ToMoney(),
|
TotalAmount = workshopDetails.Sum(x => x.WorkshopServicesAmount).ToMoney(),
|
||||||
WorkshopTemps = workshopDetails
|
WorkshopTemps = workshopDetails,
|
||||||
|
TempId = creationTemp.Id
|
||||||
};
|
};
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user