Hankintailmoitukset / hilma-api

11 stars 0 forks source link

eForms notices created using draft API cannot be published because of validation error #196

Closed ScRistinen closed 1 year ago

ScRistinen commented 1 year ago

An eForms notice, created using draft API, cannot be published because of validation error. All required fields are populated in Hilma UI, but preview view shows an error and notice cannot be published.

image

Steps to reproduce the behavior:

  1. Create CreateDraftNoticeContract JSON
    • Fill eForm.procurementProjectLot.tenderingTerms.callForTendersDocumentReference
  2. Send request to https://hns-hilma-test-apim.azure-api.net/eforms/external-write/v1/procedure/{procedureId}/notice/{etsIdentifier}/draft
  3. Fill all required data in Hilma UI
  4. Move to preview view

Expected behavior No errors are shown and notice can be published.

Juhisee commented 1 year ago

Issue under development

jadefrantila commented 1 year ago

First, the TED validation error says that ID is missing from CallForTendersDocumentReference. After adding the required Id, more errors occurred and below is listed all the necessary modifications to pass the TED validation. Unfortunately these cannot be done from Hilma UI, so for now you must send the eForm with these modifications (in case of contract notices).

  1. Update CallForTendersDocumentReference with three modifications:
    • add OPT-140 (Id) and BT-615 (DocumentType)
    • change BT-15 URL pattern (localhost does not pass validation).
    • These three changes are presented below with example values.
  2. Change first organization's PartyIdentification.Id.Value to format ORG-XXXX and their references (appealInformationParty, contractingparty) accordingly.
  3. Add lot Id's (ProcurementProjectLot.Id) schemeName as "schemeName": "Lot" and change its value to right format: LOT-XXXX
    • update all lot Id references to match the updated lot Id (statistics and BT-22-Lot)
  4. Change BT-26(m) (MainCommodityClassification.ItemClassificationCode.listName) from "CPV" to "cpv" from procedure and lot level
"CallForTendersDocumentReference": [
          {
            "id": {
              "value": "SomeTenderDocID1"
            },
            "Attachment": {
              "ExternalReference": {
                "URI": {
                  "Value": "https://localdev.fi:44387"
                }
              }
            },
            "languageID": {
              "value": "FIN"
            },
            "documentType": [
              {
                "value": "non-restricted-document"
              }
            ],
            "DocumentStatusCode": {
              "Value": "official"
            }
          }
        ]
ScRistinen commented 1 year ago

Ok, I managed to get every thing in order and no more errors are shown.