package com.caliverse.admin.domain.batch;

// import org.springframework.batch.core.Job;
// import org.springframework.batch.core.JobExecutionException;
// import org.springframework.batch.core.JobParameters;
// import org.springframework.batch.core.JobParametersBuilder;
// import org.springframework.batch.core.Step;
// import org.springframework.batch.core.job.builder.JobBuilder;
// import org.springframework.batch.core.launch.JobLauncher;
// import org.springframework.batch.core.repository.JobRepository;
// import org.springframework.batch.core.step.builder.StepBuilder;
// import org.springframework.batch.core.step.tasklet.Tasklet;
// import org.springframework.batch.repeat.RepeatStatus;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.transaction.PlatformTransactionManager;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

//@Configuration
//@RequiredArgsConstructor
@Slf4j
@Getter
public class TestJob {

    // private final JobLauncher jobLauncher;
    // private final PlatformTransactionManager transactionManager;

 
    // @Bean
    // public Job testSimpleJob(PlatformTransactionManager transactionManager, JobRepository jobRepository) {
    //     return new JobBuilder("testSimpleJob", jobRepository)
    //             .start(testSimpleStep(transactionManager, jobRepository))
    //             .build();
    // }

    // @Bean
    // public Step testSimpleStep(PlatformTransactionManager transactionManager, JobRepository jobRepository) {

    //     return new StepBuilder("testSimpleStep", jobRepository)
    //             .tasklet(testTasklet(), transactionManager)
    //             .build();
    // }

    // public Tasklet testTasklet() {
    //     return (contribution, chunkContext) -> {
    //         log.info("test job runned");
    //         return RepeatStatus.FINISHED;
    //     };
    // }

    // public void runJob() {
    //     try {
    //         JobParameters jobParameters = new JobParametersBuilder()
    //                 .addLong("run.id", System.currentTimeMillis())
    //                 .toJobParameters();
    //         jobLauncher.run(testSimpleJob(transactionManager, null), jobParameters);
    //     } catch (JobExecutionException e) {
    //         log.error("Failed to execute job", e);
    //     }
    // }
    
}
