mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Change "empty trash" settings for a collective and submit the job
This commit is contained in:
@ -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]
|
||||
|
||||
}
|
Reference in New Issue
Block a user