Closed samlown closed 2 years ago
@dstotijn @renegalindo I've tried to refine some of the comments in Slack here. Essentially, the idea is to move to a consistent interface between command line and Web.
sign
- requires that the envelope is no longer a draft, will validate and then sign the envelope.
You reckon this needs to be a separate command? Or could signing be achieved by using the build
command, passing an envelope with head.draft
set to false
? Or wouldn't that be correct because build
always calculates (and sign
wouldn't)?
you're right... "build" does seem a bit redundant with these descriptions. Maybe build
should just calculate and validate, without a signature, whereas sign
does the same and adds the signature, but only for non-drafts... I'll modify the text to see.
The current CLI consists of the following principal commands (there are more utility commands):
build
- calculate, validate, and sign a partial GOBL Envelopeenvelope
- wrap in an envelope, calculate, validate, and sign a GOBL Documentverify
- validate an envelope and check it was signed with a known signature.The Web UI however is highlighting a different way to interact with GOBL envelopes and documents which feels a bit more intuitive. The following set of key actions will align both interfaces. All commands output a complete GOBL Envelope, regardless of the input which may be a partial envelope, or a document:
calculate
- Perform calculations only, including invoice totals and envelope header digest.validate
- Check the contents of the envelope and document look correct (signatures are now optional in GOBL v0.28)sign
- requires that the envelope is no longer a draft, will calculate, validate and then sign the envelope.With these set of changes, we can then focus on refining the meaning of the other commands:
build
- performs a calculate and validate, but will not add a signature and works with draft documents.envelop
- no longer adds any meaning and can be removed.verify
- should continues as currently, but provide more explicit details on document validation and validity of each of the signatures.