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

DesignProduktion

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åminnelsepartyId (mottagare till påminnelsen, uuid för företag eller privatperson)

  • 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 partyId används för att knyta påminnelser till en specifik individ eller organisation.

API specifikation

Expandtitle

openapi: 3.0.1 info: title: api-remindandinform contact: {} license: name: MIT License url: https://opensource.org/licenses/MIT version: "2.0" servers: - url: https://api-test.sundsvall.se/reminders/2.0 tags: - name: Reminder description: Remind operations paths: /reminders: post: tags: - Reminder summary: Create a new reminder. operationId: createReminder requestBody: content: application/json: schema: $ref: '#/components/schemas/ReminderRequest' required: true responses: "201": description: Created headers: Location: style: simple schema: type: string content: application/problem+json: schema: $ref: '#/components/schemas/Reminder' "400": description: Bad request content: application/problem+json: schema: $ref: '#/components/schemas/Problem' "500": description: Internal Server error content: application/problem+json: schema: $ref: '#/components/schemas/Problem' /reminders/send: post: tags: - Reminder summary: Send reminders. operationId: sendReminders requestBody: content: application/json: schema: $ref: '#/components/schemas/SendRemindersRequest' required: true responses: "204": description: Successful operation "400": description: Bad request content: application/problem+json: schema: $ref: '#/components/schemas/Problem' "500": description: Internal Server error content: application/problem+json: schema: $ref: '#/components/schemas/Problem' /reminders/{reminderId}: get: tags: - Reminder summary: Returns a reminder by reminder-id operationId: getReminderByReminderId parameters: - name: reminderId in: path description: Reminder ID required: true schema: type: string example: R-81471222-5798-11e9-ae24-57fa13b361e1 responses: "400": description: Bad request content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "200": description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Reminder' application/problem+json: schema: $ref: '#/components/schemas/Reminder' "500": description: Internal Server error content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "404": description: Not Found content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' delete: tags: - Reminder summary: Deletes a reminder. operationId: deleteReminder parameters: - name: reminderId in: path description: Reminder ID required: true schema: type: string example: R-81471222-5798-11e9-ae24-57fa13b361e1 responses: "204": description: Successful operation "400": description: Bad request content: application/problem+json: schema: $ref: '#/components/schemas/Problem' "500": description: Internal Server error content: application/problem+json: schema: $ref: '#/components/schemas/Problem' "404": description: Not Found content: application/problem+json: schema: $ref: '#/components/schemas/Problem' patch: tags: - Reminder summary: Manage updates of a reminder. operationId: updateReminder parameters: - name: reminderId in: path description: Reminder ID required: true schema: type: string example: R-81471222-5798-11e9-ae24-57fa13b361e1 requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateReminderRequest' required: true responses: "400": description: Bad request content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "200": description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Reminder' application/problem+json: schema: $ref: '#/components/schemas/Reminder' "500": description: Internal Server error content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "404": description: Not Found content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' /reminders/persons/{personId}: get: tags: - Reminder summary: Returns all reminders for a person. operationId: getRemindersByPersonId 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' application/problem+json: schema: type: array items: $ref: '#/components/schemas/Reminder' "400": description: Bad request content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "500": description: Internal Server error content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "404": description: Not Found content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' /reminders/persons/{personId}/organizations/{organizationId}: get: tags: - Reminder summary: Returns all reminders for a person and an organization which the person represent. operationId: getRemindersByPersonIdAndOrganizationId parameters: - name: personId in: path description: Person ID required: true schema: type: string example: 81471222-5798-11e9-ae24-57fa13b361e2 - name: organizationId in: path description: Organization ID required: true schema: type: string example: 81471222-5798-11e9-ae24-57fa13b361e3 responses: "200": description: Successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Reminder' application/problem+json: schema: type: array items: $ref: '#/components/schemas/Reminder' "400": description: Bad request content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "500": description: Internal Server error content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' "404": description: Not Found content: application/json: schema: $ref: '#/components/schemas/Problem' application/problem+json: schema: $ref: '#/components/schemas/Problem' /api-docs: get: tags: - API summary: OpenAPI operationId: getApiDocs responses: "200": description: OK content: application/yaml: schema: type: string security: - ApiKeyAuth: [] components: schemas: ReminderRequest: required: - action - personId - reminderDate type: object properties: personId: type: string description: Person Id example: 81471222-5798-11e9-ae24-57fa13b361e2 organizationId: type: string description: Organization Id example: 81471222-5798-11e9-ae24-57fa13b361e3 action: maxLength: 8192 minLength: 0 type: string description: What should be done example: Renew application note: maxLength: 2048 minLength: 0 type: string description: Reminder note example: A short note about the reminder caseId: maxLength: 255 minLength: 0 type: string description: Id for the case example: "12345" caseLink: maxLength: 512 minLength: 0 type: string description: Link to the case example: http://test.sundsvall.se/case1337 reminderDate: type: string description: Date for reminding format: date example: 2021-11-01 description: Reminder creation request model Reminder: type: object properties: reminderId: type: string description: Reminder ID example: R-81471222-5798-11e9-ae24-57fa13b361e1 personId: type: string description: Person ID example: 81471222-5798-11e9-ae24-57fa13b361e2 organizationId: type: string description: Organization ID example: 81471222-5798-11e9-ae24-57fa13b361e3 action: type: string description: What should be done example: Renew application note: type: string description: Reminder note example: A short note about the reminder caseId: type: string description: Case ID example: "12345" caseLink: type: string description: Link to the case example: http://test.sundsvall.se/case12345 reminderDate: type: string description: Date for reminding format: date example: 2021-11-01 description: Reminder model Problem: type: object properties: instance: type: string format: uri type: type: string format: uri parameters: type: object additionalProperties: type: object status: $ref: '#/components/schemas/StatusType' title: type: string detail: type: string StatusType: type: object properties: statusCode: type: integer format: int32 reasonPhrase: type: string SendRemindersRequest: required: - reminderDate type: object properties: reminderDate: type: string description: Date for reminding format: date example: 2021-11-01 description: Request model for sending reminders of a specified date UpdateReminderRequest: type: object properties: personId: type: string description: Person Id example: 81471222-5798-11e9-ae24-57fa13b361e2 organizationId: type: string description: Organization Id example: 81471222-5798-11e9-ae24-57fa13b361e3 action: maxLength: 8192 minLength: 0 type: string description: What should be done example: Renew application note: maxLength: 2048 minLength: 0 type: string description: Reminder note example: A short note about the reminder caseId: maxLength: 255 minLength: 0 type: string description: Id for the case example: "12345" caseLink: maxLength: 512 minLength: 0 type: string description: Link to the case example: http://test.sundsvall.se/case1337 reminderDate: type: string description: Date for reminding format: date example: 2021-11-01 description: Reminder update request model securitySchemes: ApiKeyAuth: type: apiKey in: header name: apikey
API-nyckel för sandbox-miljö. Klicka på "Authorize" nedan och ange denna nyckel för att testa API:et.

eyJ4NXQiOiJOVGRtWmpNNFpEazNOalkwWXpjNU1tWm1PRGd3TVRFM01XWXdOREU1TVdSbFpEZzROemM0WkE9PSIsImtpZCI6ImdhdGV3YXlfY2VydGlmaWNhdGVfYWxpYXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZSI6bnVsbCwidGllciI6IlVubGltaXRlZCIsIm5hbWUiOiJSZW1pbmRBbmRJbmZvcm0iLCJpZCI6NDcsInV1aWQiOiI4YjljNjJhZS1lODZjLTQzNmUtOGJkZi1hNmYzN2M4ZmVjZGUifSwiaXNzIjoiaHR0cHM6XC9cL2FwaS1pbS10ZXN0LnN1bmRzdmFsbC5zZTo0NDNcL29hdXRoMlwvdG9rZW4iLCJ0aWVySW5mbyI6eyJVbmxpbWl0ZWQiOnsidGllclF1b3RhVHlwZSI6InJlcXVlc3RDb3VudCIsImdyYXBoUUxNYXhDb21wbGV4aXR5IjowLCJncmFwaFFMTWF4RGVwdGgiOjAsInN0b3BPblF1b3RhUmVhY2giOnRydWUsInNwaWtlQXJyZXN0TGltaXQiOjAsInNwaWtlQXJyZXN0VW5pdCI6bnVsbH19LCJrZXl0eXBlIjoiU0FOREJPWCIsInBlcm1pdHRlZFJlZmVyZXIiOiIiLCJzdWJzY3JpYmVkQVBJcyI6W3sic3Vic2NyaWJlclRlbmFudERvbWFpbiI6ImNhcmJvbi5zdXBlciIsIm5hbWUiOiJNZXNzYWdpbmciLCJjb250ZXh0IjoiXC9tZXNzYWdpbmdcLzEuMSIsInB1Ymxpc2hlciI6ImFkbWluIiwidmVyc2lvbiI6IjEuMSIsInN1YnNjcmlwdGlvblRpZXIiOiJVbmxpbWl0ZWQifSx7InN1YnNjcmliZXJUZW5hbnREb21haW4iOiJjYXJib24uc3VwZXIiLCJuYW1lIjoiTWVzc2FnaW5nIiwiY29udGV4dCI6IlwvbWVzc2FnaW5nXC8xLjIiLCJwdWJsaXNoZXIiOiJhZG1pbiIsInZlcnNpb24iOiIxLjIiLCJzdWJzY3JpcHRpb25UaWVyIjoiVW5saW1pdGVkIn0seyJzdWJzY3JpYmVyVGVuYW50RG9tYWluIjoiY2FyYm9uLnN1cGVyIiwibmFtZSI6IlJlbWluZEFuZEluZm9ybSIsImNvbnRleHQiOiJcL3JlbWluZGVyc1wvMi4wIiwicHVibGlzaGVyIjoiYWRtaW4iLCJ2ZXJzaW9uIjoiMi4wIiwic3Vic2NyaXB0aW9uVGllciI6IlVubGltaXRlZCJ9XSwicGVybWl0dGVkSVAiOiIiLCJpYXQiOjE2NDc0MzI5OTMsImp0aSI6Ijc5NTQ0YWE0LWE5MTctNDU4Ni1iNTIzLWE0MjIzYTQyOWUyMCJ9.sqlm-Rtk4S0GR4HALp6SUTt-kh6eFI8j7NeN34JlW-SXlof15TOA7qd3vKEyUCLXhvZCBXRouzUxfMj-eOz5Z4GfOzfyDWM8IhZcxv20etCpxPu3ENchNSOo_56ciL2GPvtSHFefj3vuZjBW2kD1_JaUB8vkMGiz1ipHBwuwhy9sS450UxGjmBVeaR8hm0M-OZFK6vFMim7S3EZkezl2WgQOp5NqPsMJQe6So6uU3DbrG8cTSMz9gUx7dr2_1mMsXYpSctlpKgmUCJVKj7qgSDntHAH39SJe1xfrf5fl-19MBr5of5dR2T6Vv-UbyzdaP--PfNEXGlQ_84olZypCYQ==

Swagger ui
urlhttps://microservices-test.sundsvall.se/remindandinform/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

<Kontaktuppgifter till utvecklare/teknisk förvaltare>

Länkar

Test

Sandbox

Produktion

Källkod

https://github.com/Sundsvallskommun/api-service-remindandinform

FAQ

<FAQ>