Skip to content

Commit 5c9cc8f

Browse files
author
paul.bardack
committed
improved doc
1 parent f843de0 commit 5c9cc8f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Column can have following settings:
2929

3030
- ```Title``` - human-readable string that describes field in interface.
3131
- ```Field API Key``` - field name from witch data will be taken. For example, if you add a field with key ```name``` than all API consumers should provide JSON with this field: ```{"name": "Some User Name"}```.
32-
- ```Type``` - type of data that will be submitted in this field. ```String```, ```Number``` or ```Boolean```.
32+
- ```Type``` - type of data that will be submitted in this field. ```String```, ```Numeric``` or ```Boolean```.
3333

3434
##### Presets
3535

@@ -39,21 +39,21 @@ It should look something like this:
3939

4040
- ```Title``` = ```Sufficient Salary```;
4141
- ```Field API Key``` = ```salary```;
42-
- ```Type``` = ```Number```;
42+
- ```Type``` = ```Numeric```;
4343
- ```Preset Condition``` = ```greater than```;
4444
- ```Preset Value``` = ```1000```.
4545

4646
By checking checkbox below ```Low Salary``` column in a row, you will make sure that this row won't pass check untill ```salary``` is greater than ```1000```.
4747

4848
#### Rows
4949

50-
Each row represents a rule in a ```OR``` logical operator style.
50+
Each row represents a rule in an ```OR``` logical operator style.
5151

5252
Row will return value selected in "Decision" column only if all validation rules in it have passed. Rules are checked in a same order as you see them in a table. You can reorder them by drug'n'drop.
5353

5454
#### Cells
5555

56-
All cells in a row represent validations in a ```AND``` logical operator style.
56+
All cells in a row represent validations in an ```AND``` logical operator style.
5757

5858
Sometimes you have a big table and in some rows you prefer to skip some validations. For this case you can select special validation rule called ```is set```. Logically it means that ```{field_name} is set``` and this condition will always pass validation.
5959

@@ -70,8 +70,9 @@ String fileds support following conditions:
7070
- ```contains``` - validation will pass if field value is contains specified value.
7171
- ```is set``` - validation will always pass. (Use it to skip some columns.)
7272

73-
Number supports:
73+
Numeric supports:
7474
- ```=``` - validation will pass if field value equals specified value.
75+
- ```!=``` - validation will pass if field value does not equal specified value.
7576
- ```>``` - validation will pass if field value is greater than specified value.
7677
- ```>=``` - validation will pass if field value is greater or equal to a specified value.
7778
- ```<``` - validation will pass if field value is less than specified value.
@@ -82,8 +83,8 @@ Number supports:
8283
- ```is set``` - validation will always pass. (Use it to skip some columns.)
8384

8485
Boolean supports:
85-
- ```true``` - will pass if field value is ```true```, ```"true"```, ```'true'```, ```1```, ```"1"``` or ```'1'```.
86-
- ```false``` - will pass if field value is ```false```, ```"false"```, ```'false'```, ```0```, ```"0"``` or ```'0'```.
86+
- ```true``` - will pass if field value is ```true```, ```1```, ```"1"``` or ```'1'```.
87+
- ```false``` - will pass if field value is ```false```, ```0```, ```"0"``` or ```'0'```.
8788
- ```is set``` - validation will always pass. (Use it to skip some columns.)
8889

8990
#### Decision Making
@@ -109,4 +110,4 @@ TODO.
109110

110111
# API Docs
111112

112-
You can find a full API docs on [this](http://nebo15.github.io/qbill.docs/gandalf.html#validation-conditions) page.
113+
You can find a full API docs on [this](http://nebo15.github.io/qbill.docs/gandalf.html) page.

tests/api/TablesCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ public function ruleEqual(ApiTester $I)
447447
$I->checkDecision($table->_id, ['boolean' => $value]);
448448
$I->assertResponseDataFields(['final_decision' => 'Decline']);
449449
}
450-
foreach (['invalid', 100, null] as $value) {
450+
foreach (['invalid', 'true', "true", 100, null] as $value) {
451451
$I->sendPOST("api/v1/tables/$table->_id/decisions", ['boolean' => $value]);
452452
$I->seeResponseCodeIs(422);
453453
}
@@ -460,7 +460,7 @@ public function ruleEqual(ApiTester $I)
460460
$I->sendPOST("api/v1/tables/$table->_id/decisions", ['boolean' => $value]);
461461
$I->seeResponseCodeIs(422);
462462
}
463-
foreach (['invalid', '123321'] as $value) {
463+
foreach (['invalid', '123321', 'true', "true"] as $value) {
464464
$I->checkDecision($table->_id, ['boolean' => $value]);
465465
$I->assertResponseDataFields(['final_decision' => 'Decline']);
466466
}

0 commit comments

Comments
 (0)