Skip to content

Add the ability to define custom variables in YAML files which will be inherited  #123

@0-Sony

Description

@0-Sony

Is your feature request related to a problem? Please describe.
Currently, we split for each entity, module, a specific YAML file such as : magento/module-sales.yaml , magento/module-quote.yaml, magento/module-customer.yaml, adyen/module-payment.yaml

For these 3 entities, let says that I want to define a limit : 30 or change the interval day in a sql request in a where parameter

But as we work on different project with different needs, the limit value could be changed depending on the project.

tables:
   sales_order:
      where: 'updated_at > date_sub(now(), interval 30 day)'
      limit: 30
   quote:
      where: 'updated_at > date_sub(now(), interval 30 day)'
      limit: 30
  customer_entity:
      where: 'updated_at > date_sub(now(), interval 30 day)'
      limit: 30
      converters:
         email:
           converter: 'randomizeEmail'
           cache_key: 'customer_email'
           unique: true

Describe the solution you'd like

It would be nice if we could define custom variables at the top of the config.yaml file, and each yaml file (extends) would inherited
Also, the custom variables could be also defined in each yaml file, not necessarily in the config.yaml

variables:
    @my_variable : 30
    @cache_key_variable : 'customer_email'
tables:
   sales_order:
      where: 'updated_at > date_sub(now(), interval {{@my_variable}} day)'
      limit: @my_variable
   quote:
      where: 'updated_at > date_sub(now(), interval {{@my_variable}} day)'
      limit: @my_variable
  customer_entity:
      where: 'updated_at > date_sub(now(), interval {{@my_variable}} day)'
      limit: @my_variable
      converters:
         email:
            converter: 'randomizeEmail'
            cache_key: @cache_key_variable 
            unique: true

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions