homerquan/kakuen — pull request #1 by zeorin (2014-08-06 08:15:26+00:00)
Title: Fixed traversal of more complicated structures

Kakuen was having some trouble traversing more complicated JSON structures, e.g.:

```json
{
"@KAKUEN_ITEM(firstName)": {
"@KAKUEN_TYPE": "first"
},
"@KAKUEN_ITEM(surName)": {
"@KAKUEN_TYPE": "last"
},
"role": "Sales Representative",
"year": {
"start": "01/01/14",
"end": "31/07/14"
},
"period": {
"start": "01/07/14",
"end": "31/07/14"
},
"@KAKUEN_ITEM(totalPoints)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 20,
"max": 100
}
},
"@KAKUEN_ITEM(volumePercentage)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 20,
"max": 150
}
},
"@KAKUEN_ITEM(distributionPercentage)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 20,
"max": 150
}
},
"group": {
"@KAKUEN_ITEM(points)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 5000,
"max": 10000
}
},
"@KAKUEN_ITEM(difference)": {
"@KAKUEN_TYPE": "integer",
"@KAKUEN_PARAM": {
"min": -1000,
"max": 1000
}
}
},
"region": {
"@KAKUEN_ITEM(points)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 2500,
"max": 5000
}
},
"@KAKUEN_ITEM(difference)": {
"@KAKUEN_TYPE": "integer",
"@KAKUEN_PARAM": {
"min": -500,
"max": 500
}
}
},
"team": {
"@KAKUEN_ITEM(points)": {
"@KAKUEN_TYPE": "natural",
"@KAKUEN_PARAM": {
"min": 1250,
"max": 2500
}
},
"@KAKUEN_ITEM(difference)": {
"@KAKUEN_TYPE": "integer",
"@KAKUEN_PARAM": {
"min": -250,
"max": 250
}
}
}
}
```