aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2021-12-08 04:28:51 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2021-12-08 04:28:51 -0600
commitfabb451dbdbd28b0f09b91ee193d6d62ed027df7 (patch)
tree896334a1d8a0540b9d54c7390db2d78e61cadb1b /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models
parentfce7acfe3581e5bb13bf15debb4289a1735d12ff (diff)
downloadetbsa-trackermap-mobile-fabb451dbdbd28b0f09b91ee193d6d62ed027df7.tar.gz
etbsa-trackermap-mobile-fabb451dbdbd28b0f09b91ee193d6d62ed027df7.tar.bz2
etbsa-trackermap-mobile-fabb451dbdbd28b0f09b91ee193d6d62ed027df7.zip
WIP: Implements the basic structure for the units list/map
- Updates the Devices and Positions APIs to properly construct the Url's query when there are null values - Adds a units controller to the shared module - Adds a devices and map fragment that each print the fetched units on the console - Adds a units view model to connect previously mentioned fragments with the units controller
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt31
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt24
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt6
3 files changed, 36 insertions, 25 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt
index 3729345..f8a1642 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt
@@ -11,6 +11,9 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.datetime.LocalDateTime
+import kotlinx.serialization.Serializable
+
/**
*
@@ -29,22 +32,22 @@ package mx.trackermap.TrackerMap.client.models
* @param geofenceIds
* @param attributes
*/
+@Serializable
data class Device (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
- val uniqueId: kotlin.String? = null,
- val status: kotlin.String? = null,
- val disabled: kotlin.Boolean? = null,
+ val id: Int,
+ val name: String,
+ val uniqueId: String? = null,
+ val status: String? = null,
+ val disabled: Boolean? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val lastUpdate: java.time.LocalDateTime? = null,
- val positionId: kotlin.Int? = null,
- val groupId: kotlin.Int? = null,
- val phone: kotlin.String? = null,
- val model: kotlin.String? = null,
- val contact: kotlin.String? = null,
- val category: kotlin.String? = null,
- val geofenceIds: kotlin.Array<kotlin.Int>? = null,
- val attributes: kotlin.Any? = null
+// val lastUpdate: LocalDateTime? = null,
+ val positionId: Int? = null,
+ val groupId: Int? = null,
+ val phone: String? = null,
+ val model: String? = null,
+ val contact: String? = null,
+ val category: String? = null,
+ val geofenceIds: Array<Int>? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt
index 0ce4ed2..d765825 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt
@@ -11,6 +11,9 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.datetime.LocalDateTime
+import kotlinx.serialization.Serializable
+
/**
*
@@ -32,28 +35,27 @@ package mx.trackermap.TrackerMap.client.models
* @param network
* @param attributes
*/
+@Serializable
data class Position (
val id: kotlin.Int? = null,
val deviceId: kotlin.Int? = null,
val protocol: kotlin.String? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val deviceTime: java.time.LocalDateTime? = null,
+// val deviceTime: LocalDateTime? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val fixTime: java.time.LocalDateTime? = null,
+// val fixTime: LocalDateTime? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
- val serverTime: java.time.LocalDateTime? = null,
+// val serverTime: LocalDateTime? = null,
val outdated: kotlin.Boolean? = null,
val valid: kotlin.Boolean? = null,
- val latitude: java.math.BigDecimal? = null,
- val longitude: java.math.BigDecimal? = null,
- val altitude: java.math.BigDecimal? = null,
+ val latitude: Double? = null,
+ val longitude: Double? = null,
+ val altitude: Double? = null,
/* in knots */
- val speed: java.math.BigDecimal? = null,
- val course: java.math.BigDecimal? = null,
+ val speed: Double? = null,
+ val course: Double? = null,
val address: kotlin.String? = null,
- val accuracy: java.math.BigDecimal? = null,
- val network: kotlin.Any? = null,
- val attributes: kotlin.Any? = null
+ val accuracy: Double? = null
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt
new file mode 100644
index 0000000..edebff0
--- /dev/null
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/UnitInformation.kt
@@ -0,0 +1,6 @@
+package mx.trackermap.TrackerMap.client.models
+
+data class UnitInformation(
+ val device: Device,
+ val position: Position?
+) \ No newline at end of file