translated domain model to ruby syntax
added some period and time window stuff