package com.capgemini.framework.teamcenter;

import com.teamcenter.soa.client.model.strong.*;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

/**
 * Class regrouping all the properties for objects.
 */
@Slf4j
@EqualsAndHashCode
public class TeamcenterObjectProperties {

    /**
     * Property for retrieving all the tasks associated to a Change.
     */
    public static final String PROCESS_STAGE_LIST = "process_stage_list";
    /**
     * Child tasks of an EPMTask.
     */
    public static final String CHILD_TASKS = "child_tasks";
    /**
     * List of target objects of an EPMTask.
     */
    public static final String ROOT_TARGET_ATTACHMENTS = "root_target_attachments";
    /**
     * List of all signoffs attached to an EPMTask.
     */
    public static final String SIGNOFF_ATTACHMENTS = "signoff_attachments";
    /**
     * Property for retrieving the {@link User} who last modified an object.
     */
    public static final String LAST_MOD_USER = "last_mod_user";
    /**
     * Property for retrieving the date at which an object was last modified.
     */
    public static final String LAST_MOD_DATE = "last_mod_date";
    /**
     * Property for retrieving the 'State' of an {@link EPMTask}.
     */
    public static final String STATE = "state";
    /**
     * Property for retrieving the valid signoffs of a task.
     */
    public static final String VALID_SIGNOFFS = "valid_signoffs";
    /**
     * End item of an Effectivity. Usually, a Product ID.
     */
    public static final String END_ITEM = "end_item";
    /**
     * Property for retrieving the main object associated to a TC {@link BOMLine}.
     */
    public static final String BL_LINE_OBJECT = "bl_line_object";
    /**
     * Property for retrieving the sequence_id of an Object.
     */
    public static final String SEQUENCE_ID = "sequence_id";
    /**
     * Property for retrieving the date released on a ReleaseStatus.
     */
    public static final String DATE_RELEASED = "date_released";
    /**
     * Property for retrieving the creationDate of an Object.
     */
    public static final String CREATION_DATE = "creation_date";
    /**
     * Property for retrieving the ID of an Item.
     */
    public static final String ITEM_ID = "item_id";
    /**
     * Property for retrieving the revision of an ItemRevision.
     */
    public static final String ITEM_REVISION_ID = "item_revision_id";
    /**
     * Property for retrieving the list of revision of an Item.
     */
    public static final String REVISION_LIST = "revision_list";
    /**
     * Property for retrieving the name of a ReleaseStatus.
     */
    public static final String NAME = "name";
    /**
     * Property for retrieving the name of a ModelObject.
     */
    public static final String OBJECT_NAME = "object_name";
    /**
     * Property for retrieving the Item of an ItemRevision.
     */
    public static final String ITEMS_TAG = "items_tag";
    /**
     * Property for retrieving the form of an Item or an ItemRevision.
     */
    public static final String ITEM_MASTER_TAG = "item_master_tag";
    /**
     * Property for retrieving the direct children of a RF Part Assemb Revision.
     */
    public static final String ASSEMBLY_BOM = "AssemblyBom";
    /**
     * Property for retrieving the direct children of a RF Part Revision.
     */
    public static final String RF_PART_BOM = "RFPartBom";
    /**
     * Property for retrieving the 'owning user'.
     */
    public static final String OWNING_USER = "owning_user";
    /**
     * Property for retrieving the 'user_name'.
     */
    public static final String USER_NAME = "user_name";
    /**
     * Property for retrieving the 'id'.
     */
    public static final String USER_ID = "user_id";
    /**
     * Property for retrieving the {@link Person} of a {@link User}.
     */
    public static final String PERSON = "person";
    /**
     * Property for Decision status on Signoff objects.
     */
    public static final String DECISION = "decision";
    /**
     * Property for 'Ligne Produit' on every Change Objects.
     */
    public static final String PROP_LIGNE_PRODUIT = "pv4_ligne_produit";
    /**
     * Property for retrieving the documents in the pseudofolder &quot;Represented by&quot;.
     */
    public static final String TC_IS_REPRESENTED_BY = "TC_Is_Represented_By";


    protected TeamcenterObjectProperties() {
        // protected <-- because ObjectProperties will extend this class
    }

    /**
     * Get item id for an item.
     *
     * @param item the Item to search
     * @return item id
     */
    public static String getItemIdOrNull(final Item item) {
        return item.get_item_id();
    }

}
