Refactored duplicate code into OfferRowMapper class. Added new test and
fixed a foreign key dependency bug.