Commit f285aa39 by Antonio Rueda

Implementación de búsqueda de hoteles por nombre parcial y localidad

parent 9e490125
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0" version="24.7.14">
<mxfile host="app.diagrams.net" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0" version="24.7.16">
<diagram name="Página-1" id="IpY-njWp8TfkcAYWz6vd">
<mxGraphModel dx="2422" dy="386" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1654" pageHeight="2336" math="0" shadow="0">
<mxGraphModel dx="2687" dy="728" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1654" pageHeight="2336" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="a_C5hD_1tt0fRA46Nat0-1" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Reserva&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-1" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Reserva&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1160" y="150" width="160" height="156" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-2" value="&lt;div&gt;- &lt;u&gt;num&lt;/u&gt;: int&lt;br&gt;&lt;/div&gt;&lt;div&gt;- fechaInicio: Fecha&lt;/div&gt;&lt;div&gt;- fechaFin: Fecha&lt;/div&gt;&lt;div&gt;- numHabSimple: init&lt;/div&gt;&lt;div&gt;- numHabDoble: int&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-2" value="&lt;div&gt;- &lt;u&gt;num&lt;/u&gt;: int&lt;br&gt;&lt;/div&gt;&lt;div&gt;- fechaInicio: Fecha&lt;/div&gt;&lt;div&gt;- fechaFin: Fecha&lt;/div&gt;&lt;div&gt;- numHabSimple: init&lt;/div&gt;&lt;div&gt;- numHabDoble: int&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-1" vertex="1">
<mxGeometry y="40" width="160" height="80" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-3" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="a_C5hD_1tt0fRA46Nat0-1" vertex="1">
<mxGeometry y="120" width="160" height="10" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-19" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-19" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-1" vertex="1">
<mxGeometry y="130" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-5" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Hotel&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-5" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Hotel&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="850" y="96" width="160" height="226" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-6" value="&lt;div&gt;- &lt;u&gt;id&lt;/u&gt;: int&lt;br&gt;&lt;/div&gt;&lt;div&gt;- nombre: string&lt;/div&gt;&lt;div&gt;- direccion: string&lt;/div&gt;&lt;div&gt;- localidad: string&lt;/div&gt;&lt;div&gt;- provincia: string&lt;/div&gt;&lt;div&gt;- cp: int&lt;/div&gt;&lt;div&gt;- numHabSimple: int&lt;/div&gt;&lt;div&gt;- numHabDoble: int&lt;/div&gt;&lt;div&gt;- precioHabSimple: int&lt;/div&gt;&lt;div&gt;- precioHabDoble: int&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-5">
<mxCell id="a_C5hD_1tt0fRA46Nat0-6" value="&lt;div&gt;- &lt;u&gt;id&lt;/u&gt;: int&lt;br&gt;&lt;/div&gt;&lt;div&gt;- nombre: string&lt;/div&gt;&lt;div&gt;- direccion: string&lt;/div&gt;&lt;div&gt;- localidad: string&lt;/div&gt;&lt;div&gt;- provincia: string&lt;/div&gt;&lt;div&gt;- cp: int&lt;/div&gt;&lt;div&gt;- numHabSimple: int&lt;/div&gt;&lt;div&gt;- numHabDoble: int&lt;/div&gt;&lt;div&gt;- precioHabSimple: int&lt;/div&gt;&lt;div&gt;- precioHabDoble: int&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-5" vertex="1">
<mxGeometry y="40" width="160" height="150" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-5">
<mxCell id="a_C5hD_1tt0fRA46Nat0-7" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="a_C5hD_1tt0fRA46Nat0-5" vertex="1">
<mxGeometry y="190" width="160" height="10" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-8" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-5">
<mxCell id="a_C5hD_1tt0fRA46Nat0-8" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-5" vertex="1">
<mxGeometry y="200" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-9" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Cliente&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=42;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-9" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;entidad&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Cliente&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=42;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="850" y="368" width="160" height="162" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-10" value="&lt;div&gt;- nombre: string&lt;/div&gt;&lt;div&gt;- direccion: string&lt;/div&gt;&lt;div&gt;- tlf: string&lt;/div&gt;&lt;div&gt;- &lt;u&gt;email&lt;/u&gt;: string&lt;/div&gt;&lt;div&gt;- clave: string&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-9">
<mxCell id="a_C5hD_1tt0fRA46Nat0-10" value="&lt;div&gt;- nombre: string&lt;/div&gt;&lt;div&gt;- direccion: string&lt;/div&gt;&lt;div&gt;- tlf: string&lt;/div&gt;&lt;div&gt;- &lt;u&gt;email&lt;/u&gt;: string&lt;/div&gt;&lt;div&gt;- clave: string&lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-9" vertex="1">
<mxGeometry y="42" width="160" height="84" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-11" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-9">
<mxCell id="a_C5hD_1tt0fRA46Nat0-11" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="a_C5hD_1tt0fRA46Nat0-9" vertex="1">
<mxGeometry y="126" width="160" height="10" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-12" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-9">
<mxCell id="a_C5hD_1tt0fRA46Nat0-12" value="&amp;nbsp;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-9" vertex="1">
<mxGeometry y="136" width="160" height="26" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;startArrow=diamond;startFill=1;endArrow=open;endFill=0;" edge="1" parent="1" source="a_C5hD_1tt0fRA46Nat0-6" target="a_C5hD_1tt0fRA46Nat0-2">
<mxCell id="a_C5hD_1tt0fRA46Nat0-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;startArrow=diamond;startFill=1;endArrow=open;endFill=0;" parent="1" source="a_C5hD_1tt0fRA46Nat0-6" target="a_C5hD_1tt0fRA46Nat0-2" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-16" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-16" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1130" y="225" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-17" value="reserva" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-17" value="reserva" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1100" y="195" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=none;endFill=0;" edge="1" parent="1" source="a_C5hD_1tt0fRA46Nat0-10" target="a_C5hD_1tt0fRA46Nat0-1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=none;endFill=0;" parent="1" source="a_C5hD_1tt0fRA46Nat0-10" target="a_C5hD_1tt0fRA46Nat0-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-22" value="cliente" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-22" value="cliente" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1010" y="423.5" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-23" value="reserva" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-23" value="reserva" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1180" y="300" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-24" value="1" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-24" value="1" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1010" y="452.5" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-25" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-25" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1240" y="300" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=open;endFill=0;startArrow=diamond;startFill=1;" edge="1" parent="1" source="a_C5hD_1tt0fRA46Nat0-26" target="a_C5hD_1tt0fRA46Nat0-6">
<mxCell id="a_C5hD_1tt0fRA46Nat0-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=open;endFill=0;startArrow=diamond;startFill=1;" parent="1" source="a_C5hD_1tt0fRA46Nat0-26" target="a_C5hD_1tt0fRA46Nat0-6" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endArrow=open;endFill=0;startArrow=diamond;startFill=1;" edge="1" parent="1" source="a_C5hD_1tt0fRA46Nat0-26" target="a_C5hD_1tt0fRA46Nat0-10">
<mxCell id="a_C5hD_1tt0fRA46Nat0-31" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endArrow=open;endFill=0;startArrow=diamond;startFill=1;" parent="1" source="a_C5hD_1tt0fRA46Nat0-26" target="a_C5hD_1tt0fRA46Nat0-10" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-26" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;servicio&amp;gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;repositorio&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;ServicioReservas&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=62;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-26" value="&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;servicio&amp;gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;lt;&amp;lt;repositorio&amp;gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;ServicioReservas&lt;/div&gt;" style="swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=62;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="-10" y="114" width="670" height="196" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-27" value="&lt;div&gt;&amp;nbsp;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-26">
<mxCell id="a_C5hD_1tt0fRA46Nat0-27" value="&lt;div&gt;&amp;nbsp;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-26" vertex="1">
<mxGeometry y="62" width="670" height="24" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-28" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-26">
<mxCell id="a_C5hD_1tt0fRA46Nat0-28" value="" style="line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;strokeColor=inherit;" parent="a_C5hD_1tt0fRA46Nat0-26" vertex="1">
<mxGeometry y="86" width="670" height="10" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-29" value="&lt;div&gt;+ nuevoHotel(h: Hotel)&lt;/div&gt;&lt;div&gt;+ nuevoCliente(c: Cliente)&lt;/div&gt;&lt;div&gt;+ login(email: string, clave: string): Cliente&lt;/div&gt;&lt;div&gt;+ buscarPorLocalidad(localidad: string, fechaInicio: Fecha, fechaFin: Fecha, numHabSimple, int, numHabDoble: int): Hotel[]&lt;/div&gt;&lt;div&gt;+ buscarHotel(nombreParcial: string, localidad: string): Hotel&lt;/div&gt;&lt;div&gt;+ reservar(c: Cliente, h: Hotel, fechaInicio: Fecha, fechaFin: Fecha, numHabSimple: int, numHabDoble: int): Reserva &lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" vertex="1" parent="a_C5hD_1tt0fRA46Nat0-26">
<mxCell id="a_C5hD_1tt0fRA46Nat0-29" value="&lt;div&gt;+ nuevoHotel(h: Hotel)&lt;/div&gt;&lt;div&gt;+ nuevoCliente(c: Cliente)&lt;/div&gt;&lt;div&gt;+ login(email: string, clave: string): Cliente&lt;/div&gt;&lt;div&gt;+ buscarPorLocalidad(localidad: string, fechaInicio: Fecha, fechaFin: Fecha, numHabSimple, int, numHabDoble: int): Hotel[]&lt;/div&gt;&lt;div&gt;+ buscarHotel(nombreParcial: string, localidad: string): Hotel[]&lt;/div&gt;&lt;div&gt;+ reservar(c: Cliente, h: Hotel, fechaInicio: Fecha, fechaFin: Fecha, numHabSimple: int, numHabDoble: int): Reserva &lt;br&gt;&lt;/div&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" parent="a_C5hD_1tt0fRA46Nat0-26" vertex="1">
<mxGeometry y="96" width="670" height="100" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-32" value="hotel" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-32" value="hotel" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="802" y="178" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-33" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-33" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="812" y="210" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-34" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-34" value="*" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="822" y="456.5" width="30" height="30" as="geometry" />
</mxCell>
<mxCell id="a_C5hD_1tt0fRA46Nat0-35" value="cliente" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxCell id="a_C5hD_1tt0fRA46Nat0-35" value="cliente" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="792" y="423.5" width="60" height="30" as="geometry" />
</mxCell>
</root>
......
......@@ -44,5 +44,13 @@ public class Hotel {
public int id() {
return id;
}
}
public String nombre() {
return nombre;
}
public String localidad() {
return localidad;
}
}
......@@ -5,6 +5,7 @@ import es.ujaen.dae.reservahoteles.entidades.Cliente;
import es.ujaen.dae.reservahoteles.entidades.Hotel;
import es.ujaen.dae.reservahoteles.entidades.Reserva;
import es.ujaen.dae.reservahoteles.excepciones.ClienteYaRegistrado;
import es.ujaen.dae.reservahoteles.util.UtilString;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
......@@ -54,10 +55,20 @@ public class ServicioReservas {
throw new UnsupportedOperationException();
}
public Optional<Hotel> buscarHotel(String nombre, String localidad) {
// Por implementar
throw new UnsupportedOperationException();
/**
* Búsqueda de hoteles por nombre o localidad aproximados
* @param nombre el nombre total o parcial del hotel
* @param localidad el nombre total o parcial de la localidad
* @return la lista de hoteles candidatos
*/
public List<Hotel> buscarHotel(String nombre, String localidad) {
var nombreNorm = UtilString.normalizar(nombre);
var localidadNorm = UtilString.normalizar(localidad);
return hoteles.values().stream().filter(h ->
UtilString.normalizar(h.localidad()).contains(localidadNorm) &&
UtilString.normalizar(h.nombre()).contains(nombreNorm))
.toList();
}
public Reserva reserva(Cliente cliente, Hotel hotel,
......
......@@ -7,7 +7,7 @@ import java.text.Normalizer;
* Utilidades para comparación flexible de cadenas
* @author ajrueda
*/
public class UtilidadesCadenas {
public class UtilString {
/**
* Normaliza una cadena pasando a minúsculas, quitando espacios al principio,
* final y duplicados y eliminando acentos.
......
......@@ -2,7 +2,9 @@
package es.ujaen.dae.reservahoteles.servicios;
import es.ujaen.dae.reservahoteles.entidades.Cliente;
import org.assertj.core.api.Assertions;
import es.ujaen.dae.reservahoteles.entidades.Hotel;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
......@@ -25,8 +27,21 @@ public class TestServicioReservas {
var cliente = new Cliente("Pedro", "Jaén Jaén", "611203025", "pjaen@gmail.com", "miClAvE");
servicio.nuevoCliente(cliente);
Assertions.assertThat(servicio.login("ppp@gmail.com", "miClAvE")).isEmpty();
Assertions.assertThat(servicio.login("pjaen@gmail.com", "xyz")).isEmpty();
Assertions.assertThat(servicio.login("pjaen@gmail.com", "miClAvE")).hasValueSatisfying(c -> c.email().equals(cliente.email()));
assertThat(servicio.login("ppp@gmail.com", "miClAvE")).isEmpty();
assertThat(servicio.login("pjaen@gmail.com", "xyz")).isEmpty();
assertThat(servicio.login("pjaen@gmail.com", "miClAvE")).hasValueSatisfying(c -> c.email().equals(cliente.email()));
}
@Test
@DirtiesContext
void testBuscarHotel() {
var hotel1 = new Hotel(1, "Gran Hotel Almería", "Almería", "Almería", 04001, 25, 50, 100, 180);
var hotel2 = new Hotel(2, "Hotel Infanta Cristina", "Jaén", "Jaén", 23009, 30, 60, 120, 200);
servicio.nuevoHotel(hotel1);
servicio.nuevoHotel(hotel2);
List<Hotel> hoteles = servicio.buscarHotel("gran hotel", "almeria");
assertThat(hoteles).containsOnly(hotel1);
}
}
......@@ -14,6 +14,6 @@ import org.junit.jupiter.api.Test;
public class TestUtilidadesCadenas {
@Test
void testNormalizar() {
Assertions.assertThat(UtilidadesCadenas.normalizar(" áÁaaa ´ OO_OO ")).isEqualTo("aaaaa oooo");
Assertions.assertThat(UtilString.normalizar(" áÁaaa ´ OO_OO ")).isEqualTo("aaaaa oooo");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment