Skip to content

Commit

Permalink
#1766 Renamed procedure occurence to occurDate
Browse files Browse the repository at this point in the history
  • Loading branch information
rriclet committed Feb 15, 2021
1 parent 4af257b commit bd1bcd9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dto/src/main/scala/org/thp/thehive/dto/v1/Procedure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.util.Date

case class InputProcedure(
description: String,
occurence: Date,
occurDate: Date,
caseId: String,
patternId: String
)
Expand All @@ -15,12 +15,12 @@ object InputProcedure {
implicit val reads: Reads[InputProcedure] = Reads[InputProcedure] { json =>
for {
description <- (json \ "description").validate[String]
occurence <- (json \ "occurence").validate[Date]
occurDate <- (json \ "occurDate").validate[Date]
caseId <- (json \ "caseId").validate[String]
patternId <- (json \ "patternId").validate[String]
} yield InputProcedure(
description,
occurence,
occurDate,
caseId,
patternId
)
Expand All @@ -36,7 +36,7 @@ case class OutputProcedure(
_updatedAt: Option[Date],
_updatedBy: Option[String],
description: String,
occurence: Date,
occurDate: Date,
patternId: String,
extraData: JsObject
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ class Properties @Inject() (
lazy val procedure: PublicProperties =
PublicPropertyListBuilder[Procedure]
.property("description", UMapping.string)(_.field.updatable)
.property("occurence", UMapping.date)(_.field.updatable)
.property("occurDate", UMapping.date)(_.field.updatable)
.build

lazy val profile: PublicProperties =
Expand Down
4 changes: 2 additions & 2 deletions thehive/app/org/thp/thehive/models/Procedure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.util.Date
@BuildVertexEntity
case class Procedure(
description: String,
occurence: Date
occurDate: Date
// metadata
)

Expand All @@ -17,7 +17,7 @@ case class ProcedurePattern()

case class RichProcedure(procedure: Procedure with Entity, pattern: Pattern with Entity) {
def description: String = procedure.description
def occurence: Date = procedure.occurence
def occurDate: Date = procedure.occurDate
def _id: EntityId = procedure._id
def _createdAt: Date = procedure._createdAt
def _createdBy: String = procedure._createdBy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.util.Date

case class TestProcedure(
description: String,
occurence: Date,
occurDate: Date,
patternId: String
)

Expand Down Expand Up @@ -66,7 +66,7 @@ class ProcedureCtrlTest extends PlaySpecification with TestAppBuilder {
val updatedDate = new Date()
val request2 = FakeRequest("PATCH", "/api/v1/procedure/testProcedure3")
.withHeaders("user" -> "[email protected]")
.withJsonBody(Json.obj("description" -> "a new description", "occurence" -> updatedDate))
.withJsonBody(Json.obj("description" -> "a new description", "occurDate" -> updatedDate))
val result2 = app[ProcedureCtrl].update(procedureId)(request2)
status(result2) must beEqualTo(204).updateMessage(s => s"$s\n${contentAsString(result2)}")

Expand Down

0 comments on commit bd1bcd9

Please sign in to comment.