mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 10:29:34 +00:00
Add logic to set due date from addons, based on #2362
Signed-off-by: martin f. krafft <madduck@madduck.net>
This commit is contained in:
parent
f6cb97119b
commit
750be99aaf
@ -127,6 +127,12 @@ private[backend] class BackendCommands[F[_]: Sync](
|
|||||||
itemOps
|
itemOps
|
||||||
.setItemDate(Nel.of(item), date.some, collective)
|
.setItemDate(Nel.of(item), date.some, collective)
|
||||||
.void
|
.void
|
||||||
|
|
||||||
|
case ItemAction.SetDueDate(duedate) =>
|
||||||
|
logger.debug(s"Set due date $duedate on item ${item.id} for $collective") *>
|
||||||
|
itemOps
|
||||||
|
.setItemDueDate(Nel.of(item), duedate, collective)
|
||||||
|
.void
|
||||||
}
|
}
|
||||||
|
|
||||||
def runAttachAction(
|
def runAttachAction(
|
||||||
|
@ -105,4 +105,10 @@ object ItemAction {
|
|||||||
implicit val jsonDecoder: Decoder[SetDate] = deriveDecoder
|
implicit val jsonDecoder: Decoder[SetDate] = deriveDecoder
|
||||||
implicit val jsonEncoder: Encoder[SetDate] = deriveEncoder
|
implicit val jsonEncoder: Encoder[SetDate] = deriveEncoder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case class SetDueDate(duedate: Option[Timestamp]) extends ItemAction
|
||||||
|
object SetDueDate {
|
||||||
|
implicit val jsonDecoder: Decoder[SetDueDate] = deriveDecoder
|
||||||
|
implicit val jsonEncoder: Encoder[SetDueDate] = deriveEncoder
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ object AddonOutputExample extends Helper {
|
|||||||
ItemAction.ReplaceTags(Set("tagX", "tagY")),
|
ItemAction.ReplaceTags(Set("tagX", "tagY")),
|
||||||
ItemAction.RemoveTags(Set("tag0", "tag9")),
|
ItemAction.RemoveTags(Set("tag0", "tag9")),
|
||||||
ItemAction.RemoveTagsCategory(Set("doc-type")),
|
ItemAction.RemoveTagsCategory(Set("doc-type")),
|
||||||
|
ItemAction.SetDueDate(Some(Timestamp.ofMillis(1707908400000L))),
|
||||||
ItemAction.SetFolder("folder-name".some),
|
ItemAction.SetFolder("folder-name".some),
|
||||||
ItemAction.SetCorrOrg(id("OaIy-org-ID").some),
|
ItemAction.SetCorrOrg(id("OaIy-org-ID").some),
|
||||||
ItemAction.SetCorrPerson(id("OaIy-person-ID").some),
|
ItemAction.SetCorrPerson(id("OaIy-person-ID").some),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user