danieleades / monzo-lib

monzo API client library, in pure rust
16 stars 4 forks source link

transaction categories are not exhaustive #12

Closed danieleades closed 3 years ago

danieleades commented 3 years ago

the enum variants for the transaction categories are not complete. Also, monzo plus now allows custom categories. The current implementation will return an error if another category is encountered.

Is an enum useful? if not, this could just be a string.

if it is useful, then this enum will need an 'other' variant, and a custom Deserialize implementation to capture the unknown categories as a string. as in,

enum Category {
   ...
   Other(String)
}
danieleades commented 3 years ago

@BreD1810 the more i think about this, the more i think a simple String for category would be acceptable. I'm not sure what value an Enum is to the calling code anyway.

danieleades commented 3 years ago

Closed by #16