Versions Compared

Key

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

Beskrivning

Funktion för att registrera påminnelser, och skicka ut dem.

I kommande steg kan påminnelser komma att triggas utifrån.

Livscykelstatus

Design

Lösningsbeskrivning

Gliffy
imageAttachmentIdatt826179599
macroId4a9f70e6-1685-4918-84f6-0633586f01dc
baseUrlhttps://sundsvall.atlassian.net/wiki
nameremindAndInformAPI
diagramAttachmentIdatt826114052
containerId823558153
timestamp1634907453023

Datamodell reminders (draft)

  • personId (den som vill ha påminnelsen)

  • companyId (vilket av de företag personen representerar som påminnelsen avser - är tom om den är en privat påminnelse)

  • todo (fritext - exempel: “Förnya ansökan skyltlov”)

  • caseId (ärendenummer i Open-E t ex - exempel: “23456” - ej obligatoriskt)

  • caseLink (länk till ärendet i Open-E t ex för ärendet med caseId ovan - ej obligatorisk)

  • note (fritext - notering kopplad till påminnelsen. Ingår ej i påminnelsenutskicket)

  • reminderDate (när skall påminnelsen skickas ut)

Utskick av påminnelser

Att köras en gång per dygn:

För alla reminders i databasen som har reminderDate idag:

  1. Hämta kontaktuppgifter via Messaging från feedbackSettings

  2. Skicka påminnelsen som e-post eller SMS (beroende på uppgifterna från feedbackSettings) via messaging

Hantering av personuppgifter

PersonId används för att knyta påminnelser till en specifik individ.

API specifikation

Expand
titleAPI-nyckel för sandbox-miljö. Klicka på "Authorize" nedan och ange denna nyckel för att testa API:et.

eyJ4NXQiOiJOVGRtWmpNNFpEazNOalkwWXpjNU1tWm1PRGd3TVRFM01XWXdOREU1TVdSbFpEZzROemM0WkE9PSIsImtpZCI6ImdhdGV3YXlfY2VydGlmaWNhdGVfYWxpYXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZSI6bnVsbCwidGllciI6IlVubGltaXRlZCIsIm5hbWUiOiJNaWNrZVRlc3QiL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PJsC3B2VUfzFC7AtDnKVyrhcIsahsyAGrcQcL0i4qx2u9WPAB2Bc9K81g-Q==

Swagger ui
---
openapi: 3.0.2
info:
  title: api-remindandinform-dev API
  version: 1.0.0-SNAPSHOT
servers:
  - url: https://api-test.sundsvall.se/reminders/1.0
tags:
- name: Reminder
  description: Remind operations
paths:
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI-definition
      parameters: []
      responses:
        "200":
          description: ok
      x-auth-type: None
  /reminders:
    post:
      tags:
      - Reminder
      summary: Create a new reminder.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReminderRequest'
        required: true
      responses:
        "201":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reminder'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
  /reminders/persons/{personId}:
    get:
      tags:
      - Reminder
      summary: Returns all reminders for a person.
      parameters:
      - name: personId
        in: path
        description: Person ID
        required: true
        schema:
          type: string
        example: 81471222-5798-11e9-ae24-57fa13b361e1
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Reminder'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
  /reminders/persons/{personId}/companies/{companyId}:
    get:
      tags:
      - Reminder
      summary: Returns all reminders for a person and a company which the person represent.
      parameters:
      - name: companyId
        in: path
        description: Company ID
        required: true
        schema:
          pattern: \S
          type: string
          nullable: false
        example: 5565112233
      - name: personId
        in: path
        description: Person ID
        required: true
        schema:
          type: string
        example: 81471222-5798-11e9-ae24-57fa13b361e1
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Reminder'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
  /reminders/send:
    post:
      tags:
      - Reminder
      summary: Send reminders.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendRemindersRequest'
        required: true
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content: {}
        "500":
          description: Internal Server error
          content: {}
  /reminders/{reminderId}:
    get:
      tags:
      - Reminder
      summary: Returns a reminder by reminder-id
      parameters:
      - name: reminderId
        in: path
        description: Reminder ID
        required: true
        schema:
          pattern: \S
          type: string
          nullable: false
        example: R-81471222-5798-11e9-ae24-57fa13b361e1
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Reminder'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
    delete:
      tags:
      - Reminder
      summary: Deletes a reminder.
      parameters:
      - name: reminderId
        in: path
        description: Reminder ID
        required: true
        schema:
          pattern: \S
          type: string
          nullable: false
        example: R-81471222-5798-11e9-ae24-57fa13b361e1
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content: {}
        "404":
          description: Not Found
          content: {}
        "500":
          description: Internal Server error
          content: {}
    patch:
      tags:
      - Reminder
      summary: Manage updates of a reminder.
      parameters:
      - name: reminderId
        in: path
        description: Reminder ID
        required: true
        schema:
          pattern: \S
          type: string
          nullable: false
        example: R-81471222-5798-11e9-ae24-57fa13b361e1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateReminderRequest'
        required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reminder'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
security:
  - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth: 
      type: apiKey
      in: header   
      name: apikey
  schemas:
    Reminder:
      description: Reminder model
      type: object
      properties:
        reminderId:
          description: Reminder ID
          type: string
          example: R-81471222-5798-11e9-ae24-57fa13b361e1
        personId:
          description: Person ID
          type: string
          example: 81471222-5798-11e9-ae24-57fa13b361e2
        companyId:
          description: Company ID
          type: string
          example: "5565112233"
        action:
          description: What should be done
          type: string
          example: Renew application
        caseId:
          description: Case ID
          type: string
          example: "12345"
        caseLink:
          description: Link to the case
          type: string
          example: http://test.sundsvall.se/case12345
        reminderDate:
          format: date
          description: Date for reminding
          type: string
          example: 2021-11-01
    ReminderRequest:
      description: Reminder creation request model
      required:
      - personId
      - action
      - reminderDate
      type: object
      properties:
        personId:
          description: Person Id
          type: string
          example: 81471222-5798-11e9-ae24-57fa13b361e2
          nullable: false
        companyId:
          description: Company Id
          maxLength: 10
          type: string
          example: "5565445566"
        action:
          description: What should be done
          maxLength: 8192
          type: string
          example: Renew application
          nullable: false
        caseId:
          description: Id for the case
          maxLength: 255
          type: string
          example: "12345"
        caseLink:
          description: Link to the case
          maxLength: 512
          type: string
          example: http://test.sundsvall.se/case1337
        reminderDate:
          format: date
          description: Date for reminding
          type: string
          example: 2021-11-01
          nullable: false
    SendRemindersRequest:
      description: Request model for sending reminders of a specified date
      required:
      - reminderDate
      type: object
      properties:
        reminderDate:
          format: date
          description: Date for reminding
          type: string
          example: 2021-11-01
          nullable: false
    ServiceErrorResponse:
      type: object
      properties:
        httpCode:
          format: int32
          type: integer
        message:
          type: string
        technicalDetails:
          $ref: '#/components/schemas/TechnicalDetails'
    TechnicalDetails:
      type: object
      properties:
        rootCode:
          format: int32
          type: integer
        rootCause:
          type: string
        serviceId:
          type: string
        details:
          type: array
          items:
            type: string
    UpdateReminderRequest:
      description: Reminder update request model
      type: object
      properties:
        personId:
          description: Person Id
          type: string
          example: 81471222-5798-11e9-ae24-57fa13b361e1
        companyId:
          description: Company Id
          maxLength: 10
          type: string
          example: "5565445566"
        action:
          description: What should be done
          maxLength: 8192
          type: string
          example: Renew application
        caseId:
          description: Id for the case
          maxLength: 255
          type: string
          example: "12345"
        caseLink:
          description: Link to the case
          maxLength: 512
          type: string
          example: http://test.sundsvall.se/case1337
        reminderDate:
          format: date
          description: Date for reminding
          type: string
          example: 2021-11-01

Säkerhetsklassning

Säkerhetsklass 1

Autentiseringsmetod: Oauth2

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel>

Teknisk ägare

<Kontaktuppgifter till utvecklare/teknisk förvaltare>

Länkar

Test

Sandbox

Produktion

FAQ

<FAQ>