zinkee 0.1.49 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -709,14 +709,72 @@ zinkee --json automations actions add <automation-uuid> \
|
|
|
709
709
|
--arg mode=safe
|
|
710
710
|
```
|
|
711
711
|
|
|
712
|
-
Valid action types: `create_record`, `update_record`, `search_records`, `send_message`, `http_request`, `execute_plugin`.
|
|
712
|
+
Valid action types: `create_record`, `update_record`, `search_records`, `send_message`, `send_email`, `http_request`, `execute_plugin`, `generate_document`, `invoicing`.
|
|
713
713
|
|
|
714
714
|
### Field mapping format
|
|
715
715
|
|
|
716
716
|
- `--map field=value` → `{"rawValue":"value","source":null}` (literal)
|
|
717
717
|
- `--map-json field='{"rawValue":null,"source":{"type":"TRIGGER","id":"<field-uuid>"}}'` (from trigger)
|
|
718
718
|
- `source.type` values: `TRIGGER`, `PREVIOUS_ACTION`
|
|
719
|
-
- `source.id`
|
|
719
|
+
- `source.id` is a field UUID or a named output of the preceding action; slugs are not resolved here. Use `source.actionId` to select the preceding action explicitly.
|
|
720
|
+
|
|
721
|
+
### Native invoicing
|
|
722
|
+
|
|
723
|
+
Use action type `invoicing` with `--operation prepare|issue|refund|cancel|create_correction|prepare_fiscal_correction|execute_fiscal_correction`
|
|
724
|
+
and `--schema <source-schema-uuid>`. Preparation and issuance run in separate automations.
|
|
725
|
+
Existing plugin automations remain unchanged; replace them manually during activation.
|
|
726
|
+
|
|
727
|
+
```bash
|
|
728
|
+
zinkee --json automations actions add <automation-uuid> \
|
|
729
|
+
--type invoicing --name "Issue invoice" --operation issue --schema <draft-schema-uuid>
|
|
730
|
+
|
|
731
|
+
zinkee --json automations actions add <automation-uuid> \
|
|
732
|
+
--type invoicing --name "Cancel invoice" --operation cancel --schema <invoice-schema-uuid> \
|
|
733
|
+
--input cause=DUPLICATE_INVOICE --input reason="Duplicate invoice" \
|
|
734
|
+
--input-json 'recordId={"source":{"type":"PREVIOUS_ACTION","id":"projectedInvoiceId","actionId":"<preceding-action-uuid>"}}'
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
Inputs accept fixed values (`--input name=value`) or the same `{rawValue, source}`
|
|
738
|
+
objects as record mappings (`--input-json name=json`):
|
|
739
|
+
|
|
740
|
+
| Operation | Required inputs |
|
|
741
|
+
| --- | --- |
|
|
742
|
+
| `prepare`, `issue` | None when the trigger record belongs to the configured schema |
|
|
743
|
+
| `refund` | `seriesSchemaId`, `seriesId`, `cause`, `reason` |
|
|
744
|
+
| `cancel` | `cause`, `reason` |
|
|
745
|
+
| `create_correction` | `draftSchemaId`, `seriesSchemaId`, `seriesId`, `cause`, `reason` |
|
|
746
|
+
| `prepare_fiscal_correction` | `correctionSchemaId` (normal destination table) |
|
|
747
|
+
| `execute_fiscal_correction` | `reason` (`--schema` is the correction requests table) |
|
|
748
|
+
|
|
749
|
+
All operations accept `recordId`; omitting it uses the trigger record only when
|
|
750
|
+
its schema matches. `invoiceNumber` is an optional override for `issue` and `refund`;
|
|
751
|
+
otherwise the fiscal service assigns the next number in the series.
|
|
752
|
+
|
|
753
|
+
Invoicing outputs can be selected by `source.type=PREVIOUS_ACTION`, `source.actionId`
|
|
754
|
+
and a named `source.id`. Fiscal `invoiceId`, `recordId` and `operationId` are distinct
|
|
755
|
+
from the visible `projectedInvoiceSchemaId` / `projectedInvoiceId`; use the latter
|
|
756
|
+
for record actions. `file` is the FileField value and `fileId` identifies its PDF;
|
|
757
|
+
`fileName`, `mediaType` and `sha256` describe that stored PDF.
|
|
758
|
+
Correction returns `draftSchemaId` / `draftId` for the editable draft. Issuance
|
|
759
|
+
continues only after the invoice projection and PDF are ready; AEAT delivery has
|
|
760
|
+
its own state. Retrying recovers the same invoice and finishes pending work.
|
|
761
|
+
|
|
762
|
+
Fiscal corrections use two separate steps: prepare from the visible invoice, review the
|
|
763
|
+
request in a normal table, then execute from that request. `recipientNifConfirmed`
|
|
764
|
+
is optional on execution and accepts `true`/`false` (or the template option IDs
|
|
765
|
+
`1`/`2`). Confirm only a checked, correct NIF for the diagnosed uncensused recipient case.
|
|
766
|
+
No input exposes AEAT flags, XML or hashes.
|
|
767
|
+
|
|
768
|
+
Outputs include `requestId` (durable request), `correctionSchemaId` / `correctionId`
|
|
769
|
+
(visible request), `sourceRecordId` (record being corrected), `recordId` (resulting
|
|
770
|
+
fiscal record, when generated), `state`, `resolution`, `diagnosisCode` and `diagnosis`.
|
|
771
|
+
The request UUID currently equals its visible record UUID. `invoiceId` and
|
|
772
|
+
`originalInvoiceId` are internal; `projectedInvoiceSchemaId` / `projectedInvoiceId`
|
|
773
|
+
refer to the visible original invoice. Preparation does not generate a fiscal record.
|
|
774
|
+
Execution continues after persisting the operation and its visible row, before AEAT
|
|
775
|
+
acceptance. Repeating an executed request recovers the stored operation and ignores
|
|
776
|
+
later edits to its inputs; another correction needs a new request. An UNKNOWN result
|
|
777
|
+
must be reconciled before another fiscal operation can be generated.
|
|
720
778
|
|
|
721
779
|
### Flow wiring
|
|
722
780
|
|
|
@@ -3845,6 +3845,59 @@ var specificExamples = {
|
|
|
3845
3845
|
"authMode": "STORED",
|
|
3846
3846
|
"connectionId": "connection-1"
|
|
3847
3847
|
}
|
|
3848
|
+
}`
|
|
3849
|
+
},
|
|
3850
|
+
{
|
|
3851
|
+
description: "Issue a previously prepared draft using native invoicing. The trigger record belongs to schemaId; the configured series assigns the invoice number.",
|
|
3852
|
+
command: 'zinkee --json automations actions add automation-1 --type invoicing --name "Issue invoice" --operation issue --schema 68d2c7be-4392-42de-b5ae-625ad79cfc3c',
|
|
3853
|
+
raw: `{
|
|
3854
|
+
"type": "invoicing",
|
|
3855
|
+
"name": "Issue invoice",
|
|
3856
|
+
"config": {
|
|
3857
|
+
"operation": "issue",
|
|
3858
|
+
"schemaId": "68d2c7be-4392-42de-b5ae-625ad79cfc3c",
|
|
3859
|
+
"inputs": {}
|
|
3860
|
+
}
|
|
3861
|
+
}`
|
|
3862
|
+
},
|
|
3863
|
+
{
|
|
3864
|
+
description: "Prepare a request from the visible invoice; review it in the normal corrections table before execution.",
|
|
3865
|
+
command: 'zinkee --json automations actions add automation-1 --type invoicing --name "Prepare fiscal correction" --operation prepare_fiscal_correction --schema 68d2c7be-4392-42de-b5ae-625ad79cfc3c --input correctionSchemaId=35443450-0000-4000-8000-000000000001',
|
|
3866
|
+
raw: `{
|
|
3867
|
+
"type": "invoicing",
|
|
3868
|
+
"name": "Prepare fiscal correction",
|
|
3869
|
+
"config": {
|
|
3870
|
+
"operation": "prepare_fiscal_correction",
|
|
3871
|
+
"schemaId": "68d2c7be-4392-42de-b5ae-625ad79cfc3c",
|
|
3872
|
+
"inputs": {
|
|
3873
|
+
"correctionSchemaId": {
|
|
3874
|
+
"rawValue": "35443450-0000-4000-8000-000000000001",
|
|
3875
|
+
"source": null
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
}`
|
|
3880
|
+
},
|
|
3881
|
+
{
|
|
3882
|
+
description: "Execute the reviewed request from its own trigger row. Returning PENDING confirms durable work, not AEAT acceptance. Repeating the request recovers it.",
|
|
3883
|
+
command: 'zinkee --json automations actions add automation-1 --type invoicing --name "Execute fiscal correction" --operation execute_fiscal_correction --schema 35443450-0000-4000-8000-000000000001 --input reason="Correct the fiscal registration" --input recipientNifConfirmed=false',
|
|
3884
|
+
raw: `{
|
|
3885
|
+
"type": "invoicing",
|
|
3886
|
+
"name": "Execute fiscal correction",
|
|
3887
|
+
"config": {
|
|
3888
|
+
"operation": "execute_fiscal_correction",
|
|
3889
|
+
"schemaId": "35443450-0000-4000-8000-000000000001",
|
|
3890
|
+
"inputs": {
|
|
3891
|
+
"reason": {
|
|
3892
|
+
"rawValue": "Correct the fiscal registration",
|
|
3893
|
+
"source": null
|
|
3894
|
+
},
|
|
3895
|
+
"recipientNifConfirmed": {
|
|
3896
|
+
"rawValue": "false",
|
|
3897
|
+
"source": null
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
}
|
|
3848
3901
|
}`
|
|
3849
3902
|
},
|
|
3850
3903
|
{
|
|
@@ -4361,4 +4414,4 @@ function withResponseEnvelope(example, commandName) {
|
|
|
4361
4414
|
export {
|
|
4362
4415
|
getCommandExamples
|
|
4363
4416
|
};
|
|
4364
|
-
//# sourceMappingURL=examples-
|
|
4417
|
+
//# sourceMappingURL=examples-V3PR2VTY.js.map
|