All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.foodtechlab.lib.auth.service.domain.confirmationCode.usecases.ExpireConfirmationCodeUseCase Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package ru.foodtechlab.lib.auth.service.domain.confirmationCode.usecases;

import com.rcore.domain.commons.usecase.UseCase;
import com.rcore.domain.commons.usecase.model.SingleInput;
import com.rcore.domain.commons.usecase.model.VoidOutputValues;
import lombok.RequiredArgsConstructor;
import ru.foodtechlab.lib.auth.service.domain.confirmationCode.entity.ConfirmationCodeEntity;
import ru.foodtechlab.lib.auth.service.domain.confirmationCode.port.ConfirmationCodeRepository;

@RequiredArgsConstructor
public class ExpireConfirmationCodeUseCase extends UseCase, VoidOutputValues> {

    private final ConfirmationCodeRepository repository;

    @Override
    public VoidOutputValues execute(SingleInput confirmationCodeEntitySingleInput) {
        confirmationCodeEntitySingleInput.getValue().expire();
        repository.save(confirmationCodeEntitySingleInput.getValue());
        return new VoidOutputValues();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy