import {Injectable} from '@angular/core';
import {Resource, Service} from 'ngx-jsonapi';

@Injectable()
export class CitiesService extends Service<Cities> {
  public resource = Cities;
  public type = 'cities';
}

export class Cities extends Resource {
  public attributes: {
    name: string,
    prefix_code: string,
  };

  get name(): string {
    return this.attributes.name;
  }
  set name(name: string) {
    this.attributes.name = name;
  }
  get prefix_code(): string {
    return this.attributes.prefix_code;
  }
  set prefix_code(prefix_code: string) {
    this.attributes.prefix_code = prefix_code;
  }
}
