aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--androidApp/build.gradle.kts2
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt53
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_calendar_today_24.xml5
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_fiber_manual_record_24.xml5
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_location_on_24.xml10
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_lock_24.xml5
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_lock_open_24.xml5
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_person_24.xml10
-rw-r--r--androidApp/src/main/res/drawable/ic_baseline_speed_24.xml10
-rw-r--r--androidApp/src/main/res/layout/unit_item.xml146
-rw-r--r--androidApp/src/main/res/layout/units_activity.xml2
-rw-r--r--androidApp/src/main/res/values/strings.xml11
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt10
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Command.kt12
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Device.kt4
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt10
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Event.kt16
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Geofence.kt14
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt10
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt10
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt18
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt19
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt32
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/User.kt4
24 files changed, 317 insertions, 106 deletions
diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts
index 6292a1e..3532986 100644
--- a/androidApp/build.gradle.kts
+++ b/androidApp/build.gradle.kts
@@ -1,5 +1,6 @@
plugins {
id("com.android.application")
+ id("kotlinx-serialization")
kotlin("android")
}
@@ -34,5 +35,6 @@ dependencies {
implementation("io.insert-koin:koin-android:3.1.4")
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.fragment:fragment-ktx:1.4.0")
+ implementation("io.ktor:ktor-client-serialization:1.6.6")
implementation(group = "", name = "WhirlyGlobeMaply", ext = "aar")
} \ No newline at end of file
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
index 4aa210d..dd7333d 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt
@@ -1,9 +1,15 @@
package mx.trackermap.TrackerMap.android.devices
+import android.graphics.Color
+import android.graphics.ColorFilter
+import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.view.ViewStructure
+import androidx.core.content.res.ResourcesCompat
import androidx.recyclerview.widget.RecyclerView
+import kotlinx.serialization.json.JsonNull
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.android.databinding.UnitItemBinding
import mx.trackermap.TrackerMap.client.models.UnitInformation
@@ -29,11 +35,46 @@ class DevicesAdapter(
holder.toggleOptions(false)
val unit = units[position]
+ val context = holder.itemView.context
holder.binding.apply {
+
+ unit.position?.let { position ->
+ /* Status icon */
+ position.speed?.let { speed ->
+ if (speed >= 2) {
+ statusIcon.setColorFilter(Color.GREEN)
+ } else {
+ statusIcon.setColorFilter(Color.RED)
+ }
+ } ?: run {
+ statusIcon.setColorFilter(Color.GRAY)
+ }
+
+ /* Engine stop */
+ val attributes = position.attributes
+ if (attributes["out1"].toString() == "null") {
+ engineStopIcon.visibility = View.GONE
+ } else {
+ engineStopIcon.visibility = View.VISIBLE
+ engineStopIcon.setImageResource(
+ when (attributes["out1"].toString()) {
+ "true" -> R.drawable.ic_baseline_lock_24
+ "false" -> R.drawable.ic_baseline_lock_open_24
+ else -> R.drawable.ic_baseline_lock_open_24
+ }
+ )
+ engineStopIcon.contentDescription = when (attributes["out1"].toString()) {
+ "true" -> context.getString(R.string.unit_lock_on)
+ "false" -> context.getString(R.string.unit_lock_off)
+ else -> context.getString(R.string.unit_lock_on)
+ }
+ }
+ }
+
unitName.text = unit.device.name
driverName.text = unit.device.contact
- unitSpeed.text = "${unit.position?.speed ?: "--"} Km/h"
- lastAddress.text = unit.position?.address ?: "Unknown location"
+ unitSpeed.text = context.getString(R.string.unit_speed_format, unit.position?.speed?.toInt() ?: 0)
+ lastAddress.text = unit.position?.address
lastDate.text = "yyyy/mm/dd, hh:mm"
actionCallback?.let { callback ->
detailsButton.setOnClickListener { callback(unit, Action.DETAILS) }
@@ -55,9 +96,11 @@ class DevicesAdapter(
fun toggleOptions(shouldExpand: Boolean) {
val context = binding.root.context
binding.unitCard.setCardBackgroundColor(
- context
- .resources
- .getColor(if (shouldExpand) R.color.background else R.color.darkBackground)
+ ResourcesCompat.getColor(
+ context.resources,
+ if (shouldExpand) R.color.background else R.color.darkBackground,
+ context.theme
+ )
)
binding.itemOptions.visibility = if (shouldExpand) View.VISIBLE else View.GONE
binding.unitCard.cardElevation = if (shouldExpand) 5.0F else 0.0F
diff --git a/androidApp/src/main/res/drawable/ic_baseline_calendar_today_24.xml b/androidApp/src/main/res/drawable/ic_baseline_calendar_today_24.xml
new file mode 100644
index 0000000..e059617
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_calendar_today_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="14dp" android:tint="?attr/colorControlNormal"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="14sp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M20,3h-1L19,1h-2v2L7,3L7,1L5,1v2L4,3c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,5c0,-1.1 -0.9,-2 -2,-2zM20,21L4,21L4,8h16v13z"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_fiber_manual_record_24.xml b/androidApp/src/main/res/drawable/ic_baseline_fiber_manual_record_24.xml
new file mode 100644
index 0000000..13890d5
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_fiber_manual_record_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="14dp" android:tint="?attr/colorControlNormal"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="14dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_location_on_24.xml b/androidApp/src/main/res/drawable/ic_baseline_location_on_24.xml
new file mode 100644
index 0000000..71ef7bc
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_location_on_24.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14sp"
+ android:height="14sp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_lock_24.xml b/androidApp/src/main/res/drawable/ic_baseline_lock_24.xml
new file mode 100644
index 0000000..ed352bf
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_lock_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="14sp" android:tint="#B71C1C"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="14sp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_lock_open_24.xml b/androidApp/src/main/res/drawable/ic_baseline_lock_open_24.xml
new file mode 100644
index 0000000..1fe62c8
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_lock_open_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="14sp" android:tint="#1B5E20"
+ android:viewportHeight="24" android:viewportWidth="24"
+ android:width="14sp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="@android:color/white" android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_person_24.xml b/androidApp/src/main/res/drawable/ic_baseline_person_24.xml
new file mode 100644
index 0000000..0faf05d
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_person_24.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14sp"
+ android:height="14sp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
+</vector>
diff --git a/androidApp/src/main/res/drawable/ic_baseline_speed_24.xml b/androidApp/src/main/res/drawable/ic_baseline_speed_24.xml
new file mode 100644
index 0000000..febd057
--- /dev/null
+++ b/androidApp/src/main/res/drawable/ic_baseline_speed_24.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="14sp"
+ android:height="14sp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?attr/colorControlNormal">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M20.38,8.57l-1.23,1.85a8,8 0,0 1,-0.22 7.58L5.07,18A8,8 0,0 1,15.58 6.85l1.85,-1.23A10,10 0,0 0,3.35 19a2,2 0,0 0,1.72 1h13.85a2,2 0,0 0,1.74 -1,10 10,0 0,0 -0.27,-10.44zM10.59,15.41a2,2 0,0 0,2.83 0l5.66,-8.49 -8.49,5.66a2,2 0,0 0,0 2.83z"/>
+</vector>
diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml
index 98fcb1b..f7ace03 100644
--- a/androidApp/src/main/res/layout/unit_item.xml
+++ b/androidApp/src/main/res/layout/unit_item.xml
@@ -9,56 +9,134 @@
app:cardCornerRadius="@dimen/card_border_radius"
app:cardElevation="0dp"
app:cardUseCompatPadding="true"
- app:contentPadding="16dp">
+ app:contentPadding="@dimen/card_padding">
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
android:animateLayoutChanges="true">
- <TextView
- android:id="@+id/unitName"
- android:layout_width="match_parent"
+ <ImageView
+ android:id="@+id/statusIcon"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="26dp"
- tools:text="1AAUTO" />
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/ic_baseline_fiber_manual_record_24"
+ app:tint="?android:textColorPrimary" />
- <TextView
- android:id="@+id/driverName"
- android:layout_width="match_parent"
+ <ImageView
+ android:id="@+id/engineStopIcon"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="Javier Zavala" />
+ android:layout_toEndOf="@id/statusIcon"
+ android:visibility="gone"
+ android:layout_marginEnd="5dp"
+ android:src="@drawable/ic_baseline_lock_24" />
<TextView
- android:id="@+id/unitSpeed"
+ android:id="@+id/unitName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="0 Km/h - Stopped" />
+ android:layout_toEndOf="@id/engineStopIcon"
+ style="@style/TextAppearance.AppCompat.Body2"
+ tools:text="1AAUTO" />
- <TextView
- android:id="@+id/lastAddress"
+ <GridLayout
+ android:id="@+id/gridLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="1000 Emerald Pools, CA" />
+ android:layout_below="@id/unitName">
- <TextView
- android:id="@+id/lastDate"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="18dp"
- tools:text="4 de Diciembre de 2021, 7:00 PM" />
+ <ImageView
+ android:id="@+id/driverNameIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="6dp"
+ android:layout_column="0"
+ android:layout_row="1"
+ android:contentDescription="@string/unit_driver_name"
+ android:src="@drawable/ic_baseline_person_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/driverName"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="1"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="Javier Zavala" />
+
+ <ImageView
+ android:id="@+id/unitSpeedIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="2"
+ style="@style/TextAppearance.MaterialComponents.Caption"
+ android:contentDescription="@string/unit_speed"
+ android:src="@drawable/ic_baseline_speed_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/unitSpeed"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="2"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="0 Km/h - Stopped" />
+
+ <ImageView
+ android:id="@+id/lastAddressIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="3"
+ android:contentDescription="@string/unit_last_address"
+ android:src="@drawable/ic_baseline_location_on_24"
+ app:tint="?android:textColorSecondary" />
+
+ <TextView
+ android:id="@+id/lastAddress"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="3"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="1000 Emerald Pools, CA" />
+
+ <ImageView
+ android:id="@+id/lastDateIcon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="4"
+ android:contentDescription="@string/unit_last_date"
+ android:src="@drawable/ic_baseline_calendar_today_24"
+ app:tint="?android:textColorSecondary" />
+
+
+ <TextView
+ android:id="@+id/lastDate"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_column="1"
+ android:layout_row="4"
+ style="@style/TextAppearance.AppCompat.Caption"
+ tools:text="4 de Diciembre de 2021, 7:00 PM" />
+
+ </GridLayout>
<LinearLayout
android:id="@+id/itemOptions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_below="@id/gridLayout"
+ android:layout_marginTop="@dimen/card_padding"
android:gravity="center"
android:orientation="horizontal"
- android:visibility="gone">
+ android:visibility="visible">
<com.google.android.material.button.MaterialButton
android:id="@+id/detailsButton"
@@ -66,8 +144,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/unit_details"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
<com.google.android.material.button.MaterialButton
android:id="@+id/reportsButton"
@@ -76,8 +154,8 @@
android:layout_marginHorizontal="8dp"
android:layout_weight="1"
android:text="@string/unit_reports"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
<com.google.android.material.button.MaterialButton
android:id="@+id/commandsButton"
@@ -85,11 +163,11 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/unit_commands"
- android:textColor="@color/colorPrimaryDark"
- app:backgroundTint="@color/darkBackground" />
+ android:textColor="@color/colorAccent"
+ style="?borderlessButtonStyle" />
</LinearLayout>
- </LinearLayout>
+ </RelativeLayout>
</com.google.android.material.card.MaterialCardView> \ No newline at end of file
diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml
index 4f4ee77..f0d80ab 100644
--- a/androidApp/src/main/res/layout/units_activity.xml
+++ b/androidApp/src/main/res/layout/units_activity.xml
@@ -37,7 +37,7 @@
app:layout_constraintBottom_toBottomOf="@id/displayModeToggle"
android:layout_marginVertical="@dimen/search_vertical_margin"
android:layout_marginHorizontal="@dimen/search_horizontal_margin"
- app:cardCornerRadius="25dp"
+ app:cardCornerRadius="@dimen/card_border_radius"
app:cardElevation="@dimen/card_elevation">
<com.google.android.material.textfield.TextInputEditText
diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml
index 0a42223..f4d69fb 100644
--- a/androidApp/src/main/res/values/strings.xml
+++ b/androidApp/src/main/res/values/strings.xml
@@ -8,6 +8,17 @@
<string name="login_login">Login</string>
<!-- Unit Item -->
+ <string name="unit_status_on">Status on</string>
+ <string name="unit_status_off">Status off</string>
+ <string name="unit_lock_on">Engine stop on</string>
+ <string name="unit_lock_off">Engine stop off</string>
+ <string name="unit_driver_name">Driver name</string>
+ <string name="unit_speed">Speed</string>
+ <string name="unit_last_address">Last position address</string>
+ <string name="unit_last_date">Last position datetime</string>
+
+ <string name="unit_speed_format">%1$d km/h</string>
+
<string name="unit_details">Details</string>
<string name="unit_reports">Reports</string>
<string name="unit_commands">Commands</string>
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
index 1718f0c..c528673 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Calendar.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -21,10 +23,10 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Calendar (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
+ val id: Int? = null,
+ val name: String? = null,
/* base64 encoded in iCalendar format */
- val `data`: kotlin.String? = null,
- val attributes: kotlin.Any? = null
+ val `data`: String? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Command.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Command.kt
index e7e2716..c1c6a5d 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Command.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Command.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -22,10 +24,10 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Command (
- val id: kotlin.Int? = null,
- val deviceId: kotlin.Int? = null,
- val description: kotlin.String? = null,
- val type: kotlin.String? = null,
- val attributes: kotlin.Any? = null
+ val id: Int? = null,
+ val deviceId: Int? = null,
+ val description: String? = null,
+ val type: String? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
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 f8a1642..4ea74e6 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
@@ -13,6 +13,7 @@ package mx.trackermap.TrackerMap.client.models
import kotlinx.datetime.LocalDateTime
import kotlinx.serialization.Serializable
+import kotlinx.serialization.json.JsonPrimitive
/**
@@ -48,6 +49,7 @@ data class Device (
val model: String? = null,
val contact: String? = null,
val category: String? = null,
- val geofenceIds: Array<Int>? = null
+ val geofenceIds: Array<Int>? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
index 09d369b..c83543e 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Driver.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -21,9 +23,9 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Driver (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
- val uniqueId: kotlin.String? = null,
- val attributes: kotlin.Any? = null
+ val id: Int? = null,
+ val name: String? = null,
+ val uniqueId: String? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Event.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Event.kt
index 701252f..e504600 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Event.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Event.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -25,14 +27,14 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Event (
- val id: kotlin.Int? = null,
- val type: kotlin.String? = null,
+ val id: Int? = null,
+ val type: String? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
val eventTime: java.time.LocalDateTime? = null,
- val deviceId: kotlin.Int? = null,
- val positionId: kotlin.Int? = null,
- val geofenceId: kotlin.Int? = null,
- val maintenanceId: kotlin.Int? = null,
- val attributes: kotlin.Any? = null
+ val deviceId: Int? = null,
+ val positionId: Int? = null,
+ val geofenceId: Int? = null,
+ val maintenanceId: Int? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Geofence.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Geofence.kt
index 783786a..f82ca07 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Geofence.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Geofence.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -23,11 +25,11 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Geofence (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
- val description: kotlin.String? = null,
- val area: kotlin.String? = null,
- val calendarId: kotlin.Int? = null,
- val attributes: kotlin.Any? = null
+ val id: Int? = null,
+ val name: String? = null,
+ val description: String? = null,
+ val area: String? = null,
+ val calendarId: Int? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
index 6c9d3b8..b90e591 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Group.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -21,9 +23,9 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Group (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
- val groupId: kotlin.Int? = null,
- val attributes: kotlin.Any? = null
+ val id: Int? = null,
+ val name: String? = null,
+ val groupId: Int? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
index 670d1e2..f9d4fcd 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Maintenance.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -23,11 +25,11 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Maintenance (
- val id: kotlin.Int? = null,
- val name: kotlin.String? = null,
- val type: kotlin.String? = null,
+ val id: Int? = null,
+ val name: String? = null,
+ val type: String? = null,
val start: java.math.BigDecimal? = null,
val period: java.math.BigDecimal? = null,
- val attributes: kotlin.Any? = null
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
index 50be5dd..2be5468 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Notification.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -25,13 +27,13 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Notification (
- val id: kotlin.Int? = null,
- val type: kotlin.String? = null,
- val always: kotlin.Boolean? = null,
- val web: kotlin.Boolean? = null,
- val mail: kotlin.Boolean? = null,
- val sms: kotlin.Boolean? = null,
- val calendarId: kotlin.Int? = null,
- val attributes: kotlin.Any? = null
+ val id: Int? = null,
+ val type: String? = null,
+ val always: Boolean? = null,
+ val web: Boolean? = null,
+ val mail: Boolean? = null,
+ val sms: Boolean? = null,
+ val calendarId: Int? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ 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 d765825..9a16615 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
@@ -12,7 +12,11 @@
package mx.trackermap.TrackerMap.client.models
import kotlinx.datetime.LocalDateTime
+import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
+import kotlinx.serialization.json.Json
+import kotlinx.serialization.json.JsonObject
+import kotlinx.serialization.json.JsonPrimitive
/**
@@ -38,24 +42,25 @@ import kotlinx.serialization.Serializable
@Serializable
data class Position (
- val id: kotlin.Int? = null,
- val deviceId: kotlin.Int? = null,
- val protocol: kotlin.String? = null,
+ val id: Int? = null,
+ val deviceId: Int? = null,
+ val protocol: String? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
// val deviceTime: LocalDateTime? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
// val fixTime: LocalDateTime? = null,
/* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */
// val serverTime: LocalDateTime? = null,
- val outdated: kotlin.Boolean? = null,
- val valid: kotlin.Boolean? = null,
+ val outdated: Boolean? = null,
+ val valid: Boolean? = null,
val latitude: Double? = null,
val longitude: Double? = null,
val altitude: Double? = null,
/* in knots */
val speed: Double? = null,
val course: Double? = null,
- val address: kotlin.String? = null,
- val accuracy: Double? = null
+ val address: String? = null,
+ val accuracy: Double? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
index 24c7a20..d2ea44e 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Server.kt
@@ -11,6 +11,8 @@
*/
package mx.trackermap.TrackerMap.client.models
+import kotlinx.serialization.json.JsonPrimitive
+
/**
*
@@ -34,22 +36,22 @@ package mx.trackermap.TrackerMap.client.models
*/
data class Server (
- val id: kotlin.Int? = null,
- val registration: kotlin.Boolean? = null,
- val readonly: kotlin.Boolean? = null,
- val deviceReadonly: kotlin.Boolean? = null,
- val limitCommands: kotlin.Boolean? = null,
- val map: kotlin.String? = null,
- val bingKey: kotlin.String? = null,
- val mapUrl: kotlin.String? = null,
- val poiLayer: kotlin.String? = null,
+ val id: Int? = null,
+ val registration: Boolean? = null,
+ val readonly: Boolean? = null,
+ val deviceReadonly: Boolean? = null,
+ val limitCommands: Boolean? = null,
+ val map: String? = null,
+ val bingKey: String? = null,
+ val mapUrl: String? = null,
+ val poiLayer: String? = null,
val latitude: java.math.BigDecimal? = null,
val longitude: java.math.BigDecimal? = null,
- val zoom: kotlin.Int? = null,
- val twelveHourFormat: kotlin.Boolean? = null,
- val version: kotlin.String? = null,
- val forceSettings: kotlin.Boolean? = null,
- val coordinateFormat: kotlin.String? = null,
- val attributes: kotlin.Any? = null
+ val zoom: Int? = null,
+ val twelveHourFormat: Boolean? = null,
+ val version: String? = null,
+ val forceSettings: Boolean? = null,
+ val coordinateFormat: String? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) {
} \ No newline at end of file
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/User.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/User.kt
index 1bda398..4906f09 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/User.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/User.kt
@@ -14,6 +14,7 @@ package mx.trackermap.TrackerMap.client.models
import kotlinx.datetime.LocalDate
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
+import kotlinx.serialization.json.JsonPrimitive
/**
@@ -64,5 +65,6 @@ data class User (
val deviceReadonly: Boolean? = null,
val limitCommands: Boolean? = null,
val poiLayer: String? = null,
- val token: String? = null
+ val token: String? = null,
+ val attributes: Map<String, JsonPrimitive> = mapOf()
) \ No newline at end of file