package com.craigvg.lichun_android.utils /** * Education qualification and formatting utilities. * Ported from iOS EducationHelpers.swift */ private val gradeLevels = listOf( "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th" ) /** * Checks if a user with a given education level qualifies for a requirement. */ fun doesUserQualify(userEducation: String, requirement: String): Boolean { if (userEducation in gradeLevels) { return requirement == "none" } return userEducation == requirement } /** * Formats an education string by replacing underscores with spaces and capitalizing words. * e.g. "high_school" -> "High School" */ fun formatEducationString(str: String): String { return str.split("_").joinToString(" ") { it.replaceFirstChar { c -> c.uppercase() } } }