package com.pixelized.biblib.model.book

import java.util.*

data class Book(
    val id: Int,
    val title: String,
    val sort: String,
    val author: List<Author>,
    val haveCover: Boolean,
    val releaseDate: Date,
    val language: Language? = null,
    val rating: Int? = null,
    val genre: List<Genre>? = null,
    // details
    val series: Series? = null,
    val seriesIndex: Int? = null,
    val synopsis: String? = null,
    // source
    val isNew: Boolean = false,
    val newOrder: Int? = null,
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is Book) return false
        if (id != other.id) return false
        return true
    }

    override fun hashCode(): Int {
        return id
    }
}