Fix customer order creation for employees by updating the schema

Update the customer order schema and data mapping in the frontend to correctly handle employee role permissions when creating customer orders.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/qPpS8VH
This commit is contained in:
michaelschal committed 2025-08-12 14:19:27 +00:00
1 parent cf738cc49a
commit fcad53ae1d
5 files changed
+296 -16

No files matched your search

@@ -0,0 +1,204 @@
nocodb_table_id: 'my7zunxprumahmm',
nocodb_table_name: 'CommandeH',
invoice_column_name: 'RefFacture',
group_created_at: '2025-07-22 11:09:08.977622',
group_updated_at: '2025-08-12 09:39:32.989'
}
]
✅ Processed 1 groups for user _1753266816257
🔍 getUserWithGroups called for user: _1753266816257
🔍 Querying user_groups for user: _1753266816257
🔍 Querying user_groups for user: _1753266816257
🔍 Found 1 group assignments for user _1753266816257
🔍 Raw query result: [
{
user_id: '_1753266816257',
group_id: 2,
group_id_ref: 2,
group_name: 'Houdemont',
group_color: '#455A64',
nocodb_config_id: 1,
nocodb_table_id: 'my7zunxprumahmm',
nocodb_table_name: 'CommandeH',
invoice_column_name: 'RefFacture',
group_created_at: '2025-07-22 11:09:08.977622',
group_updated_at: '2025-08-12 09:39:32.989'
}
]
✅ Processed 1 groups for user _1753266816257
🔍 getUserWithGroups called for user: _1753266816257
🔍 Found 1 group assignments for user _1753266816257
🔍 Raw query result: [
{
user_id: '_1753266816257',
group_id: 2,
group_id_ref: 2,
group_name: 'Houdemont',
group_color: '#455A64',
nocodb_config_id: 1,
nocodb_table_id: 'my7zunxprumahmm',
nocodb_table_name: 'CommandeH',
invoice_column_name: 'RefFacture',
group_created_at: '2025-07-22 11:09:08.977622',
group_updated_at: '2025-08-12 09:39:32.989'
}
]
✅ Processed 1 groups for user _1753266816257
🔍 getUserWithGroups called for user: _1753266816257
🔍 Querying user_groups for user: _1753266816257
🔍 Found 1 group assignments for user _1753266816257
🔍 Raw query result: [
{
user_id: '_1753266816257',
group_id: 2,
group_id_ref: 2,
group_name: 'Houdemont',
group_color: '#455A64',
nocodb_config_id: 1,
nocodb_table_id: 'my7zunxprumahmm',
nocodb_table_name: 'CommandeH',
invoice_column_name: 'RefFacture',
group_created_at: '2025-07-22 11:09:08.977622',
group_updated_at: '2025-08-12 09:39:32.989'
}
]
✅ Processed 1 groups for user _1753266816257
🔍 Querying user_groups for user: _1753266816257
🔍 Found 1 group assignments for user _1753266816257
🔍 Raw query result: [
{
user_id: '_1753266816257',
group_id: 2,
group_id_ref: 2,
group_name: 'Houdemont',
group_color: '#455A64',
nocodb_config_id: 1,
nocodb_table_id: 'my7zunxprumahmm',
nocodb_table_name: 'CommandeH',
invoice_column_name: 'RefFacture',
group_created_at: '2025-07-22 11:09:08.977622',
group_updated_at: '2025-08-12 09:39:32.989'
}
]
✅ Processed 1 groups for user _1753266816257
🔍 DLC Products API called with: {
userId: '_1753266816257',
userRole: 'employee',
userGroups: [ { groupId: 2, groupName: 'Houdemont' } ],
groupIds: [ 2 ],
filters: {},
queryStoreId: undefined
}
GET /api/dlc-products/stats 304 in 18ms
📋 DLC Products returned: 133 items
📋 Sample DLC products groupIds: [
{ id: 178, name: 'Nesta grenier strawberry aloe vera', groupId: 2 },
{ id: 48, name: 'Gressins sésame', groupId: 2 },
{ id: 154, name: 'M&m’s crispy 240g', groupId: 2 }
]
GET /api/dlc-products 304 in 26ms
HEAD /api/health 200 in 1ms
Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB