Tracking issue for the WMDE Fundraising frontend "rewrite".
This "rewrite" will happen by starting from scratch architecture and design wise. As top down implementation is done, the corresponding parts of the old codebase can be used as they are, used in a refactored form, or thrown away and replaced entirely as we see fit.
**Proposed approach**
First we identify a use case that we predict is easy to implement and minimally depends on behaviour we'd need to implement for another one. We can then implement this use case in top down manner, creating the needed services, entities and other stuff as we see fit. This is where we decide for each part of the implementation if we simply use some old code, use a refactored version of some old code, or start from scratch. Once the use case is completed, we repeat the process, until we have all use cases (and thus completed both the red and yellow circles in this diagram). The next step then is to decide how we want to proceed with the presentation mechanism(s).
(https://www.youtube.com/watch?v=Nsjsiz2A9mg, https://blog.8thlight.com/assets/posts/2012-08-13-the-clean-architecture/CleanArchitecture-81565aba46f035911a5018e77a0f2d4e.jpg)
**Use case identification**
Visualization of conceptual components and their dependencies in the current codebase:
{F2624061}
Identified use cases:
## Display specific page from the CMS
Which page is specified in url, CMS may return content not found
GET request
URL: https://test.wikimedia.de/spenden/PAGENAME
new URL will probably something like https://test.wikimedia.de/page/PAGENAME
## Validate Email
Validate email structure & do MX check
GET request
URL: https://test.wikimedia.de/ajax.php?module=action&action=checkEmail&eaddr=gb@blah.com
Success response: `{"status":"OK"}`
Error response: `{"status":"ERR"}
URL can be changed.
`
## Validate Bank Account
Validate bank data and return full set of bank data (converted from input)
GET request
URL for IBAN: https://test.wikimedia.de/ajax.php?module=action&action=checkIban&iban=DE12500105170648489890
URL for acct. number: https://test.wikimedia.de/ajax.php?module=action&action=generateIban&bankCode=50010517&accNum=0648489890
Success response: `{"bic":"INGDDEFFXXX","iban":"DE12500105170648489890","account":"0648489890","bankCode":"50010517","bankName":"ING-DiBa","status":"OK"}`
:"ING-DiBa","status":"OK"}
Error response: `{"status":"ERR"}`
## Add Donation
POST request, application/x-www-form-urlencoded
URL https://test.wikimedia.de/spenden/spende.php
Request Body: betrag_auswahl=5%2C00&betrag=&intervalType=0&zahlweise=BEZ&debit-type=non-sepa&iban=DE12500105170648489890
&bic=INGDDEFFXXX&konto=0648489890&blz=50010517&adresstyp=person&anrede=Herr&titel=Kein+Titel&vorname
=jhebk&nachname=veebwk&firma=&strasse=mevbek3b2hn&plz=11234&ort=Berlin&country=DE&email=gb%40blah.com
&go_prepare--pay%3Aeinzug=&periode=0&bankname=ING-DiBa&iframe=&form=10h16_Confirm&appeal=&from_form=10h16_Form2_Ticker_Intrvar
&tracking=&source=web&referrer=https%3A%2F%2Ftest.wikimedia.de%2Fspenden%2F&wikilogin=&layout=form%3D10h16_Form1
&color=&impCount=0&bImpCount=0&skin=10h16&from_pay=&utoken=1ad43457353b285d23b109df379424b80f000d46&stamp
=2016-01-04+15%3A52%3A45&PHPSESSID=nsh4hui3055nl76v9873invn33&appealExpanded=&back_form=10h16_Form1
Request model parameters
- betrag_auswahl
- betrag
- zahlweise
- debit-type
- iban
- bic
- konto
- blz
- adresstyp
- anrede
- titel
- vorname
- nachname
- firma
- strasse,
- plz
- ort
- country
- email
- periode
- bankname
Additional parameters for the endpoint (presentation-related):
- form
- from_form: current form
- layout
- color
- skin
- back_form: Form before the current form
## Add Comment
Append a comment to the donation data.
- All payment types except UEB (bank transfer), because we want to have a validated payment.
- After a donation (but not membership), the user is being asked for a comment.
- Can only be submitted
URL: https://test.wikimedia.de/ajax.php?module=action&action=addComment
Request body: kommentar=fjhwbjev+ejbjvbffjfhjf2hf2&eintrag=2&public=1&tracking=&source=web&referrer=https%3A%2F%2Ftest
.wikimedia.de%2Fspenden%2F&wikilogin=&layout=form%3D10h16_Form1&color=&impCount=0&bImpCount=0&skin=10h16
&token=1276888%2459b42194b31d0265df452735f6438a234bae2af8&sid=2343&utoken=b5b249c8beefb986faf8d186a3f16e86ef509ab3
&PHPSESSID=nsh4hui3055nl76v9873invn33
Error Response: `{"status":"ERR","message":"Der Datensatz kann nicht mehr ver\u00e4ndert werden. Bitte wenden Sie sich
Bitte wenden Sie sich an unsere Hotline."}`
Success response: `{"status":"OK","message":"Something"}`
Relevant fields: kommentar, public, eintrag, token, utoken, sid
## Remaining use cases to discuss
* List Comments 1
- list includes N comments,
- list allows continuation (list next N comments)
- list entry consists of author's name (may by anonymous), comment text, donation amount, date of donation
* List Comments 2
- list includes N comments
- list only includes comments from donors who agreed to have their name published with the comments (ie. no anonymous comments)
- list entry consists of author's name, comment text, donation amount
* Add Membership Request
* Add Subscription Request
* Confirm Subscription Request
* Cancel Donation
* Confirm donation (direct debit only at the moment, should probably be handled by "Add Donation" use case instead)
* Handle Callback (Credit Card Handler)
* Handle Callback (PayPal Handler)
* List Recent Donors
- list includes N recent donor names (only donations with a comment, and only those where donor wanted to have his name publish with a comment, i.e. donations with anonymous comments are excluded)
- list entry include donor's name or text saying anonymous donor
* List Recent Donations (for "Donation Liveticker")
- list includes N recent donations
- each entry consists of donation date and time, and donation amount
- this list covers all donations, not only those that have a donor added a comment
**The new code**
So far the idea is to put the rewrite in a new git repository at https://github.com/wmde/FundraisingFrontend. This way we get rid of any issues present in the old git repository history and can easily see what has been "rewritten" and what still needs to be done. (The code already there is for exploration and demonstration purposes and is not intended to be used or seen as a replacement of the original code.)
**Next steps**
(In no particular order)
* Implement "list comments" use case to get a better idea of the amount of work involved and the types of issues we'll run into (to be able to better estimate total project cost).
* Describe use cases in more detail, figure out which ones actually describe multiple use cases and which ones we missed.