Skip to content

Commit

Permalink
[Tech] upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed May 8, 2024
1 parent 9434d3a commit 43d453e
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 93 deletions.
26 changes: 13 additions & 13 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
`java-library`
`maven-publish`
id("org.springframework.boot") version "3.2.0"
id("org.jetbrains.kotlin.plugin.spring") version "1.9.10"
id("org.springframework.boot") version "3.2.5"
id("org.jetbrains.kotlin.plugin.spring") version "1.9.23"
kotlin("jvm") version "1.9.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.9.10"
id("org.jetbrains.kotlin.plugin.allopen") version "1.9.23"
kotlin("plugin.noarg") version "1.9.10"
kotlin("plugin.jpa") version "1.9.10"
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
Expand Down Expand Up @@ -41,12 +41,12 @@ tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompilation
}

dependencies {
api("org.springframework.boot:spring-boot-starter-web:3.1.4")
api("org.springframework.boot:spring-boot-starter-web:3.2.5")
api("org.hibernate.validator:hibernate-validator:8.0.1.Final")
api("jakarta.validation:jakarta.validation-api:3.0.2")
api("org.springframework.boot:spring-boot-starter-actuator:3.1.4")
api("org.springframework.boot:spring-boot-starter-json:3.1.5")
api("org.springframework.boot:spring-boot-starter-security:3.1.4")
api("org.springframework.boot:spring-boot-starter-actuator:3.2.5")
api("org.springframework.boot:spring-boot-starter-json:3.2.5")
api("org.springframework.boot:spring-boot-starter-security:3.2.5")
api("org.springframework.boot:spring-boot-starter-data-jpa:3.2.5")
api("org.hibernate.orm:hibernate-spatial:6.2.9.Final")
api("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.0")
Expand All @@ -55,33 +55,33 @@ dependencies {
api("org.flywaydb:flyway-core:9.22.0")
api("org.jetbrains.kotlin:kotlin-reflect:1.9.10")
api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10")
api("org.springframework.boot:spring-boot-configuration-processor:3.2.0")
api("org.springframework.boot:spring-boot-configuration-processor:3.2.5")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
api("com.neovisionaries:nv-i18n:1.29")
api("org.http4k:http4k-client-apache:5.10.4.0")
api("com.google.code.gson:gson:2.10.1")
api("org.springframework.boot:spring-boot-starter-cache:3.1.4")
api("org.springframework.boot:spring-boot-starter-cache:3.2.5")
api("com.github.ben-manes.caffeine:caffeine:3.1.5")
api("org.springframework.security:spring-security-test:6.1.5")
api("org.testcontainers:testcontainers:1.19.2")
api("io.hypersistence:hypersistence-utils-hibernate-62:3.5.2")
api("io.hypersistence:hypersistence-utils-hibernate-63:3.7.5")
api("org.assertj:assertj-core:3.24.2")
api("org.testcontainers:postgresql:1.19.2")
api("org.springframework.boot:spring-boot-starter-log4j2:3.1.4")
api("org.springframework.boot:spring-boot-starter-log4j2:3.2.5")
api("io.ktor:ktor-client-core-jvm:2.3.7")
api("io.ktor:ktor-client-java-jvm:2.3.7")
api("io.ktor:ktor-client-content-negotiation-jvm:2.3.7")
api("io.ktor:ktor-serialization-kotlinx-json-jvm:2.3.7")
api("io.sentry:sentry:6.31.0")
api("io.sentry:sentry-log4j2:7.8.0")
api("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0")
runtimeOnly("org.springframework.boot:spring-boot-devtools:3.1.4")
runtimeOnly("org.springframework.boot:spring-boot-devtools:3.2.5")
runtimeOnly("org.postgresql:postgresql:42.6.0")
testImplementation("io.ktor:ktor-client-mock-jvm:2.3.7")
testImplementation("jakarta.servlet:jakarta.servlet-api:6.0.0")
testImplementation("com.squareup.okhttp3:mockwebserver:4.10.0")
testImplementation("org.springframework.boot:spring-boot-starter-test:3.1.5")
testImplementation("org.springframework.boot:spring-boot-starter-test:3.2.5")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc:3.0.0")
testImplementation("org.testcontainers:junit-jupiter:1.19.2")
testImplementation("net.java.dev.jna:jna:5.13.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import fr.gouv.cacem.monitorenv.domain.entities.controlUnit.ControlUnitResourceE
import fr.gouv.cacem.monitorenv.domain.entities.controlUnit.ControlUnitResourceType
import fr.gouv.cacem.monitorenv.domain.entities.controlUnit.LegacyControlUnitResourceEntity
import fr.gouv.cacem.monitorenv.domain.use_cases.controlUnit.dtos.FullControlUnitResourceDTO
import io.hypersistence.utils.hibernate.type.basic.PostgreSQLEnumType
import jakarta.persistence.*
import org.hibernate.annotations.CreationTimestamp
import org.hibernate.annotations.Fetch
import org.hibernate.annotations.FetchMode
import org.hibernate.annotations.Type
import org.hibernate.annotations.JdbcType
import org.hibernate.annotations.UpdateTimestamp
import org.hibernate.dialect.PostgreSQLEnumJdbcType
import java.time.Instant

@Entity
Expand Down Expand Up @@ -47,7 +47,7 @@ data class ControlUnitResourceModel(

@Column(name = "type", nullable = false, columnDefinition = "control_unit_resource_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val type: ControlUnitResourceType,

@Column(name = "created_at_utc", nullable = false, updatable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.ActionTypeEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.EnvActionControlPlanEntity
import fr.gouv.cacem.monitorenv.domain.entities.mission.envAction.EnvActionEntity
import fr.gouv.cacem.monitorenv.domain.mappers.EnvActionMapper
import io.hypersistence.utils.hibernate.type.basic.PostgreSQLEnumType
import io.hypersistence.utils.hibernate.type.json.JsonBinaryType
import jakarta.persistence.CascadeType
import jakarta.persistence.Column
Expand All @@ -31,6 +30,7 @@ import org.hibernate.annotations.Fetch
import org.hibernate.annotations.FetchMode
import org.hibernate.annotations.JdbcType
import org.hibernate.annotations.Type
import org.hibernate.dialect.PostgreSQLEnumJdbcType
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType
import org.locationtech.jts.geom.Geometry
import org.n52.jackson.datatype.jts.GeometryDeserializer
Expand All @@ -55,7 +55,7 @@ class EnvActionModel(
@Column(name = "completed_by") val completedBy: String? = null,
@Column(name = "completion", columnDefinition = "mission_action_completion")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val completion: ActionCompletionEnum? = null,
@JsonSerialize(using = GeometrySerializer::class)
@JsonDeserialize(contentUsing = GeometryDeserializer::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ import fr.gouv.cacem.monitorenv.domain.entities.mission.MissionSourceEnum
import fr.gouv.cacem.monitorenv.domain.entities.mission.MissionTypeEnum
import fr.gouv.cacem.monitorenv.domain.use_cases.missions.dtos.EnvActionAttachedToReportingIds
import fr.gouv.cacem.monitorenv.domain.use_cases.missions.dtos.MissionDTO
import io.hypersistence.utils.hibernate.type.array.ListArrayType
import io.hypersistence.utils.hibernate.type.array.internal.AbstractArrayType.SQL_ARRAY_TYPE
import io.hypersistence.utils.hibernate.type.basic.PostgreSQLEnumType
import jakarta.persistence.*
import jakarta.persistence.CascadeType
import jakarta.persistence.OrderBy
import jakarta.persistence.Table
import org.hibernate.Hibernate
import org.hibernate.annotations.*
import org.hibernate.annotations.Parameter
import org.hibernate.dialect.PostgreSQLEnumJdbcType
import org.locationtech.jts.geom.MultiPolygon
import org.n52.jackson.datatype.jts.GeometryDeserializer
import org.n52.jackson.datatype.jts.GeometrySerializer
Expand Down Expand Up @@ -185,13 +182,9 @@ class MissionModel(

@Column(name = "mission_source", nullable = false, columnDefinition = "mission_source_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val missionSource: MissionSourceEnum,

@Type(
ListArrayType::class,
parameters = [Parameter(name = SQL_ARRAY_TYPE, value = "text")],
)
@Column(name = "mission_types", columnDefinition = "text[]")
val missionTypes: List<MissionTypeEnum>,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import fr.gouv.cacem.monitorenv.domain.entities.reporting.SourceTypeEnum
import fr.gouv.cacem.monitorenv.domain.entities.reporting.TargetDetailsEntity
import fr.gouv.cacem.monitorenv.domain.entities.reporting.TargetTypeEnum
import fr.gouv.cacem.monitorenv.domain.use_cases.reportings.dtos.ReportingDTO
import io.hypersistence.utils.hibernate.type.basic.PostgreSQLEnumType
import io.hypersistence.utils.hibernate.type.json.JsonBinaryType
import jakarta.persistence.CascadeType
import jakarta.persistence.Column
Expand All @@ -34,6 +33,7 @@ import org.hibernate.annotations.Generated
import org.hibernate.annotations.JdbcType
import org.hibernate.annotations.Type
import org.hibernate.annotations.UpdateTimestamp
import org.hibernate.dialect.PostgreSQLEnumJdbcType
import org.hibernate.generator.EventType
import org.hibernate.type.descriptor.jdbc.UUIDJdbcType
import org.locationtech.jts.geom.Geometry
Expand All @@ -49,7 +49,6 @@ class ReportingModel(
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", unique = true, nullable = false)
val id: Int? = null,

@Generated(event = [EventType.INSERT])
@Column(
name = "reporting_id",
Expand All @@ -59,59 +58,43 @@ class ReportingModel(
insertable = false,
)
val reportingId: Long? = null,

@Column(name = "source_type", columnDefinition = "reportings_source_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val sourceType: SourceTypeEnum? = null,

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "semaphore_id", nullable = true)
@JsonBackReference
val semaphore: SemaphoreModel? = null,

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "control_unit_id", nullable = true)
@JsonBackReference
val controlUnit: ControlUnitModel? = null,

@Column(name = "source_name")
val sourceName: String? = null,

@Column(name = "source_name") val sourceName: String? = null,
@Column(name = "target_type", columnDefinition = "reportings_target_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val targetType: TargetTypeEnum? = null,

@Column(name = "vehicle_type", columnDefinition = "reportings_vehicle_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val vehicleType: VehicleTypeEnum? = null,

@Column(name = "target_details", columnDefinition = "jsonb")
@Type(JsonBinaryType::class)
val targetDetails: List<TargetDetailsEntity>? = listOf(),

@JsonSerialize(using = GeometrySerializer::class)
@JsonDeserialize(contentUsing = GeometryDeserializer::class)
@Column(name = "geom")
val geom: Geometry? = null,

@Column(name = "sea_front")
val seaFront: String? = null,

@Column(name = "description")
val description: String? = null,

@Column(name = "sea_front") val seaFront: String? = null,
@Column(name = "description") val description: String? = null,
@Column(name = "report_type", columnDefinition = "reportings_report_type")
@Enumerated(EnumType.STRING)
@Type(PostgreSQLEnumType::class)
@JdbcType(PostgreSQLEnumJdbcType::class)
val reportType: ReportingTypeEnum? = null,

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "control_plan_theme_id", nullable = true)
val controlPlanTheme: ControlPlanThemeModel? = null,

@OneToMany(
fetch = FetchType.LAZY,
cascade = [CascadeType.ALL],
Expand All @@ -121,42 +104,21 @@ class ReportingModel(
@Fetch(value = FetchMode.SUBSELECT)
@OrderBy("orderIndex")
val controlPlanSubThemes: MutableSet<ReportingsControlPlanSubThemeModel>? = LinkedHashSet(),

@Column(name = "action_taken")
val actionTaken: String? = null,

@Column(name = "is_control_required")
val isControlRequired: Boolean? = null,

@Column(name = "has_no_unit_available")
val hasNoUnitAvailable: Boolean? = null,

@Column(name = "created_at")
val createdAt: Instant,

@Column(name = "validity_time")
val validityTime: Int? = null,

@Column(name = "is_archived", nullable = false)
val isArchived: Boolean,

@Column(name = "is_deleted", nullable = false)
val isDeleted: Boolean,

@Column(name = "open_by")
val openBy: String? = null,

@Column(name = "action_taken") val actionTaken: String? = null,
@Column(name = "is_control_required") val isControlRequired: Boolean? = null,
@Column(name = "has_no_unit_available") val hasNoUnitAvailable: Boolean? = null,
@Column(name = "created_at") val createdAt: Instant,
@Column(name = "validity_time") val validityTime: Int? = null,
@Column(name = "is_archived", nullable = false) val isArchived: Boolean,
@Column(name = "is_deleted", nullable = false) val isDeleted: Boolean,
@Column(name = "open_by") val openBy: String? = null,
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mission_id", nullable = true)
@JsonBackReference
val mission: MissionModel? = null,

@Column(name = "attached_to_mission_at_utc")
val attachedToMissionAtUtc: Instant? = null,

@Column(name = "attached_to_mission_at_utc") val attachedToMissionAtUtc: Instant? = null,
@Column(name = "detached_from_mission_at_utc")
val detachedFromMissionAtUtc: Instant? = null,

@JdbcType(UUIDJdbcType::class)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(
Expand All @@ -165,13 +127,8 @@ class ReportingModel(
referencedColumnName = "id",
)
val attachedEnvAction: EnvActionModel? = null,

@Column(name = "updated_at_utc")
@UpdateTimestamp
val updatedAtUtc: Instant? = null,

@Column(name = "with_vhf_answer")
val withVHFAnswer: Boolean? = null,
@Column(name = "updated_at_utc") @UpdateTimestamp val updatedAtUtc: Instant? = null,
@Column(name = "with_vhf_answer") val withVHFAnswer: Boolean? = null,
) {

fun toReporting() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ interface IDBMissionRepository : JpaRepository<MissionModel, Int> {
:missionStatuses IS NULL
OR (
'UPCOMING' IN :missionStatuses AND (
mission.startDateTimeUtc >= now()
mission.startDateTimeUtc >= CAST(now() AS timestamp)
))
OR (
'PENDING' IN :missionStatuses AND (
(mission.endDateTimeUtc IS NULL OR mission.endDateTimeUtc >= now())
AND (mission.startDateTimeUtc <= now())
(mission.endDateTimeUtc IS NULL OR mission.endDateTimeUtc >= CAST(now() AS timestamp))
AND (mission.startDateTimeUtc <= CAST(now() AS timestamp))
)
)
OR (
'ENDED' IN :missionStatuses AND (
mission.endDateTimeUtc < now()
mission.endDateTimeUtc < CAST(now() AS timestamp)
)
)
)
Expand Down

0 comments on commit 43d453e

Please sign in to comment.