implement mapping and DAO layer and with tests