Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Beskrivning

En CaseManagement är en tjänst som hanterar ärenden mot ByggR och Ecos2 (fas 1) samt läser historik från E-arkiv (fas 2).

Behov

Idag när en medborgare använder en e-tjänst för bygglovsärenden eller miljökontorärenden så skickas en PDF-fil innehållandes all information från E-tjänsten till handläggarna som manuellt får mata in dessa uppgifter i ByggR eller Ecos2. Detta tar mycket tid från handläggarna. Tid som kan användas till mer värdeskapande aktiviteter. Detta är dessutom ett repetitivt och inte särskilt utvecklande arbete för individen.
Denna hantering vill vi automatisera genom att E-tjänsten istället anropar vårt CaseManagement-API som skapar ett ärende maskinellt i ByggR eller Ecos2.
Ett ärende som skapas i e-tjänster består alltid av två olika ärenden. Ett i Open ePlatform(OeP) och ett annat i antingen ByggR eller Ecos2. Ärendet i OeP har varit kundens perspektiv på ärendet. Detta ärende har inte uppdaterats i takt med att ärendet handläggs i antingen ByggR eller Ecos2. Idag kan inte intressenterna i ett ärende (t.ex. den sökande) hitta information om sitt ärende på webben. Idag behöver intressenten kontakta en handläggare för information om sitt ärende. Detta är krångligt, ineffektivt och inte särskilt användarvänligt för våra kunder, samtidigt som det är en belastning för handläggarna.
Detta vill vi lösa genom att CaseManagement föder OeP med information om de underliggande ärendena. Då kommer intressenterna kunna komma åt sina ärenden på webben.

Livscykelstatus

Under utveckling

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt88113155
macroId9964760a-a025-4804-a896-4e790a78cba0
baseUrlhttps://sundsvall.atlassian.net/wiki
namecaseMan-API
diagramAttachmentIdatt88080400
containerId47317017
timestamp1644496395387

CaseManagement(CM) kommer lagra en koppling mellan ärendet i OeP och underliggande handläggningssystem. Denna lagring kommer ske i samband med att ärendet skapas från e-tjänsten. Detta kommer möjliggöra att CM kommer kunna hämta upp ärendet från underliggande system när OeP ber om information.

Anropsflöden

POST /cases

“Underliggande system” syftar på antingen ByggR eller Ecos2 för närvarande. Anropet “Skapa ärende” kan bestå av ett flertal anrop för att skapa ett komplett ärende.

Image Removed

Datamodeller

Cases

Denna datamodell är en visuell överblick över Java-klasserna. Detta motsvarar ett komplett ärende. Detta är inget som lagras idag.

Gliffy
imageAttachmentIdatt357138446
macroIdb4c422c2-aedf-49d8-8da1-e7ce845bf7cf
baseUrlhttps://sundsvall.atlassian.net/wiki
nameCaseManagement datamodell
diagramAttachmentIdatt357531655
containerId47317017
timestamp1619174516603

CaseMapping

Detta är databastabellen vi använder för att lagra kopplingen mellan OeP-ärendet och ärendet i det underliggande systemet.

Image Removed
  • caseId - ID på ärendet i det underliggande systemet

  • externalCaseId - ID på OeP-ärendet

  • system - Det underliggande systemet (BYGGR, ECOS)

  • timestamp - tidsstämpel på när raden senast ändrades

Hantering av personuppgifter

Vi tar in ett personId , Ecos2 och vårt egna ärendehanteringssystem CaseData. CaseManagement fungerar som en ärendeförmedlare mellan ett externt system (idag främst Open ePlatform) och de underliggande systemen. CaseManagement tar emot ärenden i ett generiskt format och formaterar om ärendet så att det passar just det specifika system som det ska registreras i. CaseManagement håller även koll på kopplingen mellan det externa ärendet och det underliggande systemet och på så vis möjliggörs hämtning av status från det underliggande systemet, uppdateringar av ärendet med nya bilagor o.s.v. 

Livscykelstatus

Produktion

Lösningsbeskrivning

Gliffy
displayNamecaseMan-API Copy
namecaseMan-API Copy
pagePin1

Hantering av personuppgifter

Vi tar in fältet “personId” och hämtar sedan det tillhörande personnumret från CitizenMapping för att kunna anropa Ecos2 och ByggR med personnummer. Vi kan inte påverka det faktum att dessa system kräver detta som indata. Ecos2 och ByggR ligger på det interna nätet på Sundsvalls kommun.

API specifikation

swagger-ui

{
  "openapi" : "3.0.2",
  "info" : {
    "title" : "CaseManagement",
    "description" : "A service that manage cases against ByggR (building permit cases) and Ecos2 (environmental office cases).",
    "contact" : {
      "name" : "Sundsvalls kommun - Team Dynasty",
      "email" : "teamdynasty@sundsvall.se"
    },
    "version" : "3.2"
  },
  "servers" : [ {
    "url" : "https://api-test.sundsvall.se/casemanagement/3.2"
  } ],
  "security" : [ {
    "default" : [ ]
  } ],
  "paths" : {
    "/cases" : {
      "post" : {
        "tags" : [ "Cases" ],
        "description" : "Creates a case in ByggR or Ecos2 based on caseType. Also persists a connection between externalCaseId and the created case.",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/Case"
              }
            }
          }
        },
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CaseResourceResponse"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal Server Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          }
        },
        "security" : [ {
          "default" : [ ]
        } ],
        "x-auth-type" : null,
        "x-throttling-tier" : null
      }
    },
    "/cases/case-mappings" : {
      "get" : {
        "tags" : [ "CaseMappings" ],
        "description" : "Returns the connection between externalCaseId and the case in the underlying system.",
        "parameters" : [ {
          "name" : "external-case-id",
          "in" : "query",
          "required" : false,
          "style" : "form",
          "explode" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CaseMapping"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "404" : {
            "description" : "Not found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal Server Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          }
        },
        "security" : [ {
          "default" : [ ]
        } ],
        "x-auth-type" : null,
        "x-throttling-tier" : null
      }
    },
    "/cases/{external-case-id}/attachments" : {
      "post" : {
        "tags" : [ "Attachments" ],
        "description" : "Add attachments to existing case.",
        "parameters" : [ {
          "name" : "external-case-id",
          "in" : "path",
          "required" : true,
          "style" : "simple",
          "explode" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "type" : "array",
                "items" : {
                  "$ref" : "#/components/schemas/Attachment"
                }
              }
            }
          }
        },
        "responses" : {
          "204" : {
            "description" : "No content - Successful request."
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "404" : {
            "description" : "Not found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal Server Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "501" : {
            "description" : "Not Implemented",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          }
        },
        "security" : [ {
          "default" : [ ]
        } ],
        "x-auth-type" : null,
        "x-throttling-tier" : null
      }
    },
    "/cases/{external-case-id}/status" : {
      "get" : {
        "tags" : [ "Status" ],
        "description" : "Returns the latest status for the case in the underlying system connected to the specified externalCaseId.",
        "parameters" : [ {
          "name" : "external-case-id",
          "in" : "path",
          "required" : true,
          "style" : "simple",
          "explode" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CaseStatus"
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "404" : {
            "description" : "Not found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal Server Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          }
        },
        "security" : [ {
          "default" : [ ]
        } ],
        "x-auth-type" : null,
        "x-throttling-tier" : null
      }
    },
    "/organization/{organizationNumber}/cases/status" : {
      "get" : {
        "tags" : [ "Status" ],
        "description" : "Returns the latest status for each of the cases where the specified organization has the role \"applicant\".",
        "parameters" : [ {
          "name" : "organizationNumber",
          "in" : "path",
          "required" : true,
          "style" : "simple",
          "explode" : false,
          "schema" : {
            "type" : "string",
            "description" : "Organisationsnummer bestående av 10 eller 12 siffror.",
            "example" : "19901010-1234"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "OK",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/CaseStatus"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "Bad request",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "404" : {
            "description" : "Not found",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          },
          "500" : {
            "description" : "Internal Server Error",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Information"
                }
              }
            }
          }
        },
        "security" : [ {
          "default" : [ ]
        } ],
        "x-auth-type" : null,
        "x-throttling-tier" : null
      }
    }
  },
  "components" : {
    "schemas" : {
      "Address" : {
        "required" : [ "addressCategories" ],
        "type" : "object",
        "properties" : {
          "addressCategories" : {
            "minItems" : 1,
            "type" : "array",
            "description" : "En adress kan ha en eller flera adresskategorier. Det kan exempelvis vara samma adress som ska användas för post och fakturor.",
            "items" : {
              "$ref" : "#/components/schemas/AddressCategory"
            }
          },
          "street" : {
            "type" : "string",
            "example" : "Testvägen"
          },
          "houseNumber" : {
            "type" : "string",
            "example" : "18"
          },
          "postalCode" : {
            "type" : "string",
            "example" : "123 45"
          },
          "city" : {
            "type" : "string",
            "example" : "Sundsvall"
          },
          "country" : {
            "type" : "string",
            "example" : "Sverige"
          },
          "careOf" : {
            "type" : "string",
            "description" : "c/o",
            "example" : "Test Testorsson"
          },
          "attention" : {
            "type" : "string",
            "example" : "Test Testorsson"
          },
          "propertyDesignation" : {
            "type" : "string",
            "description" : "Fastighetsbeteckning",
            "example" : "SUNDSVALL LJUSTA 7:2"
          },
          "appartmentNumber" : {
            "type" : "string",
            "example" : "LGH 1001"
          },
          "location" : {
            "$ref" : "#/components/schemas/Coordinates"
          },
          "isZoningPlanArea" : {
            "type" : "boolean",
            "description" : "Ligger inom detaljplanerat område"
          },
          "invoiceMarking" : {
            "type" : "string",
            "description" : "Märkning av faktura (anges endast i samband med addressCategory INVOICE_ADDRESS)"
          }
        }
      },
      "AddressCategory" : {
        "type" : "string",
        "description" : "Kategorisering av adresser. <li>POSTAL_ADDRESS(Postadress)</li><li>INVOICE_ADDRESS(Fakturaadress)</li><li>VISITING_ADDRESS(Besöksadress)</li>",
        "enum" : [ "INVOICE_ADDRESS", "POSTAL_ADDRESS", "VISITING_ADDRESS" ]
      },
      "Attachment" : {
        "required" : [ "category", "extension", "file", "name" ],
        "type" : "object",
        "properties" : {
          "category" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/AttachmentCategory"
            }, {
              "nullable" : false
            } ]
          },
          "name" : {
            "pattern" : "\\S",
            "type" : "string",
            "nullable" : false,
            "example" : "Namn på dokumentet"
          },
          "note" : {
            "type" : "string",
            "example" : "En anteckning."
          },
          "extension" : {
            "pattern" : "\\S",
            "type" : "string",
            "nullable" : false,
            "example" : ".pdf"
          },
          "mimeType" : {
            "type" : "string",
            "example" : "application/pdf"
          },
          "file" : {
            "pattern" : "\\S",
            "type" : "string",
            "description" : "Base64-encoded file (plain text)",
            "format" : "byte",
            "nullable" : false
          }
        }
      },
      "AttachmentCategory" : {
        "type" : "string",
        "description" : "Kategorisering av bilagor.",
        "enum" : [ "ADRESS", "ANKVU", "ANM", "ANMALAN_LIVSMEDELSANLAGGNING", "ANMÄ", "ANNO", "ANS", "ANSF", "ANSFÖ", "ANSM", "ANSR", "ANSS", "ANSSL", "ANSUP", "ANSUPA", "ANV", "ARBI", "ARIT", "ARK", "AVPLAN", "BANK", "BEGLST", "BEGSTART", "BEHA", "BEK", "BEKMOTANS", "BEMÖ", "BERBSA", "BESKA", "BESLUT", "BIL", "BLST", "BRAB", "BRAD", "BRAU", "BROS", "BRS", "BULL", "DEB", "DEL", "DELK", "DELSLU", "DELSTA", "DETALJ", "DHBHUR", "DOM", "DPH", "ELD", "ENEDEK", "ENER", "EPOS", "EXRIT", "FAKTU", "FAKTUS", "FAP", "FAPL", "FAS", "FAS2", "FASSIT", "FASSIT2", "FAST", "FOTO", "FOTOMON", "FPSS", "FS", "FS2", "FSF", "FUM", "FÄRG", "FÖLJ", "FÖLJREVRIT", "FÖRB", "FÖRG2", "FÖRGARBO", "FÖRK", "FÖRR", "GBLAD", "GEO", "GODFÄ", "GRA", "GRAM", "GRAN", "GRUNDP", "GRUNDR", "HBB", "HISSINT", "HUR", "INFOSS", "INTFAK", "INTSLUT", "INTY", "KA", "KART", "KLA", "KM", "KOMP", "KOND", "KONR", "KONT", "KP", "KPLAN", "KPR", "KPV", "KR", "KVAL", "LUFT", "LUTE", "MAIL", "MAPL", "MAST", "MATINV", "MEDDEL", "MINN", "MIRP", "MOTBKR", "MUR", "MÅTT", "NYKA", "OMPLÄ", "OVK", "PERSPEKTIV", "PFS2", "PFSI2", "PFSS2", "PLA", "PLA2", "PLAN", "PLANK", "PLASIT", "PLFA", "PLFA2", "PLFASE", "PLFASESI", "PLFASI", "PLSE", "PLSE2", "PM", "PMINN", "POIT", "PRES", "PRESENTA", "PROARB", "PROSS", "PROT", "PROTAU", "PROTKS", "PROTPLU", "PROTS", "PROTSBN", "PSI2", "PSS", "PSS2", "PÅMINNTB", "RAP", "RAPP", "REL", "REMISS", "REMS", "REMUA", "REVRIT", "RIT", "RITNING", "RIVA", "RIVP", "RUE", "RÄTT", "SAK", "SAKNAS", "SAKUT", "SBES", "SBN", "SCB", "SEK", "SEK2", "SEKSIT", "SEKT", "SESI2", "SIN", "SITU", "SKP", "SKR", "SKY", "SKYL", "SLUT", "STAB", "STIM", "STOMR", "SVAR", "SVAR2år", "SÅF", "TAPL", "TEBY", "TEKN", "TEKRAP", "TEVS", "TILL", "TILLVR", "TJ", "TJÄ", "TOMTPLBE", "TSR", "UBGARBO", "UKA", "UKON", "UKP", "UKR", "UND", "UNDER", "UNDUT", "UPLA", "UPPM", "URÖR", "UTBEU", "UTSK", "UTSKP", "UTSKS", "UVEN", "VAH", "VENT", "VS", "VVSH", "ÄRB", "ÅTG", "ÖVER" ]
      },
      "Case" : {
        "required" : [ "attachments", "caseType", "externalCaseId", "stakeholders" ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64",
            "readOnly" : true
          },
          "externalCaseId" : {
            "type" : "string",
            "description" : "ÄrendeId från Open-E",
            "nullable" : false,
            "example" : "1"
          },
          "caseType" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/CaseType"
            }, {
              "nullable" : false
            } ]
          },
          "description" : {
            "type" : "string",
            "description" : "Beskriv kort vad du vill bygga",
            "example" : "En fritextbeskrivning av case."
          },
          "stakeholders" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Stakeholder"
            }
          },
          "attachments" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Attachment"
            }
          },
          "caseTitleAddition" : {
            "type" : "string",
            "description" : "Additions to the case title. Right now only applicable to cases of CaseType: NYBYGGNAD_ANSOKAN_OM_BYGGLOV.",
            "example" : "Eldstad/rökkanal, Skylt"
          }
        },
        "oneOf" : [ {
          "$ref" : "#/components/schemas/PlanningPermissionCase"
        }, {
          "$ref" : "#/components/schemas/EnvironmentalCase"
        } ]
      },
      "CaseMapping" : {
        "required" : [ "system" ],
        "type" : "object",
        "properties" : {
          "externalCaseId" : {
            "type" : "string"
          },
          "caseId" : {
            "type" : "string"
          },
          "system" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/SystemType"
            }, {
              "nullable" : false
            } ]
          },
          "timestamp" : {
            "type" : "string",
            "format" : "date-time",
            "readOnly" : true
          }
        }
      },
      "CaseResourceResponse" : {
        "type" : "object",
        "properties" : {
          "caseId" : {
            "type" : "string"
          }
        }
      },
      "CaseStatus" : {
        "type" : "object",
        "properties" : {
          "system" : {
            "$ref" : "#/components/schemas/SystemType"
          },
          "externalCaseId" : {
            "type" : "string"
          },
          "caseId" : {
            "type" : "string"
          },
          "status" : {
            "type" : "string",
            "description" : "Status på ärendet",
            "example" : "Pågående"
          }
        }
      },
      "CaseType" : {
        "type" : "string",
        "description" : "Sätts till den enum som hör ihop med den anropande e-tjänsten.",
        "example" : "NYBYGGNAD_ANSOKAN_OM_BYGGLOV",
        "enum" : [ "LIVSMEDELSVERKSAMHET_ANMALAN_OM_REGISTRERING", "NYBYGGNAD_ANSOKAN_OM_BYGGLOV" ]
      },
      "Coordinates" : {
        "type" : "object",
        "properties" : {
          "latitude" : {
            "type" : "number",
            "description" : "Decimal Degrees (DD)",
            "format" : "double",
            "example" : 62.390205
          },
          "longitude" : {
            "type" : "number",
            "description" : "Decimal Degrees (DD)",
            "format" : "double",
            "example" : 17.306616
          }
        }
      },
      "EnvironmentalCase" : {
        "required" : [ "attachments", "caseType", "externalCaseId", "facilities", "stakeholders", "startDate" ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64",
            "readOnly" : true
          },
          "externalCaseId" : {
            "type" : "string",
            "description" : "ÄrendeId från Open-E",
            "nullable" : false,
            "example" : "1"
          },
          "caseType" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/CaseType"
            }, {
              "nullable" : false
            } ]
          },
          "description" : {
            "type" : "string",
            "description" : "Beskriv kort vad du vill bygga",
            "example" : "En fritextbeskrivning av case."
          },
          "stakeholders" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Stakeholder"
            }
          },
          "attachments" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Attachment"
            }
          },
          "startDate" : {
            "type" : "string",
            "description" : "Startdatum på verksamheten.",
            "format" : "date",
            "nullable" : false
          },
          "endDate" : {
            "type" : "string",
            "description" : "Slutdatum på verksamheten vid det fall den är tidsbegränsad.",
            "format" : "date"
          },
          "caseTitleAddition" : {
            "type" : "string",
            "description" : "Additions to the case title. Right now only applicable to cases of CaseType: NYBYGGNAD_ANSOKAN_OM_BYGGLOV.",
            "example" : "Eldstad/rökkanal, Skylt"
          },
          "facilities" : {
            "maxItems" : 1,
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/EnvironmentalFacility"
            }
          }
        },
        "description" : "Miljökontorärende (Ecos2)"
      },
      "EnvironmentalFacility" : {
        "required" : [ "facilityCollectionName" ],
        "type" : "object",
        "properties" : {
          "description" : {
            "type" : "string",
            "example" : "En fritextbeskrivning av facility."
          },
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "facilityCollectionName" : {
            "pattern" : "\\S",
            "type" : "string",
            "description" : "Skyltnamn",
            "nullable" : false,
            "example" : "Sundsvalls testfabrik"
          }
        }
      },
      "Facility" : {
        "type" : "object",
        "properties" : {
          "description" : {
            "type" : "string",
            "example" : "En fritextbeskrivning av facility."
          },
          "address" : {
            "$ref" : "#/components/schemas/Address"
          }
        },
        "oneOf" : [ {
          "$ref" : "#/components/schemas/PlanningPermissionFacility"
        }, {
          "$ref" : "#/components/schemas/EnvironmentalFacility"
        } ]
      },
      "FacilityType" : {
        "type" : "string",
        "description" : "Typ av byggnad.<br><br>Typer:<li>ONE_FAMILY_HOUSE(enbostadshus)</li><li>APARTMENT_BLOCK(flerbostadshus)</li><li>WEEKEND_COTTAGE(fritidshus)</li><li>OFFICE_BUILDING(kontorsbyggnad)</li><li>INDUSTRIAL_BUILDING(industribyggnad)</li><li>GARAGE(garage)</li><li>CARPORT(carport)</li><li>STOREHOUSE(förråd)</li><li>GREENHOUSE(växthus)</li><li>GUEST_HOUSE(gäststuga)</li><li>WAREHOUSE(lagerbyggnad)</li><li>WORKSHOP_BUILDING(Verkstadsbyggnad)</li><li>RESTAURANT(Restaurang)</li><li>SCHOOL(Skola)</li><li>PRESCHOOL(Förskola)</li><li>PARKING(Parkering, Cykelparkering)</li><li>DEPOT(Upplag)</li><li>MARINA(Småbåtshamn)</li><li>WALL(Mur)</li><li>PALING(Plank)</li><li>RECYCLING_STATION(Återvinningsstation)</li><li>OTHER(övrigt)</li>",
        "enum" : [ "APARTMENT_BLOCK", "CARPORT", "DEPOT", "GARAGE", "GREENHOUSE", "GUEST_HOUSE", "INDUSTRIAL_BUILDING", "MARINA", "OFFICE_BUILDING", "ONE_FAMILY_HOUSE", "OTHER", "PALING", "PARKING", "PRESCHOOL", "RECYCLING_STATION", "RESTAURANT", "SCHOOL", "STOREHOUSE", "WALL", "WAREHOUSE", "WEEKEND_COTTAGE", "WORKSHOP_BUILDING" ]
      },
      "Information" : {
        "type" : "object",
        "properties" : {
          "type" : {
            "type" : "string"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32"
          },
          "title" : {
            "type" : "string"
          },
          "detail" : {
            "type" : "string"
          },
          "instance" : {
            "type" : "string"
          }
        }
      },
      "Organization" : {
        "required" : [ "organizationName", "organizationNumber", "roles", "type" ],
        "type" : "object",
        "properties" : {
          "type" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/StakeholderType"
            }, {
              "nullable" : false
            } ]
          },
          "roles" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera roller.",
            "nullable" : false,
            "items" : {
              "$ref" : "#/components/schemas/StakeholderRole"
            }
          },
          "organizationName" : {
            "pattern" : "\\S",
            "type" : "string",
            "nullable" : false,
            "example" : "Sundsvalls testfabrik"
          },
          "organizationNumber" : {
            "pattern" : "\\S",
            "type" : "string",
            "description" : "Organisationsnummer bestående av 10 eller 12 siffror.",
            "nullable" : false,
            "example" : "19901010-1234"
          },
          "phoneNumber" : {
            "type" : "string",
            "example" : "060121212"
          },
          "emailAddress" : {
            "type" : "string",
            "example" : "test.testorsson@test.se"
          },
          "cellphoneNumber" : {
            "type" : "string",
            "example" : "0701231212"
          },
          "addresses" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera adresser. T.ex. en adress av typen POSTAL_ADDRESS och en annan av typen INVOICE_ADDRESS.",
            "items" : {
              "$ref" : "#/components/schemas/Address"
            }
          },
          "authorizedSignatory" : {
            "type" : "string",
            "description" : "Firmatecknare",
            "example" : "Test Testorsson"
          }
        }
      },
      "Person" : {
        "required" : [ "firstName", "lastName", "roles", "type" ],
        "type" : "object",
        "properties" : {
          "type" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/StakeholderType"
            }, {
              "nullable" : false
            } ]
          },
          "roles" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera roller.",
            "nullable" : false,
            "items" : {
              "$ref" : "#/components/schemas/StakeholderRole"
            }
          },
          "firstName" : {
            "pattern" : "\\S",
            "type" : "string",
            "nullable" : false,
            "example" : "Test"
          },
          "lastName" : {
            "pattern" : "\\S",
            "type" : "string",
            "nullable" : false,
            "example" : "Testorsson"
          },
          "personId" : {
            "type" : "string",
            "example" : "3ed5bc30-6308-4fd5-a5a7-78d7f96f4438"
          },
          "phoneNumber" : {
            "type" : "string",
            "example" : "060121212"
          },
          "emailAddress" : {
            "type" : "string",
            "example" : "test.testorsson@test.se"
          },
          "cellphoneNumber" : {
            "type" : "string",
            "example" : "0701231212"
          },
          "addresses" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera adresser. T.ex. en adress av typen POSTAL_ADDRESS och en annan av typen INVOICE_ADDRESS.",
            "items" : {
              "$ref" : "#/components/schemas/Address"
            }
          },
          "personalNumber" : {
            "type" : "string",
            "readOnly" : true
          }
        }
      },
      "PlanningPermissionCase" : {
        "required" : [ "attachments", "caseType", "externalCaseId", "facilities", "stakeholders" ],
        "type" : "object",
        "properties" : {
          "id" : {
            "type" : "integer",
            "format" : "int64",
            "readOnly" : true
          },
          "externalCaseId" : {
            "type" : "string",
            "description" : "ÄrendeId från Open-E",
            "nullable" : false,
            "example" : "1"
          },
          "caseType" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/CaseType"
            }, {
              "nullable" : false
            } ]
          },
          "description" : {
            "type" : "string",
            "description" : "Beskriv kort vad du vill bygga",
            "example" : "En fritextbeskrivning av case."
          },
          "stakeholders" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Stakeholder"
            }
          },
          "attachments" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Attachment"
            }
          },
          "caseTitleAddition" : {
            "type" : "string",
            "description" : "Additions to the case title. Right now only applicable to cases of CaseType: NYBYGGNAD_ANSOKAN_OM_BYGGLOV.",
            "example" : "Eldstad/rökkanal, Skylt"
          },
          "facilities" : {
            "minItems" : 1,
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/PlanningPermissionFacility"
            }
          },
          "diaryNumber" : {
            "type" : "string",
            "description" : "Diarienummer"
          }
        },
        "description" : "Bygglovsärende (ByggR)"
      },
      "PlanningPermissionFacility" : {
        "required" : [ "facilityType" ],
        "type" : "object",
        "properties" : {
          "facilityType" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/FacilityType"
            }, {
              "nullable" : false
            } ]
          },
          "description" : {
            "type" : "string",
            "example" : "En fritextbeskrivning av facility."
          },
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "mainFacility" : {
            "type" : "boolean"
          }
        }
      },
      "Stakeholder" : {
        "required" : [ "roles", "type" ],
        "type" : "object",
        "properties" : {
          "type" : {
            "allOf" : [ {
              "$ref" : "#/components/schemas/StakeholderType"
            }, {
              "nullable" : false
            } ]
          },
          "roles" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera roller.",
            "nullable" : false,
            "items" : {
              "$ref" : "#/components/schemas/StakeholderRole"
            }
          },
          "phoneNumber" : {
            "type" : "string",
            "example" : "060121212"
          },
          "emailAddress" : {
            "type" : "string",
            "example" : "test.testorsson@test.se"
          },
          "cellphoneNumber" : {
            "type" : "string",
            "example" : "0701231212"
          },
          "addresses" : {
            "type" : "array",
            "description" : "En intressent kan ha en eller flera adresser. T.ex. en adress av typen POSTAL_ADDRESS och en annan av typen INVOICE_ADDRESS.",
            "items" : {
              "$ref" : "#/components/schemas/Address"
            }
          }
        },
        "oneOf" : [ {
          "$ref" : "#/components/schemas/Person"
        }, {
          "$ref" : "#/components/schemas/Organization"
        } ]
      },
      "StakeholderRole" : {
        "type" : "string",
        "description" : "<h3>Generella-roller:</h3><li>CONTACT_PERSON(Kontaktperson)</li><br><br><h3>Bygglovsärende-roller:</h3><li>CONTROL_OFFICIAL(Kontrollansvarig)</li><li>APPLICANT(Sökande)<li>PROPERTY_OWNER(Fastighetsägare)</li><li>PAYMENT_PERSON(Betalningsansvarig)</li><br><br><h3>Miljökontorärende-roller:</h3><li>INVOICE_RECIPENT(Fakturamottagare)</li><li>OPERATOR(Verksamhetsutövare)</li>",
        "enum" : [ "APPLICANT", "CONTACT_PERSON", "CONTROL_OFFICIAL", "INVOICE_RECIPENT", "OPERATOR", "PAYMENT_PERSON", "PROPERTY_OWNER" ]
      },
      "StakeholderType" : {
        "type" : "string",
        "enum" : [ "ORGANIZATION", "PERSON" ]
      },
      "SystemType" : {
        "type" : "string",
        "enum" : [ "BYGGR", "ECOS" ]
      }
    },
    "securitySchemes" : {
      "default" : {
        "type" : "oauth2",
        "flows" : {
          "implicit" : {
            "authorizationUrl" : "https://api-test.sundsvall.se/authorize",
            "scopes" : { }
          }
        }
      }
    }
  }
}

Medvetna avvikelser

  • Handläggarna i ByggR ville ha filnamnet på dokument i anteckningsfältet i ByggR för att få en bättre överblick. Egentligen ska fältet “note” i Attachment-objektet användas för detta i CaseManagaement's API, men p.g.a. begränsningar i OeP’s integrationsadapter som inte möjliggör att e-tjänsteutvecklaren kan konfigurera att detta skickas med så valde vi att lösa detta i CaseManagement’s backend istället.

    • Detta påverkar endast bygglovsärenden

API specifikation

Open api
showCommonExtensionstrue
deepLinkingtrue
supportedSubmitMethodsnone
locationurl
showExtensionstrue
urlhttps://api-i-test.sundsvall.se/casemanagement/8.0/api-docs



Säkerhetsklassning

Säkerhetsklass 1

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel> )

Teknisk ägare

https://sundsvall.atlassian.net/wiki/spaces/API

Ansvarigt team: Team DynastyUnmasked

För tekniska frågor:teamdynasty@sundsvall teamunmasked@sundsvall.se 

Länkar

Länkar till dev-portal;

FAQ

<FAQ>

Källkod

GitHub

FAQ

|