export function return_obj_type_path({
    obj_type = null,
    obj_type_prop_name = null
}: {
    obj_type?: string | null;
    obj_type_prop_name?: string | null;
}) {
    console.log('*** return_obj_type_path() ***');

    let obj_type_path: string | null = null;

    const known_obj_type_li_dict = [
        { name: 'account', display: 'Account', path: 'account' },
        { name: 'archive', display: 'Archive', path: 'archive' },
        { name: 'address', display: 'Address', path: 'address' },
        { name: 'archive', display: 'Archive', path: 'archive' },
        {
            name: 'archive_content',
            display: 'Archive Content',
            path: 'archive/content'
        },
        { name: 'contact', display: 'Contact', path: 'contact' },
        { name: 'data_store', display: 'Data Store', path: 'data_store' },
        {
            name: 'event_abstract',
            display: 'Event Abstract',
            path: 'event/abstract'
        },
        { name: 'event_badge', display: 'Event Badge', path: 'event/badge' },
        { name: 'event_device', display: 'Event Device', path: 'event/device' },
        {
            name: 'event_exhibit',
            display: 'Event Exhibit',
            path: 'event/exhibit'
        },
        { name: 'event_file', display: 'Event File', path: 'event/file' },
        {
            name: 'event_location',
            display: 'Event Location',
            path: 'event/location'
        },
        { name: 'event_person', display: 'Event Person', path: 'event/person' },
        {
            name: 'event_presentation',
            display: 'Event Presentation',
            path: 'event/'
        },
        {
            name: 'event_presenter',
            display: 'Event Presenter',
            path: 'event/presenter'
        },
        {
            name: 'event_registration',
            display: 'Event Registration',
            path: 'event/registration'
        },
        {
            name: 'event_session',
            display: 'Event Session',
            path: 'event/session'
        },
        { name: 'event', display: 'Event', path: 'event' },
        { name: 'hosted_file', display: 'Hosted File', path: 'hosted_file' },
        { name: 'journal', display: 'Journal', path: 'journal' },
        {
            name: 'journal_entry',
            display: 'Journal Entry',
            path: 'journal/entry'
        },
        { name: 'order_line', display: 'Order Line', path: 'order/line' },
        { name: 'order', display: 'Order', path: 'order' },
        { name: 'person', display: 'Person', path: 'person' },
        { name: 'post', display: 'Archive', path: 'post' },
        {
            name: 'post_comment',
            display: 'Archive Content',
            path: 'post/comment'
        },
        { name: 'user', display: 'User', path: 'user' }
    ];

    if (obj_type && obj_type_prop_name) {
        // Need to loop through known for safety?
        obj_type_path = obj_type_prop_name.replaceAll('_', '/');
    } else if (obj_type_prop_name) {
        let found_obj_type_name = null;
        let found_obj_type_path = null;

        for (let i = 0; i < known_obj_type_li_dict.length; i++) {
            // console.log(known_obj_type_li_dict[i]);
            // let guessed_obj_type = prop_name.startsWith(known_obj_type_li_dict[i]
            if (obj_type_prop_name.startsWith(known_obj_type_li_dict[i].name)) {
                console.log(`Found ${known_obj_type_li_dict[i].name}`);
                found_obj_type_name = known_obj_type_li_dict[i].name;
                found_obj_type_path = known_obj_type_li_dict[i].path;
                // obj_type_path = obj_type_prop_name.replaceAll('_', '/');
                obj_type_path = found_obj_type_path;
                break;
            }
        }
    } else {
        console.log('Missing required parameters');
        return false;
    }

    return obj_type_path;
}
