Index: trip-planner-front/node_modules/.cache/babel-webpack/dc1db31b89fcb9a60acad946220957fd.json
===================================================================
--- trip-planner-front/node_modules/.cache/babel-webpack/dc1db31b89fcb9a60acad946220957fd.json	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
+++ trip-planner-front/node_modules/.cache/babel-webpack/dc1db31b89fcb9a60acad946220957fd.json	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -0,0 +1,1 @@
+{"ast":null,"code":"import { FormControl } from '@angular/forms';\nimport { map, startWith, switchMap } from 'rxjs/operators';\nimport { Observable } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"../_services/city.service\";\nimport * as i2 from \"../_services/region.service\";\nimport * as i3 from \"../_services/companion.service\";\nimport * as i4 from \"../_services/cateogry.service\";\nimport * as i5 from \"../_services/location.service\";\nimport * as i6 from \"@angular/common\";\nimport * as i7 from \"@angular/material/form-field\";\nimport * as i8 from \"@angular/material/input\";\nimport * as i9 from \"@angular/forms\";\nimport * as i10 from \"@angular/material/autocomplete\";\nimport * as i11 from \"@angular/material/select\";\nimport * as i12 from \"@angular/material/chips\";\nimport * as i13 from \"@angular/material/button\";\nimport * as i14 from \"@angular/material/core\";\nimport * as i15 from \"@angular/material/icon\";\n\nfunction LocationsFormComponent_div_9_mat_option_8_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 16);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const city_r7 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", city_r7.id)(\"value\", city_r7.id);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate1(\" \", city_r7.name, \"\");\n  }\n}\n\nfunction LocationsFormComponent_div_9_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r9 = i0.ɵɵgetCurrentView();\n\n    i0.ɵɵelementStart(0, \"div\");\n    i0.ɵɵelementStart(1, \"label\");\n    i0.ɵɵelementStart(2, \"h5\");\n    i0.ɵɵtext(3, \"Please select a city\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(4, \"mat-form-field\", 5);\n    i0.ɵɵelementStart(5, \"mat-label\");\n    i0.ɵɵtext(6, \"Please select a city\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"mat-select\", 15);\n    i0.ɵɵlistener(\"ngModelChange\", function LocationsFormComponent_div_9_Template_mat_select_ngModelChange_7_listener($event) {\n      i0.ɵɵrestoreView(_r9);\n      const ctx_r8 = i0.ɵɵnextContext();\n      return ctx_r8.cityId = $event;\n    });\n    i0.ɵɵtemplate(8, LocationsFormComponent_div_9_mat_option_8_Template, 2, 3, \"mat-option\", 9);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const ctx_r0 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(7);\n    i0.ɵɵproperty(\"ngModel\", ctx_r0.cityId);\n    i0.ɵɵadvance(1);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r0.cities);\n  }\n}\n\nfunction LocationsFormComponent_mat_option_16_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 16);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const option_r10 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", option_r10);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate1(\" \", option_r10, \" \");\n  }\n}\n\nfunction LocationsFormComponent_div_18_mat_option_8_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 16);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const region_r12 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", region_r12.id)(\"value\", region_r12.id);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate1(\" \", region_r12.name, \"\");\n  }\n}\n\nfunction LocationsFormComponent_div_18_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r14 = i0.ɵɵgetCurrentView();\n\n    i0.ɵɵelementStart(0, \"div\");\n    i0.ɵɵelementStart(1, \"label\");\n    i0.ɵɵelementStart(2, \"h5\");\n    i0.ɵɵtext(3, \"Please select a region\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(4, \"mat-form-field\", 5);\n    i0.ɵɵelementStart(5, \"mat-label\");\n    i0.ɵɵtext(6, \"Please select a region\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"mat-select\", 17);\n    i0.ɵɵlistener(\"ngModelChange\", function LocationsFormComponent_div_18_Template_mat_select_ngModelChange_7_listener($event) {\n      i0.ɵɵrestoreView(_r14);\n      const ctx_r13 = i0.ɵɵnextContext();\n      return ctx_r13.regionId = $event;\n    });\n    i0.ɵɵtemplate(8, LocationsFormComponent_div_18_mat_option_8_Template, 2, 3, \"mat-option\", 9);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const ctx_r3 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(7);\n    i0.ɵɵproperty(\"ngModel\", ctx_r3.regionId);\n    i0.ɵɵadvance(1);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r3.regions);\n  }\n}\n\nfunction LocationsFormComponent_mat_option_25_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 16);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const companion_r15 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", companion_r15.id);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate(companion_r15.type);\n  }\n}\n\nfunction LocationsFormComponent_mat_chip_35_mat_icon_2_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-icon\");\n    i0.ɵɵtext(1, \"check\");\n    i0.ɵɵelementEnd();\n  }\n}\n\nfunction LocationsFormComponent_mat_chip_35_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r20 = i0.ɵɵgetCurrentView();\n\n    i0.ɵɵelementStart(0, \"mat-chip\", 18, 19);\n    i0.ɵɵlistener(\"click\", function LocationsFormComponent_mat_chip_35_Template_mat_chip_click_0_listener() {\n      const restoredCtx = i0.ɵɵrestoreView(_r20);\n      const category_r16 = restoredCtx.$implicit;\n\n      const _r17 = i0.ɵɵreference(1);\n\n      const ctx_r19 = i0.ɵɵnextContext();\n      return ctx_r19.toggleSelection(_r17, category_r16);\n    });\n    i0.ɵɵtemplate(2, LocationsFormComponent_mat_chip_35_mat_icon_2_Template, 2, 0, \"mat-icon\", 4);\n    i0.ɵɵtext(3);\n    i0.ɵɵelementEnd();\n  }\n\n  if (rf & 2) {\n    const category_r16 = ctx.$implicit;\n\n    const _r17 = i0.ɵɵreference(1);\n\n    i0.ɵɵadvance(2);\n    i0.ɵɵproperty(\"ngIf\", !_r17.selected);\n    i0.ɵɵadvance(1);\n    i0.ɵɵtextInterpolate1(\" \", category_r16.name, \" \");\n  }\n}\n\nexport class LocationsFormComponent {\n  constructor(cityService, regionService, companionService, categoryService, locationService) {\n    this.cityService = cityService;\n    this.regionService = regionService;\n    this.companionService = companionService;\n    this.categoryService = categoryService;\n    this.locationService = locationService;\n    this.myControl = new FormControl();\n    this.disableSelect = new FormControl(false);\n    this.cityOption = false;\n    this.regionOption = false;\n    this.filteredOptions = new Observable();\n    this.cities = [];\n    this.regions = [];\n    this.companions = [];\n    this.categories = [];\n    this.chipsSeletion = [];\n    this.locationId = 0;\n    this.companionId = 0;\n    this.lengthOfStay = 1;\n    this.categoryIds = '';\n    this.regionId = 0;\n    this.cityId = 0;\n    this.value = 0;\n    this.max = 30;\n  }\n\n  ngOnInit() {\n    this.filteredOptions = this.myControl.valueChanges.pipe(startWith(''), switchMap(val => {\n      return this.filter(val || '');\n    }));\n    this.cityService.getAllCities().subscribe(data => {\n      this.cities = data;\n    });\n    this.regionService.getAllRegions().subscribe(data => {\n      this.regions = data;\n    });\n    this.categoryService.getAllCategories().subscribe(data => {\n      this.categories = data;\n    });\n    this.companionService.getAllCompanions().subscribe(data => {\n      this.companions = data;\n    });\n  }\n\n  filter(val) {\n    // call the service which makes the http-request\n    return this.cityService.getAllCities().pipe(map(response => response.filter(option => {\n      return option.name.toLowerCase().indexOf(val.toLowerCase()) === 0;\n    })));\n  }\n\n  toggleSelection(chip, category) {\n    chip.toggleSelected();\n\n    if (this.chipsSeletion.length > 0) {\n      if (this.chipsSeletion.indexOf(category.id) <= -1) {\n        this.chipsSeletion.push(category.id);\n      } else {\n        const index = this.chipsSeletion.indexOf(category.id);\n        this.chipsSeletion.splice(index, 1);\n      }\n    } else {\n      this.chipsSeletion.push(category.id);\n    }\n\n    console.log(this.chipsSeletion);\n  }\n\n  createMyPlanner() {\n    this.categoryIds = this.chipsSeletion.join(',');\n    console.log(this.categoryIds);\n\n    if (this.cityOption) {\n      this.locationService.getLocationsFromCity(this.cityId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(result => {\n        console.log(result);\n      });\n    } else if (this.regionOption) {\n      this.locationService.getLocationsFromRegion(this.regionId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(result => {\n        console.log(result);\n      });\n    }\n  }\n\n  chooseCityOption() {\n    this.cityOption = true;\n    this.regionOption = false;\n  }\n\n  chooseRegionOption() {\n    this.regionOption = true;\n    this.cityOption = false;\n  }\n\n  constraintMaxNumberDays() {\n    if (this.value > this.max) {\n      this.value = this.max;\n    }\n  }\n\n}\n\nLocationsFormComponent.ɵfac = function LocationsFormComponent_Factory(t) {\n  return new (t || LocationsFormComponent)(i0.ɵɵdirectiveInject(i1.CityService), i0.ɵɵdirectiveInject(i2.RegionService), i0.ɵɵdirectiveInject(i3.CompanionService), i0.ɵɵdirectiveInject(i4.CategoryService), i0.ɵɵdirectiveInject(i5.LocationService));\n};\n\nLocationsFormComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n  type: LocationsFormComponent,\n  selectors: [[\"app-locations-form\"]],\n  decls: 39,\n  vars: 11,\n  consts: [[\"href\", \"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css\", \"rel\", \"stylesheet\", \"integrity\", \"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x\", \"crossorigin\", \"anonymous\"], [1, \"example-form\"], [1, \"form-group\"], [1, \"btn\", 3, \"click\"], [4, \"ngIf\"], [\"appearance\", \"fill\", 1, \"example-full-width\"], [\"type\", \"text\", \"placeholder\", \"Pick one\", \"aria-label\", \"Number\", \"matInput\", \"\", 3, \"formControl\", \"matAutocomplete\"], [\"autoActiveFirstOption\", \"\"], [\"auto\", \"matAutocomplete\"], [3, \"value\", 4, \"ngFor\", \"ngForOf\"], [\"placeholder\", \"Please select a companion\", 3, \"ngModel\", \"ngModelChange\"], [\"matInput\", \"\", \"placeholder\", \"No. Days\", \"type\", \"number\", \"min\", \"1\", \"value\", \"0\", \"max\", \"30\", 3, \"constraintMaxNumberDays()\", \"ngModel\", \"ngModelChange\"], [\"selectable\", \"\", \"multiple\", \"\"], [\"selected\", \"\", 3, \"click\", 4, \"ngFor\", \"ngForOf\"], [\"mat-raised-button\", \"\", \"color\", \"primary\", 3, \"click\"], [\"placeholder\", \"Select city\", 3, \"ngModel\", \"ngModelChange\"], [3, \"value\"], [\"placeholder\", \"Select region\", 3, \"ngModel\", \"ngModelChange\"], [\"selected\", \"\", 3, \"click\"], [\"c\", \"matChip\"]],\n  template: function LocationsFormComponent_Template(rf, ctx) {\n    if (rf & 1) {\n      i0.ɵɵelement(0, \"link\", 0);\n      i0.ɵɵelementStart(1, \"div\", 1);\n      i0.ɵɵelementStart(2, \"div\", 2);\n      i0.ɵɵelementStart(3, \"button\", 3);\n      i0.ɵɵlistener(\"click\", function LocationsFormComponent_Template_button_click_3_listener() {\n        return ctx.chooseCityOption();\n      });\n      i0.ɵɵtext(4, \" City \");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(5, \"button\", 3);\n      i0.ɵɵlistener(\"click\", function LocationsFormComponent_Template_button_click_5_listener() {\n        return ctx.chooseRegionOption();\n      });\n      i0.ɵɵtext(6, \" Region \");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementEnd();\n      i0.ɵɵelement(7, \"br\");\n      i0.ɵɵelement(8, \"br\");\n      i0.ɵɵtemplate(9, LocationsFormComponent_div_9_Template, 9, 2, \"div\", 4);\n      i0.ɵɵelementStart(10, \"mat-form-field\", 5);\n      i0.ɵɵelementStart(11, \"mat-label\");\n      i0.ɵɵtext(12, \"Number\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelement(13, \"input\", 6);\n      i0.ɵɵelementStart(14, \"mat-autocomplete\", 7, 8);\n      i0.ɵɵtemplate(16, LocationsFormComponent_mat_option_16_Template, 2, 2, \"mat-option\", 9);\n      i0.ɵɵpipe(17, \"async\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementEnd();\n      i0.ɵɵtemplate(18, LocationsFormComponent_div_18_Template, 9, 2, \"div\", 4);\n      i0.ɵɵelementStart(19, \"h5\");\n      i0.ɵɵtext(20, \"Who are you travelling with? \");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(21, \"mat-form-field\", 5);\n      i0.ɵɵelementStart(22, \"mat-label\");\n      i0.ɵɵtext(23, \"Please select a companion\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(24, \"mat-select\", 10);\n      i0.ɵɵlistener(\"ngModelChange\", function LocationsFormComponent_Template_mat_select_ngModelChange_24_listener($event) {\n        return ctx.companionId = $event;\n      });\n      i0.ɵɵtemplate(25, LocationsFormComponent_mat_option_25_Template, 2, 2, \"mat-option\", 9);\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(26, \"h5\");\n      i0.ɵɵtext(27, \"How many days are you willing to stay ?\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(28, \"mat-form-field\", 5);\n      i0.ɵɵelementStart(29, \"mat-label\");\n      i0.ɵɵtext(30, \"Please select a number of days\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(31, \"input\", 11);\n      i0.ɵɵlistener(\"ngModelChange\", function LocationsFormComponent_Template_input_ngModelChange_31_listener($event) {\n        return ctx.lengthOfStay = $event;\n      });\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(32, \"h5\");\n      i0.ɵɵtext(33, \"What are your priorities to visit?\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementStart(34, \"mat-chip-list\", 12);\n      i0.ɵɵtemplate(35, LocationsFormComponent_mat_chip_35_Template, 4, 2, \"mat-chip\", 13);\n      i0.ɵɵelementEnd();\n      i0.ɵɵelement(36, \"br\");\n      i0.ɵɵelementStart(37, \"button\", 14);\n      i0.ɵɵlistener(\"click\", function LocationsFormComponent_Template_button_click_37_listener() {\n        return ctx.createMyPlanner();\n      });\n      i0.ɵɵtext(38, \"Create my planner\");\n      i0.ɵɵelementEnd();\n      i0.ɵɵelementEnd();\n    }\n\n    if (rf & 2) {\n      const _r1 = i0.ɵɵreference(15);\n\n      i0.ɵɵadvance(9);\n      i0.ɵɵproperty(\"ngIf\", ctx.cityOption);\n      i0.ɵɵadvance(4);\n      i0.ɵɵproperty(\"formControl\", ctx.myControl)(\"matAutocomplete\", _r1);\n      i0.ɵɵadvance(3);\n      i0.ɵɵproperty(\"ngForOf\", i0.ɵɵpipeBind1(17, 9, ctx.filteredOptions));\n      i0.ɵɵadvance(2);\n      i0.ɵɵproperty(\"ngIf\", ctx.regionOption);\n      i0.ɵɵadvance(6);\n      i0.ɵɵproperty(\"ngModel\", ctx.companionId);\n      i0.ɵɵadvance(1);\n      i0.ɵɵproperty(\"ngForOf\", ctx.companions);\n      i0.ɵɵadvance(6);\n      i0.ɵɵproperty(\"ngModel\", ctx.lengthOfStay);\n      i0.ɵɵadvance(4);\n      i0.ɵɵproperty(\"ngForOf\", ctx.categories);\n    }\n  },\n  directives: [i6.NgIf, i7.MatFormField, i7.MatLabel, i8.MatInput, i9.DefaultValueAccessor, i10.MatAutocompleteTrigger, i9.NgControlStatus, i9.FormControlDirective, i10.MatAutocomplete, i6.NgForOf, i11.MatSelect, i9.NgModel, i9.MinValidator, i9.MaxValidator, i9.NumberValueAccessor, i12.MatChipList, i13.MatButton, i14.MatOption, i12.MatChip, i15.MatIcon],\n  pipes: [i6.AsyncPipe],\n  styles: [\".example-form[_ngcontent-%COMP%] {\\r\\n  min-width: 150px;\\r\\n  max-width: 380px;\\r\\n  width: 100%;\\r\\n}\\r\\n\\r\\n.example-full-width[_ngcontent-%COMP%] {\\r\\n  width: 100%;\\r\\n}\\r\\n\\r\\nmat-icon[_ngcontent-%COMP%] {\\r\\n  height: 20px;\\r\\n  width: 20px;\\r\\n  font-size: 20px;\\r\\n  margin-right: 5px;\\r\\n}\\r\\n\\r\\nbutton[_ngcontent-%COMP%]{\\r\\n  float: right;\\r\\n}\\r\\n\\r\\n.colorClass[_ngcontent-%COMP%]{\\r\\n  color:yellow;\\r\\n}\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxvY2F0aW9ucy1mb3JtLmNvbXBvbmVudC5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxnQkFBZ0I7RUFDaEIsZ0JBQWdCO0VBQ2hCLFdBQVc7QUFDYjs7QUFFQTtFQUNFLFdBQVc7QUFDYjs7QUFFQTtFQUNFLFlBQVk7RUFDWixXQUFXO0VBQ1gsZUFBZTtFQUNmLGlCQUFpQjtBQUNuQjs7QUFDQTtFQUNFLFlBQVk7QUFDZDs7QUFFQTtFQUNFLFlBQVk7QUFDZCIsImZpbGUiOiJsb2NhdGlvbnMtZm9ybS5jb21wb25lbnQuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmV4YW1wbGUtZm9ybSB7XHJcbiAgbWluLXdpZHRoOiAxNTBweDtcclxuICBtYXgtd2lkdGg6IDM4MHB4O1xyXG4gIHdpZHRoOiAxMDAlO1xyXG59XHJcblxyXG4uZXhhbXBsZS1mdWxsLXdpZHRoIHtcclxuICB3aWR0aDogMTAwJTtcclxufVxyXG5cclxubWF0LWljb24ge1xyXG4gIGhlaWdodDogMjBweDtcclxuICB3aWR0aDogMjBweDtcclxuICBmb250LXNpemU6IDIwcHg7XHJcbiAgbWFyZ2luLXJpZ2h0OiA1cHg7XHJcbn1cclxuYnV0dG9ue1xyXG4gIGZsb2F0OiByaWdodDtcclxufVxyXG5cclxuLmNvbG9yQ2xhc3N7XHJcbiAgY29sb3I6eWVsbG93O1xyXG59Il19 */\"]\n});","map":{"version":3,"sources":["C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\src\\app\\locations-form\\locations-form.component.ts","C:\\Users\\DELL\\Desktop\\bachelor-thesis\\trip-planner-front\\src\\app\\locations-form\\locations-form.component.html"],"names":[],"mappings":"AACA,SAAS,WAAT,QAA4B,gBAA5B;AACA,SAAQ,GAAR,EAAa,SAAb,EAAwB,SAAxB,QAAwC,gBAAxC;AACA,SAAkB,UAAlB,QAAmC,MAAnC;;;;;;;;;;;;;;;;;;;;ACkCQ,IAAA,EAAA,CAAA,cAAA,CAAA,CAAA,EAAA,YAAA,EAAA,EAAA;AAA6E,IAAA,EAAA,CAAA,MAAA,CAAA,CAAA;AAAa,IAAA,EAAA,CAAA,YAAA;;;;;AAA9E,IAAA,EAAA,CAAA,UAAA,CAAA,OAAA,EAAA,OAAA,CAAA,EAAA,EAAiB,OAAjB,EAAiB,OAAA,CAAA,EAAjB;AAAiE,IAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,IAAA,EA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A;AAgBG,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,aAAA,EAAA,GAAA,CAAA,SAAA,EAAyB,iBAAzB,EAAyB,GAAzB;AAG0B,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA,EAAA,CAAA,WAAA,CAAA,EAAA,EAAA,CAAA,EAAA,GAAA,CAAA,eAAA,CAAA;AAM7B,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,MAAA,EAAA,GAAA,CAAA,YAAA;AAaQ,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA,GAAA,CAAA,WAAA;AAC+C,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA,GAAA,CAAA,UAAA;AAOkD,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA,GAAA,CAAA,YAAA;AAKxD,MAAA,EAAA,CAAA,SAAA,CAAA,CAAA;AAAA,MAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA,GAAA,CAAA,UAAA","sourcesContent":["import { Component, Injectable, OnInit } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport {map, startWith, switchMap} from 'rxjs/operators';\nimport {forkJoin, Observable} from 'rxjs';\nimport { CityService } from '../_services/city.service';\nimport { City } from '../_models/city';\nimport { Country } from '../_models/country';\nimport { CountryService } from '../_services/country.service';\nimport { Companion } from '../_models/companion';\nimport { CompanionService } from '../_services/companion.service';\nimport { Category } from '../_models/category';\nimport { CategoryService } from '../_services/cateogry.service';\nimport {CdkDragDrop, moveItemInArray} from '@angular/cdk/drag-drop';\nimport { MatChip } from '@angular/material/chips';\nimport { LocationService } from '../_services/location.service';\nimport { Region } from '../_models/region';\nimport { RegionService } from '../_services/region.service';\n\n@Component({\n  selector: 'app-locations-form',\n  templateUrl: './locations-form.component.html',\n  styleUrls: ['./locations-form.component.css']\n})\nexport class LocationsFormComponent implements OnInit {\n\n  myControl = new FormControl();\n  cities: City[];\n  regions: Region[];\n  companions: Companion[];\n  categories: Category[];\n  filteredOptions: Observable<City[]>;\n  disableSelect = new FormControl(false);\n  chipsSeletion: number[];\n  categoryIds: string;\n  locationId: number;\n  regionId: number;\n  cityId: number;\n  companionId: number;\n  lengthOfStay: number;\n  cityOption: boolean = false;\n  regionOption: boolean = false;\n  value:number;\n  max: number;\n\n  constructor(private cityService : CityService, private regionService: RegionService,\n              private companionService : CompanionService, private categoryService : CategoryService,\n              private locationService: LocationService){\n    this.filteredOptions = new Observable<City[]>();\n    this.cities = [];\n    this.regions = [];\n    this.companions = [];\n    this.categories = [];\n    this.chipsSeletion = [];\n    this.locationId = 0;\n    this.companionId = 0;\n    this.lengthOfStay = 1;\n    this.categoryIds = '';\n    this.regionId = 0;\n    this.cityId = 0;\n    this.value = 0;\n    this.max = 30;\n  }\n  \n  ngOnInit() :void {\n    this.filteredOptions = this.myControl.valueChanges\n    .pipe(\n      startWith(''),\n      switchMap(val => {\n        return this.filter(val || '')\n      })       \n    );\n\n    this.cityService.getAllCities().subscribe(\n      data => {\n        this.cities = data;\n      }\n    );\n\n    this.regionService.getAllRegions().subscribe(\n      data => {\n        this.regions = data;\n      }\n    );\n\n    this.categoryService.getAllCategories().subscribe(\n      data => {\n        this.categories = data;\n      }\n    );\n\n    this.companionService.getAllCompanions().subscribe(\n      data => {\n        this.companions = data;\n      }\n    )\n  }\n  \n  filter(val: string): Observable<City[]> {\n  // call the service which makes the http-request\n    return this.cityService.getAllCities()\n    .pipe(\n    map(response => response.filter(option => { \n      return option.name.toLowerCase().indexOf(val.toLowerCase()) === 0\n    }))\n  )\n  \n }  \n\n toggleSelection(chip: MatChip, category: Category){\n  chip.toggleSelected();\n  if(this.chipsSeletion.length > 0){\n    if(this.chipsSeletion.indexOf(category.id) <= -1){\n      this.chipsSeletion.push(category.id);\n    }else{\n      const index = this.chipsSeletion.indexOf(category.id);\n      this.chipsSeletion.splice(index, 1);\n    }\n  }else{\n    this.chipsSeletion.push(category.id);\n  }\n  console.log(this.chipsSeletion);\n }\n\n\n createMyPlanner(){\n   this.categoryIds = this.chipsSeletion.join(',');\n   console.log(this.categoryIds);\n   \n   if(this.cityOption){\n    this.locationService.getLocationsFromCity(this.cityId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(\n      result => {\n        console.log(result);\n      }\n    );\n   }else if(this.regionOption){\n \n    this.locationService.getLocationsFromRegion(this.regionId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(\n      result => {\n        console.log(result);\n      }\n    );\n   }\n   \n  \n }\n chooseCityOption(){\n   this.cityOption = true;\n   this.regionOption = false;\n }\n  chooseRegionOption() {\n    this.regionOption = true;\n    this.cityOption = false;\n  }\n\n  constraintMaxNumberDays(){\n     if(this.value > this.max){\n       this.value = this.max;\n     }\n  }\n}\n","<link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x\" crossorigin=\"anonymous\">\n\n<div class=\"example-form\">\n\n  <div class=\"form-group\">\n    <button class=\"btn\" (click)=\"chooseCityOption()\" >\n      City\n    </button>\n    <button class=\"btn\" (click)=\"chooseRegionOption()\">\n      Region\n    </button>\n  </div>\n  <br>\n  <br>\n  <!--\n  <mat-form-field class=\"example-full-width\" appearance=\"fill\">\n    <mat-label>Please select a place</mat-label>\n    <input type=\"text\"\n           placeholder=\"Pick one\"\n           aria-label=\"Place\"\n           matInput\n           [formControl]=\"myControl\"\n           [matAutocomplete]=\"auto\">\n    <mat-autocomplete autoActiveFirstOption  #auto=\"matAutocomplete\">\n      <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option.name\">\n        {{option.name}}\n      </mat-option>\n    </mat-autocomplete>\n  </mat-form-field>\n  -->\n\n\n  <div *ngIf=\"cityOption\">\n    <label><h5>Please select a city</h5></label>\n    <mat-form-field appearance=\"fill\" class=\"example-full-width\">\n      <mat-label>Please select a city</mat-label>\n      <mat-select [(ngModel)]=\"cityId\" placeholder=\"Select city\">\n        <mat-option [value]=\"city.id\" *ngFor=\"let city of cities\" [value]=\"city.id\"> {{city.name}}</mat-option>\n      </mat-select>\n    </mat-form-field>\n  </div>\n\n  <mat-form-field class=\"example-full-width\" appearance=\"fill\">\n    <mat-label>Number</mat-label>\n    <input type=\"text\"\n           placeholder=\"Pick one\"\n           aria-label=\"Number\"\n           matInput\n           [formControl]=\"myControl\"\n           [matAutocomplete]=\"auto\">\n    <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\n      <mat-option *ngFor=\"let option of filteredOptions | async\" [value]=\"option\">\n        {{option}}\n      </mat-option>\n    </mat-autocomplete>\n  </mat-form-field>\n\n  <div *ngIf=\"regionOption\">\n    <label><h5>Please select a region</h5></label>\n    <mat-form-field appearance=\"fill\" class=\"example-full-width\">\n      <mat-label>Please select a region</mat-label>\n      <mat-select [(ngModel)]=\"regionId\" placeholder=\"Select region\">\n        <mat-option [value]=\"region.id\" *ngFor=\"let region of regions\" [value]=\"region.id\"> {{region.name}}</mat-option>\n      </mat-select>\n    </mat-form-field>\n  </div>\n\n  <h5>Who are you travelling with?  </h5>\n  <mat-form-field appearance=\"fill\" class=\"example-full-width\">\n    <mat-label>Please select a companion</mat-label>\n    <mat-select [(ngModel)]=\"companionId\" placeholder=\"Please select a companion\">\n      <mat-option [value]=\"companion.id\" *ngFor=\"let companion of companions\">{{companion.type}}</mat-option>\n    </mat-select>\n  </mat-form-field>\n\n  <h5>How many days are you willing to stay ?</h5>\n  <mat-form-field class=\"example-full-width\" appearance=\"fill\">\n    <mat-label>Please select a number of days</mat-label>\n    <input matInput placeholder=\"No. Days\"  type=\"number\" min=\"1\" value=\"0\" max=\"30\" [constraintMaxNumberDays()] [(ngModel)]=\"lengthOfStay\">\n  </mat-form-field>\n\n   <h5>What are your priorities to visit?</h5> \n  <mat-chip-list  selectable multiple>\n    <mat-chip #c=\"matChip\" selected *ngFor=\"let category of categories\" \n    (click)=\"toggleSelection(c, category)\">\n  <mat-icon *ngIf=\"!c.selected\" >check</mat-icon>\n  {{category.name}}\n  </mat-chip>\n  </mat-chip-list>\n  <br>\n  <button mat-raised-button color=\"primary\" (click)=\"createMyPlanner()\">Create my planner</button>\n\n</div>\n  "],"sourceRoot":""},"metadata":{},"sourceType":"module"}
Index: trip-planner-front/src/app/_services/location.service.ts
===================================================================
--- trip-planner-front/src/app/_services/location.service.ts	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner-front/src/app/_services/location.service.ts	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -9,7 +9,12 @@
     constructor(private httpClient : HttpClient){}
 
-    getAllPlaces(locationId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Object[]>{
-        let url = "http://localhost:8080/api/trip/locations";
-        return this.httpClient.get<Location[]>(url + '?locationId=' + locationId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
+    getLocationsFromCity(cityId: number, companionId: number, lengthOfStay: number, categoryIds: string): Observable<Object[]>{
+        let url = "http://localhost:8080/api/city/locations";
+        return this.httpClient.get<Location[]>(url + '?cityId=' + cityId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
+    }
+
+    getLocationsFromRegion(regionId: number, companionId: number, lengthOfStay: number, categoryIds: string):Observable<Object[]>{
+        let url = "http://localhost:8080/api/region/locations";
+        return this.httpClient.get<Location[]>(url + '?regionId=' + regionId + '&companionId=' + companionId + '&lengthOfStay=' + lengthOfStay + '&categoryIds='+ categoryIds);
     }
 }
Index: trip-planner-front/src/app/locations-form/locations-form.component.css
===================================================================
--- trip-planner-front/src/app/locations-form/locations-form.component.css	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner-front/src/app/locations-form/locations-form.component.css	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -18,2 +18,6 @@
   float: right;
 }
+
+.colorClass{
+  color:yellow;
+}
Index: trip-planner-front/src/app/locations-form/locations-form.component.html
===================================================================
--- trip-planner-front/src/app/locations-form/locations-form.component.html	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner-front/src/app/locations-form/locations-form.component.html	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -3,5 +3,5 @@
 <div class="example-form">
 
-  <div class="d-block">
+  <div class="form-group">
     <button class="btn" (click)="chooseCityOption()" >
       City
@@ -35,9 +35,10 @@
     <mat-form-field appearance="fill" class="example-full-width">
       <mat-label>Please select a city</mat-label>
-      <mat-select [(ngModel)]="locationId" placeholder="Select city">
+      <mat-select [(ngModel)]="cityId" placeholder="Select city">
         <mat-option [value]="city.id" *ngFor="let city of cities" [value]="city.id"> {{city.name}}</mat-option>
       </mat-select>
     </mat-form-field>
   </div>
+
 
   <div *ngIf="regionOption">
@@ -62,5 +63,5 @@
   <mat-form-field class="example-full-width" appearance="fill">
     <mat-label>Please select a number of days</mat-label>
-    <input matInput placeholder="No. Days"  type="number" [(ngModel)]="lengthOfStay">
+    <input matInput placeholder="No. Days"  type="number" min="1" value="0" max="30" [constraintMaxNumberDays()] [(ngModel)]="lengthOfStay">
   </mat-form-field>
 
@@ -68,11 +69,11 @@
   <mat-chip-list  selectable multiple>
     <mat-chip #c="matChip" selected *ngFor="let category of categories" 
-    (click)="toggleSelection(c, category)" >
+    (click)="toggleSelection(c, category)">
   <mat-icon *ngIf="!c.selected" >check</mat-icon>
   {{category.name}}
   </mat-chip>
   </mat-chip-list>
+  <br>
   <button mat-raised-button color="primary" (click)="createMyPlanner()">Create my planner</button>
-
 
 </div>
Index: trip-planner-front/src/app/locations-form/locations-form.component.ts
===================================================================
--- trip-planner-front/src/app/locations-form/locations-form.component.ts	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner-front/src/app/locations-form/locations-form.component.ts	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -35,8 +35,11 @@
   locationId: number;
   regionId: number;
+  cityId: number;
   companionId: number;
   lengthOfStay: number;
   cityOption: boolean = false;
   regionOption: boolean = false;
+  value:number;
+  max: number;
 
   constructor(private cityService : CityService, private regionService: RegionService,
@@ -54,4 +57,7 @@
     this.categoryIds = '';
     this.regionId = 0;
+    this.cityId = 0;
+    this.value = 0;
+    this.max = 30;
   }
   
@@ -119,10 +125,22 @@
  createMyPlanner(){
    this.categoryIds = this.chipsSeletion.join(',');
-   console.log(this.companionId);
-   this.locationService.getAllPlaces(this.locationId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
-     result => {
-       console.log(result);
-     }
-   );
+   console.log(this.categoryIds);
+   
+   if(this.cityOption){
+    this.locationService.getLocationsFromCity(this.cityId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
+      result => {
+        console.log(result);
+      }
+    );
+   }else if(this.regionOption){
+ 
+    this.locationService.getLocationsFromRegion(this.regionId, this.companionId, this.lengthOfStay, this.categoryIds).subscribe(
+      result => {
+        console.log(result);
+      }
+    );
+   }
+   
+  
  }
  chooseCityOption(){
@@ -134,3 +152,9 @@
     this.cityOption = false;
   }
+
+  constraintMaxNumberDays(){
+     if(this.value > this.max){
+       this.value = this.max;
+     }
+  }
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/repository/jpa/JpaLocationRepository.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -46,15 +46,34 @@
 
     @Query(value = "SELECT  * FROM locations AS l  " +
-            "LEFT JOIN recommended_companion AS rc ON l.id_location = rc.id_location " +
-            "LEFT JOIN companions AS com ON rc.id_companion = com.id_companion " +
-            "LEFT JOIN locations_belong lb ON l.id_location = lb.id_location " +
-            "LEFT JOIN categories AS cate ON lb.id_category = cate.id_category " +
-            "LEFT JOIN regions AS r" +
-            " ON l.id_region = r.id_region" +
-            " LEFT JOIN cities AS cit" +
-            " ON r.id_region = cit.id_region AND cit.id_city = l.id_city " +
-            "WHERE cit.id_city = :locationId and com.id_companion = :companionId and cate.id_category in (:categories) " +
-            "GROUP BY l.id_location " +
-            "ORDER BY CASE l.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
-    List<Location> findLocationsFromForm(@Param("locationId") Long locationId, @Param("companionId") Long companionId, @Param("categories") List<Long> categories);
+            "LEFT JOIN recommended_companion AS rc " +
+            "ON l.id_location = rc.id_location " +
+            "LEFT JOIN companions AS companion " +
+            "ON rc.id_companion = companion.id_companion " +
+            "LEFT JOIN locations_belong lb " +
+            "ON l.id_location = lb.id_location " +
+            "LEFT JOIN categories AS category " +
+            "ON lb.id_category = category.id_category " +
+            "LEFT JOIN cities AS city " +
+            "ON city.id_city = l.id_city " +
+            "WHERE city.id_city = :cityId and companion.id_companion = :companionId and category.id_category IN (:categoryIds) " +
+            "GROUP BY l.id_location ORDER BY CASE l.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
+    List<Location> findLocationsFromCityForm(@Param("cityId") Long cityId, @Param("companionId") Long companionId, @Param("categoryIds") List<Long> categoryIds);
+
+    @Query(value="SELECT * FROM locations AS location " +
+            "LEFT JOIN recommended_companion AS rc " +
+            "ON location.id_location = rc.id_location " +
+            "LEFT JOIN companions AS companion " +
+            "ON rc.id_companion = companion.id_companion " +
+            "LEFT JOIN locations_belong lb " +
+            "ON location.id_location = lb.id_location " +
+            "LEFT JOIN categories AS category " +
+            "ON lb.id_category = category.id_category " +
+            "LEFT JOIN regions AS region " +
+            "ON location.id_region = region.id_region " +
+            "LEFT JOIN cities AS city " +
+            "ON region.id_region  = city.id_region " +
+            "AND city.id_city = location.id_city " +
+            "WHERE region.id_region = :regionId AND companion.id_companion  = :companionId AND category.id_category  IN (:categoryIds) " +
+            "GROUP BY location.id_location ORDER BY CASE location.priority WHEN 'high' THEN 1 WHEN 'medium' THEN 2 WHEN 'low' THEN 3 END", nativeQuery = true)
+    List<Location> findLocationsFromRegionForm(@Param("regionId") Long regionId, @Param("companionId") Long companionId, @Param("categoryIds") List<Long> categoryIds);
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/LocationService.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -10,10 +10,10 @@
 public interface LocationService {
     List<Location> findLocationsFromCity(String locName, String companion, List<String> categories);
+    List<Location> findLocationsFromCountry (String locName, String companion,String region, List<String> categories );
     List<Location> findAll();
     Location getById(Long id);
-    List<Location> findLocationsFromCountry (String locName, String companion,String region, List<String> categories );
     List<Location> scheduleLocations(String locName, String companion,String region, List<String> categories, int numberOfDays);
     Optional<Location> findById(Long id);
-
-    List<Location> findLocations(Long locationId, Long companionId, Long lengthOfStay, String categoryIds);
+    List<Location> findLocationsFromCityForm(Long cityId, Long companionId, Long lengthOfStay, String categoryIds);
+    List<Location> findLocationsFromRegionForm(Long regionId, Long companionId, Long lengthOfStay, String categoryIds);
 }
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/service/impl/LocationServiceImpl.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -50,5 +50,5 @@
 
     @Override
-    public List<Location> findLocations(Long locationId, Long companionId, Long lengthOfStay, String categoryIds) {
+    public List<Location> findLocationsFromCityForm(Long cityId, Long companionId, Long lengthOfStay, String categoryIds) {
         List<Long> categories = null;
         if(categoryIds != null && !categoryIds.isEmpty()){
@@ -56,7 +56,56 @@
             categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
         }
-        List<Location> foundLocations = locationRepository.findLocationsFromForm(locationId, companionId, categories);
-        return foundLocations;
+        Long maxMinutesPerDay = lengthOfStay *6 * 60;
+        int minutesPerDay = 0;
+        List<Location> citylocations = this.locationRepository.findLocationsFromCityForm(cityId, companionId, categories);
+        List<Location> newList = new ArrayList<>();
+        int listSize = citylocations.size();
+
+        while(minutesPerDay < maxMinutesPerDay ){
+            for(Location l: citylocations) {
+                if (minutesPerDay < maxMinutesPerDay && l.getDuration() + minutesPerDay <= maxMinutesPerDay && listSize != 0) {
+                    newList.add(l);
+                    listSize --;
+                }
+                minutesPerDay += l.getDuration();
+                if (minutesPerDay > maxMinutesPerDay) {
+                    break;
+                }
+            }
+        }
+
+        List<Location> foundLocations = locationRepository.findLocationsFromCityForm(cityId, companionId, categories);
+        return newList;
     }
+
+    @Override
+    public List<Location> findLocationsFromRegionForm(Long regionId, Long companionId, Long lengthOfStay, String categoryIds) {
+        List<Long> categories = null;
+        if(categoryIds != null && !categoryIds.isEmpty()){
+            List<String> ids = Arrays.asList(categoryIds.split(","));
+            categories = ids.stream().map(Long::valueOf).collect(Collectors.toList());
+        }
+        Long maxMinutesPerDay = lengthOfStay *6 * 60;
+        int minutesPerDay = 0;
+        List<Location> countryLocations = this.locationRepository.findLocationsFromRegionForm(regionId, companionId, categories);
+        List<Location> newList = new ArrayList<>();
+        int listCountrySize = countryLocations.size();
+
+            while(minutesPerDay < maxMinutesPerDay){
+                for(Location l: countryLocations) {
+                    if (minutesPerDay < maxMinutesPerDay && l.getDuration() + minutesPerDay <= maxMinutesPerDay && listCountrySize != 0) {
+                        newList.add(l);
+                        listCountrySize --;
+                    }
+                    minutesPerDay += l.getDuration();
+                    if (minutesPerDay > maxMinutesPerDay) {
+                        break;
+                    }
+                }
+
+        }
+        return newList;
+    }
+
 
     @Override
Index: trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java
===================================================================
--- trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/main/java/finki/diplomska/tripplanner/web/rest/LocationRestController.java	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -34,16 +34,19 @@
     }
 
-    @GetMapping(value = "/trip/locations")
-    public List<Location> allLocationsAfterSubmittedForm(@RequestParam(required = false) Long locationId,
+    @GetMapping(value = "/city/locations")
+    public List<Location> getAllLocationsFromCity(@RequestParam(required = false) Long cityId,
                                                          @RequestParam(required = false)  Long companionId,
                                                          @RequestParam(required = false) Long lengthOfStay,
                                                          @RequestParam(required = false) String categoryIds)  {
-        return this.locationService.findLocations(locationId, companionId, lengthOfStay, categoryIds);
-        /* List<Location> generatedLocations = this.locationService.scheduleLocations(locName, companion, region, categories, numberOfDays);
-        if(locName.equals("Macedonia")){
-            return generatedLocations;
-        }else{
-            return generatedLocations;
-        }*/
+        return this.locationService.findLocationsFromCityForm(cityId, companionId, lengthOfStay, categoryIds);
+
+    }
+
+    @GetMapping(value = "/region/locations")
+    public List<Location> getAllLocationsFromRegion(@RequestParam(required = false) Long regionId,
+                                                    @RequestParam(required = false)  Long companionId,
+                                                    @RequestParam(required = false) Long lengthOfStay,
+                                                    @RequestParam(required = false) String categoryIds){
+        return this.locationService.findLocationsFromRegionForm(regionId, companionId,lengthOfStay, categoryIds);
     }
 }
Index: trip-planner/src/test/api.http
===================================================================
--- trip-planner/src/test/api.http	(revision eed0bf860deec9614c6d4891e655270e2bb3b8ab)
+++ trip-planner/src/test/api.http	(revision 188ee53d7e92cd841a2f812afa7a47793c1280f2)
@@ -30,8 +30,8 @@
 
 ###
-GET http://localhost:8080/api/trip/locations
-Content-Type: application/x-www-form-urlencoded
+GET http://localhost:8080/api/city/locations?cityId=1&companionId=1&lengthOfStay=1&categoryIds=1,2
 
-locName=Macedonia&companion=Wandering Solo&region=Skopje Region&categories=sightseeing&numberOfDays=1
+###
+GET http://localhost:8080/api/region/locations?regionId=1&companionId=1&lengthOfStay=1&categoryIds=1,2
 
 ###
