Pairing Session - Marcopolo Gil
Never
## Goal To extend the [Authorizer exercise](https://github.com/nubank/challenges/blob/master/specs/take-home/generic/authorizer/spec.md) with a new operation. #### Extension Create a new operation: `deny-list`. That operation will set the merchants whose the authorizer should deny transactions from. The account has no deny-list by default, and it can be changed anytime. The `deny-list` operation input is going to be: ```json {"deny-list": ["merchant-A", "merchant-B"]} ``` The output of that operation is going to be the current account state: ```json {"account": {"active-card": true, "available-limit": 100, "deny-list": ["merchant-A", "merchant-B"]}, "violations": []} ``` #### Examples: For the following operations: ``` { "account": { "active-card": true, "available-limit": 1000 } } { "transaction": { "merchant": "merchant-A", "amount": 20, "time": "2019-02-13T10:00:00.000Z" } } { "transaction": { "merchant": "merchant-B", "amount": 30, "time": "2019-02-13T11:00:00.000Z" } } {"deny-list": ["merchant-A", "merchant-B"]} { "transaction": { "merchant": "merchant-A", "amount": 20, "time": "2019-02-13T12:00:00.000Z" } } {"deny-list": ["merchant-A"]} { "transaction": { "merchant": "merchant-B", "amount": 30, "time": "2019-02-13T13:00:00.000Z" } } ``` The output should be: ``` { "violations": [], "account": { "deny-list": [], "available-limit": 1000, "active-card": true } } { "violations": [], "account": { "deny-list": [], "available-limit": 980, "active-card": true } } { "violations": [], "account": { "deny-list": [], "available-limit": 950, "active-card": true } } { "violations": [], "account": { "deny-list": ["merchant-A", "merchant-B"], "available-limit": 950, "active-card": true } } { "violations": ["merchant-denied"], "account": { "deny-list": ["merchant-A", "merchant-B"], "available-limit": 950, "active-card": true } } { "violations": [], "account": { "deny-list": ["merchant-A"], "available-limit": 950, "active-card": true } } { "violations": [], "account": { "deny-list": ["merchant-A"], "available-limit": 920, "active-card": true } } ```
Raw Text
-
V BUCKS GENERATOR
1 min ago
-
Furiosa: A Mad Max Saga Streamcloud Deutsch Ganzer Film
10 min ago
-
She SWALLOWED cum for MONEY!
22 min ago
-
https://twor.microsoftcrmportals.com/forums/support-forum/faf992e5-2002-ef11-a73d-6045bd3fd1cb
28 min ago
-
https://twor.microsoftcrmportals.com/forums/support-forum/faf992e5-2002-ef11-a73d-6045bd3fd1cb
28 min ago
-
bnbwt
30 min ago
-
Punk'd Parody - MYLF
53 min ago
-
🌜✨FUCKING♥️😏 SLEEPING💤 TEEN GIRL🍭👧✨🌛
54 min ago
-
Untitled
59 min ago
-
Untitled
1 hour ago