@startuml

package core {
    class Project
}

interface SCMCatalogProvider {
    id: String
    entries: [SCMCatalogSource]
}

interface SCMCatalog <<service>>

SCMCatalog ..> SCMCatalogEntry: manages

SCMCatalog ..> SCMCatalogProvider: uses "1..*"

class SCMCatalogSource {
    source: String // config name
    repository: String // location
}

SCMCatalogProvider .right.> SCMCatalogSource: returns

class SCMCatalogEntry {
    / key: String
    scm: String // github, bitbucket, etc.
    source: String // config name
    repository: String // location
    timestamp: LocalDateTime // time of last collection
}

class SCMCatalogProjectLink


SCMCatalogEntry "0..*" - "0..*" Project

(SCMCatalogEntry, Project) .. SCMCatalogProjectLink

interface CatalogLinkService <<service>>

CatalogLinkService .up.> SCMCatalogProjectLink: manages

CatalogLinkService .up.> SCMCatalogProvider: uses

interface CatalogInfoContributor<? extends CatalogInfo> <<extension>> {
    collectInfo(project: Project): CatalogInfo
}

CatalogInfoContributor .left.> Project: associates data

interface CatalogInfoCollector <<service>>

CatalogInfoCollector ..> CatalogInfoContributor: uses "1..*"

package scm {
    interface BitbucketConfigurationService
    class BitbucketCatalogProvider

    BitbucketCatalogProvider -up-|> SCMCatalogProvider
    BitbucketCatalogProvider .down.> BitbucketConfigurationService: uses
}

@enduml