<?xml version="1.0" encoding="UTF-8"?>
<!--
  processed-kafka-events — consumer-side compound-PK Kafka dedup.

  Public API:
    - ProcessedKafkaEvent              (JPA @Entity, @EmbeddedId compound PK)
    - ProcessedKafkaEventId            (@Embeddable record — composite PK)
    - ProcessedKafkaEventRepository    (Spring Data JPA + native INSERT-OR-NOTHING)
    - DedupGuard                       (boolean tryClaim(...))
    - DedupAutoConfiguration           (autoconfig, @ConditionalOnProperty)
    - DedupProperties                  (im2be.dedup.* config)
    - DedupMetricsBinder               (Micrometer counters + gauges)

  Consumers enable via:
    im2be.dedup.enabled=true
    im2be.dedup.default-scope-id=family-service

  Production impl landed in PR-PLATFORM-2 (this PR) per ADR-0014 D-4 +
  .planning/26-stage-b-outbox-parity.md §L-7 / §L-8 / §L-10 / §L-12.
-->
<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>processed-kafka-events</artifactId>
    <packaging>jar</packaging>
    <name>im2be-platform-libs :: processed-kafka-events</name>
    <description>Consumer-side compound-PK Kafka dedup (ADR-0014 D-4).</description>

    <properties>
        <!-- Pinned per rule 9. Verified against Maven Central 2026-05-27. -->
        <testcontainers.version>1.20.4</testcontainers.version>
    </properties>

    <dependencies>
        <!-- Compile dependencies (transitive to consumers). -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <!-- Validation: enforces @NotBlank on DedupProperties.defaultScopeId
             when the module is enabled. Brought in at compile scope so
             consumers don't have to remember to add it. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>

        <!-- Provided: consumers bring spring-kafka, micrometer and the OTel
             API themselves at compile scope (Spring Boot Actuator already
             pulls micrometer; spring-cloud-sleuth-otel / OTel starter pulls
             the OTel API). Provided keeps the dedup module light + avoids
             version drift with the consuming service's choice.
             Provided IS on the compile + test classpath, so unit/integration
             tests in this module can reference these symbols directly. -->
        <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>spring-kafka</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-database-postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Failsafe wires the *IT.java integration tests so
                 `mvn verify` triggers the Testcontainers PG run. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
