import { Member } from "@/@types/member"

/**
 * Search Type
 */
export type SearchType = {
    keyword: string,
}

/**
 * Member List
 */
export type FinalLogType = {
    id                  : number,
    code                : string,
    member              : Member,
    member_name         : string,
    submission_date     : string,
    service_name        : string,
    payment_type_name   : string,
    status_final_log    : string,
    provider            : string,
    status              : string,
    files_by_type   : files_by_type,
}


export type DetailFinalLogType = {
    id                  : number,
    code                : string,
    member_id           : string, 
    provider            : string,
    policy_number       : string,
    name                : string|any,
    date_of_birth       : string,
    gender              : string,
    marital_status      : string,
    submission_date     : string,
    service_type        : string,
    claim_method        : string,
    status              : string,
    status_final_log    : string,
    no_identitas        : string,
    keterangan          : string,
    hak_kamar_pasien    : string,
    penempatan_kamar    : string,
    catatan             : string,
    discharge_date      : string,
    reason              : string,
    diagnosis           : Diagnosis[],
    benefit             : Benefit[],
    benefit_data        : BenefitData[],
    config_service      : ConfigService,
    exclusion           : Exclusion[],
    medicine            : Medicine[],
    files               : file[],
}

export type Diagnosis = {
    id : number,
    name : string,
    code : string
}

export type BenefitData = {
    amount_incurred : number,
    amount_approved : number,
    amount_not_approved : number,
    excess_paid : number,
    keterangan : string,
    benefit : Benefit,
    request_log_id : number,
    benefit_name : string,
    description : string,
    id : number,
}

export type BenefitConfigurationListType = {
    request_log_id: number|undefined,
    benefit_name: string,
    benefit: {
        description: string
    },
    amount_incurred: number,
    amount_approved: number,
    amount_not_approved: number,
    excess_paid: number,
    keterangan: string,
    description: string,
}

export type Benefit = {
    id: number,
    code: string,
    description: string
}

export type files_by_type = {
    claim_diagnosis : file[],
    claim_kondisi : file[],
    claim_result : file[],
}

export type file = {
    original_name: string,
    name: string,
    path: string,
    url: string,
}

export type ConfigService = {
    gp_external_doctor_online: string,
    gp_external_doctor_offline: string,
    gp_internal_doctor_online: string,
    gp_internal_doctor_offline: string,
    sp_external_doctor_online: string,
    sp_external_doctor_offline: string,
    sp_internal_doctor_online: string,
    sp_internal_doctor_offline: string,
    vitamins: string,
    delivery_fee: string,
    general_practitioner_fee: string,
    specialist_practitioner_fee: string
}

export type Exclusion = {
    exclusionable: {
        code: string,
        name: string
    },
    rules: Rule[]
}

export type Rule = {
    id: number,
    exclusion_id: number,
    name: string,
    values: string,

}

export type MedicineType = {
    medicine: Medicine[],
}

export type Medicine = {
    id: number,
    medicine_name: string,
    medicine_price: number,
    medicine: string,
    price: number,
    request_log_id: number|undefined,
}


