|
@@ -111,8 +111,11 @@ supabase functions serve
|
|
|
- **WooCommerce integration** (fully implemented)
|
|
- **WooCommerce integration** (fully implemented)
|
|
|
- OAuth flow: `oauth-woocommerce` (OAuth 1.0a authentication)
|
|
- OAuth flow: `oauth-woocommerce` (OAuth 1.0a authentication)
|
|
|
- API client: `_shared/woocommerce-client.ts`
|
|
- API client: `_shared/woocommerce-client.ts`
|
|
|
|
|
+ - **Data synchronization**: `woocommerce-sync` (manual sync for products, orders, customers)
|
|
|
- Read-only access to products, orders, and customers
|
|
- Read-only access to products, orders, and customers
|
|
|
- Secure OAuth 1.0a with HMAC-SHA256 signatures
|
|
- Secure OAuth 1.0a with HMAC-SHA256 signatures
|
|
|
|
|
+ - Rate limiting (5 req/sec) and retry logic with exponential backoff
|
|
|
|
|
+ - Pagination support for large datasets
|
|
|
- **ShopRenter integration** (fully implemented)
|
|
- **ShopRenter integration** (fully implemented)
|
|
|
- OAuth flow: `oauth-shoprenter-init`, `oauth-shoprenter-callback`
|
|
- OAuth flow: `oauth-shoprenter-init`, `oauth-shoprenter-callback`
|
|
|
- Uninstall webhook: `webhook-shoprenter-uninstall`
|
|
- Uninstall webhook: `webhook-shoprenter-uninstall`
|
|
@@ -174,6 +177,67 @@ supabase functions serve
|
|
|
- last_synced_at: timestamp
|
|
- last_synced_at: timestamp
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
+**woocommerce_products_cache table** (cached WooCommerce products):
|
|
|
|
|
+```
|
|
|
|
|
+- id: UUID (primary key)
|
|
|
|
|
+- store_id: UUID (FK to stores)
|
|
|
|
|
+- wc_product_id: text
|
|
|
|
|
+- name: text
|
|
|
|
|
+- sku: text
|
|
|
|
|
+- price: decimal
|
|
|
|
|
+- currency: text
|
|
|
|
|
+- description: text
|
|
|
|
|
+- short_description: text
|
|
|
|
|
+- stock_quantity: integer
|
|
|
|
|
+- stock_status: text
|
|
|
|
|
+- type: text ('simple', 'variable', 'grouped', 'external')
|
|
|
|
|
+- categories: jsonb
|
|
|
|
|
+- images: jsonb
|
|
|
|
|
+- raw_data: jsonb
|
|
|
|
|
+- last_synced_at: timestamptz
|
|
|
|
|
+- created_at: timestamptz
|
|
|
|
|
+- UNIQUE(store_id, wc_product_id)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+**woocommerce_orders_cache table** (cached WooCommerce orders):
|
|
|
|
|
+```
|
|
|
|
|
+- id: UUID (primary key)
|
|
|
|
|
+- store_id: UUID (FK to stores)
|
|
|
|
|
+- wc_order_id: text
|
|
|
|
|
+- order_number: text
|
|
|
|
|
+- status: text
|
|
|
|
|
+- total: decimal
|
|
|
|
|
+- currency: text
|
|
|
|
|
+- customer_name: text
|
|
|
|
|
+- customer_email: text
|
|
|
|
|
+- line_items: jsonb
|
|
|
|
|
+- billing_address: jsonb
|
|
|
|
|
+- shipping_address: jsonb
|
|
|
|
|
+- created_at: timestamptz
|
|
|
|
|
+- raw_data: jsonb
|
|
|
|
|
+- last_synced_at: timestamptz
|
|
|
|
|
+- UNIQUE(store_id, wc_order_id)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+**woocommerce_customers_cache table** (cached WooCommerce customers):
|
|
|
|
|
+```
|
|
|
|
|
+- id: UUID (primary key)
|
|
|
|
|
+- store_id: UUID (FK to stores)
|
|
|
|
|
+- wc_customer_id: text
|
|
|
|
|
+- email: text
|
|
|
|
|
+- first_name: text
|
|
|
|
|
+- last_name: text
|
|
|
|
|
+- username: text
|
|
|
|
|
+- billing_address: jsonb
|
|
|
|
|
+- shipping_address: jsonb
|
|
|
|
|
+- orders_count: integer
|
|
|
|
|
+- total_spent: decimal
|
|
|
|
|
+- raw_data: jsonb
|
|
|
|
|
+- last_synced_at: timestamptz
|
|
|
|
|
+- created_at: timestamptz
|
|
|
|
|
+- UNIQUE(store_id, wc_customer_id)
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
**shoprenter_webhooks table** (webhook registrations):
|
|
**shoprenter_webhooks table** (webhook registrations):
|
|
|
```
|
|
```
|
|
|
- store_id: UUID (FK to stores)
|
|
- store_id: UUID (FK to stores)
|