aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala
new file mode 100644
index 0000000..49bcbcb
--- /dev/null
+++ b/src/main/scala/xyz/driver/pdsuidomain/formats/json/trial/TrialStatus.scala
@@ -0,0 +1,30 @@
+package xyz.driver.pdsuidomain.formats.json.trial
+
+import xyz.driver.pdsuidomain.entities.Trial.Status
+
+object TrialStatus {
+
+ val statusFromString: PartialFunction[String, Status] = {
+ case "New" => Status.New
+ case "ReviewSummary" => Status.ReviewSummary
+ case "Summarized" => Status.Summarized
+ case "PendingUpdate" => Status.PendingUpdate
+ case "Update" => Status.Update
+ case "ReviewCriteria" => Status.ReviewCriteria
+ case "Done" => Status.Done
+ case "Flagged" => Status.Flagged
+ case "Archived" => Status.Archived
+ }
+
+ def statusToString(x: Status): String = x match {
+ case Status.New => "New"
+ case Status.ReviewSummary => "ReviewSummary"
+ case Status.Summarized => "Summarized"
+ case Status.PendingUpdate => "PendingUpdate"
+ case Status.Update => "Update"
+ case Status.ReviewCriteria => "ReviewCriteria"
+ case Status.Done => "Done"
+ case Status.Flagged => "Flagged"
+ case Status.Archived => "Archived"
+ }
+}