---------- Start of ./ChecklistCompletionType.java ----------
package eu.reply.lea.services.yms.task.checklist;

public enum ChecklistCompletionType {
    NOT_COMPLETED,
    PARTIAL_COMPLETION,
    COMPLETED;

    public boolean isCompleted(){
        return this == COMPLETED;
    }

    public boolean isPartialCompletion(){
        return this == PARTIAL_COMPLETION;
    }
}

---------- End of ./ChecklistCompletionType.java ----------

---------- Start of ./repository/ChecklistRepository.java ----------
package eu.reply.lea.services.yms.task.checklist.repository;





@ApplicationScoped
@Logged
public class ChecklistRepository {

    @Inject
    @ModuleConfiguration.Module(ModuleConfiguration.Module.CURRENT)
    private EntityManager em;
    @Inject
    private EntityReferenceHandler entityReferenceHandler;

    public Optional<Checklist> findByEntityRef(EntityReference entityRef) {
        return Optional.ofNullable(entityReferenceHandler.getEntity(entityRef,em));
    }

    public Optional<Checklist> findById(Long id) {
        return Optional.ofNullable(em.find(Checklist.class, id));
    }

    public void save(Checklist checklist) {
        em.persist(checklist);
    }

}

---------- End of ./repository/ChecklistRepository.java ----------

---------- Start of ./repository/ChecklistConfigurationRepository.java ----------
package eu.reply.lea.services.yms.task.checklist.repository;




@ApplicationScoped
@Logged
public class ChecklistConfigurationRepository {

    @Inject
    @ModuleConfiguration.Module(ModuleConfiguration.Module.CURRENT)
    private EntityManager em;
    @Inject
    private EntityReferenceHandler entityReferenceHandler;

    public Optional<ChecklistConfiguration> findByEntityRef(EntityReference entityRef) {
        return Optional.ofNullable(entityReferenceHandler.getEntity(entityRef,em));
    }

    public Optional<ChecklistConfiguration> findById(Long id) {
        return Optional.ofNullable(em.find(ChecklistConfiguration.class, id));
    }

    public void save(ChecklistConfiguration checklistConfiguration) {
        em.persist(checklistConfiguration);
    }

}

---------- End of ./repository/ChecklistConfigurationRepository.java ----------

---------- Start of ./exception/NotesNotRequiredException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class NotesNotRequiredException extends RuntimeException {
    public NotesNotRequiredException(String message) {
        super(message);
    }
}
---------- End of ./exception/NotesNotRequiredException.java ----------

---------- Start of ./exception/ChecklistConfigurationNotFoundException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class ChecklistConfigurationNotFoundException extends RuntimeException {
    public ChecklistConfigurationNotFoundException(String message) {
        super(message);
    }
}
---------- End of ./exception/ChecklistConfigurationNotFoundException.java ----------

---------- Start of ./exception/ChecklistBlockedException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class ChecklistBlockedException extends RuntimeException {
    public ChecklistBlockedException(String message) {
        super(message);
    }
}
---------- End of ./exception/ChecklistBlockedException.java ----------

---------- Start of ./exception/ValidationNotRequiredException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class ValidationNotRequiredException extends RuntimeException {
    public ValidationNotRequiredException(String message) {
        super(message);
    }
}
---------- End of ./exception/ValidationNotRequiredException.java ----------

---------- Start of ./exception/ChecklistNotFoundException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class ChecklistNotFoundException extends RuntimeException {
    public ChecklistNotFoundException(String message) {
        super(message);
    }
}
---------- End of ./exception/ChecklistNotFoundException.java ----------

---------- Start of ./exception/DocumentUploadNotRequiredException.java ----------
package eu.reply.lea.services.yms.task.checklist.exception;

public class DocumentUploadNotRequiredException extends RuntimeException {
    public DocumentUploadNotRequiredException(String message) {
        super(message);
    }
}
---------- End of ./exception/DocumentUploadNotRequiredException.java ----------

---------- Start of ./ChecklistItemConfiguration.java ----------
package eu.reply.lea.services.yms.task.checklist;





@Entity
@Getter
@Setter
public class ChecklistItemConfiguration extends StringCustomizableEntity {

    @ManyToOne
    private ChecklistConfiguration checklistConfiguration;

    @Column(nullable = false)
    private String name;

    @Column(nullable = false)
    private String description;

    @Column(nullable = false)
    private BigDecimal orderNumber;

    private boolean checkValidation = false;

    private boolean documentUpload = false;

    private boolean checkNotes = false;

}

---------- End of ./ChecklistItemConfiguration.java ----------

---------- Start of ./ChecklistConfiguration.java ----------
package eu.reply.lea.services.yms.task.checklist;




@Entity
@StringifyAttributes(attributes = { "name"})
@Table(
    uniqueConstraints = {@UniqueConstraint(columnNames = {"name"})},
    indexes = {@Index(name = "idx_checklist_config_name", columnList = "name")}
)
public class ChecklistConfiguration extends StringCustomizableEntity {

    @NotNull
    private String name;

    @OneToMany(mappedBy = "checklistConfiguration", orphanRemoval = true, cascade = CascadeType.ALL)
    private List<ChecklistItemConfiguration> itemsConfiguration = new ArrayList<>();

    public List<ChecklistItemConfiguration> getItemsConfiguration() {
        return Collections.unmodifiableList(itemsConfiguration);
    }

    public void addItem(ChecklistItemConfiguration itemConfiguration) {
        this.addChild(itemConfiguration, itemsConfiguration);
        itemConfiguration.setChecklistConfiguration(this);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

}

---------- End of ./ChecklistConfiguration.java ----------

---------- Start of ./ChecklistItem.java ----------
package eu.reply.lea.services.yms.task.checklist;






@Entity
@Getter
public class ChecklistItem extends StringCustomizableEntity {

    @Column(nullable = false)
    private String name;

    @Column(nullable = false)
    private String description;

    @Column(nullable = false)
    private BigDecimal orderNumber;

    @Setter(AccessLevel.PROTECTED)
    private boolean completed = false;

    @ManyToOne
    @Setter(AccessLevel.PACKAGE)
    private Checklist checklist;

    @Embedded
    private CheckValidation checkValidation = new CheckValidation(false);

    @Embedded
    private DocumentUpload documentUpload = new DocumentUpload(false);

    @Embedded
    private CheckNotes checkNotes = new CheckNotes(false);

    // Constructors, getters, and setters

    public ChecklistItem(String name, String description, BigDecimal orderNumber, boolean validationRequired, boolean documentRequired, boolean notesRequired) {
        this.name = name;
        this.description = description;
        this.setOrderNumber(orderNumber);
        this.checkValidation = new CheckValidation(validationRequired);
        this.documentUpload = new DocumentUpload(documentRequired);
        this.checkNotes = new CheckNotes(notesRequired);
    }


    public ChecklistItem() {

    }

    public boolean isCheckValidationRequired(){
        return checkValidation.isValidationRequired();
    }

    public boolean isDocumentUploadRequired(){
        return documentUpload.isDocumentRequired();
    }

    public boolean isCheckNotesRequired(){
        return checkNotes.isNotesRequired();
    }

    public boolean isBlocked(){
        if (this.getOrderNumber().compareTo(BigDecimal.ZERO)<=0){
            return false;
        }else if (this.getChecklist().canProceedPastPartialConfirmation()){
            return false;
        }
        return true;
    }

    public void confirmValid() {
        if (isBlocked()){
            throw new ChecklistBlockedException("Checklist item is blocked");
        }
        if (isCheckValidationRequired()) {
            checkValidation.confirmValid();
        }else{
            throw new ValidationNotRequiredException("Validation is not required for this checklist item");
        }
    }

    public boolean isValid() {
        return checkValidation == null? false : checkValidation.isValid();
    }

    public boolean isInvalid() {
        return checkValidation == null? false : checkValidation.isInvalid();
    }

    public boolean isNotValidated() {
        return checkValidation == null? true : checkValidation.isNotValidated();
    }


    public void uploadDocument(AttachmentReference attachmentReference) {
        if (isBlocked()){
            throw new ChecklistBlockedException("Checklist item is blocked");
        }
        if (isDocumentUploadRequired()) {
            documentUpload.uploadDocument(attachmentReference);
        }else{
            throw new DocumentUploadNotRequiredException("Document upload is not required for this checklist item");
        }
    }

    public AttachmentReference getUploadedDocument() {
        return documentUpload == null? null : documentUpload.getAttachmentReference();
    }

    public void addNotes(String notesText) {
        if (isBlocked()){
            throw new ChecklistBlockedException("Checklist item is blocked");
        }
        if (isCheckNotesRequired()) {
            checkNotes.addNotes(notesText);
        }else{
            throw new NotesNotRequiredException("Adding notes is not required for this checklist item");
        }
    }

    public String getNotes() {
        return checkNotes == null ? null : checkNotes.getNotes();
    }

    boolean isDocumentCompleted(){
        if(isDocumentUploadRequired()){
            return documentUpload.isDocumentUploaded();
        }else{
            return true;
        }
    }

    boolean isCheckCompleted(){
        if(isCheckValidationRequired()){
            return checkValidation.isCheckCompleted();
        }else{
            return true;
        }
    }

    boolean isNotesCompleted(){
        if(isCheckNotesRequired()){
            return checkNotes.isNotesAdded();
        }else{
            return true;
        }
    }

    boolean completenessVerified(){
        return isCheckCompleted() && isNotesCompleted() && isDocumentCompleted();
    }

    public void confirmCompleted(){
        if (isBlocked()){
            throw new ChecklistBlockedException("Checklist item is blocked");
        }
        if (!completed && this.completenessVerified()){
            this.completed = true;
            checklist.confirmCompleted();
        } else if (!completed){
            throw new IllegalStateException("It's not possible to confirm, since there are still checks to do");
        }
    }

    public void setOrderNumber(BigDecimal orderNumber) {
        this.orderNumber = orderNumber;
    }
}

---------- End of ./ChecklistItem.java ----------

---------- Start of ./ChecklistFactory.java ----------
package eu.reply.lea.services.yms.task.checklist;




@ApplicationScoped
@Logged
public class ChecklistFactory {

    public Checklist generateChecklistFromConfiguration(ChecklistConfiguration configuration) {
        if (configuration == null) {
            throw new IllegalArgumentException("ChecklistConfiguration cannot be null");
        }
        Checklist checklist = new Checklist(configuration.getName());

        // Loop through each item configuration and create checklist items
        List<ChecklistItem> checklistItems = configuration.getItemsConfiguration().stream()
            .map(this::createChecklistItem)
            .collect(Collectors.toList());

        checklistItems.forEach(checklist::addItem);

        checklist.confirmCompleted();

        return checklist;
    }

    private ChecklistItem createChecklistItem(ChecklistItemConfiguration itemConfig) {
        return new ChecklistItem(itemConfig.getName(), itemConfig.getDescription(), itemConfig.getOrderNumber(),
                                 itemConfig.isCheckValidation(), itemConfig.isDocumentUpload(),
                                 itemConfig.isCheckNotes());
    }
}

---------- End of ./ChecklistFactory.java ----------

---------- Start of ./DocumentUpload.java ----------
package eu.reply.lea.services.yms.task.checklist;





@Embeddable
public class DocumentUpload {

    private boolean documentRequired = false;

    @Embedded
    @AttributeOverrides({@AttributeOverride(name = "name", column = @Column(name = "document_name")),
        @AttributeOverride(name = "uuid", column = @Column(name = "document_uuid"))})
    private AttachmentReference attachmentReference;

    public DocumentUpload(final boolean documentRequired) {
        this.documentRequired = documentRequired;
    }

    public DocumentUpload() {
    }

    public boolean isDocumentRequired() {
        return documentRequired;
    }

    private void setDocumentRequired(final boolean documentRequired) {
        this.documentRequired = documentRequired;
    }

    public AttachmentReference getAttachmentReference() {
        return attachmentReference;
    }

    public void uploadDocument(AttachmentReference attachmentReference) {
        this.attachmentReference = attachmentReference;
    }

    public boolean isDocumentUploaded() {
        return attachmentReference != null;
    }

}

---------- End of ./DocumentUpload.java ----------

---------- Start of ./boundary/ChecklistConfigurationProcessor.java ----------
package eu.reply.lea.services.yms.task.checklist.boundary;



@ApplicationScoped
@Logged
@Default
@EntityProcessor(entityClass= ChecklistConfiguration.class)
public class ChecklistConfigurationProcessor {


    @Inject
    private ChecklistFactory checklistFactory;

    @Inject
    private ChecklistRepository checklistRepository;

    public ChecklistConfiguration createCheckList(final ChecklistConfiguration checklistConfiguration) {
        Checklist checklist =  checklistFactory.generateChecklistFromConfiguration(checklistConfiguration);
        checklistRepository.save(checklist);
        return checklistConfiguration;
    }


}

---------- End of ./boundary/ChecklistConfigurationProcessor.java ----------

---------- Start of ./boundary/ChecklistItemProcessor.java ----------
package eu.reply.lea.services.yms.task.checklist.boundary;



@ApplicationScoped
@Logged
@Default
@EntityProcessor(entityClass= ChecklistItem.class)
public class ChecklistItemProcessor {

    public ChecklistItem persisting(ChecklistItem item){
        return item;
    }

    @Condition(value = {@Condition.Attribute(name = "checkValidation.validationRequired", values = {"true"})})
    public ChecklistItem confirmValid(final ChecklistItem item) {
        item.confirmValid();
        return item;
    }

    @Condition(value = {@Condition.Attribute(name = "documentUpload.documentRequired", values = {"true"})})
    public ChecklistItem action(final ChecklistItem item, final AddDocumentAction action) {
        item.uploadDocument(action.getAttachmentReference());
        return item;
    }

    @Condition(value = {@Condition.Attribute(name = "checkNotes.notesRequired", values = {"true"})})
    public ChecklistItem action(final ChecklistItem item, final ChecklistItemAddNotesAction action) {
        item.addNotes(action.getNotes());
        return item;
    }

    public ChecklistItem complete(final ChecklistItem item) {
        item.confirmCompleted();
        return item;
    }


}

---------- End of ./boundary/ChecklistItemProcessor.java ----------

---------- Start of ./boundary/ChecklistProcessor.java ----------
package eu.reply.lea.services.yms.task.checklist.boundary;



@ApplicationScoped
@Logged
@Default
@EntityProcessor(entityClass= Checklist.class)
public class ChecklistProcessor {

    @Inject
    private ChecklistApplicationService checklistApplicationService;


    public Checklist proceedPastPartialConfirmation(final Checklist checklist) {
        checklistApplicationService.proceedPastPartialConfirmation(checklist);
        return checklist;
    }


}

---------- End of ./boundary/ChecklistProcessor.java ----------

---------- Start of ./boundary/api/ChecklistApiImpl.java ----------
package eu.reply.lea.services.yms.task.checklist.boundary.api;



public class ChecklistApiImpl implements ChecklistApi {

    @Inject
    private ChecklistApplicationService checklistApplicationService;

    @Inject
    private EntityReferenceHandler entityReferenceHandler;

    @Inject
    @ModuleConfiguration.Module(ModuleConfiguration.Module.CURRENT)
    private EntityManager em;

    @Override
    public boolean isChecklistPartiallyConfirmed(final Long checklistId){
        return checklistApplicationService.isChecklistPartiallyCompleted(checklistId);
    }

    @Override
    public boolean isChecklistCompleted(final Long checklistId){
        return checklistApplicationService.isChecklistCompleted(checklistId);
    }

    @Override
    public void proceedPastPartialConfirmation(Long checklistId){
        checklistApplicationService.proceedPastPartialConfirmation(checklistId);
    }

    @Override
    public EntityReference createChecklist(final EntityReference checkListConfiguration) {
        Checklist checklist = checklistApplicationService.createChecklist(checkListConfiguration);
        return entityReferenceHandler.getEntityReference(em,checklist);
    }
}

---------- End of ./boundary/api/ChecklistApiImpl.java ----------

---------- Start of ./boundary/api/ChecklistApi.java ----------
package eu.reply.lea.services.yms.task.checklist.boundary.api;


public interface ChecklistApi {
    public boolean isChecklistPartiallyConfirmed(final Long checklistId);
    public boolean isChecklistCompleted(final Long checklistId);
    public void proceedPastPartialConfirmation(Long checklistId);
    public EntityReference createChecklist(EntityReference checkListConfiguration);
}

---------- End of ./boundary/api/ChecklistApi.java ----------

---------- Start of ./Checklist.java ----------
package eu.reply.lea.services.yms.task.checklist;




@Entity
public class Checklist extends StringCustomizableEntity {

    @NotNull
    @Getter
    private String name;

    @OneToMany(mappedBy = "checklist", orphanRemoval = true, cascade = CascadeType.ALL)
    private List<ChecklistItem> items  = new ArrayList<>();

    private ChecklistCompletionType completionType = ChecklistCompletionType.NOT_COMPLETED;

    private boolean canProceedPastPartialConfirmation = false;

    public Checklist(String name){
        this.name = name;
    }

    public Checklist(){
    }

    public List<ChecklistItem> getItems() {
        return Collections.unmodifiableList(items);
    }

    public void addItem(ChecklistItem item) {
        this.items.add(item);
        item.setChecklist(this);
    }

    public void setCanProceedPastPartialConfirmation() {
        this.canProceedPastPartialConfirmation = true;
    }

    public boolean canProceedPastPartialConfirmation() {
        return canProceedPastPartialConfirmation;
    }

    public boolean isCompleted() {
        return completionType.equals(ChecklistCompletionType.COMPLETED);
    }

    public boolean isPartialCompletion() {
        return completionType.isPartialCompletion();
    }

    private boolean completenessVerified() {
        return this.items.stream().allMatch(ChecklistItem::isCompleted);
    }

    private boolean partialCompletenessVerified() {
        return this.items.stream().filter(t -> t.getOrderNumber().compareTo(BigDecimal.ZERO) < 0).allMatch(ChecklistItem::isCompleted);
    }

    public void confirmCompleted() {
        if (!isCompleted() && this.completenessVerified()) {
            this.setCompletionType(ChecklistCompletionType.COMPLETED);
        } else if ((!isCompleted() || !isPartialCompletion()) && this.partialCompletenessVerified()) {
            this.setCompletionType( ChecklistCompletionType.PARTIAL_COMPLETION);
        }
    }

    private void setCompletionType(ChecklistCompletionType completionType) {
        this.completionType = completionType;
    }

    public ChecklistCompletionType getCompletionType() {
        return completionType;
    }
}

---------- End of ./Checklist.java ----------

---------- Start of ./CheckNotes.java ----------
package eu.reply.lea.services.yms.task.checklist;



@Embeddable
public class CheckNotes {

    private boolean notesRequired = false;

    private String notes;

    public CheckNotes() {}

    public CheckNotes(boolean notesRequired) {
        this.setNotesRequired(notesRequired);
    }

    public boolean isNotesRequired() {
        return notesRequired;
    }

    private void setNotesRequired(boolean notesRequired){
        this.notesRequired = notesRequired;
    }

    public String getNotes() {
        return notes;
    }

    public void addNotes(String notes) {
        this.notes = notes;
    }

    public boolean isNotesAdded() {
        return notes != null;
    }
}

---------- End of ./CheckNotes.java ----------

---------- Start of ./CheckValidation.java ----------
package eu.reply.lea.services.yms.task.checklist;



@Embeddable
public class CheckValidation {

    private ValidationStatus status = ValidationStatus.NOT_VALIDATED;

    public enum ValidationStatus {
        NOT_VALIDATED,
        VALID,
        INVALID
    }

    private boolean validationRequired = false;

    public CheckValidation(boolean validationRequired) {
        this.setValidationRequired(validationRequired);
    }

    public CheckValidation() {

    }

    private void setValidationRequired(boolean validationRequired) {
        this.validationRequired = validationRequired;
    }
    public boolean isValidationRequired() {
        return validationRequired;
    }

    // Constructors, getters, and setters

    public ValidationStatus getStatus() {
        return status;
    }

    public void confirmValid() {
        this.status = ValidationStatus.VALID;
    }

    public void confirmInvalid() {
        this.status = ValidationStatus.INVALID;
    }

    public boolean isCheckCompleted(){
        return status != ValidationStatus.NOT_VALIDATED;
    }


    /**
     * Checks if the validation state is valid.
     */
    public boolean isValid() {
        return this.status == ValidationStatus.VALID;
    }

    /**
     * Checks if the validation state is invalid.
     */
    public boolean isInvalid() {
        return this.status == ValidationStatus.INVALID;
    }

    /**
     * Checks if the validation has not been performed yet.
     */
    public boolean isNotValidated() {
        return this.status == ValidationStatus.NOT_VALIDATED;
    }


    @Override
    public String toString() {
        return "CheckValidation{" +
               "validationRequired=" + validationRequired +
               ", status=" + status +
               '}';
    }


}

---------- End of ./CheckValidation.java ----------

---------- Start of ./action/ChecklistItemAddNotesAction.java ----------
package eu.reply.lea.services.yms.task.checklist.action;



public class ChecklistItemAddNotesAction implements Serializable {

    private static final long serialVersionUID = -753133695422042391L;

    @NonNull
    private String notes;

    public ChecklistItemAddNotesAction() {
    }

    public @NonNull String getNotes() {
        return notes;
    }

    public void setNotes(final @NonNull String notes) {
        this.notes = notes;
    }
}

---------- End of ./action/ChecklistItemAddNotesAction.java ----------

---------- Start of ./action/AddDocumentAction.java ----------
package eu.reply.lea.services.yms.task.checklist.action;




public class AddDocumentAction extends Stringable implements Serializable {

    private static final long serialVersionUID = -753133695422042391L;

    @NonNull
    private AttachmentReference attachmentReference;

    public AddDocumentAction() {
    }

    public AttachmentReference getAttachmentReference() {
        return attachmentReference;
    }

    public void setAttachmentReference(final AttachmentReference attachmentReference) {
        this.attachmentReference = attachmentReference;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", AddDocumentAction.class.getSimpleName() + "[", "]")
            .add("attachmentReference=" + attachmentReference)
            .toString();
    }
}

---------- End of ./action/AddDocumentAction.java ----------

---------- Start of ./application/ChecklistApplicationService.java ----------
package eu.reply.lea.services.yms.task.checklist.application;


public interface ChecklistApplicationService {

    Checklist proceedPastPartialConfirmation(Long checklistId);

    Checklist proceedPastPartialConfirmation(Checklist checklist);

    boolean isChecklistPartiallyCompleted(final Long checklistId);
    boolean isChecklistCompleted(final Long checklistId);

    Checklist createChecklist(EntityReference checkListConfigurationRef);
}

---------- End of ./application/ChecklistApplicationService.java ----------

---------- Start of ./application/ChecklistApplicationServiceImpl.java ----------
package eu.reply.lea.services.yms.task.checklist.application;




@ApplicationScoped
@Logged
@Transactional
public class ChecklistApplicationServiceImpl implements ChecklistApplicationService {


    @Inject
    private ChecklistRepository checklistRepository;

    @Inject
    private ChecklistConfigurationRepository checklistConfigurationRepository;

    @Inject
    private ChecklistFactory checklistFactory;

    @Inject
    private Logger logger;

    @Override
    public Checklist proceedPastPartialConfirmation(final Long checklistId) {
        logger.debug("Proceeding past partial confirmation for Checklist ID: {}", checklistId);
        Checklist checklist = checklistRepository.findById(checklistId)
            .orElseThrow(() -> new ChecklistNotFoundException("Checklist not found"));
        return proceedPastPartialConfirmation(checklist);
    }

    @Override
    public Checklist proceedPastPartialConfirmation(final Checklist checklist) {
        if (checklist == null) {
            logger.error("Checklist provided is null");
            throw new IllegalArgumentException("Checklist provided is null");
        }

        // Call the processor for domain logic
        checklist.setCanProceedPastPartialConfirmation();

        // Persist the changes
        checklistRepository.save(checklist);

        return checklist;
    }


    @Override
    public boolean isChecklistPartiallyCompleted(final Long checklistId) {
        logger.debug("Checking if checklist is partially confirmed for Checklist ID: {}", checklistId);
        Checklist checklist = checklistRepository.findById(checklistId)
            .orElseThrow(() -> new ChecklistNotFoundException("Checklist not found"));
        return checklist.isPartialCompletion();
    }

    @Override
    public boolean isChecklistCompleted(final Long checklistId) {
        logger.debug("Checking if checklist is completed for Checklist ID: {}", checklistId);
        Checklist checklist = checklistRepository.findById(checklistId)
            .orElseThrow(() -> new ChecklistNotFoundException("Checklist not found"));
        return checklist.isCompleted();
    }

    @Override
    public Checklist createChecklist(final EntityReference checkListConfigurationRef) {
        if (checkListConfigurationRef == null) {
            throw new IllegalArgumentException("Checklist configuration ref is null");
        }
        logger.debug("Creating a new checklist from configuration with id ID: {}", checkListConfigurationRef);
        ChecklistConfiguration checklistConfiguration = checklistConfigurationRepository.findByEntityRef(checkListConfigurationRef)
            .orElseThrow(() -> new ChecklistConfigurationNotFoundException("ChecklistConfiguration not found"));
        Checklist checklist = checklistFactory.generateChecklistFromConfiguration(checklistConfiguration);
        checklistRepository.save(checklist);
        return checklist;
    }
}

---------- End of ./application/ChecklistApplicationServiceImpl.java ----------

 Can  you provide javadoc