<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>xyz.tcheeric</groupId>
        <artifactId>wallet-core</artifactId>
        <version>1.2.7</version>
    </parent>

    <artifactId>wallet-core-cashu</artifactId>

    <name>Wallet Core - Cashu</name>
    <description>Cashu protocol implementation (mint, melt, proofs, tokens)</description>

    <dependencies>
        <!-- Depend on base, observability, and nostr -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-base</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-observability</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-nostr</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Cashu libraries -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-lib-entities</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-lib-crypto</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-lib-common</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-wallet-client</artifactId>
        </dependency>

        <!-- Nostr libraries for NUT-60/61 (Cashu-over-Nostr) -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>nostr-java-event</artifactId>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>nostr-java-base</artifactId>
        </dependency>

        <!-- HTTP Client -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>

        <!-- JSON -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <!-- Resilience4j -->
        <dependency>
            <groupId>io.github.resilience4j</groupId>
            <artifactId>resilience4j-circuitbreaker</artifactId>
        </dependency>

        <!-- Database -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>wallet-core-nostr</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.jqwik</groupId>
            <artifactId>jqwik</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>phoenixd-rest</artifactId>
            <version>0.1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xyz.tcheeric</groupId>
            <artifactId>cashu-gateway-phoenixd</artifactId>
            <version>0.4.1</version>
            <scope>test</scope>
        </dependency>
        <!-- Jakarta Validation (used in WalletSnapshot, WalletHistory, etc.) -->
        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.el</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*IT.java</exclude>
                        <exclude>**/*ITCase.java</exclude>
                        <exclude>**/*IntegrationTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.plugin.version}</version>
                <configuration>
                    <!-- Uses skipITs.wallet from parent profiles -->
                    <skipITs>${skipITs.wallet}</skipITs>
                    <includes>
                        <include>**/*IT.java</include>
                        <include>**/*ITCase.java</include>
                        <include>**/*IntegrationTest.java</include>
                    </includes>
                    <!-- Uses it.groups from parent profiles if set -->
                    <groups>${it.groups}</groups>
                    <systemPropertyVariables>
                        <testcontainers.reuse.enable>true</testcontainers.reuse.enable>
                        <wallet.db.pool.registerMbeans>false</wallet.db.pool.registerMbeans>
                        <wallet.db.pool.uniqueName>true</wallet.db.pool.uniqueName>
                        <jna.nosys>true</jna.nosys>
                        <jna.tmpdir>/tmp</jna.tmpdir>
                        <WALLET_HOME>/tmp/.cashu-client-tests</WALLET_HOME>
                        <CASHU_HOME>/tmp/.cashu-client-tests</CASHU_HOME>
                    </systemPropertyVariables>
                    <environmentVariables>
                        <WALLET_HOME>/tmp/.cashu-client-tests</WALLET_HOME>
                        <CASHU_HOME>/tmp/.cashu-client-tests</CASHU_HOME>
                        <JNA_NOSYS>true</JNA_NOSYS>
                        <JNA_TEMPDIR>/tmp</JNA_TEMPDIR>
                    </environmentVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!--
         Integration test execution is controlled by parent profile properties.
         Use: mvn verify -Pit-wallet-cashu (wallet cashu integration tests)
         Use: mvn verify -Pit-wallet (all wallet integration tests)
         Use: mvn verify -Pit-all (all integration tests across repository)

         Failsafe plugin is configured in build section for consistent inclusion,
         skip behavior is controlled via skipITs.wallet property from parent.
    -->

</project>
