If I’ve understood this correctly I think the below might be what you’re looking for:
Create a button for the contractor to create a new category in the app (link this to a form perhaps where they can enter the relevant info). This should probably prefill the contractor name in a property in the categories collection.
Create a relationship between categories and subcategories in your database
Create another button for the contractor to create new subcategories (via a form again and because of the relationship created above they should be able to select the relevant category that it falls under). Again, I would set the form to automatically update a property such as ‘contractor name’ in the subcategory collection.
Then you can only display categories and subcategories where the contractor name is equal to current contractor.