-
Notifications
You must be signed in to change notification settings - Fork 4
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
HCX-12 Add methods for files to document attaching #24
Conversation
don't forget to update changelog |
92eded8
to
6468164
Compare
Please don't forget to backport to v1.4 |
@@ -16,6 +16,10 @@ trait File { | |||
return getFileEntityType(getSubjectEntityType(subjectId), id) | |||
} | |||
|
|||
Map getContractFileEntityType(def contractId, def id = null) { | |||
return getFileEntityType(getContractEntityType(contractId), id) |
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.
No, this is not really how it works.
Firstly, getContractEntityType requires not only contract id itself, but also parent entity url part because for contract creation/update/delete urls should looks like subjects/customers/:customer_id/contracts/:contract_id
. You cannot just skip parent part here because url will be malformed. Also calling this method without passing a parent will cause exception.
Secondly, there is no entpoint like subjects/customers/:customer_id/contracts/:contract_id/files
you're trying to use for attaching files to contract. Real url should look like documents/:document:id/files
.
Thirdly, you can attach files to any document as well as any subject. Currently there are methods to work with any subject files like getSubjectFiles. So here should be getDocumentFiles instead of getContractFiles.
No description provided.