Update interfaces to latest version

This commit is contained in:
Patrick Gebhardt 2020-06-16 18:08:28 +02:00
parent d1be826866
commit fd325fa005
5 changed files with 24 additions and 260 deletions

View File

@ -1,11 +1,4 @@
<mat-card class="search-container">
<mat-form-field appearance="outline">
<mat-label>Search</mat-label>
<input #textSearch matInput>
<button (click)="textSearch.value=''" *ngIf="textSearch.value.length>0" mat-icon-button matSuffix>
<mat-icon>clear</mat-icon>
</button>
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Start</mat-label>
<input matInput type="date">
@ -14,14 +7,6 @@
<mat-label>End</mat-label>
<input matInput type="date">
</mat-form-field>
<mat-form-field>
<mat-label>Price</mat-label>
<mat-select value="Budget">
<mat-option value="Budget">Budget</mat-option>
<mat-option value="Mid-Range">Mid-Range</mat-option>
<mat-option value="Luxury">Luxury</mat-option>
</mat-select>
</mat-form-field>
<button (click)="onSearch()" color="primary" mat-flat-button>Search
<mat-icon matSuffix>search</mat-icon>
</button>

View File

@ -1,7 +1,7 @@
/** Represents the structure of a search preset. */
export interface Preset {
preset_id: number;
preset_name: number;
parameter: string;
tag_label: string;
value: number[];
}

View File

@ -1,6 +1,25 @@
/** Represents the structure of a region. */
export interface Region {
/** Database ID */
region_id: number;
/** Name of the region */
name: string;
/** Name of the country */
country: string;
/** Short description of the region */
description: string;
/** Max temperature means per month */
temperature_mean_max: number[];
/** Monthly precipitation */
precipitation: number[];
/** Monthly sun hours */
sun_hours: number[];
/** Monthly rainy days */
rain_days: number[];
/** Average food costs per day */
food_costs: number;
/** Average alcohol costs per day */
alcohol_costs: number;
/** Average accommodation costs per day */
accommodation_costs: number;
}

View File

@ -1,8 +1,7 @@
/** Represents the structure of one search result. */
export interface Result {
region_id: number;
name: string;
country_id: number;
import {Region} from './region.interface';
export interface Result extends Region {
score: number;
scores: Score[];
}

View File

@ -1,242 +1,3 @@
import {Result} from '../interfaces/result.interface';
export const MOCK_RESULT: Result[] = [
{
region_id: 24,
country_id: 20,
name: 'Kuala Lumpur',
scores: [
{
type: 'temperature_mean',
value: 28.1,
score: 10
},
{
type: 'raindays',
value: 13.8,
score: 7.5
}
],
score: 8.75
},
{
region_id: 10,
country_id: 7,
name: 'Shanghai',
scores: [
{
type: 'temperature_mean',
value: 24.8,
score: 6.3
},
{
type: 'raindays',
value: 8.6,
score: 9.4
},
{
type: 'sunhours',
value: 151.2,
score: 2.2
}
],
score: 5.97
},
{
region_id: 3,
country_id: 2,
name: 'Sydney',
scores: [
{
type: 'temperature_mean',
value: 16.8,
score: 0
},
{
type: 'raindays',
value: 6.4,
score: 8.2
},
{
type: 'sunhours',
value: 245.8,
score: 9.5
}
],
score: 5.9
},
{
region_id: 9,
country_id: 7,
name: 'Peking',
scores: [
{
type: 'temperature_mean',
value: 21.1,
score: 4.2
},
{
type: 'raindays',
value: 5.4,
score: 7.1
},
{
type: 'sunhours',
value: 199,
score: 6
}
],
score: 5.77
},
{
region_id: 7,
country_id: 5,
name: 'Toronto',
scores: [
{
type: 'temperature_mean',
value: 16.8,
score: 1.2
},
{
type: 'raindays',
value: 8.4,
score: 9.3
},
{
type: 'sunhours',
value: 206.4,
score: 6.2
}
],
score: 5.57
},
{
region_id: 2,
country_id: 2,
name: 'Melbourne',
scores: [
{
type: 'temperature_mean',
value: 12.3,
score: 0
},
{
type: 'raindays',
value: 8.3,
score: 10
},
{
type: 'sunhours',
value: 187.4,
score: 5.1
}
],
score: 5.03
},
{
region_id: 12,
country_id: 9,
name: 'Kairo',
scores: [
{
type: 'temperature_mean',
value: 27.9,
score: 8.9
},
{
type: 'raindays',
value: 0,
score: 1.1
}
],
score: 5
},
{
region_id: 13,
country_id: 10,
name: 'London',
scores: [
{
type: 'temperature_mean',
value: 16,
score: 0
},
{
type: 'raindays',
value: 8.6,
score: 9.6
},
{
type: 'sunhours',
value: 142.4,
score: 1.9
}
],
score: 3.83
},
{
region_id: 6,
country_id: 4,
name: 'Sao Paolo',
scores: [
{
type: 'temperature_mean',
value: 19.6,
score: 0.8
},
{
type: 'raindays',
value: 4.6,
score: 6
}
],
score: 3.4
},
{
region_id: 11,
country_id: 8,
name: 'Bogota',
scores: [
{
type: 'temperature_mean',
value: 13.7,
score: 0
},
{
type: 'raindays',
value: 9.1,
score: 9.8
},
{
type: 'sunhours',
value: 121.2,
score: 0.1
}
],
score: 3.3
},
{
region_id: 18,
country_id: 15,
name: 'Reykjavik',
scores: [
{
type: 'temperature_mean',
value: 8.6,
score: 0
},
{
type: 'raindays',
value: 13.5,
score: 7.4
},
{
type: 'sunhours',
value: 135.1,
score: 1.7
}
],
score: 3.03
}
];
export const MOCK_RESULT: Result[] = [];