byrokrat / giroapp

Command line app for managing autogiro donations.
GNU General Public License v3.0
4 stars 2 forks source link

Mandate response codes are misinterpreted in MandateResponseListener #82

Closed hanneskod closed 7 years ago

hanneskod commented 7 years ago

MandateResponseListener mistakenly assumes that the info code in a mandate response node represents the value of the response. It does not.

The info code represents the scope (does the reponse consern the request to add a new mandate?).

The info and comment codes together represents the value (is the request to add a new mandate accepted or rejected, why?).

Now the possible combinations of info and comment codes (see the ag specs) are much too many to be manually checked for in a switch statement as is currently done in MandateResponseListener. Someting more clever is needed here, possibly some helper methods in byrokrat/autogiro?

See features-missing/import.feature for a test that should pass.