package com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.models;

import androidx.annotation.NonNull;

import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;

import java.io.Serializable;
import java.util.Objects;

public class ContactData implements Serializable {
    public int id;
    public String first_name;
    public String phone_number;
    public String email_address;
    public String relationship;
    public String is_sos;
    public String contact_photo, photo_uri;
    public CareGiverData care_giver_data;

    public String extra_phone_numbers;

    public int contact_id;

    public String is_doctor;

    public ContactData() {
    }

    public ContactData(Contact contact){
        this.first_name = contact.first_name;
        this.phone_number = contact.phone_number;
        this.email_address = contact.email_address;
        this.extra_phone_numbers = contact.extra_phone_numbers;
        this.photo_uri = contact.imageUri;
    }

    public ContactData(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ContactData that = (ContactData) o;
        return id == that.id && Objects.equals(first_name, that.first_name) && Objects.equals(phone_number, that.phone_number) && Objects.equals(email_address, that.email_address) && Objects.equals(relationship, that.relationship) && Objects.equals(is_sos, that.is_sos) && Objects.equals(contact_photo, that.contact_photo) && Objects.equals(care_giver_data, that.care_giver_data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, first_name, phone_number, email_address, relationship, is_sos, contact_photo, care_giver_data);
    }

    @NonNull
    @Override
    public String toString() {
        return "ContactData{" +
                "id=" + id +
                ", first_name='" + first_name + '\'' +
                ", phone_number='" + phone_number + '\'' +
                ", email_address='" + email_address + '\'' +
                ", relationship='" + relationship + '\'' +
                ", is_sos='" + is_sos + '\'' +
                ", contact_photo='" + contact_photo + '\'' +
                ", care_giver_data=" + care_giver_data +
                '}';
    }
}
