Firebase Realtime Database has a different data key from the Kotlin data class

Viewed 19

I have multiple data classes and all upload fine to Firebase Realtime database except for this one key "isCompleted" gets changed to "completed" in the database.

My data class:

data class MaintenanceLog(
    val isCompleted: Boolean? = null,
    val brand: String? = null,
    val clientCode: String? = null,
    val dateOfSubmission: Double? = null,
    val details: String? = null,
    val equipmentID: String? = null,
    val id: String? = null,
    val model: String? = null,
    val name: String? = null,
    val photosArray: List<String>? = null,
    val refNum: String? = null,
    val restaurantID: String? = null,
    var hidden: Boolean? = null,
    val userSelectedDate: Double? = null,
    val wasFutureMaintCreated: Boolean? = null,
    val workLogRef: String? = null,
    val contractorCode: String? = null,
    val isCalendarEvent: Boolean? = null,
    val calendarEvent_venueName: String? = null,
    val createdBy: String? = null
)

Implementation:

        val demoLog = MaintenanceLog(
            isCompleted = true,
            id = "DemoLog22222",
            equipmentID = "demo_equipID_123456",
            refNum = "DemoRefNum_123456",
            dateOfSubmission = APSDate.getCurrentDatabaseFormattedTime(),
            details = "Maintenance Log created from Work Log - Demo Description",
            photosArray = null,
            workLogRef = "DemoRefNum_123456",
            createdBy = "Demo User",
            clientCode = "Demo Client",
            restaurantID = "Demo Restaurant",
            brand = "Demo Brand",
            model = "Demo Model",
            name = "Demo User",
            userSelectedDate = APSDate.dateFromComponents(timeIn_Year, timeIn_Month, timeIn_Day, timeIn_Hour, timeIn_Minute),
            wasFutureMaintCreated = false)

        dbRef.child(FirebaseLocations.MAINTENANCE_RECORDS.code).child("111_demo_path").setValue(demoLog)

The demo log when setting the value:

enter image description here

And the firebase value:

enter image description here

Why is "isCompleted" getting changed to "completed" when uploaded to the database?

0 Answers
Related