Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/app/code/Amasty/RewardsImportEntity/etc/entity/
Upload File :
Current File : //home/rtorresani/www/app/code/Amasty/RewardsImportEntity/etc/entity/amrewards_rewards.xml

<?xml version="1.0"?>
<!--
/**
 * @author Amasty Team
 * @copyright Copyright (c) 2023 Amasty (https://www.amasty.com)
 * @package Reward Points Import Entity for Magento 2 (System)
 */-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:amasty:module:Amasty_ImportCore:etc/am_import.xsd">
    <entity code="amasty_rewards_rewards">
        <name>Amasty Reward Point Transactions</name>
        <group>Amasty Reward Points</group>
        <fieldsConfig>
            <fieldsClass class="Amasty\ImportCore\Import\FieldsClass\Describe">
                <arguments>
                    <argument name="tableName" xsi:type="string">amasty_rewards_rewards</argument>
                </arguments>
            </fieldsClass>
            <fields rowActionClass="Amasty\RewardsImportEntity\Import\DataHandling\RowModifier\Rewards">
                <field name="id">
                    <validation>
                        <nonNegative/>
                    </validation>
                </field>
                <field name="customer_id">
                    <actions>
                        <trim apply="beforeValidate"/>
                    </actions>
                    <validation>
                        <nonNegative/>
                        <notEmpty/>
                        <customerExists>
                            <includeBehaviors>
                                <addDirect/>
                            </includeBehaviors>
                        </customerExists>
                    </validation>
                </field>
                <field name="amount">
                    <validation>
                        <number/>
                        <custom class="Amasty\RewardsImportEntity\Import\Validation\EntityValidator\Rewards\IntNotEmpty"
                                error="Field amount is Empty">
                            <includeBehaviors>
                                <addDirect/>
                            </includeBehaviors>
                        </custom>
                        <custom class="Amasty\RewardsImportEntity\Import\Validation\EntityValidator\Rewards\NonNegativeSumAmount"
                                error="Sum amount cannot be negative">
                            <includeBehaviors>
                                <addDirect/>
                            </includeBehaviors>
                        </custom>
                    </validation>
                </field>
                <field name="visible_for_customer">
                    <actions>
                        <custom preselected="true" class="Amasty\RewardsImportEntity\Import\DataHandling\FieldModifier\VisibleForCustomer"/>
                    </actions>
                    <filter>
                        <type>select</type>
                        <options>
                            <class>Magento\Config\Model\Config\Source\Yesno</class>
                        </options>
                    </filter>
                </field>
                <field name="action">
                    <actions>
                        <defaultValue value="Admin Point Change"/>
                    </actions>
                </field>
                <field name="expiration_date">
                    <actions>
                        <emptyToNull />
                    </actions>
                </field>
                <field name="expiring_amount">
                    <actions>
                        <defaultValue value="0"/>
                    </actions>
                    <validation>
                        <custom class="Amasty\RewardsImportEntity\Import\Validation\EntityValidator\Rewards\NotGreaterThanAmount"
                                error="expiring_amount cannot be greater than amount">
                            <includeBehaviors>
                                <addDirect/>
                            </includeBehaviors>
                        </custom>
                    </validation>
                </field>
            </fields>
            <sampleData>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">1</field>
                    <field name="action_date">2020-11-15</field>
                    <field name="amount">20</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">order_completed</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">1</field>
                    <field name="action_date"></field>
                    <field name="amount">14.73</field>
                    <field name="comment">Reimbursement</field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer">no</field>
                    <field name="action">Admin Point Change</field>
                    <field name="expiration_date">2021-11-18</field>
                    <field name="expiring_amount">14.73</field>
                    <field name="admin_name">John Doe</field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">1</field>
                    <field name="action_date">2018-10-28</field>
                    <field name="amount">50</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">newsletter_subscription</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">2</field>
                    <field name="action_date">2019-11-15</field>
                    <field name="amount">-15</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">Admin Point Change</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name">John Doe</field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">2</field>
                    <field name="action_date">2020-08-04</field>
                    <field name="amount">25</field>
                    <field name="comment">Happy Birthday!</field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer">yes</field>
                    <field name="action">birthday</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">2</field>
                    <field name="action_date"></field>
                    <field name="amount">47</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">for_every_x_spent</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">3</field>
                    <field name="action_date">2019-05-10</field>
                    <field name="amount">10</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">registration</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">3</field>
                    <field name="action_date">2020-08-11</field>
                    <field name="amount">15</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">review</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
                <row>
                    <field name="id"></field>
                    <field name="customer_id">3</field>
                    <field name="action_date"></field>
                    <field name="amount">20</field>
                    <field name="comment"></field>
                    <field name="points_left"></field>
                    <field name="visible_for_customer"></field>
                    <field name="action">inactivity</field>
                    <field name="expiration_date"></field>
                    <field name="expiring_amount"></field>
                    <field name="admin_name"></field>
                </row>
            </sampleData>
        </fieldsConfig>
        <behaviors>
            <addDirect name="Only add">
                <tableName>amasty_rewards_rewards</tableName>
            </addDirect>
        </behaviors>
    </entity>
</config>