"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAssociationHierarchy = void 0;
const ProjectAssociationHierarchies_1 = require("../../projects/_internal/ProjectAssociationHierarchies");
const InitiativeAssociationHierarchies_1 = require("../../initiatives/_internal/InitiativeAssociationHierarchies");
/**
 * associations are hierarchical in nature, e.g.
 * there is always a parent and a child involved
 * in the relationship.
 *
 * given an entity type, this util returns the
 * parent and children entity types that it can
 * associate with
 *
 * @param type - entity type
 * @returns {IHubAssociationHierarchy}
 */
const getAssociationHierarchy = (type) => {
    let hierarchy = {
        children: [],
        parents: [],
    };
    switch (type) {
        case "initiative":
            hierarchy = InitiativeAssociationHierarchies_1.InitiativeAssociationHierarchies;
            break;
        case "project":
            hierarchy = ProjectAssociationHierarchies_1.ProjectAssociationHierarchies;
            break;
        // as we support more entity associations, we'll need to extend this
        default:
            throw new Error(`getAssociationHierarchy: Invalid type for associations: ${type}.`);
    }
    return hierarchy;
};
exports.getAssociationHierarchy = getAssociationHierarchy;
//# sourceMappingURL=getAssociationHierarchy.js.map