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

public enum ChecklistCompletionType {
    NotCompleted,
    PartialCompleteness,
    Completed;

    public boolean isCompleted(){
        return this.equals(Completed);
    }

    public boolean isPartialCompleteness(){
        return this.equals(PartialCompleteness);
    }
}

---------- 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 Checklist findByEntityRef(EntityReference entityRef) {
        return entityReferenceHandler.getEntity(entityRef,em);
    }

    public Checklist findById(Long id) {
        return 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 ChecklistConfiguration findByEntityRef(EntityReference entityRef) {
        return entityReferenceHandler.getEntity(entityRef,em);
    }

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

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

}

---------- End of ./repository/ChecklistConfigurationRepository.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
@Table(
    uniqueConstraints = {@UniqueConstraint(
        columnNames = {"name"}
    )}
)
@StringifyAttributes(attributes = { "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
@Setter
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.PRIVATE)
    private boolean completed = false;

    @ManyToOne
    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.orderNumber = 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 IllegalStateException("Checklist item is blocked");
        }
        if (isCheckValidationRequired()) {
            checkValidation.confirmValid();
        }else{
            throw new IllegalArgumentException("It's not possible to confirm validation since it's not required for current checklist");
        }
    }

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


    public void uploadDocument(AttachmentReference attachmentReference) {
        if (isBlocked()){
            throw new IllegalStateException("Checklist item is blocked");
        }
        if (isDocumentUploadRequired()) {
            documentUpload.uploadDocument(attachmentReference);
        }else{
            throw new IllegalArgumentException("It's not possible to upload documents since it's not required for current checklist");
        }
    }

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

    public void addNotes(String notesText) {
        if (isBlocked()){
            throw new IllegalStateException("Checklist item is blocked");
        }
        if (isCheckNotesRequired()) {
            checkNotes.addNotes(notesText);
        }else{
            throw new IllegalArgumentException("It's not possible to upload documents since it's not required for current checklist");
        }
    }

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

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

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

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

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

    public void confirmCompleted(){
        if (isBlocked()){
            throw new IllegalStateException("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");
        }
    }
}

---------- 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) {
        Checklist checklist = new Checklist();

        // 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);

        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.isChecklistPartiallyConfirmed(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 {

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

    private ChecklistCompletionType completionType = ChecklistCompletionType.NotCompleted;

    private boolean canProceedPastPartialConfirmation = false;

    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 isPartialCompleteness() {
        return completionType.equals(ChecklistCompletionType.PartialCompleteness);
    }

    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() || !isPartialCompleteness()) && this.partialCompletenessVerified()) {
            this.setCompletionType( ChecklistCompletionType.PartialCompleteness);
        }
    }

    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 boolean validationRequired = false;

    private Boolean valid;

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

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

    public boolean isValidationRequired() {
        return validationRequired;
    }

    public CheckValidation() {

    }

    public Boolean isValid() {
        return valid;
    }

    public void confirmValid() {
        this.valid = true;
    }

    public void confirmInvalid() {
        this.valid = false;
    }

    public boolean isCheckCompleted(){
        return valid != null;
    }
}

---------- 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 isChecklistPartiallyConfirmed(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
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class ChecklistApplicationServiceImpl implements ChecklistApplicationService {


    @Inject
    private ChecklistRepository checklistRepository;

    @Inject
    private ChecklistConfigurationRepository checklistConfigurationRepository;

    @Inject
    private ChecklistFactory checklistFactory;

    @Override
    public Checklist proceedPastPartialConfirmation(final Long checklistId) {
        Checklist checklist = checklistRepository.findById(checklistId);
        if (checklist == null) {
            throw new IllegalArgumentException("Checklist not found");
        }
        return proceedPastPartialConfirmation(checklist);
    }

    @Override
    public Checklist proceedPastPartialConfirmation(final Checklist checklist) {
        if (checklist == null) {
            throw new IllegalArgumentException("Checklist not found");
        }

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

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

        return checklist;
    }


    @Override
    public boolean isChecklistPartiallyConfirmed(final Long checklistId) {
        Checklist checklist = checklistRepository.findById(checklistId);
        if (checklist == null) {
            throw new IllegalArgumentException("Checklist not found");
        }
        return checklist.isPartialCompleteness();
    }

    @Override
    public boolean isChecklistCompleted(final Long checklistId) {
        Checklist checklist = checklistRepository.findById(checklistId);
        if (checklist == null) {
            throw new IllegalArgumentException("Checklist not found");
        }
        return checklist.isCompleted();
    }

    @Override
    public Checklist createChecklist(final EntityReference checkListConfigurationRef) {
        ChecklistConfiguration checklistConfiguration = checklistConfigurationRepository.findByEntityRef(checkListConfigurationRef);
        Checklist checklist = checklistFactory.generateChecklistFromConfiguration(checklistConfiguration);
        checklistRepository.save(checklist);
        return checklist;
    }
}

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


Can you make this more production ready (let's give aside tests and documentation for now)