// Path: src/main/java/com/github/sandokandias/payments/domain/command/PerformPayment.java
// @Value(staticConstructor = "commandOf")
// public class PerformPayment implements PaymentCommand {
//     private final CustomerId customerId;
//     private final PaymentIntent paymentIntent;
//     private final PaymentMethod paymentMethod;
//     private final Transaction transaction;
//     private final LocalDateTime timestamp = LocalDateTime.now();
// }
// 
// Path: src/main/java/com/github/sandokandias/payments/domain/shared/CommandFailure.java
// @AllArgsConstructor
// public class CommandFailure {
//     public final Set<I18nCode> codes;
// }
// 
// Path: src/main/java/com/github/sandokandias/payments/domain/shared/CommandValidation.java
// public interface CommandValidation<C extends Command> {
// 
//     Either<CommandFailure, C> acceptOrReject(C command);
// }


import com.github.sandokandias.payments.domain.command.PerformPayment;
import com.github.sandokandias.payments.domain.shared.CommandFailure;
import com.github.sandokandias.payments.domain.shared.CommandValidation;
import io.vavr.control.Either;
import org.springframework.stereotype.Component;
package com.github.sandokandias.payments.domain.command.validation;


@Component
public class PerformPaymentValidator implements CommandValidation<PerformPayment> {

    @Override
// Path: src/main/java/com/github/sandokandias/payments/domain/command/PerformPayment.java
// @Value(staticConstructor = "commandOf")
// public class PerformPayment implements PaymentCommand {
//     private final CustomerId customerId;
//     private final PaymentIntent paymentIntent;
//     private final PaymentMethod paymentMethod;
//     private final Transaction transaction;
//     private final LocalDateTime timestamp = LocalDateTime.now();
// }
// 
// Path: src/main/java/com/github/sandokandias/payments/domain/shared/CommandFailure.java
// @AllArgsConstructor
// public class CommandFailure {
//     public final Set<I18nCode> codes;
// }
// 
// Path: src/main/java/com/github/sandokandias/payments/domain/shared/CommandValidation.java
// public interface CommandValidation<C extends Command> {
// 
//     Either<CommandFailure, C> acceptOrReject(C command);
// }


// Path: src/main/java/com/github/sandokandias/payments/domain/command/validation/PerformPaymentValidator.java
import com.github.sandokandias.payments.domain.command.PerformPayment;
import com.github.sandokandias.payments.domain.shared.CommandFailure;
import com.github.sandokandias.payments.domain.shared.CommandValidation;
import io.vavr.control.Either;
import org.springframework.stereotype.Component;

package com.github.sandokandias.payments.domain.command.validation;


@Component
public class PerformPaymentValidator implements CommandValidation<PerformPayment> {

    @Override
    public Either<CommandFailure, PerformPayment> acceptOrReject(PerformPayment command) {