public with sharing class buttonMaintenanceTaskCtl {
    public buttonMaintenanceTaskCtl() {

    }

    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Maintenance_Task__c report =  [SELECT Id,Maintenance_Contract__c  FROM Maintenance_Task__c WHERE Id =: recordId LIMIT 1];
            System.debug(LoggingLevel.INFO, '*** opp: ' + report);
            res.Id = report.Id;
            res.MaintenanceContractC = report.Maintenance_Contract__c;

            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }   


    @AuraEnabled
    public static List<Maintenance_Contract__c> selectMaintenanceContract(String Id){
        List<Maintenance_Contract__c> res = new List<Maintenance_Contract__c>();
        try{
            res = [SELECT Id,RecordType_DeveloperName__c,Estimate_Target__c from Maintenance_Contract__c WHERE Id =: Id];
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }

    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String MaintenanceContractC;
     }
}