aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-06-24 13:36:19 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-06-24 13:44:42 +0300
commitebe8cba9837872de3dd611d6cd615425c51fefec (patch)
tree776af0f6361d5727f65143b9d8066b85a180c2b2 /README.md
parent2ed435c73d0bc80a6b0d9d16a9fd0e9a0b464ed2 (diff)
downloadmolodivo-ebe8cba9837872de3dd611d6cd615425c51fefec.tar.gz
Support many bills
Diffstat (limited to 'README.md')
-rw-r--r--README.md68
1 files changed, 60 insertions, 8 deletions
diff --git a/README.md b/README.md
index dd87c22..53b92a0 100644
--- a/README.md
+++ b/README.md
@@ -20,8 +20,7 @@ Command-line utility
The command-line utility `malodivo` provides a means to process input JSON
files and output JSON describing the actual amounts that go towards each bill
by each district. This utility reads input JSON data from standard input
-and writes output JSON data to standard output. _The format of output is
-unstable and subject to change_.
+and writes output JSON data to standard output.
Usage
-----
@@ -39,13 +38,12 @@ Options:
Examples
--------
-We would get this:
+Command:
```
$ malodivo < sample/simpleBudget.json
-[["Lakos",100],["Palolene",66],["SouthernPalolene",133]]
```
-with this file ([sample/simpleBudget.json](sample/simpleBudget.json)):
+Input:
```json
{
"bills": [
@@ -53,22 +51,76 @@ with this file ([sample/simpleBudget.json](sample/simpleBudget.json)):
"name": "An Act to Construct the Great Wall of Malodivo",
"ministry": "Defense",
"amount": 300
+ },
+ {
+ "name": "An Act to Construct Shelters for the Homeless",
+ "ministry": "Welfare",
+ "amount": 400
}
],
"districts": [
{
"name": "Palolene",
- "availableFunds": 200
+ "amount": 200
},
{
"name": "SouthernPalolene",
- "availableFunds": 400
+ "amount": 400
},
{
"name": "Lakos",
- "availableFunds": 300
+ "amount": 300
}
]
}
```
+Output:
+```json
+[
+ {
+ "bill": {
+ "amount": 300,
+ "name": "An Act to Construct the Great Wall of Malodivo",
+ "ministry": "Defense"
+ },
+ "districts": [
+ {
+ "amount": 100,
+ "name": "Lakos"
+ },
+ {
+ "amount": 66,
+ "name": "Palolene"
+ },
+ {
+ "amount": 133,
+ "name": "SouthernPalolene"
+ }
+ ]
+ },
+ {
+ "bill": {
+ "amount": 400,
+ "name": "An Act to Construct Shelters for the Homeless",
+ "ministry": "Welfare"
+ },
+ "districts": [
+ {
+ "amount": 133,
+ "name": "Lakos"
+ },
+ {
+ "amount": 88,
+ "name": "Palolene"
+ },
+ {
+ "amount": 177,
+ "name": "SouthernPalolene"
+ }
+ ]
+ }
+]
+
+```
+