Add quality control process for supplier deliveries

Introduce a new 'requires_control' flag for suppliers, enabling a quality control workflow for deliveries. This includes UI updates, database schema changes, and API endpoints to manage and track control validation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/e7P7sOc
This commit is contained in:
michaelschal committed 2025-09-30 08:22:02 +00:00
1 parent b643ea5fa8
commit a2ab38a412
7 files changed
+97 -6

No files matched your search

+9
View File
@@ -1165,6 +1165,15 @@ export class DatabaseStorage implements IStorage {
await db.update(deliveries).set(updateData).where(eq(deliveries.id, id));
}
async markDeliveryControlValidated(id: number, userId: string): Promise<void> {
await db.update(deliveries).set({
controlValidated: true,
controlValidatedBy: userId,
controlValidatedAt: new Date(),
updatedAt: new Date(),
}).where(eq(deliveries.id, id));
}
// User-Group operations
async getUserGroups(userId: string): Promise<UserGroup[]> {
return await db.select().from(userGroups).where(eq(userGroups.userId, userId));