|
@@ -741,8 +741,8 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
qdrant_sync_enabled,
|
|
qdrant_sync_enabled,
|
|
|
data_access_permissions,
|
|
data_access_permissions,
|
|
|
store_sync_config (
|
|
store_sync_config (
|
|
|
- sync_orders,
|
|
|
|
|
- sync_customers
|
|
|
|
|
|
|
+ orders_access_policy,
|
|
|
|
|
+ customers_access_policy
|
|
|
)
|
|
)
|
|
|
`)
|
|
`)
|
|
|
.eq('id', storeId)
|
|
.eq('id', storeId)
|
|
@@ -787,11 +787,6 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
qdrant: qdrantEnabled
|
|
qdrant: qdrantEnabled
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- console.log('[ShopRenter] Sync config:', {
|
|
|
|
|
- syncOrders: shouldSyncOrders,
|
|
|
|
|
- syncCustomers: shouldSyncCustomers
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
const syncStats = {
|
|
const syncStats = {
|
|
|
products: { synced: 0, errors: 0 },
|
|
products: { synced: 0, errors: 0 },
|
|
|
orders: { synced: 0, errors: 0 },
|
|
orders: { synced: 0, errors: 0 },
|
|
@@ -884,7 +879,7 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
// Note: Not cached to database for GDPR compliance, only synced to Qdrant for AI access
|
|
// Note: Not cached to database for GDPR compliance, only synced to Qdrant for AI access
|
|
|
const allOrders: any[] = []
|
|
const allOrders: any[] = []
|
|
|
let orderSyncError: Error | null = null
|
|
let orderSyncError: Error | null = null
|
|
|
- if (qdrantEnabled && shouldSyncOrders && canSyncOrders) {
|
|
|
|
|
|
|
+ if (qdrantEnabled && canSyncOrders) {
|
|
|
try {
|
|
try {
|
|
|
console.log('[ShopRenter] Syncing orders to Qdrant...')
|
|
console.log('[ShopRenter] Syncing orders to Qdrant...')
|
|
|
let page = 0
|
|
let page = 0
|
|
@@ -925,7 +920,6 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
} else {
|
|
} else {
|
|
|
console.log('[ShopRenter] Order sync skipped:', {
|
|
console.log('[ShopRenter] Order sync skipped:', {
|
|
|
qdrantEnabled,
|
|
qdrantEnabled,
|
|
|
- shouldSyncOrders,
|
|
|
|
|
canSyncOrders
|
|
canSyncOrders
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -934,7 +928,7 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
// Note: Not cached to database for GDPR compliance, only synced to Qdrant for AI access
|
|
// Note: Not cached to database for GDPR compliance, only synced to Qdrant for AI access
|
|
|
const allCustomers: any[] = []
|
|
const allCustomers: any[] = []
|
|
|
let customerSyncError: Error | null = null
|
|
let customerSyncError: Error | null = null
|
|
|
- if (qdrantEnabled && shouldSyncCustomers && canSyncCustomers) {
|
|
|
|
|
|
|
+ if (qdrantEnabled && canSyncCustomers) {
|
|
|
try {
|
|
try {
|
|
|
console.log('[ShopRenter] Syncing customers to Qdrant...')
|
|
console.log('[ShopRenter] Syncing customers to Qdrant...')
|
|
|
let page = 0
|
|
let page = 0
|
|
@@ -975,7 +969,6 @@ serve(wrapHandler('shoprenter-sync', async (req) => {
|
|
|
} else {
|
|
} else {
|
|
|
console.log('[ShopRenter] Customer sync skipped:', {
|
|
console.log('[ShopRenter] Customer sync skipped:', {
|
|
|
qdrantEnabled,
|
|
qdrantEnabled,
|
|
|
- shouldSyncCustomers,
|
|
|
|
|
canSyncCustomers
|
|
canSyncCustomers
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|