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(projects): refactor projects route with value objects (DEV-64)…
… (#1909) * add value objects for projects * WIP * fix(routing): optiona IRI validation * refactor: remov redundant traits + make sealed abstract classes private Co-authored-by: Marcin Procyk <marcin.procyk@dasch.swiss>
- Loading branch information
Showing
8 changed files
with
446 additions
and
259 deletions.
There are no files selected for viewing
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
45 changes: 45 additions & 0 deletions
45
...in/scala/org/knora/webapi/messages/admin/responder/usersmessages/ProjectPayloadsADM.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,45 @@ | ||
package org.knora.webapi.messages.admin.responder.usersmessages | ||
|
||
import org.knora.webapi.IRI | ||
|
||
/** | ||
* Project payload | ||
*/ | ||
sealed abstract case class ProjectCreatePayloadADM private ( | ||
id: Option[IRI], | ||
shortname: Shortname, | ||
shortcode: Shortcode, | ||
longname: Option[Longname], | ||
description: Description, | ||
keywords: Keywords, | ||
logo: Option[Logo], | ||
status: Status, | ||
selfjoin: Selfjoin | ||
) | ||
|
||
object ProjectCreatePayloadADM { | ||
|
||
/** The create constructor */ | ||
def create( | ||
id: Option[IRI] = None, | ||
shortname: Shortname, | ||
shortcode: Shortcode, | ||
longname: Option[Longname] = None, | ||
description: Description, | ||
keywords: Keywords, | ||
logo: Option[Logo] = None, | ||
status: Status, | ||
selfjoin: Selfjoin | ||
): ProjectCreatePayloadADM = | ||
new ProjectCreatePayloadADM( | ||
id = id, | ||
shortname = shortname, | ||
shortcode = shortcode, | ||
longname = longname, | ||
description = description, | ||
keywords = keywords, | ||
logo = logo, | ||
status = status, | ||
selfjoin = selfjoin | ||
) {} | ||
} |
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
146 changes: 0 additions & 146 deletions
146
...src/main/scala/org/knora/webapi/messages/admin/responder/usersmessages/ValueObjects.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.