fix: update time restrictions for entry and exit registration to 5 minutes
This commit is contained in:
@@ -1425,7 +1425,7 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
|
||||
public string CheckRepeat(long employeeId, long workshopId)
|
||||
{
|
||||
var validSpan = new TimeSpan(0, 0, 2, 0);
|
||||
var validSpan = new TimeSpan(0, 0, 5, 0);
|
||||
var checkDate = DateTime.Now.AddDays(-3);
|
||||
var query = _context.RollCalls
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.CreationDate >= checkDate);
|
||||
|
||||
@@ -145,10 +145,10 @@ public class CameraController : CameraBaseController
|
||||
switch (repeatStatus)
|
||||
{
|
||||
case "IncomRegistred-InvalidOut":
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
|
||||
case "outRegistred-InvalidIncom":
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
|
||||
}
|
||||
|
||||
@@ -201,10 +201,10 @@ public class CameraController : CameraBaseController
|
||||
switch (repeatStatus)
|
||||
{
|
||||
case "IncomRegistred-InvalidOut":
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
throw new BadRequestException("شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید");
|
||||
|
||||
case "outRegistred-InvalidIncom":
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
throw new BadRequestException("شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید");
|
||||
|
||||
}
|
||||
|
||||
@@ -302,13 +302,13 @@ public class CameraController : CameraBaseController
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید",
|
||||
message = "شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید",
|
||||
});
|
||||
case "outRegistred-InvalidIncom":
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید",
|
||||
message = "شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -412,6 +412,32 @@ public class CameraController : CameraBaseController
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("check-password")]
|
||||
public IActionResult OnPostCheckPassword([FromBody]string password)
|
||||
{
|
||||
var cameraAccount = _authHelper.CameraAccountInfo();
|
||||
var cameraPassword = _cameraAccountApplication.GetDetails(cameraAccount.Id).Password;
|
||||
(bool Verified, bool NeedUpgrade) result = _passwordHasher.Check(cameraPassword, password);
|
||||
if (result.Verified)
|
||||
{
|
||||
_accountApplication.Logout();
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = true,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
errorMessage = "گذرواژه اشتباه است",
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class RollCallExitRequest:RollCallEnterRequest
|
||||
|
||||
@@ -139,13 +139,13 @@ public class IndexModel : PageModel
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت ورود نموده اید ,تا 2 دقیقه نمی توانید ثبت خروج نمایید",
|
||||
message = "شما به تازگی ثبت ورود نموده اید ,تا 5 دقیقه نمی توانید ثبت خروج نمایید",
|
||||
});
|
||||
case "outRegistred-InvalidIncom":
|
||||
return new JsonResult(new
|
||||
{
|
||||
isSuccess = false,
|
||||
message = "شما به تازگی ثبت خروج نموده اید تا 2 دقیقه نمی توانید ثبت ورود نمایید",
|
||||
message = "شما به تازگی ثبت خروج نموده اید تا 5 دقیقه نمی توانید ثبت ورود نمایید",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"sqlDebugging": true,
|
||||
"dotnetRunMessages": "true",
|
||||
"nativeDebugging": true,
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;",
|
||||
"applicationUrl": "https://localhost:5004;http://localhost:5003;https://192.168.0.117:5006",
|
||||
"jsWebView2Debugging": false,
|
||||
"hotReloadEnabled": true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user