-
Notifications
You must be signed in to change notification settings - Fork 0
feat: contract composer apis #2
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
3b5341e
34e00bc
c5942c2
797eac4
6429b51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,12 @@ service EqualIQ { | |
GetContractSignatures | ||
UpdateSignatureStatus | ||
DeleteContractSignature | ||
CreateComposerContract | ||
UpdateComposerContract | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we split out different kinds of updates? |
||
ListComposerContracts | ||
GetComposerContract | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we split different kinds of Gets? Maybe we should use Meta vs Content? |
||
SubmitComposerContractForAnalysis | ||
THLyon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DeleteComposerContract | ||
THLyon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
|
||
} | ||
|
@@ -98,6 +104,18 @@ enum SignContractResult { | |
FAILURE | ||
} | ||
|
||
enum ComposerContractStatus { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall Flow that we want to pursue: Composer View -> Export to Vault, View Exports |
||
DRAFT | ||
FINALIZED | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should treat this more like a cache structure for now: NEW |
||
SUBMITTED | ||
ANALYZED | ||
} | ||
|
||
enum ComposerContractResult { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this necessary? |
||
SUCCESS | ||
FAILURE | ||
} | ||
|
||
// Contract operations | ||
@http(method: "POST", uri: "/getContract") | ||
operation GetContract { | ||
|
@@ -698,3 +716,130 @@ structure DeleteContractSignatureOutput { | |
message: String | ||
} | ||
|
||
|
||
structure ComposerContractSection { | ||
sectionId: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enum |
||
name: String | ||
content: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of 'name'/'content' let's add specific structured type for each section with the required fields. |
||
plainTextSummary: String | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave this in the frontend for now |
||
} | ||
|
||
structure ComposerContract { | ||
contractId: ContractId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ComposerContractId : uuid ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a revisionId There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can put the list of revision ids in the Meta object. |
||
title: String | ||
type: ContractType | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to separate this out into like a 'ComposerContractType' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're going to start with just producer. |
||
sections: ComposerContractSectionList | ||
status: ComposerContractStatus | ||
createdAt: Timestamp | ||
updatedAt: Timestamp | ||
} | ||
|
||
list ComposerContractList { | ||
member: ComposerContract | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's split out a Metadata type so that we don't need the full composer data for every item in the list |
||
} | ||
|
||
list ComposerContractSectionList { | ||
member: ComposerContractSection | ||
} | ||
|
||
@idempotent | ||
@http(method: "POST", uri: "/composer/create") | ||
operation CreateComposerContract { | ||
input: CreateComposerContractInput | ||
output: CreateComposerContractOutput | ||
} | ||
|
||
structure CreateComposerContractInput { | ||
@required | ||
title: String | ||
@required | ||
type: ContractType | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should take the input form details as well |
||
} | ||
|
||
structure CreateComposerContractOutput { | ||
contract: ComposerContract | ||
} | ||
|
||
@idempotent | ||
@http(method: "POST", uri: "/composer/update") | ||
operation UpdateComposerContract { | ||
input: UpdateComposerContractInput | ||
output: UpdateComposerContractOutput | ||
} | ||
|
||
structure UpdateComposerContractInput { | ||
@required | ||
contractId: ContractId | ||
title: String | ||
sections: ComposerContractSectionList | ||
status: ComposerContractStatus | ||
} | ||
|
||
structure UpdateComposerContractOutput { | ||
contract: ComposerContract | ||
} | ||
|
||
@http(method: "POST", uri: "/composer/list") | ||
operation ListComposerContracts { | ||
input: ListComposerContractsInput | ||
output: ListComposerContractsOutput | ||
} | ||
|
||
structure ListComposerContractsInput {} | ||
|
||
structure ListComposerContractsOutput { | ||
contracts: ComposerContractList | ||
} | ||
|
||
@http(method: "POST", uri: "/composer/get") | ||
operation GetComposerContract { | ||
input: GetComposerContractInput | ||
output: GetComposerContractOutput | ||
} | ||
|
||
structure GetComposerContractInput { | ||
@required | ||
contractId: ContractId | ||
} | ||
|
||
structure GetComposerContractOutput { | ||
contract: ComposerContract | ||
} | ||
|
||
@http(method: "POST", uri: "/composer/submit") | ||
operation SubmitComposerContractForAnalysis { | ||
input: SubmitComposerContractForAnalysisInput | ||
output: SubmitComposerContractForAnalysisOutput | ||
} | ||
|
||
structure SubmitComposerContractForAnalysisInput { | ||
@required | ||
contractId: ContractId | ||
} | ||
|
||
structure SubmitComposerContractForAnalysisOutput { | ||
@required | ||
success: ComposerContractResult | ||
} | ||
|
||
@idempotent | ||
@http(method: "POST", uri: "/composer/delete") | ||
operation DeleteComposerContract { | ||
input: DeleteComposerContractInput | ||
output: DeleteComposerContractOutput | ||
errors: [ | ||
AuthenticationError, | ||
ResourceNotFoundError, | ||
InternalServerError | ||
] | ||
} | ||
|
||
structure DeleteComposerContractInput { | ||
@required | ||
contractId: ContractId | ||
} | ||
|
||
structure DeleteComposerContractOutput { | ||
@required | ||
success: ComposerContractResult | ||
} |
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.
Should we use smithy Resources?