Skip to content

Commit

Permalink
Add a documentation example for adding an attribute to a family.
Browse files Browse the repository at this point in the history
a-ast committed Aug 22, 2021

Unverified

No user is associated with the committer email.
1 parent 3284a37 commit 89bd85d
Showing 4 changed files with 57 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ It is similar and compatible with Akeneo Enrichment Rules but is more powerful.
* copy number data to a metric attribute

:star: **Data model changes** e.g.
* add an attribute to all families
* [add an attribute to families](docs/examples/add-attribute-to-families.md)

:star: **Migration** e.g.
* copy a product range from UAT to production
2 changes: 1 addition & 1 deletion docs/example-list.md
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
## How to modify non-product data

- [Modify reference entity records](examples/modify-reference-entity-records.md)
- [Add attributes to families](examples/add-attributes-to-families.md)
- [Add attributes to families](examples/add-attribute-to-families.md)

## See also

4 changes: 2 additions & 2 deletions docs/example-provider.yaml
Original file line number Diff line number Diff line change
@@ -281,9 +281,9 @@ modify-associations:
product_models: [ 'mermaid']
NEW:
groups: ['magical_creatures']
add-attributes-to-families:
add-attribute-to-families:
category: resource-types
file_name: add-attributes-to-families
file_name: add-attribute-to-families
header: Add attributes to families
tasks:
- description: add an attribute to families.
53 changes: 53 additions & 0 deletions docs/examples/add-attribute-to-families.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[comment]: <> (This file is auto-generated based on example-provider.)
# Add attributes to families

**Task:** add an attribute to families.

### Rules

```yaml
actions:
-
type: add
field: attributes
items:
- colour
```
### Result
Field: `attributes`

Before applying actions: <pre>sku, name, description</pre>

After applying actions: <pre>sku, name, description, colour</pre>
**Task:** add an attribute to families and set it as required for the channel `ecommerce`.

### Rules

```yaml
actions:
-
type: add
field: attributes
items:
- colour
-
type: add
field: attribute_requirements
items:
ecommerce: [colour]
```

### Result

Field: `attributes`

Before applying actions: <pre>sku, name, description</pre>

After applying actions: <pre>sku, name, description, colour</pre>
Field: `attribute_requirements`

Before applying actions: <pre>ecommerce: sku, name</pre>

After applying actions: <pre>ecommerce: sku, name, colour</pre>

0 comments on commit 89bd85d

Please sign in to comment.