-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev marshal shiva 2965 rrt #5152
Conversation
if 'rrt' in document['category']: | ||
#Create notification event for RRT document | ||
print(f"RRT Uploaded on FOI Request {ministryrequestid}") | ||
#message = f'RRT Uploaded on FOI Request {ministryrequestid}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
print("notificationtype", notificationtype) | ||
print("requesttype", requesttype) | ||
print("foirequest", foirequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments
for document in documentschema['documents']: | ||
# Add attachment event here as we need to pass in the document | ||
# to the event service to identify if the document is an RRT document. | ||
attachmenteventresponse = attachmentevent().createattachmentevent(requestid, userid, document) | ||
return self.createrequestdocument(requestid, documentschema, None, "rawrequest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, attachmentevent call should be at resource level not at the service level.
@@ -11,6 +11,7 @@ | |||
from request_api.models.FOIApplicantCorrespondenceAttachments import FOIApplicantCorrespondenceAttachment | |||
from request_api.services.eventservice import eventservice | |||
from request_api.utils.enums import RequestType | |||
from request_api.services.events.attachment import attachmentevent | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unnecessary import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response should contain ministryrequestID and not version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response should contain ministryrequestID and not version.
@@ -101,7 +101,7 @@ def createdocuments(cls,ministryrequestid,ministryrequestversion, documents, use | |||
newdocuments.append(FOIMinistryRequestDocument(documentpath=document["documentpath"], version='1', filename=document["filename"], category=document["category"], isactive=True, foiministryrequest_id=ministryrequestid, foiministryrequestversion_id=ministryrequestversion, created_at=createdat, createdby=createuserid)) | |||
db.session.add_all(newdocuments) | |||
db.session.commit() | |||
return DefaultMethodResult(True,'Documents created') | |||
return DefaultMethodResult(True,'Documents created',None, ministryrequestversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response should have the ministryrequestid instead of None.
@@ -65,7 +65,7 @@ def createdocuments(cls,requestid,requestversion, documents, userid): | |||
newdocuments.append(FOIRawRequestDocument(documentpath=document["documentpath"], version='1', filename=document["filename"], category=document["category"], isactive=True, foirequest_id=requestid, foirequestversion_id=requestversion, created_at=createdat, createdby=createuserid)) | |||
db.session.add_all(newdocuments) | |||
db.session.commit() | |||
return DefaultMethodResult(True,'Documents created') | |||
return DefaultMethodResult(True,'Documents created', None, requestversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response should have the ministryrequestid instead of None.
for document in documentschema['documents']: | ||
# Add attachment event here as we need to pass in the document | ||
# to the event service to identify if the document is an RRT document. | ||
eventservice().attachmenteventservice(requestid, document, AuthHelper.getuserid(), ministryversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Do not pass version to the event class. Leverage the below loc for getting version in the attachment event class.
version = FOIMinistryRequest.getversionforrequest(requestid)
Reference: divisionevent.class
@@ -13,10 +13,14 @@ class attachmentevent(): | |||
""" FOI Attachment Event management service | |||
|
|||
""" | |||
def createattachmentevent(self, ministryrequestid, message, userid, event): | |||
def createattachmentevent(self, ministryrequestid, userid, document, ministryversion): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the necessary changes mentioned in accordance with callstack.
_comment = self.__preparecomment(ministryrequestid, message, ministryversion) | ||
return commentservice().createcomments(_comment, userid, 2) | ||
|
||
def __preparecomment(self, ministryrequestid, message, ministryversion): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer the divisionevent for creation of __createcomment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Division comment event does not seem to take any raw request.
|
||
def attachmenteventservice(self, ministryrequestid, document, userid, ministryversion): | ||
try: | ||
attachmenteventresponse = attachmentevent().createattachmentevent(ministryrequestid, userid, document, ministryversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the necessary changes mentioned in accordance with callstack.
|
||
def __getscanningteam(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the necessary changes mentioned in accordance with callstack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@antsand , use __getgroupmembers method.
Quality Gate passedIssues Measures |
No description provided.