fixes the compile and timestamps to db
This commit is contained in:
parent
abfc68a809
commit
bed9c8a272
15 changed files with 36 additions and 36 deletions
|
|
@ -53,18 +53,18 @@ namespace Yavsc.ApiControllers
|
|||
|
||||
[HttpGet("facture-{billingCode}-{id}.pdf"), Authorize]
|
||||
public async Task<IActionResult> GetPdf(string billingCode, long id)
|
||||
{
|
||||
{
|
||||
var bill = await billingService.GetBillAsync(billingCode, id);
|
||||
|
||||
if ( authorizationService.AuthorizeAsync(User, bill, new ReadPermission()).IsFaulted)
|
||||
{
|
||||
return new ChallengeResult();
|
||||
}
|
||||
|
||||
|
||||
var fi = bill.GetBillInfo(billingService);
|
||||
|
||||
if (!fi.Exists) return Ok(new { Error = "Not generated" });
|
||||
return File(fi.OpenRead(), "application/x-pdf", fi.Name);
|
||||
return File(fi.OpenRead(), "application/x-pdf", fi.Name);
|
||||
}
|
||||
|
||||
[HttpGet("facture-{billingCode}-{id}.tex"), Authorize]
|
||||
|
|
@ -90,7 +90,7 @@ namespace Yavsc.ApiControllers
|
|||
public async Task<IActionResult> GeneratePdf(string billingCode, long id)
|
||||
{
|
||||
var bill = await billingService.GetBillAsync(billingCode, id);
|
||||
|
||||
|
||||
if (bill==null) {
|
||||
logger.LogCritical ( $"# not found !! {id} in {billingCode}");
|
||||
return this.NotFound();
|
||||
|
|
@ -111,20 +111,20 @@ namespace Yavsc.ApiControllers
|
|||
return new BadRequestResult();
|
||||
if (!(await authorizationService.AuthorizeAsync(User, estimate, new ReadPermission())).Succeeded)
|
||||
|
||||
|
||||
|
||||
{
|
||||
return new ChallengeResult();
|
||||
}
|
||||
if (Request.Form.Files.Count!=1)
|
||||
return new BadRequestResult();
|
||||
await User.ReceiveProSignatureAsync(billingCode,id,Request.Form.Files[0],"pro");
|
||||
estimate.ProviderValidationDate = DateTime.Now;
|
||||
estimate.ProviderValidationDate = DateTime.UtcNow;
|
||||
dbContext.SaveChanges(User.GetUserId());
|
||||
// Notify the client
|
||||
var locstr = _localizer["EstimationMessageToClient"];
|
||||
|
||||
var yaev = new EstimationEvent(estimate,_localizer);
|
||||
|
||||
|
||||
var regids = new [] { estimate.Client.Id };
|
||||
bool gcmSent = false;
|
||||
var grep = await _GCMSender.NotifyEstimateAsync(regids,yaev);
|
||||
|
|
@ -138,7 +138,7 @@ namespace Yavsc.ApiControllers
|
|||
// For authorization purpose
|
||||
var estimate = dbContext.Estimates.FirstOrDefault(e=>e.Id == id);
|
||||
if (!(await authorizationService.AuthorizeAsync(User, estimate, new ReadPermission())).Succeeded)
|
||||
|
||||
|
||||
{
|
||||
return new ChallengeResult();
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ namespace Yavsc.ApiControllers
|
|||
if (Request.Form.Files.Count!=1)
|
||||
return new BadRequestResult();
|
||||
await User.ReceiveProSignatureAsync(billingCode,id,Request.Form.Files[0],"cli");
|
||||
estimate.ClientValidationDate = DateTime.Now;
|
||||
estimate.ClientValidationDate = DateTime.UtcNow;
|
||||
dbContext.SaveChanges(User.GetUserId());
|
||||
return Ok (new { ClientValidationDate = estimate.ClientValidationDate });
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ namespace Yavsc.ApiControllers
|
|||
{
|
||||
return new ChallengeResult();
|
||||
}
|
||||
|
||||
|
||||
var filename = AbstractFileSystemHelpers.SignFileNameFormat("pro", billingCode, id);
|
||||
FileInfo fi = new FileInfo(Path.Combine(AbstractFileSystemHelpers.UserBillsDirName, filename));
|
||||
if (!fi.Exists) return NotFound(new { Error = "Professional signature not found" });
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace Yavsc.Controllers
|
|||
public IEnumerable<RdvQueryProviderInfo> GetCommands(long maxId=long.MaxValue)
|
||||
{
|
||||
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
var now = DateTime.Now;
|
||||
var now = DateTime.UtcNow;
|
||||
|
||||
var result = _context.RdvQueries.Include(c => c.Location).
|
||||
Include(c => c.Client).Where(c => c.PerformerId == uid && c.Id < maxId && c.EventDate > now
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
query.ValidationDate = DateTime.Now;
|
||||
query.ValidationDate = DateTime.UtcNow;
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
_context.Entry(query).State = EntityState.Detached;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace Yavsc.ApiControllers
|
|||
|
||||
var uid = User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||
|
||||
var now = DateTime.Now;
|
||||
var now = DateTime.UtcNow;
|
||||
var result = _context.HairCutQueries
|
||||
.Include(q => q.Prestation)
|
||||
.Include(q => q.Client)
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ public class NativeConfidentialController : Controller
|
|||
_logger.LogError("Invalid model for GCMD");
|
||||
return new BadRequestObjectResult(ModelState);
|
||||
}
|
||||
declaration.LatestActivityUpdate = DateTime.Now;
|
||||
declaration.LatestActivityUpdate = DateTime.UtcNow;
|
||||
|
||||
_logger.LogInformation($"Registering device with id:{declaration.DeviceId} for {uid}");
|
||||
DeviceDeclaration? alreadyRegisteredDevice = _context.DeviceDeclaration.FirstOrDefault(d => d.DeviceId == declaration.DeviceId);
|
||||
var deviceAlreadyRegistered = (alreadyRegisteredDevice!=null);
|
||||
if (alreadyRegisteredDevice==null)
|
||||
{
|
||||
declaration.DeclarationDate = DateTime.Now;
|
||||
declaration.DeclarationDate = DateTime.UtcNow;
|
||||
declaration.DeviceOwnerId = uid;
|
||||
_context.DeviceDeclaration.Add(declaration);
|
||||
}
|
||||
|
|
@ -59,12 +59,12 @@ public class NativeConfidentialController : Controller
|
|||
_context.Update(alreadyRegisteredDevice);
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
}
|
||||
|
||||
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
|
||||
|
||||
var latestActivityUpdate = _context.Activities.Max(a=>a.DateModified);
|
||||
return Json(new {
|
||||
IsAnUpdate = deviceAlreadyRegistered,
|
||||
return Json(new {
|
||||
IsAnUpdate = deviceAlreadyRegistered,
|
||||
UpdateActivities = latestActivityUpdate != declaration.LatestActivityUpdate
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue