pachli-android/core/network
Nik Clayton 9a23439d04
refactor: Remove duplicate strings from Filter contexts (#478)
A filter's context (previously referred to as its `kind`) controls where
the filter is applied.

This was implemented as an enum with a specific property to control how
it would serialise when @FormUrlEncoded, and with a @Json annotation for
Moshi.

In addition, the model objects kept the filter context in its string
form throughout Pachli, requiring periodic conversion to/from the enum
type, making the code more complicated.

Fix this, by:

1. Converting the incoming JSON value to the enum type immediately, so
the rest of the code uses the enum constants exclusively.

2. Implement a Retrofit converter that serialises the enum value when
@FormUrlEncoded to the same string used in JSON serialisation
2024-02-28 19:09:54 +01:00
..
src refactor: Remove duplicate strings from Filter contexts (#478) 2024-02-28 19:09:54 +01:00
build.gradle.kts refactor: Convert from Gson to Moshi (#428) 2024-02-09 12:41:13 +01:00
lint-baseline.xml change: Disable SyntheticAccessor lint rule (#424) 2024-02-06 19:51:37 +01:00
proguard-rules.pro refactor: Start creating core modules (#286) 2023-12-04 16:58:36 +01:00