package com.writeoff.module.scheduler.model;

import java.time.LocalDateTime;

public class AsyncJob {
    private Long id;
    private Long tenantId;
    private String jobType;
    private String payload;
    private AsyncJobStatus status;
    private LocalDateTime nextRunAt;
    private int retryCount;
    private int maxRetry;
    private String idempotencyKey;
    private String lockedBy;
    private LocalDateTime lockedAt;

    public AsyncJob(Long id, Long tenantId, String jobType, String payload, AsyncJobStatus status, LocalDateTime nextRunAt, int retryCount, int maxRetry, String idempotencyKey, String lockedBy, LocalDateTime lockedAt) {
        this.id = id;
        this.tenantId = tenantId;
        this.jobType = jobType;
        this.payload = payload;
        this.status = status;
        this.nextRunAt = nextRunAt;
        this.retryCount = retryCount;
        this.maxRetry = maxRetry;
        this.idempotencyKey = idempotencyKey;
        this.lockedBy = lockedBy;
        this.lockedAt = lockedAt;
    }

    public Long getId() {
        return id;
    }

    public Long getTenantId() {
        return tenantId;
    }

    public String getJobType() {
        return jobType;
    }

    public String getPayload() {
        return payload;
    }

    public AsyncJobStatus getStatus() {
        return status;
    }

    public LocalDateTime getNextRunAt() {
        return nextRunAt;
    }

    public int getRetryCount() {
        return retryCount;
    }

    public int getMaxRetry() {
        return maxRetry;
    }

    public String getIdempotencyKey() {
        return idempotencyKey;
    }

    public String getLockedBy() {
        return lockedBy;
    }

    public LocalDateTime getLockedAt() {
        return lockedAt;
    }

    public void setStatus(AsyncJobStatus status) {
        this.status = status;
    }

    public void setNextRunAt(LocalDateTime nextRunAt) {
        this.nextRunAt = nextRunAt;
    }

    public void setRetryCount(int retryCount) {
        this.retryCount = retryCount;
    }

    public void setLockedBy(String lockedBy) {
        this.lockedBy = lockedBy;
    }

    public void setLockedAt(LocalDateTime lockedAt) {
        this.lockedAt = lockedAt;
    }
}
