public with sharing class LexCancelConsumDetailsCtl {
    public LexCancelConsumDetailsCtl() {

    }

    @AuraEnabled
    public static List<Consum_Apply_Equipment_Set__c> splitApplyButton(String recordId){

        try{
            List<Consum_Apply_Equipment_Set__c> report=[select RAES_Status__c from Consum_Apply_Equipment_Set__c where Consum_Apply__c =: recordId];
            return report;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO,'Consum_Apply_Equipment_Set__c Cancel Error : ' + e);
        }
        return null;
    }

    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try {
            Consum_Apply__c rep = [select Id,Yi_loaner_arranged__c from Consum_Apply__c where Id =: recordId];
            res.consumApplyId = rep.Id;
            res.yiLoaner = rep.Yi_loaner_arranged__c;
            Consum_Apply_Equipment_Set__c repSet = [select Id,Yi_loaner_arranged__c from Consum_Apply_Equipment_Set__c where Id =: recordId];
            res.equipmentyiLoaner = repSet.Yi_loaner_arranged__c;
            return res;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
    }
    public class InitData{
        @AuraEnabled
        public String consumApplyId;
        @AuraEnabled
        public Decimal yiLoaner;
        @AuraEnabled
        public Decimal equipmentyiLoaner;
    }



}