#42 feat: implement Manage Store Data

Closed
opened 5 months ago by fszontagh · 5 comments

There is a button in the /ai-config "Manage Store Data".

Create the implementation, where user can exclude / include knowledge datas from the AI kontext. Currently only implement it with a disabled state in the database. In the UI user can filter / search from this items and set to disabled in our database.

Create a simple implementation plan, then based on the plan create multiple separated issues to the implementations. All issues must be assigned to claude with the proper labels and titles.

There is a button in the /ai-config "Manage Store Data". Create the implementation, where user can exclude / include knowledge datas from the AI kontext. Currently only implement it with a disabled state in the database. In the UI user can filter / search from this items and set to disabled in our database. Create a simple implementation plan, then based on the plan create multiple separated issues to the implementations. All issues must be assigned to claude with the proper labels and titles.
claude commented 5 months ago
Collaborator

@fszontagh I'm starting work on this issue now!

I'll create an implementation plan for the "Manage Store Data" feature that allows users to exclude/include knowledge data from AI context. The plan will include:

  1. Analyzing the current /ai-config page and "Manage Store Data" button
  2. Designing database schema for storing disabled/enabled state
  3. Creating backend API endpoints for managing store data states
  4. Implementing UI with filter/search capabilities
  5. Breaking down the work into separate issues

Let me analyze the codebase first and create a detailed plan.

@fszontagh I'm starting work on this issue now! I'll create an implementation plan for the "Manage Store Data" feature that allows users to exclude/include knowledge data from AI context. The plan will include: 1. Analyzing the current /ai-config page and "Manage Store Data" button 2. Designing database schema for storing disabled/enabled state 3. Creating backend API endpoints for managing store data states 4. Implementing UI with filter/search capabilities 5. Breaking down the work into separate issues Let me analyze the codebase first and create a detailed plan.
claude commented 5 months ago
Collaborator

Implementation Plan: Manage Store Data Feature

After analyzing the codebase, here's the implementation plan for the "Manage Store Data" feature in /ai-config:

Current State Analysis

  • The "Manage Store Data" button exists at line 453-458 in AIConfigContent.tsx
  • Currently redirects to /webshops page
  • Store data is synced from e-commerce platforms (Shopify, WooCommerce, ShopRenter) into cache tables:
    • Products: woocommerce_products_cache, shopify_products_cache, shoprenter_products_cache
    • Orders: woocommerce_orders_cache, shopify_orders_cache, shoprenter_orders_cache
    • Customers: woocommerce_customers_cache, shopify_customers_cache, shoprenter_customers_cache

Proposed Implementation

Phase 1: Database Schema

New table: store_data_exclusions

- id: UUID (primary key)
- store_id: UUID (FK to stores)
- data_type: TEXT ('product', 'order', 'customer')
- data_id: TEXT (original platform ID)
- is_enabled: BOOLEAN (default: true, false = disabled/excluded)
- metadata: JSONB (name, sku, email, etc. for display)
- created_at: TIMESTAMPTZ
- updated_at: TIMESTAMPTZ
- UNIQUE(store_id, data_type, data_id)

Phase 2: Backend API Endpoints

New Edge Function routes in /api:

  1. GET /api/stores/:id/knowledge-data - List all knowledge data items with filter/search
  2. PUT /api/stores/:id/knowledge-data/:data_type/:data_id - Toggle enabled/disabled state
  3. POST /api/stores/:id/knowledge-data/batch - Bulk enable/disable items

Phase 3: Frontend UI Component

New page/component: ManageStoreData.tsx Features:

  • Data type tabs (Products, Orders, Customers)
  • Search/filter functionality
  • Toggle switches for each item
  • Bulk actions (enable all, disable all)
  • Display item metadata (name, SKU, email, etc.)

Phase 4: Integration

  • Update "Manage Store Data" button to navigate to new page
  • Add sync trigger to populate store_data_exclusions on first access
  • Update AI context retrieval to respect is_enabled flag

Breaking Down Into Separate Issues

I'll now create the following issues:

  1. feat: Add store_data_exclusions database schema (backend, database)
  2. feat: Add knowledge data management API endpoints (backend)
  3. feat: Create Manage Store Data UI page (frontend)
  4. feat: Integrate exclusions with AI context (backend, integration)

Each issue will be assigned to claude with appropriate labels.

## Implementation Plan: Manage Store Data Feature After analyzing the codebase, here's the implementation plan for the "Manage Store Data" feature in `/ai-config`: ### Current State Analysis - The "Manage Store Data" button exists at line 453-458 in `AIConfigContent.tsx` - Currently redirects to `/webshops` page - Store data is synced from e-commerce platforms (Shopify, WooCommerce, ShopRenter) into cache tables: - Products: `woocommerce_products_cache`, `shopify_products_cache`, `shoprenter_products_cache` - Orders: `woocommerce_orders_cache`, `shopify_orders_cache`, `shoprenter_orders_cache` - Customers: `woocommerce_customers_cache`, `shopify_customers_cache`, `shoprenter_customers_cache` ### Proposed Implementation #### Phase 1: Database Schema **New table: `store_data_exclusions`** ```sql - id: UUID (primary key) - store_id: UUID (FK to stores) - data_type: TEXT ('product', 'order', 'customer') - data_id: TEXT (original platform ID) - is_enabled: BOOLEAN (default: true, false = disabled/excluded) - metadata: JSONB (name, sku, email, etc. for display) - created_at: TIMESTAMPTZ - updated_at: TIMESTAMPTZ - UNIQUE(store_id, data_type, data_id) ``` #### Phase 2: Backend API Endpoints **New Edge Function routes in `/api`:** 1. `GET /api/stores/:id/knowledge-data` - List all knowledge data items with filter/search 2. `PUT /api/stores/:id/knowledge-data/:data_type/:data_id` - Toggle enabled/disabled state 3. `POST /api/stores/:id/knowledge-data/batch` - Bulk enable/disable items #### Phase 3: Frontend UI Component **New page/component: `ManageStoreData.tsx`** Features: - Data type tabs (Products, Orders, Customers) - Search/filter functionality - Toggle switches for each item - Bulk actions (enable all, disable all) - Display item metadata (name, SKU, email, etc.) #### Phase 4: Integration - Update "Manage Store Data" button to navigate to new page - Add sync trigger to populate `store_data_exclusions` on first access - Update AI context retrieval to respect `is_enabled` flag --- ### Breaking Down Into Separate Issues I'll now create the following issues: 1. **feat: Add store_data_exclusions database schema** (backend, database) 2. **feat: Add knowledge data management API endpoints** (backend) 3. **feat: Create Manage Store Data UI page** (frontend) 4. **feat: Integrate exclusions with AI context** (backend, integration) Each issue will be assigned to claude with appropriate labels.
Szontágh Ferenc commented 5 months ago
Owner

create these new issues and close the current issue

create these new issues and close the current issue
claude commented 5 months ago
Collaborator

@fszontagh Understood! I'll now create the 4 separate implementation issues based on the plan and close this issue once complete.

@fszontagh Understood! I'll now create the 4 separate implementation issues based on the plan and close this issue once complete.
claude commented 5 months ago
Collaborator

@fszontagh Done! I've created 4 separate implementation issues:

  1. #43 - feat: Add store_data_exclusions database schema

    • Database table creation with proper indexes and RLS policies
    • Foundation for storing enabled/disabled state of knowledge data
  2. #44 - feat: Add knowledge data management API endpoints

    • Backend API endpoints for listing, filtering, and managing knowledge data
    • Support for bulk operations and search functionality
    • Depends on #43
  3. #45 - feat: Create Manage Store Data UI page

    • Frontend UI with tabs, search, filters, and toggle switches
    • Bulk actions and pagination support
    • Depends on #44
  4. #46 - feat: Integrate exclusions with AI context

    • Integration layer to ensure AI only uses enabled knowledge data
    • Performance optimization and query updates
    • Depends on #43

All issues are:

  • ✅ Assigned to claude
  • ✅ Labeled as enhancement
  • ✅ Linked back to parent issue #42
  • ✅ Include detailed requirements and acceptance criteria
  • ✅ Have proper dependency chain

Closing this issue now as the work has been properly broken down into implementable tasks.

@fszontagh Done! I've created 4 separate implementation issues: 1. **#43 - feat: Add store_data_exclusions database schema** - Database table creation with proper indexes and RLS policies - Foundation for storing enabled/disabled state of knowledge data 2. **#44 - feat: Add knowledge data management API endpoints** - Backend API endpoints for listing, filtering, and managing knowledge data - Support for bulk operations and search functionality - Depends on #43 3. **#45 - feat: Create Manage Store Data UI page** - Frontend UI with tabs, search, filters, and toggle switches - Bulk actions and pagination support - Depends on #44 4. **#46 - feat: Integrate exclusions with AI context** - Integration layer to ensure AI only uses enabled knowledge data - Performance optimization and query updates - Depends on #43 All issues are: - ✅ Assigned to claude - ✅ Labeled as enhancement - ✅ Linked back to parent issue #42 - ✅ Include detailed requirements and acceptance criteria - ✅ Have proper dependency chain Closing this issue now as the work has been properly broken down into implementable tasks.
Sign in to join this conversation.
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.