import { Injectable } from '@angular/core';
import { DictionariesService } from '@modules/components/page-filters/services/dictionaries-service';

@Injectable({
    providedIn: 'root',
})
export class StationCodeValidationService {
    constructor(private dictionariesService: DictionariesService) {}

    public isStationCodeValid(code: string) {
        return this.dictionariesService.ready$.then(() => {
            return Boolean(this.dictionariesService.getCityOrAirport(code));
        });
    }
}
