import Foundation

/// Contrato técnico Bi.Go.C Site → Go.
/// Não contém nome, telefone, e-mail, localidade ou mensagem.
struct GoSiteConversationContext: Codable, Identifiable, Sendable {
    static let currentContractVersion = "2026-08-21.2"

    var id: String { protocolID }
    let contractVersion: String
    let protocolID: String
    let externalChannel: GoExternalChannel
    let intentID: GoSiteIntent
    let routeCode: GoConversationRoute
    let pillarID: GoEcosystemPillar
    let source: String
    let landingPage: String?
    let callToAction: String?
    let utmSource: String?
    let utmMedium: String?
    let utmCampaign: String?
    let projectID: String?
    let unitID: String?
    let createdAt: Date

    enum CodingKeys: String, CodingKey {
        case contractVersion
        case protocolID = "protocol"
        case externalChannel
        case intentID = "intentId"
        case routeCode
        case pillarID = "pillarId"
        case source, landingPage
        case callToAction = "cta"
        case utmSource, utmMedium, utmCampaign
        case projectID = "projectId"
        case unitID = "unitId"
        case createdAt
    }
}

enum GoExternalChannel: String, Codable, Sendable {
    case whatsapp
}

enum GoSiteIntent: String, Codable, Sendable {
    case case01, arquitetura, construcao, metodologia, software, outro
}

enum GoConversationRoute: String, Codable, Sendable {
    case case01Commercial = "PROJECTS-CASE01-COMERCIAL"
    case architectureProject = "ARQUITETURA-PROJETO"
    case construction = "CONSTRUCAO-CASAL-CASTRO"
    case buildSystem = "BUILD-SYSTEM"
    case buildOS = "BUILD-OS"
    case ecosystemGeneral = "ECOSSISTEMA-GERAL"
}

enum GoEcosystemPillar: String, Codable, Sendable {
    case bi, go, c, ecossistema
}
