На сайте только то, что можно купитьOnly what can be bought is on the site
· Открыть на сайтеOpen on the site
ЦельGoal
Инвестор видит в каталоге, на карте, на страницах стран и городов, в сравнении и рейтинге только проекты, где сейчас есть юниты в продаже, и только города и страны с такими проектами.In the catalogue, on the map, on country and city pages, in the comparison and the rating the investor sees only projects with units for sale now, and only the cities and countries that have them.
ЗадачаProblem
У 18 из 51 проекта нет ни одного юнита в продаже, а в Чешме, Сапандже, Белеке и Кемере нет юнитов совсем. Их всё равно показывали: строка «Сейчас без юнитов в продаже — 18 проектов» и карточки под ней в каталоге, бледные метки на карте, «Сейчас без юнитов в продаже — 4 города» на странице Турции, «сейчас юнитов в продаже нет» на странице проекта. Владелец: «а в чем прикол „нет юнитов в продаже“ зачем это показывать?»18 of 51 projects have no unit for sale, and Çeşme, Sapanca, Belek and Kemer have no units at all. They were shown anyway: «No units for sale now — 18 projects» with the cards under it in the catalogue, pale pins on the map, «No units for sale now — 4 cities» on the Turkey page, «no units for sale now» on a project page. The owner: «what's the point of showing "no units for sale"?»
Как решилиHow it was solved
- Проект на сайте, пока у него есть хотя бы один юнит в продаже; город и страна — пока в них есть такой проект. Правило считается при сборке из данных: появился юнит — проект, его город и страна вернутся сами.A project is on the site while it has at least one unit for sale; a city and a country — while they have such a project. The rule is worked out from the data at build time: a new unit brings the project, its city and country back by themselves.
- Остальных страниц нет, ссылок на них тоже, строк и меток «без юнитов в продаже» нет. Собранные о них факты остаются в данных.The others have no pages and no links, and there are no «no units for sale» lines or pins. The facts collected about them stay in the data.
- Счётчики считают только показанное: на странице Турции 8 городов, на «Странах» — 29 проектов в Турции, в рейтинге — 33 проекта.The counters count only what is shown: 8 cities on the Turkey page, 29 projects in Turkey on «Countries», 33 projects in the rating.
До и послеBefore and after



