Skip to content

Commit

Permalink
WIP case merging
Browse files Browse the repository at this point in the history
  • Loading branch information
rriclet committed Feb 25, 2021
1 parent bb0a652 commit c6f98c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion thehive/app/org/thp/thehive/controllers/v0/CaseCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class PublicCase @Inject() (
val namespace = UMapping.string.getProperty(v, "namespace")
val predicate = UMapping.string.getProperty(v, "predicate")
val value = UMapping.string.optional.getProperty(v, "value")
Tag(namespace, predicate, value, None, 0).toString
Tag(namespace, predicate, value, None, "#000000").toString
},
Converter.identity[String]
)
Expand Down
19 changes: 5 additions & 14 deletions thehive/app/org/thp/thehive/services/CaseSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,6 @@ class CaseSrv @Inject() (
}

def merge(cases: Seq[Case with Entity])(implicit graph: Graph, authContext: AuthContext): Try[RichCase] = {
// TODO all case class fields
// impactStatus: Option[String],
// resolutionStatus: Option[String],
// assignee: Option[String],
// customFields: Seq[RichCustomField],
// userPermissions: Set[Permission]
//
// TODO ShareCase link
// TODO Procedure link
// TODO Audit
val mergedCase = Case(
nextCaseNumber,
cases.map(_.title).mkString(" / "),
Expand All @@ -326,13 +316,14 @@ class CaseSrv @Inject() (
orga <- organisationSrv.get(authContext.organisation).getOrFail("Organisation")
tags <- tryTags
richCase <- create(mergedCase, Some(user), orga, tags.toSet, Seq(), None, Seq())
// TODO customFields: Seq[RichCustomField],
// TODO ShareCase link
// TODO Procedure link
// TODO tasks
// TODO cascadeRemove cases
// TODO link to share(s) of original cases
} yield richCase
// {
// val summaries = cases.flatMap(_.summary)
// val caseTaskSrv = new EdgeSrv[CaseTask, Case, Task]
// val caseObservableSrv = new EdgeSrv[CaseObservable, Case, Observable] nop
//
// caseUserSrv.create(CaseUser(), mergedCase, user)
// caseOrganisationSrv.create(CaseOrganisation(), mergedCase, organisation)
// cases
Expand Down

0 comments on commit c6f98c5

Please sign in to comment.