fix(proposals): Add proposal.load.company populate
This commit is contained in:
118
server/docs/assets/APIDesign.drawio
Normal file
118
server/docs/assets/APIDesign.drawio
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
<mxfile host="app.diagrams.net" modified="2024-04-12T18:18:19.489Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0" etag="IcOi7BUkbZV7L-Fstefg" version="24.2.3" type="device">
|
||||||
|
<diagram name="Page-1" id="TZpYyL79LOodfNr5sDYv">
|
||||||
|
<mxGraphModel dx="1656" dy="1032" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1100" pageHeight="850" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-5" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="80" y="540" width="720" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-1" value="<div>Connections</div>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="180" y="590" width="160" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-2" value="Controller (ExpressJS)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="540" y="590" width="160" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-3" value="EventManager" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="360" y="590" width="160" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-6" value="<div>SystemServices</div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="97.5" y="560" width="100" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-8" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="80" y="400" width="400" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-10" value="Resources" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="280" y="450" width="180" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-9" value="Shared" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="97.5" y="420" width="87.5" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-11" value="Models" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="97.5" y="450" width="172.5" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-12" value="Controller (Router)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="490" y="400" width="310" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-14" value="entry_point with safe exit events" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="80" y="680" width="720" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-17" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-2" target="pRzEEGsYkG0vH22XolYE-12">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="510" y="550" as="sourcePoint" />
|
||||||
|
<mxPoint x="560" y="500" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-18" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="80" y="90" width="720" height="300" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-19" value="Controller" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="662.5" y="290" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-20" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="232.5" y="270" width="420" height="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-21" value="Domain" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="97.5" y="150" width="690" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-22" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-12" target="pRzEEGsYkG0vH22XolYE-19">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="510" y="540" as="sourcePoint" />
|
||||||
|
<mxPoint x="560" y="490" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-23" value="Application" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="102.5" y="110" width="80" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-24" value="Repository" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="102.5" y="290" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-25" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-19" target="pRzEEGsYkG0vH22XolYE-21">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="542.5" y="530" as="sourcePoint" />
|
||||||
|
<mxPoint x="592.5" y="480" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-27" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-21" target="pRzEEGsYkG0vH22XolYE-20">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="542.5" y="530" as="sourcePoint" />
|
||||||
|
<mxPoint x="592.5" y="480" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-28" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-21" target="pRzEEGsYkG0vH22XolYE-24">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="542.5" y="530" as="sourcePoint" />
|
||||||
|
<mxPoint x="592.5" y="480" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-29" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-24" target="pRzEEGsYkG0vH22XolYE-11">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="510" y="530" as="sourcePoint" />
|
||||||
|
<mxPoint x="90" y="340" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-30" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-3" target="pRzEEGsYkG0vH22XolYE-10">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="510" y="520" as="sourcePoint" />
|
||||||
|
<mxPoint x="560" y="470" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-32" value="Public" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="252.5" y="290" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-33" value="Interfaces" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="382.5" y="290" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-34" value="Events" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
|
||||||
|
<mxGeometry x="512.5" y="290" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pRzEEGsYkG0vH22XolYE-35" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="pRzEEGsYkG0vH22XolYE-34" target="pRzEEGsYkG0vH22XolYE-10">
|
||||||
|
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||||
|
<mxPoint x="450" y="480" as="sourcePoint" />
|
||||||
|
<mxPoint x="500" y="430" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -150,8 +150,6 @@ async function findCalendarLoads( userId, companyId, query ){
|
|||||||
andFilterList.push( { load_status } )
|
andFilterList.push( { load_status } )
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log( andFilterList );
|
|
||||||
|
|
||||||
const filter = {
|
const filter = {
|
||||||
$and : andFilterList,
|
$and : andFilterList,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,15 @@ const { GenericHandler } = require( '../../../lib/Handlers/Generic.handler' );
|
|||||||
const { onPatchEvent } = require('../../../lib/Handlers/Proposals.handler');
|
const { onPatchEvent } = require('../../../lib/Handlers/Proposals.handler');
|
||||||
const Model = getModel('proposals');
|
const Model = getModel('proposals');
|
||||||
|
|
||||||
const populate_list = [{ path:'load' , populate : { path : 'categories' } }, 'shipper','carrier','vehicle','bidder','accepted_by'];
|
const populate_list = [
|
||||||
|
{ path:'load' , populate : { path : 'categories' } },
|
||||||
|
{ path:'load' , populate : { path : 'company' } },
|
||||||
|
'shipper',
|
||||||
|
'carrier',
|
||||||
|
'vehicle',
|
||||||
|
'bidder',
|
||||||
|
'accepted_by'
|
||||||
|
];
|
||||||
const generic = new GenericHandler( Model, null, populate_list );
|
const generic = new GenericHandler( Model, null, populate_list );
|
||||||
|
|
||||||
function getAndFilterList( query ){
|
function getAndFilterList( query ){
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ const getListPublished = async(req, res) => {
|
|||||||
"truck_type",
|
"truck_type",
|
||||||
"tyre_type",
|
"tyre_type",
|
||||||
"destino",
|
"destino",
|
||||||
|
"available_in",
|
||||||
"available_date",
|
"available_date",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
"updatedAt",
|
"updatedAt",
|
||||||
|
|||||||
Reference in New Issue
Block a user