Change "empty trash" settings for a collective and submit the job

This commit is contained in:
eikek
2021-08-14 18:06:48 +02:00
parent 828e5cf703
commit 4901276c66
14 changed files with 505 additions and 19 deletions

View File

@ -0,0 +1,40 @@
/*
* Copyright 2020 Docspell Contributors
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
package docspell.common
import docspell.common.syntax.all._
import io.circe._
import io.circe.generic.semiauto._
/** Arguments to the empty-trash task.
*
* This task is run periodically to really delete all soft-deleted
* items. These are items with state `ItemState.Deleted`.
*/
case class EmptyTrashArgs(
collective: Ident
) {
def makeSubject: String =
"Empty trash "
}
object EmptyTrashArgs {
val taskName = Ident.unsafe("empty-trash")
implicit val jsonEncoder: Encoder[EmptyTrashArgs] =
deriveEncoder[EmptyTrashArgs]
implicit val jsonDecoder: Decoder[EmptyTrashArgs] =
deriveDecoder[EmptyTrashArgs]
def parse(str: String): Either[Throwable, EmptyTrashArgs] =
str.parseJsonAs[EmptyTrashArgs]
}