package com.b2lmobitech.fieldcloudhrms

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

data class LoginResponse(
    val status: String,
    val message: String,
    val username: String?,
    val user_id: String?,
    val email: String?,
    val org_id: String?
)

data class User(
    val id: String,
    val name: String,
    val email: String
)
data class AttendanceResponse(
    val success: Boolean,
    val message: String
)
data class AttendanceRequest(
    val userId: String,
    val organizationId: String,
    val date: String,
    val dateTime: String,
    val status: String,
    val source: String,
    val shift_id: String?,
    val imageUrl: String? = null,
    val signatureUrl: String? = null,
    val latitude: String?,
    val longitude: String?,
    val isLate: String,
    val lateMinutes: String,
    val isEarly: String,
    val earlyMinutes: String
)
data class TodayAttendanceResponse(
    val success: Boolean,
    val status: String, // NOT_STARTED, IN, PRESENT
    val totalHours: String? = null,
    val message: String? = null
)
data class WeekAttendanceResponse(
    val success: Boolean,
    val data: List<AttendanceModel>
)
data class MoreMenuModel(
    val icon: Int,
    val title: String
)
data class ServerResponse(
    val status: String,
    val message: String,
    val fileUrl: String? = null
)
data class TimesheetModel(
    val id: String,
    val title: String,
    val startTime: String,
    val endTime: String,
    val totalHours: String,
    val description: String
)
data class FileResponse(
    val success: Boolean,
    val message: String,
    val fileUrls: List<String>? = null
)
data class BasicUploadResponse(
    val success: Boolean,
    val message: String,
    val imageurl: String? = null,
    val signatureurl: String? = null

)
data class TimesheetDetailsResponse(
    val id: String,
    val timesheet_id: String,
    val main_organisation_id: String,
    val people_id: String,
    val activity: String,
    val timesheetdate: String,
    val starttime: String,
    val endtime: String,
    val description: String,
    val attachments: List<TimesheetAttachment>
)
data class TimesheetAttachment(
    val id: String,
    val timesheet_id: String,
    val doc_path: String,
    val original_file_name: String
)
data class UserAttendanceConfigResponse(
    val success: Boolean,
    val checkin_image: String,
    val geofence: String,
    val locations: List<GeofenceLocation>
)

data class GeofenceLocation(
    val location_id: String,
    val latitude: String,
    val longitude: String,
    val geofence_distance: String
)

data class LeaveModel(
    val requestId: String,
    val leaveType: String,
    val leaveDate: String,
    val days: Int,
    val status: String,
    val reason: String
)
data class SimpleResponse(
    val status: Boolean,
    val message: String
)
data class TodayShiftResponse(
    val success: Boolean,
    val date: String,
    val shift: Shift?
)

data class Shift(
    val shift_id: String,
    val shift_name: String,
    val from_time: String,
    val to_time: String,
    val before_margin: String,
    val after_margin: String,
    val allowance: String?,
    val description: String?,
    val permissionMinutes: String
)
data class ProfileResponse(
    val success: Boolean,
    val data: ProfileData
)
data class ProfileData(
    val people_id: String?,
    val emp_id: String?,
    val name: String?,
    val email_id: String?,
    val mobile_number: String?,
    val gender: String?,
    val dob: String?,
    val join_date: String?,
    val emp_status: String?,
    val photo_image_path: String?,
    val aadhar_photo_path: String?,
    val blood_group: String?,
    val marital_status: String?,
    val address: String?,
    val aadhar_number: String?,
    val pan_number: String?,
    val role_name: String?,
    val department_name: String?,
    val designation_name: String?,
    val country_name: String?,
    val state_name: String?,
    val city_name: String?,
    val net_salary: String?,
    val basic_salary: String?,
    val pf: String?,
    val ctc: String?
)

@Parcelize
data class TravelModel(
    val travel_id: String,
    val location: String,
    val start_date: String,
    val end_date: String,
    val purpose: String,
    val duration: String,
    val customer_billable: String,
    val customer_name: String
) : Parcelable
data class TravelResponse(
    val success: Boolean,
    val data: List<TravelModel>
)
data class ApiResponse(
    val success: Boolean,
    val message: String
)
data class Country(val id: String, val country: String)
data class State(val id: String, val state: String)
data class City(val id: String, val city: String)

data class ListResponse<T>(
    val success: Boolean,
    val data: List<T>
)
data class PayslipData(
    val basic: Double,
    val hra: Double,
    val da: Double,
    val lta: Double,
    val bonus: Double,
    val transport: Double,
    val medical: Double,
    val otherAllowance: Double,

    val otherDeduction: Double,
    val arrears: Double,
    val tds: Double,
    val pf: Double,

    val netSalary: Double
)
data class PayslipMonth(
    val month: String,          // January 2025
    val isAvailable: Boolean,
    val payslip: PayslipData? = null
)
data class PayslipModel(

    /* ===== Employee Details (people table) ===== */
    val employeeName: String,
    val employeeId: String,
    val department: String,
    val designation: String,
    val panNumber: String,
    val joinDate: String,

    /* ===== Pay Period ===== */
    val month: Int,
    val year: Int,
    val paidDays: Int,
    val lossOfPayDays: Int,

    /* ===== Earnings ===== */
    val basicSalary: Double,
    val hra: Double,
    val dearnessAllowance: Double,
    val lta: Double,
    val bonus: Double,
    val transportAllowance: Double,
    val medicalAllowance: Double,
    val otherAllowance: Double,

    /* ===== Deductions ===== */
    val pf: Double,
    val tds: Double,
    val arrears: Double,
    val otherDeduction: Double,

    /* ===== Totals ===== */
    val grossEarnings: Double,
    val totalDeductions: Double,
    val netSalary: Double
)
data class EmployeeModel(

    val people_id: String,
    val emp_id: String,
    val name: String,
    val email_id: String,
    val mobile_number: String,

    val department_id: String,
    val designation_id: String,

    val join_date: String,        // yyyy-MM-dd
    val dob: String?,
    val gender: String?,
    val blood_group: String?,
    val marital_status: String?,

    val pan_number: String?,
    val aadhar_number: String?,

    val address: String?,
    val country: String?,
    val state: String?,
    val city: String?,
    val pincode: String?,

    val photo_image_path: String?
)
data class LeaveType(
    val leave_type_id: String,
    val leave_type: String,
    val yearly_quota: String
)
data class LeaveTypeResponse(
    val status: Boolean,
    val policy_id: String,
    val accrual_type: String,
    val accrual_value: String,
    val leave_types: List<LeaveType>,
    val message: String?
)
data class LeaveQuotaResponse(
    val status: Boolean,
    val message: String?,
    val used_days: Int,
    val remaining_days: Int
)
data class LeaveBalanceModel(
    val leave_type: String,
    val credited: Int,
    val used: Int,
    val balance: Int
)
data class LeaveBalanceResponse(
    val success: Boolean,
    val data: List<LeaveBalanceModel>
)
data class ProfilePhotoResponse(
    val success: Boolean,
    val photo: String?
)
data class TimesheetResponse(
    val status: String,
    val timesheet_id: String?,
    val message: String?
)

