Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRW-6085 Adjusted documentations. #2221

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Install the required features:
Install the required modules using Composer:

```bash
composer require spryker/dynamic-entity-backend-api:"^0.1.0" spryker/dynamic-entity-gui:"^0.1.0" --update-with-dependencies
composer require spryker/dynamic-entity-backend-api:"^1.0.0" spryker/dynamic-entity-gui:"^1.0.0" --update-with-dependencies
```

{% info_block warningBox "Verification" %}
Expand Down Expand Up @@ -181,6 +181,8 @@ Make sure you've triggered the following changes by checking the database:
| DATABASE ENTITY | TYPE |
| --- | --- |
| spy_dynamic_entity_configuration | table |
| spy_dynamic_entity_configuration_relation | table |
| spy_dynamic_entity_configuration_relation_field_mapping | table |

Make sure the following transfers have been created:

Expand Down Expand Up @@ -216,8 +218,21 @@ Make sure the following transfers have been created:
| GlueResponse | class | created | src/Generated/Shared/Transfer/GlueResponseTransfer.php |
| Pagination | class | created | src/Generated/Shared/Transfer/PaginationTransfer.php |

Ensure successful generation of Propel entities by verifying that they exist. Additionally, modify the generated entity classes to extend from Spryker core classes.

| CLASS PATH | EXTENDS |
| --- | --- |
| src/Generated/Entity/SpyDynamicEntityConfiguration.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfiguration |
| src/Generated/Entity/SpyDynamicEntityConfigurationQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationQuery |
| src/Generated/Entity/SpyDynamicEntityConfigurationRelation.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelation |
| src/Generated/Entity/SpyDynamicEntityConfigurationRelationQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationQuery |
| src/Generated/Entity/SpyDynamicEntityConfigurationRelationFieldMapping.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationFieldMapping |
| src/Generated/Entity/SpyDynamicEntityConfigurationRelationFieldMappingQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationFieldMappingQuery |


{% endinfo_block %}


### Add translations

1. Append the glossary according to your language configuration:
Expand All @@ -239,8 +254,8 @@ dynamic_entity.validation.invalid_field_value,"Invalid data value for field: %fi
dynamic_entity.validation.invalid_field_value,"Ungültiger Datenwert für das Feld: %fieldName%, Zeilennummer: %rowNumber%. Feldregeln: %validationRules%",de_DE
dynamic_entity.validation.required_field_is_missing,"The required field must not be empty. Field: '%fieldName%'",en_US
dynamic_entity.validation.required_field_is_missing,"Das erforderlich Feld darf nicht leer sein. Feld: '%fieldName%'",de_DE
dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entity not found by identifier, and new identifier can not be persisted. Please update the request.",en_US
dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entität konnte anhand der ID nicht gefunden werden, und die neue ID kann nicht dauerhaft gespeichert werden. Bitte aktualisieren Sie die Anfrage.",de_DE
dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entity `%identifier%` not found by identifier, and new identifier can not be persisted. Please update the request.",en_US
dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entität `%identifier%` konnte anhand der ID nicht gefunden werden, und die neue ID kann nicht dauerhaft gespeichert werden. Bitte aktualisieren Sie die Anfrage.",de_DE
dynamic_entity.validation.modification_of_immutable_field_prohibited,"Modification of immutable field `%fieldName%` is prohibited",en_US
dynamic_entity.validation.modification_of_immutable_field_prohibited,"Änderung des unveränderlichen Feldes %fieldName% ist nicht zulässig.",de_DE
dynamic_entity.validation.missing_identifier,"Incomplete Request - missing identifier",en_US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,26 @@ Authorization: Bearer {your_token}
Response sample:

```json
[
{
"id_country": 2,
"iso2_code": "AD",
"iso3_code": "AND",
"name": "Andorra",
"postal_code_mandatory": true,
"postal_code_regex": "AD\\d{3}"
},
{
"id_country": 3,
"iso2_code": "AE",
"iso3_code": "ARE",
"name": "United Arab Emirates",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
{
"data": [
{
"id_country": 2,
"iso2_code": "AD",
"iso3_code": "AND",
"name": "Andorra",
"postal_code_mandatory": true,
"postal_code_regex": "AD\\d{3}"
},
{
"id_country": 3,
"iso2_code": "AE",
"iso3_code": "ARE",
"name": "United Arab Emirates",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
}
```

The response contains all the columns from the `spy_country` table that are configured in `spy_dynamic_entity_definition.definition`. Each column is represented using the `fieldVisibleName` as the key, providing a comprehensive view of the table's data in the API response. By default the API `GET` request returns up to 20 records.
Expand All @@ -81,16 +83,18 @@ Authorization: Bearer {your_token}
Response sample:

```json
[
{
"id_country": 1,
"iso2_code": "AA",
"iso3_code": "UUD",
"name": "Create",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
{
"data": [
{
"id_country": 1,
"iso2_code": "AA",
"iso3_code": "UUD",
"name": "Create",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
}
```
{% info_block infoBox %}

Expand All @@ -111,16 +115,18 @@ Authorization: Bearer {your_token}
Response sample:

```json
[
{
"id_country": 3,
"iso2_code": "AE",
"iso3_code": "ARE",
"name": "United Arab Emirates",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
{
"data":[
{
"id_country": 3,
"iso2_code": "AE",
"iso3_code": "ARE",
"name": "United Arab Emirates",
"postal_code_mandatory": false,
"postal_code_regex": null
}
]
}
```


Expand Down Expand Up @@ -163,14 +169,16 @@ Content-Length: 154
The response payload includes all the specified fields from the request body, along with the ID of the created entity. Response sample:

```json
[
{
"iso2_code": "WA",
"iso3_code": "WWA",
"name": "FOO",
"id_country": 257
}
]
{
"data":[
{
"iso2_code": "WA",
"iso3_code": "WWA",
"name": "FOO",
"id_country": 257
}
]
}
```


Expand Down Expand Up @@ -232,14 +240,16 @@ Content-Length: 174
The response payload includes all the specified fields from the request body. Response sample:

```json
[
{
"iso2_code": "WB",
"iso3_code": "WWB",
"name": "FOO",
"id_country": 1
}
]
{
"data":[
{
"iso2_code": "WB",
"iso3_code": "WWB",
"name": "FOO",
"id_country": 1
}
]
}
```


Expand Down Expand Up @@ -337,16 +347,18 @@ Content-Length: 263
The response payload includes all touched fields for the provided resource. Response sample:

```json
[
{
"iso2_code": "WB",
"iso3_code": "WWB",
"name": "FOO",
"postal_code_mandatory": null,
"postal_code_regex": null,
"id_country": 1
}
]
{
"data": [
{
"iso2_code": "WB",
"iso3_code": "WWB",
"name": "FOO",
"postal_code_mandatory": null,
"postal_code_regex": null,
"id_country": 1
}
]
}
```


Expand Down Expand Up @@ -397,6 +409,6 @@ Bellow you can find a list of error codes that you can receive when sending `GET
| 1305 | Invalid data type for field: `field` | The specified field has an incorrect type. Please check the configuration for this field and correct the value. |
| 1306 | Invalid data value for field: `field`, row number: `row`. Field rules: `validation rules`. | The error indicates a data row and a field that does not comply with the validation rules in the configuration. Here is an example of the error: `Invalid data value for field: id, row number: 2. Field rules: min: 0, max: 127`. |
| 1307 | The required field must not be empty. Field: `field` | The specified field is required according to the configuration. The field was not provided. Please check the data you are sending and try again. |
| 1308 | Entity not found by identifier, and new identifier can not be persisted. Please update the request. | The entity could not be found using the provided identifier, and a new identifier cannot be persisted. Please update your request accordingly or check configuration for identifier field. |
| 1308 |Entity `some field identifier` not found by identifier, and new identifier can not be persisted. Please update the request. | The entity could not be found using the provided identifier, and a new identifier cannot be persisted. Please update your request accordingly or check configuration for identifier field. |
| 1309 | Failed to persist the data. Please verify the provided data and try again. Entry is duplicated. | Failed to persist the data. Please verify the provided data and try again. This error may occur if a record with the same information already exists in the database. |
| 1310 | Incomplete Request - missing identifier. | The request is incomplete. The identifier is missing. Please check the request and try again. |
Loading