# Copyright (C) 2025 Michael Becker  <alcexhim@gmail.com>
# 
# This file is part of mocha-docker.
# 
# mocha-docker is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# mocha-docker is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with mocha-docker.  If not, see <https://www.gnu.org/licenses/>.

- entityDefinitions:
  - IDI_Task_Relationship_Create: '{a0f94dac-72e2-47cf-8a06-24b629160118}'
  - IDE_Relationship_Create: '{d3b9a84a-f424-43a7-bad7-79bd87342967}'
    
  - IDM_Relationship_Create_CT: '{69d7cfcb-add9-433a-aae0-7274ed3ec4f1}'
  - IDM_Relationship_Create_PRU: '{4737a39e-50f4-4e45-9b91-251856e3c983}'
    
  - IDMB_Relationship_Create_Final: '{9e9a593d-21c7-4b1d-b690-d7f218f4bd36}'
  - IDM_Relationship_Create_Final: '{adff8354-22b3-4952-86a8-9780c7d2cc2d}'

- library: '&IDL_MochaBaseSystem;'
  instances:
  - sequenceTask: '&IDI_Task_Relationship_Create;'
    name: 'Create Relationship'
    initiatingElement: '&IDE_Relationship_Create;'
    taskCategory: '&IDI_TaskCategory_Relationship;'

  - element: '&IDE_Relationship_Create;'
    name: 'Create Relationship'
    elementContents:
    - globalIdentifier: '{9d16cbd4-23a5-428b-8f00-9daa8f5d3e8d}'
      defaultDataType: '&IDC_Relationship;'
      label: 'Relationship'
      displayOptions:
      - instance: '&IDI_DisplayOption_NotEnterable;'
      - instance: '&IDI_DisplayOption_DoNotShow;'
    - globalIdentifier: '{cf2558ee-9bb9-4992-92db-73f02915950d}'
      defaultDataType: '&IDE_Relationship_Definition;'
      displayOptions:
      - instance: '&IDI_DisplayOption_Singular;'
      - instance: '&IDI_DisplayOption_ShowSubelementsVertically;'
    processedByCTMethod: '&IDM_Relationship_Create_CT;'
    processedByPRUMethod: '&IDM_Relationship_Create_PRU;'
    
  - controlTransactionMethod: '&IDM_Relationship_Create_CT;'
    forClassId: '&IDC_Relationship;'
    verb: ''
    name: 'Create Relationship'
    buildsResponseWithBRMB:
    - instance: '&IDMB_Relationship_Create_Final;'
    
  - buildResponseMethodBinding: '&IDMB_Relationship_Create_Final;'
    executesMethod: '&IDM_Relationship_Create_Final;'

  - buildUIResponseMethod: '&IDM_Relationship_Create_Final;'
    # usesExecutableReturningElement: '&IDE_BuildAttributeMethod_View;'
    targetUrl: '~/d/home.htmld'
    # targetUrlAttributeId: '&IDA_ReferralURL;'
    # FIXME!: this should trigger a write user session, then redirect to home page
