package com.capgemini.reports.definition.r11report.data.extractor;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.reports.bomlineholder.BOMLineHolder;
import com.capgemini.reports.bomlineholder.flattener.AbstractRepereFlattener;
import com.capgemini.reports.releasestatus.EffectivityBehaviourHelper;
import com.capgemini.reports.snecmaobjects.part.DETRevision;

import javax.enterprise.inject.Alternative;

/**
 * This class is specific of the report R11. <br>
 * Inherits {@link AbstractRepereFlattener}, he gets only receptor and repere.<br>
 * For the report 11, the explosion of nomenclature is deepth-first, we don't need to findAll {@link Alternative} and {@link DETRevision}, to findAll the part number and only the effectivity by unit.
 */
public class BomLineBrowserR11 extends AbstractRepereFlattener<R11ReceptorRepere> {
    private static final boolean VISIT_PART_BELOW_PART = false;
    private static final boolean RETRIEVE_PART_NUMBER_UNDER_RF_GENERIC = false;
    private static final boolean VISIT_PARTS_IN_PSEUDO_FOLDER = false;
    private static final boolean DEEPLY_EXPLOSION = true;

    /**
     * Constructor.
     */
    public BomLineBrowserR11() {
        super(EffectivityBehaviourHelper.visitOnlyUnitManagedParts(), VISIT_PARTS_IN_PSEUDO_FOLDER, RETRIEVE_PART_NUMBER_UNDER_RF_GENERIC,
                VISIT_PART_BELOW_PART, DEEPLY_EXPLOSION);
    }

    @Override
    public R11ReceptorRepere makeRepairReceptorLine(final TcSession session, final BOMLineHolder bomLineReceptor, final BOMLineHolder bomLineRepair) {
        return new R11ReceptorRepere(session, bomLineReceptor, bomLineRepair);

    }

}
