Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org) using the following scheme: MAJOR.MINOR.PATCH

## [0.43.0] - 2026-05-21

### Changed
- Fixed DolibarrIntervention decoding/encoding

## [0.42.0] - 2026-05-21

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ public final class DolibarrInterventionLine: CommonBusinessObjectLine {
enum CodingKeys: String, CodingKey {
case dateIntervene = "datei"
case durationSeconds = "duration"
case durationSecondsV21 = "duree"
case interventionId = "fk_fichinter"
case description = "desc"
case desc = "desc"
case description = "description"
}

// MARK: - Inits
Expand Down Expand Up @@ -112,8 +114,11 @@ public final class DolibarrInterventionLine: CommonBusinessObjectLine {
self.dateIntervene = try container.decode(Int.self, forKey: .dateIntervene)
self.durationSeconds = try container.decode(String.self, forKey: .durationSeconds)
self.interventionId = try container.decode(String.self, forKey: .interventionId)
self.description = try container.decodeIfPresent(String.self, forKey: .description)
self.description = try container.decodeIfPresent(String.self, forKey: .desc)
try super.init(from: decoder)
if self.durationSeconds.isEmpty {
self.durationSeconds = try container.decode(String.self, forKey: .durationSecondsV21)
}
#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS) || os(visionOS)
Logger.logWithoutSignal("\(Self.self).init.decoded", category: .api)
#endif
Expand Down Expand Up @@ -162,6 +167,7 @@ public final class DolibarrInterventionLine: CommonBusinessObjectLine {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(dateIntervene, forKey: .dateIntervene)
try container.encode(durationSeconds, forKey: .durationSeconds)
try container.encode(durationSeconds, forKey: .durationSecondsV21)
try container.encode(interventionId, forKey: .interventionId)
try container.encodeIfPresent(description, forKey: .description)
try super.encode(to: encoder)
Expand Down
Loading