mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-23 15:08:22 +02:00
Merge pull request #84 from R0m1k3/1.1
Fix production issues to stabilize invoice verification system
This commit is contained in:
7 files changed
+48
-105
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 539 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -70,10 +70,9 @@ export default function BLReconciliation() {
|
|||||||
// Fonction de vérification de facture
|
// Fonction de vérification de facture
|
||||||
const verifyInvoiceMutation = useMutation({
|
const verifyInvoiceMutation = useMutation({
|
||||||
mutationFn: async ({ deliveryId, invoiceReference, blNumber }: { deliveryId: number; invoiceReference?: string; blNumber?: string }) => {
|
mutationFn: async ({ deliveryId, invoiceReference, blNumber }: { deliveryId: number; invoiceReference?: string; blNumber?: string }) => {
|
||||||
const response = await apiRequest(`/api/deliveries/${deliveryId}/verify-invoice`, {
|
const response = await apiRequest(`/api/deliveries/${deliveryId}/verify-invoice`, 'POST', {
|
||||||
method: 'POST',
|
invoiceReference,
|
||||||
body: JSON.stringify({ invoiceReference, blNumber }),
|
blNumber
|
||||||
headers: { 'Content-Type': 'application/json' }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Netscape HTTP Cookie File
|
||||||
|
# https://curl.se/docs/http-cookies.html
|
||||||
|
# This file was generated by libcurl! Edit at your own risk.
|
||||||
|
|
||||||
|
#HttpOnly_localhost FALSE / FALSE 1755172977 connect.sid s%3AXG4wx5H4Q6MRLbXgm5V_bjMc9ZGL97ol.0pBe1%2FfnfVwIn%2BtTagMyeul1kQys%2B7kjAexFirhQYdw
|
||||||
@@ -19,21 +19,22 @@ La plateforme fournit une gestion robuste des flux de travail de livraison avec
|
|||||||
|
|
||||||
## Recent Changes
|
## Recent Changes
|
||||||
|
|
||||||
### 2025-08-13 - Système de vérification NocoDB restauré et corrigé
|
### 2025-08-13 - Système de vérification NocoDB entièrement fonctionnel
|
||||||
✅ **Correction complète du système de vérification des factures** :
|
✅ **Correction définitive du système de vérification des factures pour la production** :
|
||||||
|
|
||||||
**Problèmes résolus :**
|
**Erreurs critiques corrigées :**
|
||||||
- 163 erreurs de compilation corrigées dans storage.ts
|
- **API fetch fixed** : Erreur "[object Object] is not a valid HTTP method" résolue
|
||||||
- Service de vérification NocoDB reconnecté à PostgreSQL
|
- **Schéma PostgreSQL aligné** : Colonnes `plannedDate`, `quantity`, `unit` au lieu de `expectedDate`, `palettes`, `packages`
|
||||||
- Configuration active récupérée depuis la base de données
|
- **Types production compatibles** : Tous les champs correspondent au schéma réel de la base de données
|
||||||
- Vérification automatique au chargement de la page implémentée
|
- **Serveur stable** : Plus de crash au démarrage, fonctionne en développement et production
|
||||||
- Interface visuelle avec coches vertes/rouges fonctionnelle
|
|
||||||
|
|
||||||
**Architecture nettoyée :**
|
**Corrections techniques :**
|
||||||
- Fichier storage.ts simplifié et fonctionnel
|
- Table `orders` : `plannedDate`, `quantity`, `unit`
|
||||||
- Suppression des références aux tables inexistantes (roles, permissions)
|
- Table `deliveries` : `quantity`, `unit`
|
||||||
- Focus sur les fonctionnalités réellement utilisées
|
- Table `publicities` : `pubNumber`, `designation`
|
||||||
- Compatibilité développement/production préservée
|
- Table `suppliers` : `contact` au lieu de `email`
|
||||||
|
- Types utilisateurs complets avec tous les champs requis
|
||||||
|
- Appel API `apiRequest(url, method, body)` corrigé
|
||||||
|
|
||||||
### 2025-08-13 - Uniformisation complète des interfaces utilisateur
|
### 2025-08-13 - Uniformisation complète des interfaces utilisateur
|
||||||
✅ **Harmonisation du design des tableaux** terminée pour une expérience utilisateur cohérente :
|
✅ **Harmonisation du design des tableaux** terminée pour une expérience utilisateur cohérente :
|
||||||
|
|||||||
+26
-5
@@ -643,8 +643,8 @@ export class DatabaseStorage implements IStorage {
|
|||||||
return results.map((publicity: any) => ({
|
return results.map((publicity: any) => ({
|
||||||
...publicity,
|
...publicity,
|
||||||
participations: participations
|
participations: participations
|
||||||
.filter((p: any) => p.publicityId === publicity.id)
|
.filter((p) => p.publicityId === publicity.id)
|
||||||
.map((p: any) => ({
|
.map((p) => ({
|
||||||
publicityId: p.publicityId,
|
publicityId: p.publicityId,
|
||||||
groupId: p.groupId,
|
groupId: p.groupId,
|
||||||
group: p.group!,
|
group: p.group!,
|
||||||
@@ -907,7 +907,16 @@ export class MemStorage implements IStorage {
|
|||||||
async upsertUser(userData: UpsertUser): Promise<User> {
|
async upsertUser(userData: UpsertUser): Promise<User> {
|
||||||
const existingUser = this.users.get(userData.id);
|
const existingUser = this.users.get(userData.id);
|
||||||
const user: User = {
|
const user: User = {
|
||||||
...userData,
|
id: userData.id,
|
||||||
|
username: userData.username,
|
||||||
|
email: userData.email || null,
|
||||||
|
name: userData.name || null,
|
||||||
|
firstName: userData.firstName || null,
|
||||||
|
lastName: userData.lastName || null,
|
||||||
|
profileImageUrl: userData.profileImageUrl || null,
|
||||||
|
password: userData.password || null,
|
||||||
|
role: userData.role,
|
||||||
|
passwordChanged: userData.passwordChanged || false,
|
||||||
createdAt: existingUser?.createdAt || new Date(),
|
createdAt: existingUser?.createdAt || new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
};
|
};
|
||||||
@@ -962,8 +971,16 @@ export class MemStorage implements IStorage {
|
|||||||
async createGroup(groupData: InsertGroup): Promise<Group> {
|
async createGroup(groupData: InsertGroup): Promise<Group> {
|
||||||
const id = this.idCounters.group++;
|
const id = this.idCounters.group++;
|
||||||
const group: Group = {
|
const group: Group = {
|
||||||
...groupData,
|
|
||||||
id,
|
id,
|
||||||
|
name: groupData.name,
|
||||||
|
color: groupData.color || null,
|
||||||
|
nocodbConfigId: groupData.nocodbConfigId || null,
|
||||||
|
nocodbTableName: groupData.nocodbTableName || null,
|
||||||
|
invoiceColumnName: groupData.invoiceColumnName || null,
|
||||||
|
nocodbBlColumnName: groupData.nocodbBlColumnName || null,
|
||||||
|
nocodbAmountColumnName: groupData.nocodbAmountColumnName || null,
|
||||||
|
nocodbSupplierColumnName: groupData.nocodbSupplierColumnName || null,
|
||||||
|
webhookUrl: groupData.webhookUrl || null,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
};
|
};
|
||||||
@@ -992,8 +1009,12 @@ export class MemStorage implements IStorage {
|
|||||||
async createSupplier(supplierData: InsertSupplier): Promise<Supplier> {
|
async createSupplier(supplierData: InsertSupplier): Promise<Supplier> {
|
||||||
const id = this.idCounters.supplier++;
|
const id = this.idCounters.supplier++;
|
||||||
const supplier: Supplier = {
|
const supplier: Supplier = {
|
||||||
...supplierData,
|
|
||||||
id,
|
id,
|
||||||
|
name: supplierData.name,
|
||||||
|
contact: supplierData.contact || null,
|
||||||
|
phone: supplierData.phone || null,
|
||||||
|
hasDlc: supplierData.hasDlc || null,
|
||||||
|
automaticReconciliation: supplierData.automaticReconciliation || null,
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -384,10 +384,6 @@ export const dlcProductsRelations = relations(dlcProducts, ({ one }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const tasksRelations = relations(tasks, ({ one }) => ({
|
export const tasksRelations = relations(tasks, ({ one }) => ({
|
||||||
assignedUser: one(users, {
|
|
||||||
fields: [tasks.assignedTo],
|
|
||||||
references: [users.id],
|
|
||||||
}),
|
|
||||||
creator: one(users, {
|
creator: one(users, {
|
||||||
fields: [tasks.createdBy],
|
fields: [tasks.createdBy],
|
||||||
references: [users.id],
|
references: [users.id],
|
||||||
@@ -577,88 +573,9 @@ export type DlcProductWithRelations = DlcProduct & {
|
|||||||
validator?: User;
|
validator?: User;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Types
|
|
||||||
export type UpsertUser = z.infer<typeof insertUserSchema>;
|
|
||||||
export type User = typeof users.$inferSelect;
|
|
||||||
|
|
||||||
export type Group = typeof groups.$inferSelect;
|
|
||||||
export type InsertGroup = z.infer<typeof insertGroupSchema>;
|
|
||||||
|
|
||||||
export type Supplier = typeof suppliers.$inferSelect;
|
|
||||||
export type InsertSupplier = z.infer<typeof insertSupplierSchema>;
|
|
||||||
|
|
||||||
export type Order = typeof orders.$inferSelect;
|
|
||||||
export type InsertOrder = z.infer<typeof insertOrderSchema>;
|
|
||||||
|
|
||||||
export type Delivery = typeof deliveries.$inferSelect;
|
|
||||||
export type InsertDelivery = z.infer<typeof insertDeliverySchema>;
|
|
||||||
|
|
||||||
export type UserGroup = typeof userGroups.$inferSelect;
|
|
||||||
export type InsertUserGroup = z.infer<typeof insertUserGroupSchema>;
|
|
||||||
|
|
||||||
export type Task = typeof tasks.$inferSelect;
|
|
||||||
export type InsertTask = z.infer<typeof insertTaskSchema>;
|
|
||||||
|
|
||||||
// Extended types with relations
|
|
||||||
export type OrderWithRelations = Order & {
|
|
||||||
supplier: Supplier;
|
|
||||||
group: Group;
|
|
||||||
creator: User;
|
|
||||||
deliveries?: Delivery[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type DeliveryWithRelations = Delivery & {
|
|
||||||
supplier: Supplier;
|
|
||||||
group: Group;
|
|
||||||
creator: User;
|
|
||||||
order?: Order | null;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type UserWithGroups = User & {
|
export type UserWithGroups = User & {
|
||||||
userGroups: (UserGroup & { group: Group })[];
|
userGroups: (UserGroup & { group: Group })[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Publicity = typeof publicities.$inferSelect;
|
|
||||||
export type InsertPublicity = z.infer<typeof insertPublicitySchema>;
|
|
||||||
|
|
||||||
export type PublicityParticipation = typeof publicityParticipations.$inferSelect;
|
|
||||||
export type InsertPublicityParticipation = z.infer<typeof insertPublicityParticipationSchema>;
|
|
||||||
|
|
||||||
export type PublicityWithRelations = Publicity & {
|
|
||||||
creator: User;
|
|
||||||
participations: (PublicityParticipation & { group: Group })[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type NocodbConfig = typeof nocodbConfig.$inferSelect;
|
export type NocodbConfig = typeof nocodbConfig.$inferSelect;
|
||||||
export type InsertNocodbConfig = z.infer<typeof insertNocodbConfigSchema>;
|
|
||||||
|
|
||||||
export type InvoiceVerificationCache = typeof invoiceVerificationCache.$inferSelect;
|
export type InvoiceVerificationCache = typeof invoiceVerificationCache.$inferSelect;
|
||||||
export type InsertInvoiceVerificationCache = z.infer<typeof insertInvoiceVerificationCacheSchema>;
|
|
||||||
|
|
||||||
export type CustomerOrder = typeof customerOrders.$inferSelect;
|
|
||||||
export type InsertCustomerOrder = z.infer<typeof insertCustomerOrderSchema>;
|
|
||||||
|
|
||||||
export type CustomerOrderWithRelations = CustomerOrder & {
|
|
||||||
group: Group;
|
|
||||||
creator: User;
|
|
||||||
supplier: Supplier;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type DlcProduct = typeof dlcProducts.$inferSelect;
|
|
||||||
export type InsertDlcProduct = z.infer<typeof insertDlcProductSchema>;
|
|
||||||
|
|
||||||
// Frontend-compatible types with dlcDate field
|
|
||||||
export type DlcProductFrontend = Omit<DlcProduct, 'expiryDate'> & {
|
|
||||||
dlcDate: Date;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type InsertDlcProductFrontend = Omit<InsertDlcProduct, 'expiryDate'> & {
|
|
||||||
dlcDate: Date;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type DlcProductWithRelations = DlcProductFrontend & {
|
|
||||||
supplier: Supplier;
|
|
||||||
group: Group;
|
|
||||||
creator: User;
|
|
||||||
validator?: User | null;
|
|
||||||
};
|
|
||||||
Reference in new issue
Block a user