id: "basic-collaboration-profile"
version: "1.0.0"
name: "Basic Collaboration"
description: "Modeling profile for collaboration elements - Discussion Threads for collaborative conversations about architecture, design, and domain topics"
icon: "UserMultiple"

# Note: Model elements and relationships already have a default 'description' field.
# Do not create duplicate description properties in property groups.

# Status Enumerations
statusEnumerations:
  - id: "collaboration.discussion-lifecycle"
    name: "Discussion Lifecycle"
    description: "Lifecycle status for discussion threads"
    descriptionDetailed: "Status enumeration for the various phases in the lifecycle of a discussion thread from creation to resolution or closure."
    default: "active"
    values:
      - key: "active"
        displayName: "Active"
        description: "Discussion is active and ongoing"
        descriptionDetailed: "The discussion thread is currently active, with participants actively contributing and engaging in the conversation."
        category: "active"
        order: 1
      - key: "pending"
        displayName: "Pending"
        description: "Discussion is pending response or input"
        descriptionDetailed: "The discussion thread is waiting for input, response, or decision from participants or stakeholders."
        category: "active"
        order: 2
      - key: "resolved"
        displayName: "Resolved"
        description: "Discussion has been resolved with a conclusion"
        descriptionDetailed: "The discussion thread has reached a conclusion or resolution, with a decision or consensus reached."
        category: "active"
        order: 3
      - key: "closed"
        displayName: "Closed"
        description: "Discussion has been closed"
        descriptionDetailed: "The discussion thread has been closed, either because it was resolved, superseded, or is no longer relevant."
        category: "deactive"
        order: 4
      - key: "archived"
        displayName: "Archived"
        description: "Discussion has been archived"
        descriptionDetailed: "The discussion thread has been archived for historical reference but is no longer active."
        category: "deactive"
        order: 5

# Element Types
elementTypes:
  - id: "collaboration.discussion-thread"
    name: "Discussion Thread"
    description: "A collaborative discussion thread about architecture, design, or domain topics"
    descriptionDetailed: "A Discussion Thread represents an ongoing conversation or debate about architectural decisions, design choices, domain concepts, or other topics relevant to the system. Discussion threads capture the collaborative process of exploring ideas, gathering input, and reaching consensus. They differ from ADRs (Architecture Decision Records) in that discussions are the process of exploration, while ADRs document the final decision. Discussion threads can be linked to any model element to provide context and collaborative input."
    baseType: "default-model-element"
    layer: "knowledge"
    statusEnumeration: "collaboration.discussion-lifecycle"
    organizationalRoles: ["watcher", "participant"]
    propertiesSchema:
      - "collaboration-discussion-common"
      - "collaboration-discussion-context"
    style:
      icon: "Chat"
      accentColor: "#8a3ffc"
      defaultCanvasStyle: "card"

# Relationship Types
relationshipTypes:
  - id: "collaboration.discusses"
    name: "discusses"
    description: "Indicates that a discussion thread discusses a specific element"
    descriptionDetailed: "A Discusses relationship indicates that a Discussion Thread discusses, debates, or provides collaborative input about a specific model element (System, Container, Component, Risk, Decision, etc.). This relationship documents which elements are being discussed and helps link collaborative conversations to the relevant model elements."
    typeMappings:
      - sourceElementTypes: ["collaboration.discussion-thread"]
        targetElementTypes: ["*"]
    bidirectional: false
    relationshipType: "default"
    prefillLabel: false
    reverse:
      name: "discussed in"
      description: "Discussion threads that discuss this element"
      descriptionDetailed: "The reverse of the 'Discusses' relationship. When a discussion thread discusses an element, the element is 'discussed in' the discussion thread."
    style:
      style: "dashed"
      startArrow: "none"
      endArrow: "arrow"
      defaultColor: "#000000"
      thickness: 1

  - id: "collaboration.related-to"
    name: "related to"
    description: "Indicates a general relationship between discussion threads"
    descriptionDetailed: "A Related To relationship indicates a general relationship between discussion threads. This relationship can be used to document connections between related discussions, such as follow-up discussions, related topics, or discussions that reference each other."
    typeMappings:
      - sourceElementTypes: ["collaboration.discussion-thread"]
        targetElementTypes: ["collaboration.discussion-thread"]
    bidirectional: true
    relationshipType: "default"
    prefillLabel: false
    style:
      style: "dashed"
      startArrow: "none"
      endArrow: "none"
      defaultColor: "#000000"
      thickness: 1

# Property Groups
propertyGroups:
  - id: "collaboration-discussion-common"
    name: "Discussion Thread Common Properties"
    description: "Common properties for discussion threads"
    descriptionDetailed: "This property group contains common properties for Discussion Thread elements, including the topic and category."
    properties:
      - fieldName: "discussion-topic"
        displayName: "Topic"
        description: "The main topic or theme of the discussion"
        descriptionDetailed: "The primary topic, theme, or subject matter of the discussion thread. This helps categorize and identify what the discussion is about."
        type: "text"
        required: false
      - fieldName: "discussion-category"
        displayName: "Category"
        description: "The category of the discussion"
        descriptionDetailed: "The category classifies the discussion by its type. This helps organize discussions by domain or purpose."
        type: "selection"
        required: false
        defaultValue: "architecture"
        options:
          - key: "architecture"
            displayName: "Architecture"
            description: "Architecture-related discussion - about system structure, design patterns, or architectural decisions"
          - key: "design"
            displayName: "Design"
            description: "Design-related discussion - about design choices, patterns, or implementation details"
          - key: "domain"
            displayName: "Domain"
            description: "Domain-related discussion - about business domain concepts, requirements, or domain modeling"
          - key: "technical"
            displayName: "Technical"
            description: "Technical discussion - about technology choices, tools, frameworks, or technical implementation"
          - key: "process"
            displayName: "Process"
            description: "Process-related discussion - about development processes, workflows, or methodologies"
          - key: "risk"
            displayName: "Risk"
            description: "Risk-related discussion - about risks, concerns, or mitigation strategies"
          - key: "other"
            displayName: "Other"
            description: "Other category of discussion"

  - id: "collaboration-discussion-context"
    name: "Discussion Thread Context"
    description: "Context properties for discussion threads"
    descriptionDetailed: "This property group contains context properties for Discussion Thread elements, including the discussion context and key questions or points."
    properties:
      - fieldName: "discussion-context"
        displayName: "Context"
        description: "The context in which the discussion was initiated"
        descriptionDetailed: "The business, technical, or organizational context that led to the initiation of this discussion thread. This helps understand why the discussion was started."
        type: "text"
        required: false
      - fieldName: "key-questions"
        displayName: "Key Questions"
        description: "The key questions or points being discussed"
        descriptionDetailed: "A summary of the key questions, points, or issues being discussed in this thread. This helps participants understand what needs to be addressed."
        type: "text"
        required: false
      - fieldName: "outcome"
        displayName: "Outcome"
        description: "The outcome or conclusion of the discussion"
        descriptionDetailed: "The outcome, conclusion, or decision reached as a result of the discussion. This should be filled in when the discussion is resolved or closed."
        type: "text"
        required: false

# Validations
validations:
  - id: "collaboration-discussion-should-have-topic"
    name: "Discussion Thread Should Have Topic"
    description: "Discussion threads should specify their topic"
    severity: "warning"
    scope:
      elementTypes: ["collaboration.discussion-thread"]
    validation: "element.properties.common != null && element.properties.common['discussion-topic'] != null && element.properties.common['discussion-topic'] != ''"
    message: "Discussion Thread '{{element.properties.name}}' should specify its topic"
    suggestion: "Add a topic to the discussion thread to clarify what is being discussed"

  - id: "collaboration-discussion-should-discuss-elements"
    name: "Discussion Thread Should Discuss Elements"
    description: "Discussion threads should be linked to the elements they discuss"
    severity: "info"
    scope:
      elementTypes: ["collaboration.discussion-thread"]
    validation: "element.relationships[type == 'collaboration.discusses'].count() > 0"
    message: "Discussion Thread '{{element.properties.name}}' could be linked to the elements it discusses"
    suggestion: "Add 'Discusses' relationships to document which elements are being discussed in this thread"

  - id: "collaboration-discussion-resolved-should-have-outcome"
    name: "Resolved Discussion Should Have Outcome"
    description: "Resolved or closed discussion threads should document their outcome"
    severity: "info"
    scope:
      elementTypes: ["collaboration.discussion-thread"]
    validation: "element.status != 'resolved' && element.status != 'closed' || (element.properties.context != null && element.properties.context['outcome'] != null && element.properties.context['outcome'] != '')"
    message: "Discussion Thread '{{element.properties.name}}' is resolved or closed but does not document its outcome"
    suggestion: "Add an outcome to document the conclusion or decision reached in this discussion"

# Metadata
metadata:
  tags:
    - "collaboration"
    - "discussion"
    - "knowledge"
    - "communication"
    - "architecture"
  source: "Internal"
