-
Notifications
You must be signed in to change notification settings - Fork 6
[Android] Поддержка таргетинга visit для in-app #3211 #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| override fun checkTargeting(data: TargetingData): Boolean { | ||
| val userVisitCount = MindboxPreferences.userVisitCount.toLong() | ||
| return when (kind) { | ||
| KindVisit.GTE -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем скобки ставить? мне нравится больше когда в одну строку
KindVisit.GTE -> value >= userVisitCount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я обычно всегда ставлю, на случай, что если придется что-то дописывать, то не пришлось бы их ставить потом. А у нас нет нигде какого-то код стайла, чтобы посмотреть как лучше писать
| is TreeTargetingDto.VisitNodeDto -> { | ||
| !targeting.type.isNullOrBlank() && targeting.kind.equalsAny( | ||
| GREATER_OR_EQUALS, LOWER_OR_EQUALS, EQUALS, NOT_EQUALS | ||
| ) && (targeting.value?.let { it > 0 } == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А 0 не может быть?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
согласен что > 0
"value": 1 // required long > 0
| } | ||
|
|
||
| @Test | ||
| fun `validate targeting dto is visit node and its valid with gte`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь бы получше было что-то такое validate targeting dto return true when is visit node and its valid with gte, но здесь сразу проверка, поэтому тест и так хорошо читается
https://github.com/mindbox-cloud/issues-web-mobile/issues/3211