Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: fix filename * feat: add create list payload & value objects * feat: add update list payload & value objects + update routes & responder * test: update test data * many things happened, mainly add ChangeNodeInfoPayloadADM * update NodeCreatePayloadADM class * refactor list payloads * WIP - fix tests * fix tests * separate root and child nodes creation * WIP: fix tests * bring back ListChildNodeInfoADM non-optional comments * fix tests * update tests * refactor list value objects + add tests * remove redundant fields from RootNodeCreatePayloadADM * refactor list naming + remove redundand request type * fix test * add ProjectIRI value object * add CustomID value object * add ListIRI value object * add RootNodeIRI value object * fix tests * update value objects + add unit tests * update value objects * remove RootNodeIRI value object * add more checks to value objects + update tests * remove redundand tests * fix optional comments creating child node * clenup * review fixes * minor improvements
- Loading branch information
Showing
21 changed files
with
1,086 additions
and
748 deletions.
There are no files selected for viewing
File renamed without changes.
68 changes: 68 additions & 0 deletions
68
.../main/scala/org/knora/webapi/messages/admin/responder/listsmessages/ListPayloadsADM.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package org.knora.webapi.messages.admin.responder.listsmessages | ||
|
||
import org.knora.webapi.messages.admin.responder.valueObjects.{ | ||
Comments, | ||
Labels, | ||
ListIRI, | ||
ListName, | ||
Position, | ||
ProjectIRI | ||
} | ||
|
||
/** | ||
* List (parent node, former root node) and Node (former child node) creation payloads | ||
*/ | ||
sealed trait NodeCreatePayloadADM | ||
object NodeCreatePayloadADM { | ||
final case class ListCreatePayloadADM( | ||
id: Option[ListIRI] = None, | ||
projectIri: ProjectIRI, | ||
name: Option[ListName] = None, | ||
labels: Labels, | ||
comments: Comments | ||
) extends NodeCreatePayloadADM | ||
final case class ChildNodeCreatePayloadADM( | ||
id: Option[ListIRI] = None, | ||
parentNodeIri: Option[ListIRI] = None, | ||
projectIri: ProjectIRI, | ||
name: Option[ListName] = None, | ||
position: Option[Position] = None, | ||
labels: Labels, | ||
comments: Option[Comments] = None | ||
) extends NodeCreatePayloadADM | ||
} | ||
|
||
/** | ||
* Node Info update payload | ||
*/ | ||
final case class NodeInfoChangePayloadADM( | ||
listIri: ListIRI, | ||
projectIri: ProjectIRI, | ||
hasRootNode: Option[ListIRI] = None, | ||
position: Option[Position] = None, | ||
name: Option[ListName] = None, | ||
labels: Option[Labels] = None, | ||
comments: Option[Comments] = None | ||
) | ||
|
||
/** | ||
* Node Name update payload | ||
*/ | ||
final case class NodeNameChangePayloadADM( | ||
name: ListName | ||
) | ||
|
||
/** | ||
* Node Labels update payload | ||
*/ | ||
final case class NodeLabelsChangePayloadADM( | ||
labels: Labels | ||
) | ||
|
||
/** | ||
* Node Comments update payload | ||
*/ | ||
final case class NodeCommentsChangePayloadADM( | ||
// TODO: remove Option here | ||
comments: Option[Comments] = None | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.