Combining Quasi-Experimental Shocks with Endogenous Exposure: A General Framework