package hirondelle.predict.pub.lostpassword;
import static hirondelle.predict.pub.lostpassword.LostPasswordAction.FETCH_PARTIAL_USER;
import static hirondelle.predict.pub.lostpassword.LostPasswordAction.SET_TEMP_PASSWORD_NONCE;
import hirondelle.web4j.database.DAOException;
import hirondelle.web4j.database.Db;
import hirondelle.web4j.model.Id;
final class LostPasswordDAO {
PartialUser fetchUser(String aEmailAddr) throws DAOException {
return Db.fetch(PartialUser.class, FETCH_PARTIAL_USER, Id.from(aEmailAddr));
}
void setNewNonce(PartialUser aUser, String aNonce) throws DAOException {
Db.edit(SET_TEMP_PASSWORD_NONCE, Id.from(aNonce), Id.from(aUser.getEmailAddress()));
}
}