From 4ea50b0e835c49c02da77ec5ef31ce8c061625ba Mon Sep 17 00:00:00 2001 From: Josepablo C Date: Tue, 10 Jun 2025 21:56:40 -0600 Subject: [PATCH] fix: Change status=Completed as observers rule instead of Published --- v1/src/apps/observers/private/loads/services.js | 2 +- v1/src/lib/Models/loads.model.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/v1/src/apps/observers/private/loads/services.js b/v1/src/apps/observers/private/loads/services.js index 451212b..42bd704 100644 --- a/v1/src/apps/observers/private/loads/services.js +++ b/v1/src/apps/observers/private/loads/services.js @@ -124,7 +124,7 @@ async function findList( user_type, email, query ) { const { page, elements } = getPagination( query ); const andFilterList = getAndFilterList( query ) || []; - andFilterList.push({ "status": "Published" }); // Only when the publication is not in draft or completed. + andFilterList.push({ "status": "Completed" }); // Only when the publication is connected to a carrier. andFilterList.push({ "bidder": { "$ne":null } }); // Only when published have a proposal accepted. if( user_type == "client" ){ diff --git a/v1/src/lib/Models/loads.model.js b/v1/src/lib/Models/loads.model.js index c20ebb3..988d3eb 100644 --- a/v1/src/lib/Models/loads.model.js +++ b/v1/src/lib/Models/loads.model.js @@ -71,7 +71,7 @@ const schema = new Schema({ // 3. Enroute Shipments (In Transit) // 4. Shipments in Unloading (Unloading) // 5. Shipments pending finding truck - status: { type: String, default: 'Draft', enum: ['Draft', 'Published', 'Completed', 'Closed'] }, + status: { type: String, default: 'Draft', enum: ['Draft', 'Published', 'Completed', 'Closed'] },//When completed => Publication is done, awaiting for the load transit to finish (load_status set tot Delivered). load_status: { type: String, enum: ['Published', 'Loading', 'Transit', 'Downloading', 'Delivered'] },