package com.example.ops_android.data.model

import com.google.gson.annotations.SerializedName

data class Customer(
    @SerializedName("id") val id: Int = 0,
    @SerializedName("first_name") val first_name: String? = null,
    @SerializedName("last_name") val last_name: String? = null,
    @SerializedName("primary_phone") val phone: String? = null,
    @SerializedName("primary_email") val email: String? = null,
    @SerializedName("created_at") val created_at: String? = null,
    @SerializedName("created_by") val user_id: Int? = null,
    @SerializedName("address") private val _address: String? = null,
    @SerializedName("remark") private val _remark: String? = null
) {
    // backward-compat with UI code
    val name: String? get() = listOfNotNull(first_name, last_name).joinToString(" ").ifEmpty { null }
    val address: String? get() = _address
    val remark: String? get() = _remark
}
