Skip to content
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

Merged
merged 1 commit into from
Feb 17, 2020
Merged

Conversation

NatalieKor
Copy link
Member

No description provided.

@sugarfree1
Copy link
Contributor

don't forget to update changelog

@NatalieKor NatalieKor force-pushed the HCX-12 branch 2 times, most recently from 92eded8 to 6468164 Compare February 14, 2020 08:13
@dolfinus
Copy link
Contributor

Please don't forget to backport to v1.4

@NatalieKor NatalieKor merged commit f654a00 into master Feb 17, 2020
@NatalieKor NatalieKor deleted the HCX-12 branch February 17, 2020 07:29
@dolfinus dolfinus restored the HCX-12 branch February 17, 2020 08:19
@@ -16,6 +16,10 @@ trait File {
return getFileEntityType(getSubjectEntityType(subjectId), id)
}

Map getContractFileEntityType(def contractId, def id = null) {
return getFileEntityType(getContractEntityType(contractId), id)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants