public with sharing class lexSolutionProgrammeController {
    @AuraEnabled
    public static InitData initSubmitSolutionSchemeForApprovalButton(String recordId){
        InitData res = new InitData();
        try {
            Solution_Programme__c so = [
                select
                Scheme_Type__c,
                Confirmation_Result__c
                from Solution_Programme__c where Id =: recordId
            ];
            res.schemeType = so.Scheme_Type__c;
            res.confirmationResult = so.Confirmation_Result__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static List<solutionClosingAttachment__c> queryForAttachments(String Id){
        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
        try {
            so = [select id,name from solutionClosingAttachment__c where Solution_Programme__c =: Id];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }

    @AuraEnabled
    public static string updateSubmitSolutionSchemeForApprovalButton(String recordId){
        Solution_Programme__c so = new Solution_Programme__c();
        try {
            so.Id = recordId;
            so.Submint_TF__c = true;
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    class InitData{
        @AuraEnabled
        public String schemeType;
        @AuraEnabled
        public String confirmationResult;
    }
}