mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 23:18:18 +02:00
4 files changed
+277
-9
No files matched your search
+231
@@ -0,0 +1,231 @@
|
|||||||
|
Registries
|
||||||
|
|
||||||
|
Logs
|
||||||
|
|
||||||
|
Notifications
|
||||||
|
|
||||||
|
Settings
|
||||||
|
|
||||||
|
New version available 2.27.9
|
||||||
|
DismissSee what's new
|
||||||
|
Community Edition
|
||||||
|
2.27.6 LTS
|
||||||
|
Containers>logiflow-logiflow-1>Logs
|
||||||
|
Container logs
|
||||||
|
|
||||||
|
|
||||||
|
admin
|
||||||
|
Log viewer settings
|
||||||
|
Auto-refresh logs
|
||||||
|
Wrap lines
|
||||||
|
Display timestamps
|
||||||
|
Fetch
|
||||||
|
All logs
|
||||||
|
Search
|
||||||
|
Filter...
|
||||||
|
Lines
|
||||||
|
100
|
||||||
|
Actions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Customer Orders API called with: { groupIds: [ 2 ], userRole: 'admin' }
|
||||||
|
|
||||||
|
Orders API called with: {
|
||||||
|
|
||||||
|
startDate: undefined,
|
||||||
|
|
||||||
|
endDate: undefined,
|
||||||
|
|
||||||
|
storeId: '2',
|
||||||
|
|
||||||
|
userRole: 'admin'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Admin filtering with groupIds: [ 2 ]
|
||||||
|
|
||||||
|
Fetching all orders
|
||||||
|
|
||||||
|
GET /api/publicities 304 in 33ms
|
||||||
|
|
||||||
|
Customer Orders returned: 25 items
|
||||||
|
|
||||||
|
GET /api/customer-orders 304 in 43ms
|
||||||
|
|
||||||
|
🔗 PRODUCTION: getOrders() récupéré 18 commandes avec relations
|
||||||
|
|
||||||
|
Orders returned: 18 items
|
||||||
|
|
||||||
|
GET /api/orders 304 in 59ms
|
||||||
|
|
||||||
|
🔗 PRODUCTION: getDeliveries() récupéré 38 livraisons avec relations
|
||||||
|
|
||||||
|
Deliveries returned: 38 items
|
||||||
|
|
||||||
|
GET /api/deliveries 304 in 65ms
|
||||||
|
|
||||||
|
GET /api/groups 200 in 5ms
|
||||||
|
|
||||||
|
POST /api/logout 302 in 4ms
|
||||||
|
|
||||||
|
📄 SPA: Serving index.html for /auth
|
||||||
|
|
||||||
|
📄 SPA: Serving index.html for /auth
|
||||||
|
|
||||||
|
GET /api/user 401 in 1ms
|
||||||
|
|
||||||
|
GET /api/user 401 in 0ms
|
||||||
|
|
||||||
|
GET /api/default-credentials-check 304 in 1ms
|
||||||
|
|
||||||
|
🔐 comparePasswords: {
|
||||||
|
|
||||||
|
supplied: 'HIDDEN',
|
||||||
|
|
||||||
|
stored: 'b23ec450a63faf3957a1...',
|
||||||
|
|
||||||
|
hasFormat: true
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
🔐 Password comparison result: true
|
||||||
|
|
||||||
|
POST /api/login 200 in 51ms
|
||||||
|
|
||||||
|
GET /api/user 200 in 3ms
|
||||||
|
|
||||||
|
GET /api/user 304 in 4ms
|
||||||
|
|
||||||
|
📊 Calcul statistiques mensuelles: {
|
||||||
|
|
||||||
|
year: 2025,
|
||||||
|
|
||||||
|
month: 8,
|
||||||
|
|
||||||
|
startDate: '2025-08-01',
|
||||||
|
|
||||||
|
endDate: '2025-09-01',
|
||||||
|
|
||||||
|
groupIds: [ 2 ]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Orders API called with: {
|
||||||
|
|
||||||
|
startDate: undefined,
|
||||||
|
|
||||||
|
endDate: undefined,
|
||||||
|
|
||||||
|
storeId: undefined,
|
||||||
|
|
||||||
|
userRole: 'employee'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Non-admin filtering with groupIds: [ 2 ]
|
||||||
|
|
||||||
|
Deliveries API called with: {
|
||||||
|
|
||||||
|
startDate: undefined,
|
||||||
|
|
||||||
|
endDate: undefined,
|
||||||
|
|
||||||
|
storeId: undefined,
|
||||||
|
|
||||||
|
withBL: undefined,
|
||||||
|
|
||||||
|
userRole: 'employee'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Non-admin filtering deliveries with groupIds: [ 2 ]
|
||||||
|
|
||||||
|
🔗 PRODUCTION: getOrders() récupéré 18 commandes avec relations
|
||||||
|
|
||||||
|
Orders returned: 18 items
|
||||||
|
|
||||||
|
GET /api/orders 200 in 54ms
|
||||||
|
|
||||||
|
Customer Orders API called with: { groupIds: [ 2 ], userRole: 'employee' }
|
||||||
|
|
||||||
|
📊 Statistiques calculées: {
|
||||||
|
|
||||||
|
ordersCount: 8,
|
||||||
|
|
||||||
|
deliveriesCount: 21,
|
||||||
|
|
||||||
|
pendingOrdersCount: 4,
|
||||||
|
|
||||||
|
averageDeliveryTime: 0.17647058823529413,
|
||||||
|
|
||||||
|
totalPalettes: 57,
|
||||||
|
|
||||||
|
totalPackages: 17
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GET /api/stats/monthly 200 in 62ms
|
||||||
|
|
||||||
|
Tasks API called with: { groupIds: [ 2 ], userRole: 'employee' }
|
||||||
|
|
||||||
|
Customer Orders returned: 25 items
|
||||||
|
|
||||||
|
GET /api/customer-orders 200 in 76ms
|
||||||
|
|
||||||
|
Tasks returned: 9 items
|
||||||
|
|
||||||
|
GET /api/dlc-products/stats 200 in 80ms
|
||||||
|
|
||||||
|
GET /api/tasks 200 in 78ms
|
||||||
|
|
||||||
|
GET /api/publicities 304 in 84ms
|
||||||
|
|
||||||
|
GET /api/user 304 in 40ms
|
||||||
|
|
||||||
|
🔗 PRODUCTION: getDeliveries() récupéré 38 livraisons avec relations
|
||||||
|
|
||||||
|
Deliveries returned: 38 items
|
||||||
|
|
||||||
|
GET /api/deliveries 200 in 93ms
|
||||||
|
|
||||||
|
GET /api/user 304 in 5ms
|
||||||
|
|
||||||
|
GET /api/publicities 304 in 8ms
|
||||||
|
|
||||||
|
GET /api/groups 200 in 6ms
|
||||||
|
|
||||||
|
GET /api/user 304 in 7ms
|
||||||
|
|
||||||
|
GET /api/suppliers 304 in 6ms
|
||||||
|
|
||||||
|
GET /api/user 304 in 4ms
|
||||||
|
|
||||||
|
🔍 CUSTOMER ORDER PERMISSION DEBUG: {
|
||||||
|
|
||||||
|
userRole: 'employee',
|
||||||
|
|
||||||
|
userId: '_1753266816257',
|
||||||
|
|
||||||
|
userGroups: [ { userId: '_1753266816257', groupId: 2, group: [Object] } ],
|
||||||
|
|
||||||
|
requestedGroupId: 1,
|
||||||
|
|
||||||
|
requestedGroupIdType: 'number'
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
🔍 CUSTOMER ORDER - User group IDs: [ 2 ]
|
||||||
|
|
||||||
|
🔍 CUSTOMER ORDER - Requested group ID: 1
|
||||||
|
|
||||||
|
❌ CUSTOMER ORDER - Access denied: User not in requested group
|
||||||
|
|
||||||
|
🔍 Available groups: [ 2 ] Requested: 1
|
||||||
|
|
||||||
|
POST /api/customer-orders 403 in 7ms
|
||||||
|
|
||||||
|
HEAD /api/health 200 in 0ms
|
||||||
|
|
||||||
|
HEAD /api/health 200 in 1ms
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 271 KiB |
@@ -82,9 +82,9 @@ export function CustomerOrderForm({
|
|||||||
return selectedStoreId;
|
return selectedStoreId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FALLBACK: Default to 1
|
// FALLBACK: Return null to force proper assignment later
|
||||||
console.log("🚨 CustomerOrderForm defaultValue: Using fallback groupId 1");
|
console.log("🚨 CustomerOrderForm defaultValue: No group found, will be set dynamically");
|
||||||
return 1;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const form = useForm<CustomerOrderFormData>({
|
const form = useForm<CustomerOrderFormData>({
|
||||||
@@ -135,8 +135,8 @@ export function CustomerOrderForm({
|
|||||||
fullUserObject: user
|
fullUserObject: user
|
||||||
});
|
});
|
||||||
|
|
||||||
// Override groupId if needed (defaultValues might be calculated before userGroups is loaded)
|
// Ensure correct groupId assignment for non-admin users
|
||||||
if (!groupId || groupId === 1) {
|
if (!groupId || (user?.role !== 'admin' && !user?.userGroups?.some(ug => ug.groupId === groupId))) {
|
||||||
if (user?.userGroups?.[0]?.groupId) {
|
if (user?.userGroups?.[0]?.groupId) {
|
||||||
groupId = user.userGroups[0].groupId;
|
groupId = user.userGroups[0].groupId;
|
||||||
console.log("🔧 Customer Order Override: Using user's assigned group:", groupId);
|
console.log("🔧 Customer Order Override: Using user's assigned group:", groupId);
|
||||||
@@ -265,7 +265,38 @@ export function CustomerOrderForm({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Magasin automatiquement sélectionné - pas de champ visible */}
|
{/* Sélection du magasin/groupe avec restrictions de permissions */}
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="groupId"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Magasin</FormLabel>
|
||||||
|
<Select
|
||||||
|
onValueChange={(value) => {
|
||||||
|
const numValue = parseInt(value);
|
||||||
|
field.onChange(numValue);
|
||||||
|
console.log("🏪 Group selected:", numValue);
|
||||||
|
}}
|
||||||
|
value={field.value?.toString()}
|
||||||
|
>
|
||||||
|
<FormControl>
|
||||||
|
<SelectTrigger>
|
||||||
|
<SelectValue placeholder="Sélectionner un magasin" />
|
||||||
|
</SelectTrigger>
|
||||||
|
</FormControl>
|
||||||
|
<SelectContent>
|
||||||
|
{availableGroups.map((group) => (
|
||||||
|
<SelectItem key={group.id} value={group.id.toString()}>
|
||||||
|
{group.name}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
<h3 className="text-lg font-medium">Informations produit</h3>
|
<h3 className="text-lg font-medium">Informations produit</h3>
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -1384,7 +1384,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
createdBy: user.id,
|
createdBy: user.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if user has access to the group
|
// Check if user has access to the group - PRODUCTION DEBUG
|
||||||
console.log('🔍 CUSTOMER ORDER PERMISSION DEBUG:', {
|
console.log('🔍 CUSTOMER ORDER PERMISSION DEBUG:', {
|
||||||
userRole: user.role,
|
userRole: user.role,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
@@ -1398,15 +1398,21 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
console.log('🔍 CUSTOMER ORDER - User group IDs:', userGroupIds);
|
console.log('🔍 CUSTOMER ORDER - User group IDs:', userGroupIds);
|
||||||
console.log('🔍 CUSTOMER ORDER - Requested group ID:', data.groupId);
|
console.log('🔍 CUSTOMER ORDER - Requested group ID:', data.groupId);
|
||||||
|
|
||||||
|
// Convert data.groupId to number if it's a string
|
||||||
|
const requestedGroupId = typeof data.groupId === 'string' ? parseInt(data.groupId) : data.groupId;
|
||||||
|
console.log('🔍 CUSTOMER ORDER - Converted group ID:', requestedGroupId);
|
||||||
|
|
||||||
// Allow managers, directeurs, and employees to create orders in their assigned groups
|
// Allow managers, directeurs, and employees to create orders in their assigned groups
|
||||||
if (!['manager', 'directeur', 'employee'].includes(user.role)) {
|
if (!['manager', 'directeur', 'employee'].includes(user.role)) {
|
||||||
console.log('❌ CUSTOMER ORDER - Access denied: Invalid role for customer orders');
|
console.log('❌ CUSTOMER ORDER - Access denied: Invalid role for customer orders');
|
||||||
return res.status(403).json({ message: "Insufficient permissions to create customer orders" });
|
return res.status(403).json({ message: "Insufficient permissions to create customer orders" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userGroupIds.includes(data.groupId)) {
|
if (!userGroupIds.includes(requestedGroupId)) {
|
||||||
console.log('❌ CUSTOMER ORDER - Access denied: User not in requested group');
|
console.log('❌ CUSTOMER ORDER - Access denied: User not in requested group');
|
||||||
console.log('🔍 Available groups:', userGroupIds, 'Requested:', data.groupId);
|
console.log('🔍 Available groups:', userGroupIds, 'Requested:', requestedGroupId);
|
||||||
|
console.log('🔍 Type check - userGroupIds types:', userGroupIds.map(id => typeof id));
|
||||||
|
console.log('🔍 Type check - requestedGroupId type:', typeof requestedGroupId);
|
||||||
return res.status(403).json({ message: "Access denied to this group" });
|
return res.status(403).json({ message: "Access denied to this group" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user