build.gradle.kts 2.29 KB
plugins {
    alias(libs.plugins.kotlin.jvm)
    alias(libs.plugins.kotlin.spring)
    alias(libs.plugins.kotlin.jpa)
    alias(libs.plugins.spring.dependency.management)
}

description = "vibe_erp pbc-orders-sales — sales order header + lines, three-way cross-PBC validation. INTERNAL Packaged Business Capability."

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(21))
    }
}

kotlin {
    jvmToolchain(21)
    compilerOptions {
        freeCompilerArgs.add("-Xjsr305=strict")
    }
}

allOpen {
    annotation("jakarta.persistence.Entity")
    annotation("jakarta.persistence.MappedSuperclass")
    annotation("jakarta.persistence.Embeddable")
}

// CRITICAL: pbc-orders-sales may depend on api-v1 (which exposes the
// cross-PBC PartnersApi, CatalogApi, and InventoryApi interfaces),
// platform-persistence, platform-security, and platform-metadata —
// but NEVER on platform-bootstrap, NEVER on another pbc-* (NOT on
// pbc-partners, pbc-catalog, OR pbc-inventory, even though we INJECT
// all three of their *Api interfaces at runtime).
//
// The cross-PBC concrete adapters live in their respective PBCs and
// are wired into the Spring context at runtime by the bootstrap
// @ComponentScan; this PBC sees only the api.v1 interfaces, exactly
// as guardrail #9 demands.
//
// pbc-orders-sales is the FIRST PBC to consume THREE cross-PBC
// facades simultaneously — the most rigorous test of the modular
// monolith story so far. The root build.gradle.kts enforces the
// dependency rule at configuration time.
dependencies {
    api(project(":api:api-v1"))
    implementation(project(":platform:platform-persistence"))
    implementation(project(":platform:platform-security"))
    implementation(project(":platform:platform-metadata")) // ExtJsonValidator (P3.4)

    implementation(libs.kotlin.stdlib)
    implementation(libs.kotlin.reflect)

    implementation(libs.spring.boot.starter)
    implementation(libs.spring.boot.starter.web)
    implementation(libs.spring.boot.starter.data.jpa)
    implementation(libs.spring.boot.starter.validation)
    implementation(libs.jackson.module.kotlin)

    testImplementation(libs.spring.boot.starter.test)
    testImplementation(libs.junit.jupiter)
    testImplementation(libs.assertk)
    testImplementation(libs.mockk)
}

tasks.test {
    useJUnitPlatform()
}