The RG API exposes a few fields that can be used to determine if a cat is a senior. However, all of these fields are optional, and it's likely that many org's don't use them, making it impossible to determine the age of the cat. In these cases we will need to simply exclude the cat from the senior identifying logic.
RG Fields for Age
ageString is a dynamic value (not user entered) based on birthDate, assuming a birth date value exists.
ageGroup is an optional radio group input. If a value exists, we can likely rely on the value. Possible values are: Baby, Young Adult, Senior. NOTE: This is a user entered value, not a dynamic selection based on the birth date.
From what I can tell, the best approach is to first look to see if ageString has a value. If it does, either use the value or the actual birth day value to calculate if the animal is >=10 years. If it is, flag as a senior. A secondary condition, if ageString and birth date aren't available, is to look at ageGroup. If it has a value, and the value is "senior", flag as senior. Only evaluate the second condition if the first condition does not have data. ageGroup should be considered less reliable than ageString and birthDate, and should only be utilized as an indicator when neither exists.
Design Implementation
Similar to the design concept for #40 , the front end implementation will involve a colored badge overlayed on the cat photo. Think Bootstrap badge style with a text label like "Senior", that is visible in the upper left or right of the cat photo (other placement options can be considered/recommended).
Consideration
If both the new cat and senior cat logic are implemented, and both are true, we will display both badges. But we need to ensure in this scenario that the badges are displayed properly. We should also use a different color badge for each.
The RG API exposes a few fields that can be used to determine if a cat is a senior. However, all of these fields are optional, and it's likely that many org's don't use them, making it impossible to determine the age of the cat. In these cases we will need to simply exclude the cat from the senior identifying logic.
RG Fields for Age
ageStringis a dynamic value (not user entered) based onbirthDate, assuming a birth date value exists.ageGroupis an optional radio group input. If a value exists, we can likely rely on the value. Possible values are: Baby, Young Adult, Senior. NOTE: This is a user entered value, not a dynamic selection based on the birth date.From what I can tell, the best approach is to first look to see if
ageStringhas a value. If it does, either use the value or the actual birth day value to calculate if the animal is >=10 years. If it is, flag as a senior. A secondary condition, ifageStringand birth date aren't available, is to look atageGroup. If it has a value, and the value is "senior", flag as senior. Only evaluate the second condition if the first condition does not have data.ageGroupshould be considered less reliable thanageStringandbirthDate, and should only be utilized as an indicator when neither exists.Design Implementation
Similar to the design concept for #40 , the front end implementation will involve a colored badge overlayed on the cat photo. Think Bootstrap badge style with a text label like "Senior", that is visible in the upper left or right of the cat photo (other placement options can be considered/recommended).
Consideration
If both the new cat and senior cat logic are implemented, and both are true, we will display both badges. But we need to ensure in this scenario that the badges are displayed properly. We should also use a different color badge for each.