Skip to content

Commit

Permalink
Merge pull request #4573 from bcgov/revert-4566-dev-AA-4362
Browse files Browse the repository at this point in the history
Revert "#4362 - Scanning, Tagging  Clock Stop"
  • Loading branch information
abin-aot authored Oct 10, 2023
2 parents e2c0650 + 4b9b112 commit cff3390
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions forms-flow-web/src/components/FOI/Dashboard/Ministry/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Queue = ({ userDetail, tableInfo }) => {
function getRecordsDue(params) {
let receivedDateString = params.row.cfrduedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.tagging.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.readytoscan.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -102,7 +102,7 @@ const Queue = ({ userDetail, tableInfo }) => {
function getLDD(params) {
let receivedDateString = params.row.duedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.tagging.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.readytoscan.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand Down
6 changes: 3 additions & 3 deletions forms-flow-web/src/components/FOI/Dashboard/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const onBehalfFullName = (params) => {
export const getRecordsDue = (params) => {
let receivedDateString = params.row.cfrduedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.tagging.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.readytoscan.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -144,7 +144,7 @@ export const getRecordsDue = (params) => {
export const getLDD = (params) => {
let receivedDateString = params.row.duedate;
const currentStatus = params.row.currentState;
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.tagging.name.toLowerCase() || currentStatus.toLowerCase() === StateEnum.readytoscan.name.toLowerCase()) {
if (currentStatus.toLowerCase() === StateEnum.onhold.name.toLowerCase()) {
return "N/A";
} else if(!receivedDateString) {
return "";
Expand All @@ -157,7 +157,7 @@ export const getDaysLeft = (params) => {
const receivedDateString = params.row.duedate;

if (
[StateEnum.onhold.name.toLowerCase(), StateEnum.tagging.name.toLowerCase(), StateEnum.readytoscan.name.toLowerCase(),StateEnum.closed.name.toLowerCase()].includes(params.row.currentState.toLowerCase())
[StateEnum.onhold.name.toLowerCase(), StateEnum.closed.name.toLowerCase()].includes(params.row.currentState.toLowerCase())
) {
return "N/A";
} else if(!receivedDateString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ import { getFullnameList } from "../../../../helper/FOI/helper";
return {title: "Changing the state", body: "Are you sure you want to change the state to Intake in Progress?"};
case StateEnum.peerreview.name.toLowerCase():
return {title: "Changing the state", body: "Are you sure you want to change the state to Peer Review?"};
case StateEnum.tagging.name.toLowerCase():
return {title: "Changing the state", body: <>Are you sure you want to change the state to Tagging?<br/> <b>This action will stop the clock.</b></>};
case StateEnum.tagging.name.toLowerCase():
return {title: "Changing the state", body: "Are you sure you want to change the state to Tagging?"};
case StateEnum.readytoscan.name.toLowerCase():
return {title: "Changing the state", body: <>Are you sure you want to change the state to Ready to Scan?<br/> <b>This action will stop the clock.</b></>};
return {title: "Changing the state", body: "Are you sure you want to change the state to Ready to Scan?"};
case StateEnum.open.name.toLowerCase():
return {title: "Changing the state", body: "Are you sure you want to Open this request?"};
case StateEnum.closed.name.toLowerCase():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def getlastoffholddate(cls, ministryrequestid):
recent_offhold_index = None
offhold_indicator = False
for entry in desc_transitions:
if (entry["status"] == StateName.onhold.value or entry["status"] == StateName.readytoscan.value or entry["status"] == StateName.tagging.value):
if entry["status"] == StateName.onhold.value:
onhold_occurance = onhold_occurance + 1
if onhold_occurance > 1:
recent_offhold_index = index
Expand Down Expand Up @@ -737,7 +737,7 @@ def getupcominglegislativeduerecords(cls):
upcomingduerecords = []
try:
sql = """select distinct on (filenumber) filenumber, to_char(duedate, 'YYYY-MM-DD') as duedate, foiministryrequestid, version, foirequest_id, created_at, createdby from "FOIMinistryRequests" fpa
where isactive = true and duedate is not null and requeststatusid not in (5,6,4,11,3,15,17,18)
where isactive = true and duedate is not null and requeststatusid not in (5,6,4,11,3,15)
and duedate between NOW() - INTERVAL '7 DAY' AND NOW() + INTERVAL '7 DAY'
order by filenumber , version desc;"""
rs = db.session.execute(text(sql))
Expand All @@ -760,7 +760,7 @@ def getupcomingdivisionduerecords(cls):
from "FOIMinistryRequestDivisions" frd
inner join (select distinct on (fpa.foiministryrequestid) foiministryrequestid, version as foiministryrequestversion, axisrequestid, filenumber, foirequest_id, requeststatusid
from "FOIMinistryRequests" fpa
order by fpa.foiministryrequestid , fpa.version desc) fma on frd.foiministryrequest_id = fma.foiministryrequestid and frd.foiministryrequestversion_id = fma.foiministryrequestversion and fma.requeststatusid not in (5,6,4,11,3,15,17,18)
order by fpa.foiministryrequestid , fpa.version desc) fma on frd.foiministryrequest_id = fma.foiministryrequestid and frd.foiministryrequestversion_id = fma.foiministryrequestversion and fma.requeststatusid not in (5,6,4,11,3,15)
inner join "ProgramAreaDivisions" pad2 on frd.divisionid = pad2.divisionid
inner join "ProgramAreaDivisionStages" pads on frd.stageid = pads.stageid and frd.stageid in (5, 7, 9)
and frd.divisionduedate between NOW() - INTERVAL '7 DAY' AND NOW() + INTERVAL '7 DAY'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,14 @@ def getdivisions(self, ministrydivisions):


def getonholdtransition(self, foiministryrequestid):
onholddate = None
onholddate = None
transitions = FOIMinistryRequest.getrequeststatusById(foiministryrequestid)
for entry in transitions:
if (entry['requeststatusid'] == 11 or entry['requeststatusid'] == 17 or entry['requeststatusid'] == 18):
onholddate = datetimehandler().convert_to_pst(entry['created_at'],'%Y-%m-%d')
else:
if entry['requeststatusid'] == 11:
onholddate = datetimehandler().convert_to_pst(entry['created_at'],'%Y-%m-%d')
else:
if onholddate is not None:
break

return onholddate

def getministryrequest(self, foiministryrequestid):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def updateduedate(self, requestid, ministryrequestid, offholddate, foirequestsch
foirequest = self.getrequest(requestid, ministryrequestid)
currentstatus = foirequest["stateTransition"][0]["status"] if "stateTransition" in foirequest and len(foirequest["stateTransition"]) > 1 else None
#Check for Off Hold
if currentstatus not in (None, "") and (currentstatus == StateName.onhold.value or currentstatus == StateName.tagging.value or currentstatus == StateName.readytoscan.value) and nextstatename != StateName.response.value:
if currentstatus not in (None, "") and currentstatus == StateName.onhold.value and nextstatename != StateName.response.value:
skipcalculation = self.__skipduedatecalculation(ministryrequestid, offholddate)
#Skip multiple off hold in a day
if skipcalculation == True:
Expand Down
2 changes: 0 additions & 2 deletions request-management-api/request_api/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ class StateName(Enum):
deduplication = "Deduplication"
harmsassessment = "Harms Assessment"
response = "Response"
tagging = "Tagging"
readytoscan ="Ready to Scan"

class CacheUrls(Enum):
keycloakusers= "/api/foiassignees"
Expand Down

0 comments on commit cff3390

Please sign in to comment.