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


@Injectable()
export class TypesService extends Service<Type> {
  public resource = Type;
  public type = 'types';

}


export class Type extends Resource {
  public attributes: {
    id: string,
    name: string,
  };

  public getName() {
    return this.attributes.name;
  }

  public setName(name: string) {
    return this.attributes.name = name;
  }

  public getId() {
    return this.attributes.id;
  }

  public setId(id: string) {
    return this.attributes.id = id;
  }

}
