Active Perks Catalog
The merchant browse rules, defined once.
Every function here is pure: same input, same output, no I/O. The one platform input is the device locale, which decides how names collate; every other rule is identical on the JVM and on Kotlin/Native.
Functions
The categories the catalogue actually uses, de-duplicated and collated by the device locale like merchant names, so no filter option a client offers can yield an empty list.
Applies search, categories and favorites together. A merchant is kept only if it satisfies all three.
The merchant's favorite state, with a client-supplied override taking precedence over the value the catalogue carried.
Matches the free-form brand string a location carries to a merchant.
Orders the catalogue by the criteria in turn, each breaking the previous one's ties. An empty list returns the input order unchanged.