1
0

feat: Add relative Reminders (#1427)

Partially resolves #1416

Co-authored-by: ce72 <christoph.ernst72@googlemail.com>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/1427
Reviewed-by: konrad <k@knt.li>
Co-authored-by: cernst <ce72@noreply.kolaente.de>
Co-committed-by: cernst <ce72@noreply.kolaente.de>
This commit is contained in:
cernst
2023-03-27 20:07:06 +00:00
committed by konrad
parent 823c817b1f
commit 3f5252dc24
21 changed files with 724 additions and 207 deletions

View File

@ -1,5 +1,4 @@
// Package swagger GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
// Code generated by swaggo/swag. DO NOT EDIT
package swagger
import "github.com/swaggo/swag"
@ -7791,12 +7790,19 @@ const docTemplate = `{
]
},
"reminder_dates": {
"description": "An array of datetimes when the user wants to be reminded of the task.",
"description": "An array of datetimes when the user wants to be reminded of the task.\n\nDeprecated: Use Reminders",
"type": "array",
"items": {
"type": "string"
}
},
"reminders": {
"description": "An array of reminders that are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.TaskReminder"
}
},
"repeat_after": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
@ -8303,6 +8309,19 @@ const docTemplate = `{
"RelationKindCopiedTo"
]
},
"models.ReminderRelation": {
"type": "string",
"enum": [
"due_date",
"start_date",
"end_date"
],
"x-enum-varnames": [
"ReminderRelationDueDate",
"ReminderRelationStartDate",
"ReminderRelationEndDate"
]
},
"models.Right": {
"type": "integer",
"enum": [
@ -8518,12 +8537,19 @@ const docTemplate = `{
]
},
"reminder_dates": {
"description": "An array of datetimes when the user wants to be reminded of the task.",
"description": "An array of datetimes when the user wants to be reminded of the task.\n\nDeprecated: Use Reminders",
"type": "array",
"items": {
"type": "string"
}
},
"reminders": {
"description": "An array of reminders that are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.TaskReminder"
}
},
"repeat_after": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
@ -8691,6 +8717,27 @@ const docTemplate = `{
}
}
},
"models.TaskReminder": {
"type": "object",
"properties": {
"relative_period": {
"description": "A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due.",
"type": "integer"
},
"relative_to": {
"description": "The name of the date field to which the relative period refers to.",
"allOf": [
{
"$ref": "#/definitions/models.ReminderRelation"
}
]
},
"reminder": {
"description": "The absolute time when the user wants to be reminded of the task.",
"type": "string"
}
}
},
"models.TaskRepeatMode": {
"type": "integer",
"enum": [

View File

@ -7782,12 +7782,19 @@
]
},
"reminder_dates": {
"description": "An array of datetimes when the user wants to be reminded of the task.",
"description": "An array of datetimes when the user wants to be reminded of the task.\n\nDeprecated: Use Reminders",
"type": "array",
"items": {
"type": "string"
}
},
"reminders": {
"description": "An array of reminders that are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.TaskReminder"
}
},
"repeat_after": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
@ -8294,6 +8301,19 @@
"RelationKindCopiedTo"
]
},
"models.ReminderRelation": {
"type": "string",
"enum": [
"due_date",
"start_date",
"end_date"
],
"x-enum-varnames": [
"ReminderRelationDueDate",
"ReminderRelationStartDate",
"ReminderRelationEndDate"
]
},
"models.Right": {
"type": "integer",
"enum": [
@ -8509,12 +8529,19 @@
]
},
"reminder_dates": {
"description": "An array of datetimes when the user wants to be reminded of the task.",
"description": "An array of datetimes when the user wants to be reminded of the task.\n\nDeprecated: Use Reminders",
"type": "array",
"items": {
"type": "string"
}
},
"reminders": {
"description": "An array of reminders that are associated with this task.",
"type": "array",
"items": {
"$ref": "#/definitions/models.TaskReminder"
}
},
"repeat_after": {
"description": "An amount in seconds this task repeats itself. If this is set, when marking the task as done, it will mark itself as \"undone\" and then increase all remindes and the due date by its amount.",
"type": "integer"
@ -8682,6 +8709,27 @@
}
}
},
"models.TaskReminder": {
"type": "object",
"properties": {
"relative_period": {
"description": "A period in seconds relative to another date argument. Negative values mean the reminder triggers before the date. Default: 0, tiggers when RelativeTo is due.",
"type": "integer"
},
"relative_to": {
"description": "The name of the date field to which the relative period refers to.",
"allOf": [
{
"$ref": "#/definitions/models.ReminderRelation"
}
]
},
"reminder": {
"description": "The absolute time when the user wants to be reminded of the task.",
"type": "string"
}
}
},
"models.TaskRepeatMode": {
"type": "integer",
"enum": [

View File

@ -196,11 +196,18 @@ definitions:
- $ref: '#/definitions/models.RelatedTaskMap'
description: All related tasks, grouped by their relation kind
reminder_dates:
description: An array of datetimes when the user wants to be reminded of the
task.
description: |-
An array of datetimes when the user wants to be reminded of the task.
Deprecated: Use Reminders
items:
type: string
type: array
reminders:
description: An array of reminders that are associated with this task.
items:
$ref: '#/definitions/models.TaskReminder'
type: array
repeat_after:
description: An amount in seconds this task repeats itself. If this is set,
when marking the task as done, it will mark itself as "undone" and then
@ -596,6 +603,16 @@ definitions:
- RelationKindFollows
- RelationKindCopiedFrom
- RelationKindCopiedTo
models.ReminderRelation:
enum:
- due_date
- start_date
- end_date
type: string
x-enum-varnames:
- ReminderRelationDueDate
- ReminderRelationStartDate
- ReminderRelationEndDate
models.Right:
enum:
- 0
@ -763,11 +780,18 @@ definitions:
- $ref: '#/definitions/models.RelatedTaskMap'
description: All related tasks, grouped by their relation kind
reminder_dates:
description: An array of datetimes when the user wants to be reminded of the
task.
description: |-
An array of datetimes when the user wants to be reminded of the task.
Deprecated: Use Reminders
items:
type: string
type: array
reminders:
description: An array of reminders that are associated with this task.
items:
$ref: '#/definitions/models.TaskReminder'
type: array
repeat_after:
description: An amount in seconds this task repeats itself. If this is set,
when marking the task as done, it will mark itself as "undone" and then
@ -889,6 +913,22 @@ definitions:
description: The ID of the "base" task, the task which has a relation to another.
type: integer
type: object
models.TaskReminder:
properties:
relative_period:
description: 'A period in seconds relative to another date argument. Negative
values mean the reminder triggers before the date. Default: 0, tiggers when
RelativeTo is due.'
type: integer
relative_to:
allOf:
- $ref: '#/definitions/models.ReminderRelation'
description: The name of the date field to which the relative period refers
to.
reminder:
description: The absolute time when the user wants to be reminded of the task.
type: string
type: object
models.TaskRepeatMode:
enum:
- 0