mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-03-18 07:24:36 +01:00
38 lines
1.2 KiB
Markdown
38 lines
1.2 KiB
Markdown
# Video store kata
|
|
|
|
Based on the book 'Refactoring' by Martin Fowler. More information on this book can be found on https://martinfowler.com/books/refactoring.html
|
|
|
|
Imagine a company of theatrical players who go out to various events performing plays. Typically, a customer will request a few plays and the company charges
|
|
them based on the size of the audience and the kind of play they perform. There are currently two kinds of plays that the company performs: tragedies and comedies. As well as providing a bill for the performance, the company gives its customers “volume credits” which they can use for discounts on future performances—think of it as a customer loyalty mechanism.
|
|
|
|
Plays.json
|
|
```json
|
|
{
|
|
"hamlet": {"name": "Hamlet", "type": "tragedy"},
|
|
"as-like": {"name": "As You Like It", "type": "comedy"},
|
|
"othello": {"name": "Othello", "type": "tragedy"}
|
|
}
|
|
```
|
|
|
|
Invoices.json
|
|
```json
|
|
[
|
|
{
|
|
"customer": "BigCo",
|
|
"performances": [
|
|
{
|
|
"playID": "hamlet",
|
|
"audience": 55
|
|
},
|
|
{
|
|
"playID": "as-like",
|
|
"audience": 35
|
|
},
|
|
{
|
|
"playID": "othello",
|
|
"audience": 40
|
|
}
|
|
]
|
|
}
|
|
]
|
|
``` |