Skip to content

Commit

Permalink
Fix nullable property total weight onboard
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Feb 5, 2025
1 parent 1378edd commit 854e38c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ data class RiskFactorsEntity(
val riskFactor: Double,
@Type(JsonBinaryType::class)
@Column(name = "gear_onboard", columnDefinition = "jsonb")
val gearOnboard: String,
val gearOnboard: String?,
@Type(JsonBinaryType::class)
@Column(name = "species_onboard", columnDefinition = "jsonb")
val speciesOnboard: String,
val speciesOnboard: String?,
@Column(name = "segments", columnDefinition = "varchar(50)[]")
val segments: List<String>,
@Column(name = "segment_highest_impact")
Expand All @@ -47,7 +47,7 @@ data class RiskFactorsEntity(
@Column(name = "control_rate_risk_factor")
val controlRateRiskFactor: Double,
@Column(name = "total_weight_onboard")
val totalWeightOnboard: Double,
val totalWeightOnboard: Double?,
@Column(name = "infraction_score")
val infractionScore: Double? = null,
@Column(name = "number_controls_last_5_years")
Expand Down Expand Up @@ -78,7 +78,7 @@ data class RiskFactorsEntity(
controlPriorityLevel = controlPriorityLevel,
segmentHighestImpact = segmentHighestImpact,
segmentHighestPriority = segmentHighestPriority,
totalWeightOnboard = totalWeightOnboard,
totalWeightOnboard = totalWeightOnboard ?: 0.0,
lastControlDatetime = lastControlDatetime,
controlRateRiskFactor = controlRateRiskFactor,
numberControlsLastFiveYears = numberControlsLastFiveYears,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ INSERT INTO risk_factors (cfr, control_priority_level, control_rate_risk_factor,

INSERT INTO risk_factors (cfr, control_priority_level, control_rate_risk_factor, departure_datetime_utc, detectability_risk_factor, external_immatriculation, impact_risk_factor, infraction_rate_risk_factor, infraction_score, ircs, last_control_datetime_utc, last_control_infraction, last_logbook_message_datetime_utc, number_controls_last_3_years, number_controls_last_5_years, number_gear_seizures_last_5_years, number_infractions_last_5_years, number_recent_controls, number_species_seizures_last_5_years, number_vessel_seizures_last_5_years, post_control_comments, probability_risk_factor, risk_factor, segment_highest_impact, segment_highest_priority, segments, total_weight_onboard, trip_number, vessel_id, gear_onboard, species_onboard) VALUES ('CFR115', 4, 5, NOW() - INTERVAL '1 day', 5, 'EXTIMM115', 4, 3, NULL, 'IRCS115', '2024-05-01 00:00:00', true, NOW(), 0, 0, 4, 5, 0, 3, 2, '', 4, 2.5, 'NWW10', 'PEL03', '{"NWW10", "PEL03"}', 12345.67, 123102, 115, '[{"gear":"OTB","mesh":70,"dimensions":45}]', '[{"gear":"OTB","faoZone":"27.8.b","species":"BLI","weight":13.46},{"gear":"OTB","faoZone":"27.8.c","species":"HKE","weight":235.6},{"gear":"OTB","faoZone":"27.8.b","species":"HKE","weight":235.6}]');

INSERT INTO risk_factors (cfr, control_priority_level, control_rate_risk_factor, departure_datetime_utc, detectability_risk_factor, external_immatriculation, impact_risk_factor, infraction_rate_risk_factor, infraction_score, ircs, last_control_datetime_utc, last_control_infraction, last_logbook_message_datetime_utc, number_controls_last_3_years, number_controls_last_5_years, number_gear_seizures_last_5_years, number_infractions_last_5_years, number_recent_controls, number_species_seizures_last_5_years, number_vessel_seizures_last_5_years, post_control_comments, probability_risk_factor, risk_factor, segment_highest_impact, segment_highest_priority, segments, total_weight_onboard, trip_number, vessel_id, gear_onboard, species_onboard) VALUES ('CFR117', 4, 5, NOW() - INTERVAL '1 day', 1.8, 'EXTIMM117', 2, 3, NULL, 'IRCS117', '2023-10-15 00:00:00', true, NOW(), 0, 0, 4, 5, 0, 3, 2, '', 3, 2.2, 'NWW10', 'PEL03', '{"NWW10", "PEL03"}', 12345.67, 123102, 117, '[{"gear":"OTB","mesh":70,"dimensions":45}]', '[{"gear":"OTB","faoZone":"27.8.b","species":"BLI","weight":13.46},{"gear":"OTB","faoZone":"27.8.c","species":"HKE","weight":235.6},{"gear":"OTB","faoZone":"27.8.b","species":"HKE","weight":235.6}]');
INSERT INTO risk_factors (cfr, control_priority_level, control_rate_risk_factor, departure_datetime_utc, detectability_risk_factor, external_immatriculation, impact_risk_factor, infraction_rate_risk_factor, infraction_score, ircs, last_control_datetime_utc, last_control_infraction, last_logbook_message_datetime_utc, number_controls_last_3_years, number_controls_last_5_years, number_gear_seizures_last_5_years, number_infractions_last_5_years, number_recent_controls, number_species_seizures_last_5_years, number_vessel_seizures_last_5_years, post_control_comments, probability_risk_factor, risk_factor, segment_highest_impact, segment_highest_priority, segments, total_weight_onboard, trip_number, vessel_id, gear_onboard, species_onboard) VALUES ('CFR117', 4, 5, NOW() - INTERVAL '1 day', 1.8, 'EXTIMM117', 2, 3, NULL, 'IRCS117', '2023-10-15 00:00:00', true, NOW(), 0, 0, 4, 5, 0, 3, 2, '', 3, 2.2, 'NWW10', 'PEL03', '{"NWW10", "PEL03"}', NULL, 123102, 117, '[{"gear":"OTB","mesh":70,"dimensions":45}]', '[{"gear":"OTB","faoZone":"27.8.b","species":"BLI","weight":13.46},{"gear":"OTB","faoZone":"27.8.c","species":"HKE","weight":235.6},{"gear":"OTB","faoZone":"27.8.b","species":"HKE","weight":235.6}]');
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
"segment_highest_impact": "NWW10",
"segment_highest_priority": "PEL03",
"segments": ["NWW10", "PEL03"],
"total_weight_onboard": 12345.67,
"total_weight_onboard": null,
"trip_number": 123102,
"vessel_id": 117,
"gear_onboard:jsonb": [
Expand Down

0 comments on commit 854e38c

Please sign in to comment.