package io.nexilis.service.data.entities

import android.net.Uri
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.Index

@Entity(
    primaryKeys = ["message_id"],
    indices = [
        Index(value = ["opposite_pin", "chat_id", "server_date", "account_type", "mail_account", "reff_id", "local_timestamp", "call_center"])
    ]
)
data class Message(
    var message_id: String = "",
    var f_pin: String = "",
    var l_pin: String = "",
    var message_scope_id: String = "",
    var server_date: Long = 0,
    var status: String = "",
    var message_text: String = "",
    var audio_id: String = "",
    var video_id: String = "",
    var image_id: String = "",
    var thumb_id: String = "",
    var opposite_pin: String = "",
    var lock: String = "",
    var format: String = "",
    var broadcast_flag: Int = 0,
    var blog_id: String = "",
    var f_user_id: String = "",
    var l_user_id: String = "",
    var read_receipts: Int = 0,
    var chat_id: String = "",
    var file_id: String = "",
    var delivery_receipts: Int = 0,
    var account_type: String = "",
    var contact: String = "",
    var credential: String = "",
    var attachment_flag: Int = 0,
    var stared: Int = 0,
    var f_display_name: String = "",
    var reff_id: String = "",
    var sent_qty: Int = 0,
    var delivered_qty: Int = 0,
    var read_qty: Int = 0,
    var ack_qty: Int = 0,
    var read_local_qty: Int = 0,
    var delivered_pin: String = "",
    var read_pin: String = "",
    var ack_pin: String = "",
    var read_local_pin: String = "",
    var expired_qty: String = "",
    var message_large_text: String = "",
    var tag_forum: String = "",
    var tag_activity: String = "",
    var unk_numbers: Int = 0,
    var conn_state: Int = 1,
    var tag_client: String = "",
    var tag_subactivity: String = "",
    var messagenumber: Int = 0,
    var mail_account: String = "",
    var message_text_plain: String = "",
    var local_timestamp: Long = 0,
    var consult: Int = 0,
    var call_center: Int = 0,
    var call_center_id: String = "",
    var work_mode: Int = 0,
    @Ignore var uri: Uri = Uri.EMPTY
) : MainEntity {
    constructor(
        message_id: String = "",
        f_pin: String = "",
        l_pin: String = "",
        message_scope_id: String = "",
        server_date: Long = 0,
        status: String = "",
        message_text: String = "",
        audio_id: String = "",
        video_id: String = "",
        image_id: String = "",
        thumb_id: String = "",
        opposite_pin: String = "",
        lock: String = "",
        format: String = "",
        broadcast_flag: Int = 0,
        blog_id: String = "",
        f_user_id: String = "",
        l_user_id: String = "",
        read_receipts: Int = 0,
        chat_id: String = "",
        file_id: String = "",
        delivery_receipts: Int = 0,
        account_type: String = "",
        contact: String = "",
        credential: String = "",
        attachment_flag: Int = 0,
        stared: Int = 0,
        f_display_name: String = "",
        reff_id: String = "",
        sent_qty: Int = 0,
        delivered_qty: Int = 0,
        read_qty: Int = 0,
        ack_qty: Int = 0,
        read_local_qty: Int = 0,
        delivered_pin: String = "",
        read_pin: String = "",
        ack_pin: String = "",
        read_local_pin: String = "",
        expired_qty: String = "",
        message_large_text: String = "",
        tag_forum: String = "",
        tag_activity: String = "",
        unk_numbers: Int = 0,
        conn_state: Int = 1,
        tag_client: String = "",
        tag_subactivity: String = "",
        messagenumber: Int = 0,
        mail_account: String = "",
        message_text_plain: String = "",
        local_timestamp: Long = 0,
        consult: Int = 0,
        call_center: Int = 0,
        call_center_id: String = "",
        work_mode: Int = 0
    ) : this(
        message_id,
        f_pin,
        l_pin,
        message_scope_id,
        server_date,
        status,
        message_text,
        audio_id,
        video_id,
        image_id,
        thumb_id,
        opposite_pin,
        lock,
        format,
        broadcast_flag,
        blog_id,
        f_user_id,
        l_user_id,
        read_receipts,
        chat_id,
        file_id,
        delivery_receipts,
        account_type,
        contact,
        credential,
        attachment_flag,
        stared,
        f_display_name,
        reff_id,
        sent_qty,
        delivered_qty,
        read_qty,
        ack_qty,
        read_local_qty,
        delivered_pin,
        read_pin,
        ack_pin,
        read_local_pin,
        expired_qty,
        message_large_text,
        tag_forum,
        tag_activity,
        unk_numbers,
        conn_state,
        tag_client,
        tag_subactivity,
        messagenumber,
        mail_account,
        message_text_plain,
        local_timestamp,
        consult,
        call_center,
        call_center_id,
        work_mode,
        Uri.EMPTY
    )
}