diff options
author | Aleksandr <ognelisar@gmail.com> | 2017-11-14 17:14:10 +0700 |
---|---|---|
committer | Aleksandr <ognelisar@gmail.com> | 2017-11-14 17:14:10 +0700 |
commit | 579951fa5fe2f518cb0281e6dcee346ae6dace74 (patch) | |
tree | 3d15b3e5063b7e602f4a0aba5aab6df941e04494 /src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala | |
parent | add98e1a1100d5b0fb666ac4669d0a90272959ca (diff) | |
download | rest-query-579951fa5fe2f518cb0281e6dcee346ae6dace74.tar.gz rest-query-579951fa5fe2f518cb0281e6dcee346ae6dace74.tar.bz2 rest-query-579951fa5fe2f518cb0281e6dcee346ae6dace74.zip |
Improved DocumentHistory and MedicalRecordHistory
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala b/src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala index a1404a7..81fa240 100644 --- a/src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala +++ b/src/main/scala/xyz/driver/pdsuidomain/entities/DocumentHistory.scala @@ -25,11 +25,15 @@ object DocumentHistory { case object Flag extends State case object New extends State + private implicit def stateToName(state: State): (State, String) = { + state -> state.getClass.getSimpleName + } + private val stateToName = immutable.Map[State, String]( - State.Extract -> "Extract", - State.Review -> "Review", - State.Flag -> "Flag", - State.New -> "New" + State.Extract, + State.Review, + State.Flag, + State.New ) val All: Set[State] = stateToName.keySet @@ -61,19 +65,21 @@ object DocumentHistory { case object PostedEvidence extends Action case object CreatedDocument extends Action case object ReadDocument extends Action - case object DeletedDocument extends Action + + private implicit def stateToName(action: Action): (Action, String) = { + action -> action.getClass.getSimpleName + } private val actionToName = immutable.Map[Action, String]( - Action.Start -> "Start", - Action.Submit -> "Submit", - Action.Unassign -> "Unassign", - Action.Resolve -> "Resolve", - Action.Flag -> "Flag", - Action.Archive -> "Archive", - Action.PostedEvidence -> "PostedEvidence", - Action.CreatedDocument -> "CreatedDocument", - Action.DeletedDocument -> "DeletedDocument", - Action.ReadDocument -> "ReadDocument" + Action.Start, + Action.Submit, + Action.Unassign, + Action.Resolve, + Action.Flag, + Action.Archive, + Action.PostedEvidence, + Action.CreatedDocument, + Action.ReadDocument ) val All: Set[Action] = actionToName.keySet |