fix(proposal events): Add userId to update accepted_by and reorder event to update all objects in time

feat(loads/public-load-tracking): add missing data to load objects
This commit is contained in:
Josepablo C
2025-04-08 22:59:11 -06:00
parent 97b0b2ff88
commit 5e55b0f738
3 changed files with 56 additions and 6 deletions

View File

@@ -7,7 +7,34 @@ const CompanyModel = getModel('companies');
const ProposalsModel = getModel('proposals');
const branchesModel = getModel('branches');
const populate_list = ['product', 'company', 'carrier', 'vehicle', 'categories','shipper_warehouse','driver'];
const carrier_projection = [
'company_name',
'company_code',
'createdAt',
'rfc'
];
const vehicle_projection = [
'vehicle_code',
'truck_type',
'driver',
'categories',
'circulation_serial_number',
'trailer_plate_1',
'trailer_plate_2',
'city',
];
const user_projection = ['first_name','last_name','middle_name'];
const populate_list = [
'product',
'company',
'categories',
'shipper_warehouse',
{path:'carrier',select: carrier_projection },
{path:'vehicle',select: vehicle_projection },
{path:'driver',select: user_projection },
{path:'bidder',select: user_projection },
];
const generic = new GenericHandler( Model, null, populate_list );
function getAndFilterList( query ){