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

Asynchronous Import #330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Update in respect to comments
  • Loading branch information
nuzil committed Nov 20, 2019
commit f91e29cfb1969616470656db3237a129f280cfd2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions design-documents/asynchronous-import/asycnhronous-import.md
Original file line number Diff line number Diff line change
@@ -31,13 +31,18 @@ Main idea of extension is to replace current Import module with new implementati
- CSV reader;
- Data Converting Rules;
- Import Data Exchanging;
- Import configuration;
- Import Configuration;
- Product import;
- Stock status import;
- Stock import;
- Advanced pricing import;
- Documentation;

## UML

![AsyncImportUML@2x](AsyncImportUML.png)

## TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets change a Priorities here

  • Design of Import configuration;
  • Design of Get Import status;
  • Design of Import processing - Sync / Async
  • Design of Restart failed operations;

- Design of `Import configuration`;
- Design of `Restart failed operations`;
- Design of `Get Import status`;
- Design of Import configuration;
- Design of Get Import status;
- Design of Import processing - Sync / Async
- Design of Restart failed operations
Original file line number Diff line number Diff line change
@@ -79,6 +79,14 @@ interface ConvertingRuleInterface
}
```

Converting rules are transforming incoming data in a way, that Magento API can correctly understand them.

#### Example:
Magento default Advanced Pricing import *.csv file contains Magento Website assignment as a string value: "All Websites [ALL]".

Magento API cannot recognise correct website base on this string representation, so this means we have to create converting rule that will define correct transformation from provided text to Magento Website ID.


### Extension points

```php
47 changes: 0 additions & 47 deletions design-documents/asynchronous-import/modularity/import-csv.md
Original file line number Diff line number Diff line change
@@ -101,53 +101,6 @@ interface CsvFormatInterface extends ExtensibleDataInterface
}
```

```php
/**
* Describes how to parse data
*
* @api
*/
interface CsvFormatInterface extends ExtensibleDataInterface
{
/**
* Get CSV Escape
*
* @return string|null
*/
public function getEscape(): ?string;

/**
* Get CSV Enclosure
*
* @return string|null
*/
public function getEnclosure(): ?string;

/**
* Get CSV Delimiter
*
* @return string|null
*/
public function getDelimiter(): ?string;

/**
* Get Multiple Value Separator
*
* @return string|null
*/
public function getMultipleValueSeparator(): ?string;

/**
* Get existing extension attributes object
*
* Used fully qualified namespaces in annotations for proper work of extension interface/class code generation
*
* @return \Magento\AsynchronousImportCsvApi\Api\Data\CsvFormatExtensionInterface|null
*/
public function getExtensionAttributes(): ?CsvFormatExtensionInterface;
}
```

### Extension points

```php
8 changes: 4 additions & 4 deletions design-documents/asynchronous-import/rest-api.md.md
Original file line number Diff line number Diff line change
@@ -42,9 +42,9 @@ Single entry point for **partial** reading and import of data.
}
"format': {
"escape": "|"
"enclosure" : "|"
"delimiter" => "|"
"multipleValueSeparator" : "|"
"enclosure": "|"
"delimiter": "|"
"multipleValueSeparator": "|"
"extensionAttributes": []
}
"convertingRules": [
@@ -80,6 +80,6 @@ Where is:

```
{
"UUID": "uuid_string"
"uuid": "uuid_string"
}
```