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

Reimplememts draft command in cicero-cli #801

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mttrbrts
Copy link
Member

@mttrbrts mttrbrts commented Oct 19, 2023

Closes #797

Reimplememts draft command in cicero-cli

Changes

  • Add draft command to args
  • Use template-engine to render in target format.

Remaining tasks

-[ ] Add tests (taken from old code). The test run is currently failing because of low test coverage
-[ ] Review command flags (utcOffset, offline, format, warning etc.). Some may no longer be necessary/possible.
-[ ] Review the default target (markdown). Right now, the output includes in-lined JSON objects. I remember a bug around this, but I can't find a reference (@dselman ?). Example output:

 Late Delivery and Penalty. In case of delayed delivery except for Force Majeure cases, the Seller shall pay to the Buyer for every {"$class":"org.accordproject.time@0.3.0.Duration","amount":9,"unit":"days"} of delay penalty amounting to 7.0% of the total value of the Equipment whose delivery has been delayed. Any fractional part of a days is to be considered a full days. The total amount of penalty shall not however, exceed 2.0% of the total value of the Equipment involved in late delivery. If the delay is more than {"$class":"org.accordproject.time@0.3.0.Duration","amount":2,"unit":"weeks"}, the Buyer is entitled to terminate this Contract.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to master from fork:branchname

mttrbrts and others added 5 commits October 19, 2023 09:02
Signed-off-by: Matt Roberts <code@rbrts.uk>
Signed-off-by: Martin Halford <martin@benext.io>
Signed-off-by: Matt Roberts <code@rbrts.uk>
Signed-off-by: Matt Roberts <code@rbrts.uk>
Signed-off-by: Matt Roberts <code@rbrts.uk>
@dselman
Copy link
Contributor

dselman commented Oct 26, 2023

The JSON output is expected for complex types that don't have specific draft code baked in (eg MometaryAmount). We used to inline the space separated fields which was a hack and not localisation friendly. The template should render the fields of the Duration or we could bake in Duration drafting but we would need VOC support for enum values as well as an "as" formatting string.

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.

CLI: Reimplement "draft" command
3 participants