<?xml version="1.0" encoding="UTF-8"?>
<!--
  archunit-rules — shared ArchUnit assertions for aim2be Java services.

  Public API:
    - EntityVersionParity            (public static ArchRule entitiesMustCarryVersion())
    - EntityVersionParityArchTest    (sample test class consumers @Import)

  EntityVersionParity.entitiesMustCarryVersion() enforces ADR-0001 §1.4 —
  every JPA @Entity must carry a @Version field/accessor for optimistic-lock
  detection. The rule uses a custom inheritance-aware ArchCondition inspecting
  getAllFields()/getAllMethods() (because @Version is a field/method-target
  annotation never present on the class itself), with exclusions @Immutable,
  ..audit.. and ..replica.., and allowEmptyShould(true). Implemented and
  self-tested in #315 (positive fixtures: field/inherited/accessor @Version
  plus the three exclusions; negative fixture: an unversioned @Entity must
  violate). Consumers wire it via @AnalyzeClasses + @ArchTest (#319).

  ArchUnit 1.3.0 pinned per parent pom.xml properties.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.aim2be</groupId>
        <artifactId>im2be-platform-libs-parent</artifactId>
        <version>1.1.0-SNAPSHOT</version>
    </parent>

    <artifactId>archunit-rules</artifactId>
    <packaging>jar</packaging>
    <name>im2be-platform-libs :: archunit-rules</name>
    <description>Shared ArchUnit assertions (ADR-0001 §1.4 — @Entity / @Version parity).</description>

    <dependencies>
        <dependency>
            <groupId>com.tngtech.archunit</groupId>
            <artifactId>archunit-junit5</artifactId>
            <version>${archunit.version}</version>
        </dependency>
        <!-- Compile-time dep on jakarta.persistence so EntityVersionParity
             can reference @Entity / @Version annotation types directly. -->
        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
        </dependency>
        <!-- Hibernate's @Immutable lives in org.hibernate.annotations; needed
             at compile time so the EntityVersionParity rule can reference
             the exclusion annotation by type rather than string. -->
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Self-test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- spring-web (test only) supplies @RestControllerAdvice for the
             NoBlanketCatch boundary-exclusion self-test fixture (BoundaryAdvice).
             The rule matches the annotation by FQN string, so spring-web is NOT a
             compile dep — only the test fixture needs the real annotation type. -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
