This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework/Acl/etc/acl.xsd">
<acl>
<resources>
<resource id="Magento_Backend::admin">
<resource id="Magento_Customer::customer">
<resource id="Esun_AiMascotCampaign::participants"
title="AI Mascot Participants"
translate="title"
sortOrder="70"/>
</resource>
</resource>
</resources>
</acl>
</config>
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Ui\Model\Export\MetadataProvider">
<arguments>
<argument name="data" xsi:type="array">
<item name="esun_ai_mascot_participant_listing" xsi:type="array">
<item name="registered_at" xsi:type="string">registered_at</item>
</item>
</argument>
</arguments>
</type>
</config>
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<add id="Esun_AiMascotCampaign::participants"
title="AI Mascot Participants"
translate="title"
module="Esun_AiMascotCampaign"
sortOrder="70"
parent="Magento_Customer::customer"
action="esun_ai_mascot/participant/index"
resource="Esun_AiMascotCampaign::participants"/>
</menu>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework/App/etc/routes.xsd">
<router id="admin">
<route id="esun_ai_mascot" frontName="esun_ai_mascot">
<module name="Esun_AiMascotCampaign" before="Magento_Backend"/>
</route>
</router>
</config>
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework/Setup/Declaration/Schema/etc/schema.xsd">
<table name="esun_campaign_registration" resource="default" engine="innodb"
comment="eSUN Campaign Registrations">
<column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
comment="Entity ID"/>
<column xsi:type="varchar" name="campaign_code" nullable="false" length="64"
comment="Campaign Code"/>
<column xsi:type="int" name="customer_id" unsigned="true" nullable="false"
comment="Customer ID"/>
<column xsi:type="varchar" name="email" nullable="false" length="255"
comment="Registration Email (Normalized)"/>
<column xsi:type="smallint" name="website_id" unsigned="true" nullable="false"
comment="Website ID"/>
<column xsi:type="smallint" name="store_id" unsigned="true" nullable="false"
comment="Store ID"/>
<column xsi:type="timestamp" name="registered_at" nullable="false" default="CURRENT_TIMESTAMP"
on_update="false" comment="Registered At"/>
<constraint xsi:type="primary" referenceId="PRIMARY">
<column name="entity_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_CAMPAIGN_REGISTRATION_CODE_CUSTOMER_UNQ">
<column name="campaign_code"/>
<column name="customer_id"/>
</constraint>
<constraint xsi:type="unique" referenceId="ESUN_CAMPAIGN_REGISTRATION_CODE_EMAIL_UNQ">
<column name="campaign_code"/>
<column name="email"/>
</constraint>
<index referenceId="ESUN_CAMPAIGN_REGISTRATION_REGISTERED_AT" indexType="btree">
<column name="registered_at"/>
</index>
</table>
</schema>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
<arguments>
<argument name="collections" xsi:type="array">
<item name="esun_ai_mascot_participant_listing_data_source" xsi:type="string">EsunAiMascotParticipantGridCollection</item>
</argument>
</arguments>
</type>
<virtualType name="EsunAiMascotParticipantGridCollection"
type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
<arguments>
<argument name="mainTable" xsi:type="string">esun_campaign_registration</argument>
<argument name="resourceModel" xsi:type="string">Esun\AiMascotCampaign\Model\ResourceModel\Registration</argument>
</arguments>
</virtualType>
</config>
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework/Event/etc/events.xsd">
<event name="customer_register_success">
<observer name="esun_ai_mascot_record_campaign_registration"
instance="Esun\AiMascotCampaign\Observer\RecordCampaignRegistration"/>
</event>
</config>
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework/App/etc/routes.xsd">
<router id="standard">
<route id="ai_mascot" frontName="ai-mascot">
<module name="Esun_AiMascotCampaign"/>
</route>
</router>
</config>
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Esun_AiMascotCampaign">
<sequence>
<module name="Magento_Customer"/>
<module name="Magento_Store"/>
<module name="Magento_Search"/>
<module name="Magento_Ui"/>
</sequence>
</module>
</config>