Commit 99c1c264 authored by Johan Vervloet's avatar Johan Vervloet

Fixed vue console error, #132.

Also another API simplification.
Closes #132.
parent 1632ec9f
Pipeline #127933553 passed with stages
in 5 minutes and 19 seconds
......@@ -6,11 +6,11 @@
- Introduced `ScoreLineNumber`, got rid of 'dummy games', #129
- Log event time in the event store, #103
- Api documentation, #106.
- Api documentation, #106, #132.
### Changed
- Tried to bring more consistency to the API, #106.
- Tried to bring more consistency to the API, #106, #132.
## [0.5.1] - 2020-02-29
......
......@@ -34,7 +34,7 @@
</thead>
<tbody>
<tr v-for="(line) in log" v-bind:key="line.game">
<tr v-for="(line) in log" v-bind:key="line.line">
<td>
<span v-for="n in (line.factor-1)" v-bind:key="n">*</span>
</td>
......
......@@ -273,7 +273,7 @@ This returns an object with the following properties:
The properties of a score line, are:
* `note`: a note; this should be a translatable string
* `score_line_number`: number of the score line
* `line`: number of the score line
* `scores`: the actual scores; an associative array mapping player identifiers to points
* `game`: the number of the game the score line applies to
* `factor`: the score factor that was used; this indicates whether the points earned were multiplied
......@@ -295,7 +295,7 @@ Example result:
"log": [
{
"note": "prop_and_cop",
"score_line_number": 1,
"line": 1,
"scores": {
"84e24e2f-773e-4bbc-943a-93830e97677c": 2,
"b35fdea5-9f59-4322-9ec4-bae18fbf6dc3": 2,
......@@ -308,7 +308,7 @@ Example result:
},
{
"note": "prop_and_cop",
"score_line_number": 2,
"line": 2,
"scores": {
"84e24e2f-773e-4bbc-943a-93830e97677c": -2,
"b35fdea5-9f59-4322-9ec4-bae18fbf6dc3": 6,
......@@ -321,7 +321,7 @@ Example result:
},
{
"note": "misere",
"score_line_number": 3,
"line": 3,
"scores": {
"84e24e2f-773e-4bbc-943a-93830e97677c": -12,
"b35fdea5-9f59-4322-9ec4-bae18fbf6dc3": 16,
......@@ -334,7 +334,7 @@ Example result:
},
{
"note": "alone",
"score_line_number": 4,
"line": 4,
"scores": {
"84e24e2f-773e-4bbc-943a-93830e97677c": -16,
"b35fdea5-9f59-4322-9ec4-bae18fbf6dc3": 12,
......@@ -347,7 +347,7 @@ Example result:
},
{
"note": "",
"score_line_number": 5,
"line": 5,
"scores": [],
"game": 5,
"factor": 2,
......
......@@ -17,7 +17,7 @@ final class ScoreLineNormalizer implements NormalizerInterface, DenormalizerInte
$builder = ScoreLineBuilder::create(
(string) $data['note'],
ScoreLineNumber::fromInteger((int) $data['score_line_number'])
ScoreLineNumber::fromInteger((int) $data['line'])
);
foreach ($francs as $playerId => $francsForPlayer) {
......@@ -44,7 +44,7 @@ final class ScoreLineNormalizer implements NormalizerInterface, DenormalizerInte
$data = [
'note' => $object->getNote(),
'score_line_number' => $object->getScoreLineNumber()->toInteger(),
'line' => $object->getScoreLineNumber()->toInteger(),
'scores' => [],
];
......
......@@ -28,7 +28,7 @@ final class GetLogCest
'note' => '',
'dealer' => TestIds::PLAYER_PENNINGMEESTER,
'factor' => 1,
'score_line_number' => 1,
'line' => 1,
],
],
]);
......
......@@ -318,7 +318,7 @@ final class NormalizationTest extends AbstractEventSourcingIntegrationTest
// Check some array keys that should not change, because
// they're used by the normalization for the API.
$this->assertIsArray($normalized['scores']);
$this->assertEquals(1, $normalized['score_line_number']);
$this->assertEquals(1, $normalized['line']);
/** @var SimpleScoreLogEntry */
$denormalized = $this->getDenormalizer()->denormalize($normalized, SimpleScoreLogEntry::class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment