-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add format and type fields * interpret type and format fields * update schema and minor workflow update * fix standards
- Loading branch information
1 parent
b98b925
commit fe5a54c
Showing
12 changed files
with
475 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"yaml.schemas": { | ||
"storage/schema.json": "file:///c%3A/html/power-parser/storage/tests/blueprints/*.yaml" | ||
"storage/schema.json": "storage/tests/blueprints/*.yaml" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace HusamAwadhi\PowerParser\Blueprint; | ||
|
||
enum FieldFormat: string | ||
{ | ||
case STRING = 's'; | ||
case FLOAT = 'f'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace HusamAwadhi\PowerParser\Blueprint; | ||
|
||
enum FieldType: string | ||
{ | ||
case INT = 'int'; | ||
case FLOAT = 'float'; | ||
case BOOL = 'bool'; | ||
case BOOL_STRICT = 'bool-strict'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace HusamAwadhi\PowerParser\Blueprint\ValueObject; | ||
|
||
use HusamAwadhi\PowerParser\Blueprint\FieldFormat as FieldFormatEnum; | ||
|
||
class FieldFormat | ||
{ | ||
public function __construct( | ||
public readonly FieldFormatEnum $type, | ||
public readonly int $argument, | ||
) { | ||
} | ||
|
||
public static function from(FieldFormatEnum $type, int $argument): self | ||
{ | ||
return new self( | ||
type: $type, | ||
argument: $argument, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
version: "1.0" | ||
meta: | ||
file: | ||
extension: xlsx | ||
name: "sample" | ||
blueprint: | ||
- name: header_info | ||
mandatory: true | ||
type: hit | ||
conditions: | ||
- column: [1] | ||
is: "Cashier Number" | ||
fields: | ||
- name: currency | ||
position: 6 | ||
- name: cashier | ||
position: 2 | ||
type: int | ||
- name: balance_info | ||
type: hit | ||
mandatory: true | ||
conditions: | ||
- column: [4] | ||
is: "Open Balance" | ||
fields: | ||
- name: opening_balance | ||
position: 6 | ||
format: f%2 | ||
- name: transaction_table | ||
type: hit | ||
mandatory: true | ||
table: true | ||
conditions: | ||
- column: [1] | ||
isNot: "{null}" | ||
fields: | ||
- name: date | ||
position: 1 | ||
- name: type | ||
position: 2 | ||
- name: document_number | ||
position: 3 | ||
type: int | ||
- name: description | ||
position: 4 | ||
- name: reference_number | ||
position: 5 | ||
type: int | ||
- name: credit | ||
position: 6 | ||
format: f%2 | ||
- name: debit | ||
position: 7 | ||
format: f%2 | ||
- name: total | ||
type: next | ||
fields: | ||
- name: total_credit | ||
position: 6 | ||
format: f%2 | ||
- name: total_debit | ||
position: 7 | ||
format: f%2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.