Aiida status messages
Background
A status message (status_message
) will be created after interpretation and validation. The status_message
is part of the JSON item and contains validation information of the item and its fields.
Status messages
Parameter | Comment |
type
|
Defines what type of status message it is. See the definitions below. |
message
|
A text describing the status. In the normal case this is a warning. |
metadata
|
Contain metadata about the status. Often a list of fields or items. |
Status messages can contain the following status types:
Parameter | Comment |
REQUIRED_VALUE
|
A required value is missing (e.g. Invoice number is missing). |
CANNOT_SHARE_VALUE
|
Two or more fields are using the same value (e.g. VAT and Total can't share the same value). |
DUPLICATE_ITEM
|
At least one or more duplicate items exists. This means that another item has the same OCR and/or Invoice number within a collection. |
SUPPLIER_BLACKLISTED
|
A value of a field matches a supplier on Svensk Handel's warning list. |
INVALID_VALUE
|
A value can't be parsed (e.g. bad format) or validation is false (e.g. OCR number, checksum, etc.). |
INVALID_VALUE_COMBINATION
|
Two or more values do not work in combination (e.g. VAT is not a valid % rate of Total or Due Date is earlier than Invoice Date). |
ACCOUNTING_DOES_NOT_BALANCE
|
The debit and credit does not match in the accountings fields as indicated in the total debt and credit calculations. |
ACCOUNT_REQUIRED
|
The account needs to be filled out before it can be saved. |
CREDIT_OR_DEBIT_REQUIRED
|
Credit or debit is needed in order for the account to be saved. |
Example
[
{
"type": "DUPLICATE_ITEM",
"message": "Duplicate warning, field values of 'Fakturanummer' exists in other items (https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/cbdbbd88-b8d0-11eb-bb78-12a619e7adf8, https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/2dc21c92-bd61-11eb-813f-0eb4bc4070be) in same collection",
"metadata": {
"fields": [
"fd810d99-8e63-4814-ace5-7c048b49ccaf"
],
"items": [
"cbdbbd88-b8d0-11eb-bb78-12a619e7adf8",
"2dc21c92-bd61-11eb-813f-0eb4bc4070be"
]
}
},
{
"type": "DUPLICATE_ITEM",
"message": "Duplicate warning, field values of 'OCR' exists in other items (https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-)ffc-416f-a031-1f3763627582/item/cbdbbd88-b8d0-11eb-bb78-12a619e7adf8, https://app.dev.aiida.io/b7b45c42-06c6-11ea-bdfc-327afa3b762a/workflow/d703d553-9ffc-416f-a031-1f3763627582/item/2dc21c92-bd61-11eb-813f-0eb4bc407011) in same collection",
"metadata": {
"fields": [
"c080f592-7192-4609-8442-bd9e16b5709b"
],
"items": [
"cbdbbd88-b8d0-11eb-bb78-12a619e7adf8",
"2dc21c92-bd61-11eb-813f-0eb4bc4070be"
]
}
},
{
"type": "SUPPLIER_BLACKLISTED",
"message": "Value for field 'Organisationsnummer' matches a supplier in Svensk Handel's warning list",
"metadata": {
"fields": [
"3cc1fc4f-6fe7-4a67-b4bb-a22edffd4d30"
],
}
},
{
"type": "INVALID_VALUE_COMBINATION",
"message": "Invalid combination of values for fields 'Moms' and 'Totalt'",
"metadata": {
"fields": [
"7579fd4a-b5c6-4b92-a98c-9a4181d10e84",
"b9cc9245-f52a-4a4c-84e3-f3081b56d209",
"223c2303-85de-4c93-9707-d0d6d60b7f2e"
]
}
},
{
"type": "INVALID_VALUE_COMBINATION",
"message": "Invalid combination of values for fields 'Moms' and 'Totalt'",
"metadata": {
"fields": [
"7579fd4a-b5c6-4b92-a98c-9a4181d10e84",
"b9cc9245-f52a-4a4c-84e3-f3081b56d209",
"223c2303-85de-4c93-9707-d0d6d60b7f2e"
]
}
},
{
"type": "ACCOUNTING_DOES_NOT_BALANCE",
"message": "Total credit and debit does not match",
"metadata": {
"accountings": [
"053f4ec0-4ba2-4ad1-a770-abacd4fef51f",
"5bef9a81-1e05-41aa-9a18-0b8a9dffc05c",
"a3a34b62-0b53-4f94-b198-048c232a1200"
]
}
},
{
"type": "ACCOUNT_REQUIRED",
"message": "Account required for accounting with id 053f4ec0-4ba2-4ad1-a770-abacd4fef51f",
"metadata": {
"accountings": [
"053f4ec0-4ba2-4ad1-a770-abacd4fef51f"
]
}
}
]