This commit is contained in:
@@ -23,8 +23,8 @@ SERVER
|
|||||||
- BUMP AyaNova.csproj version number
|
- BUMP AyaNova.csproj version number
|
||||||
- BUILD RELEASE Run buildrelease.bat in server project folder
|
- BUILD RELEASE Run buildrelease.bat in server project folder
|
||||||
|
|
||||||
https://www.ayanova.com/Downloads/v8/ayanova8.alpha.124-win-x64.7z
|
https://www.ayanova.com/Downloads/v8/ayanova8.alpha.125-win-x64.7z
|
||||||
https://www.ayanova.com/Downloads/v8/migrate124.7z **ARCHIVE IT, otherwise it could be false positived
|
https://www.ayanova.com/Downloads/v8/migrate125.7z **ARCHIVE IT, otherwise it could be false positived
|
||||||
|
|
||||||
- COPY TO DEVOPS SERVER
|
- COPY TO DEVOPS SERVER
|
||||||
NOTE: if need to replace "files" subfolder on server the rights need to be set to 775
|
NOTE: if need to replace "files" subfolder on server the rights need to be set to 775
|
||||||
|
|||||||
@@ -321,11 +321,11 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get Unit Contract name/id if active and not expired
|
/// Get Unit info required for service workorder on selection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">UnitId</param>
|
/// <param name="id">UnitId</param>
|
||||||
/// <returns>Contract name and Id</returns>
|
/// <returns>Contract name and Id, meter reading status</returns>
|
||||||
[HttpGet("active-contract/{id}")]
|
[HttpGet("work-order-info/{id}")]
|
||||||
public async Task<IActionResult> GetUnitActiveContract([FromRoute] long id)
|
public async Task<IActionResult> GetUnitActiveContract([FromRoute] long id)
|
||||||
{
|
{
|
||||||
if (!serverState.IsOpen)
|
if (!serverState.IsOpen)
|
||||||
@@ -335,19 +335,20 @@ namespace AyaNova.Api.Controllers
|
|||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
return BadRequest(new ApiErrorResponse(ModelState));
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
|
||||||
var ret = new NameIdItem { Name = string.Empty, Id = 0 };
|
//Get contract info
|
||||||
var UnitContractInfo = await ct.Unit.AsNoTracking().Where(x => x.Id == id).Select(x => new { x.ContractId, x.ContractExpires }).FirstOrDefaultAsync();
|
var retContract = new NameIdItem { Name = string.Empty, Id = 0 };
|
||||||
if (UnitContractInfo == null || UnitContractInfo.ContractExpires < DateTime.UtcNow)//none or expired
|
var UnitInfo = await ct.Unit.AsNoTracking().Where(x => x.Id == id).Select(x => new { x.ContractId, x.ContractExpires, x.Metered }).FirstOrDefaultAsync();
|
||||||
return Ok(ApiOkResponse.Response(ret));
|
if (UnitInfo != null && UnitInfo.ContractExpires >= DateTime.UtcNow)//has valid contract
|
||||||
|
{
|
||||||
|
var c = await ct.Contract.AsNoTracking().FirstOrDefaultAsync(x => x.Id == UnitInfo.ContractId);
|
||||||
|
if (c != null && c.Active != false)
|
||||||
|
{
|
||||||
|
retContract.Name = c.Name;
|
||||||
|
retContract.Id = c.Id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var c = await ct.Contract.AsNoTracking().FirstOrDefaultAsync(x => x.Id == UnitContractInfo.ContractId);
|
return Ok(ApiOkResponse.Response(new{contract=retContract,IsMetered=UnitInfo.Metered}));
|
||||||
if (c == null || c.Active == false)
|
|
||||||
return Ok(ApiOkResponse.Response(ret));
|
|
||||||
|
|
||||||
ret.Name = c.Name;
|
|
||||||
ret.Id = c.Id;
|
|
||||||
|
|
||||||
return Ok(ApiOkResponse.Response(ret));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace AyaNova.Util
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static class AyaNovaVersion
|
internal static class AyaNovaVersion
|
||||||
{
|
{
|
||||||
public const string VersionString = "8.0.0-alpha.124";
|
public const string VersionString = "8.0.0-alpha.125";
|
||||||
public const string FullNameAndVersion = "AyaNova server " + VersionString;
|
public const string FullNameAndVersion = "AyaNova server " + VersionString;
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user