-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#133): distinguish between data synchronization and observation …
…records synchronization
- Loading branch information
Showing
45 changed files
with
1,557 additions
and
890 deletions.
There are no files selected for viewing
Submodule gn_mobile_core
updated
15 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
occtax/src/main/java/fr/geonature/occtax/features/record/domain/SynchronizationStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package fr.geonature.occtax.features.record.domain | ||
|
||
import androidx.work.WorkInfo | ||
|
||
/** | ||
* Describes the current status of [ObservationRecord] synchronization. | ||
* | ||
* @author S. Grimault | ||
*/ | ||
sealed class SynchronizationStatus(open val state: WorkInfo.State ) { | ||
|
||
/** | ||
* The current worker status. | ||
*/ | ||
data class WorkerStatus(override val state: WorkInfo.State) : SynchronizationStatus(state) | ||
|
||
/** | ||
* The current [ObservationRecord] status. | ||
*/ | ||
data class ObservationRecordStatus( | ||
override val state: WorkInfo.State, | ||
val internalId: Long, | ||
val status: ObservationRecord.Status | ||
) : SynchronizationStatus(state) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...fr/geonature/occtax/features/record/repository/ISynchronizeObservationRecordRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fr.geonature.occtax.features.record.repository | ||
|
||
import fr.geonature.occtax.features.record.domain.ObservationRecord | ||
import fr.geonature.occtax.features.record.error.ObservationRecordException | ||
|
||
/** | ||
* Synchronize observation record. | ||
* | ||
* @author S. Grimault | ||
*/ | ||
interface ISynchronizeObservationRecordRepository { | ||
|
||
/** | ||
* Performs synchronization of given [ObservationRecord]. | ||
* Returns [ObservationRecordException.InvalidStatusException] if this [ObservationRecord] has a | ||
* wrong status. | ||
*/ | ||
suspend fun synchronize(observationRecord: ObservationRecord): Result<ObservationRecord> | ||
} |
Oops, something went wrong.