package org.nstart.dep265.requestservice.entity

import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.Table
import java.time.LocalDateTime
import java.util.UUID

@Entity
@Table(name = "request_route_matches")
class RequestRouteMatchEntity(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    var id: Long? = null,

    @Column(name = "request_id", nullable = false)
    var requestId: UUID,

    @Column(name = "route_id", nullable = false)
    var routeId: UUID,

    @Column(name = "original_intersection_geometry", nullable = false, columnDefinition = "TEXT")
    var originalIntersectionGeometry: String,

    @Column(name = "original_intersection_area", nullable = false)
    var originalIntersectionArea: Double,

    @Column(name = "applied_intersection_geometry", columnDefinition = "TEXT")
    var appliedIntersectionGeometry: String? = null,

    @Column(name = "applied_intersection_area", nullable = false)
    var appliedIntersectionArea: Double,

    @Column(name = "coverage_delta_percent", nullable = false)
    var coverageDeltaPercent: Double,

    @Column(name = "contributes_to_coverage", nullable = false)
    var contributesToCoverage: Boolean,

    @Column(name = "matched_at", nullable = false)
    var matchedAt: LocalDateTime,
)
