import { Page } from './page';

export class Query {
  fields: string[];
  filter: string[];
  page: Page;

  constructor(data: Partial<Query>) {
    this.fields = data?.fields ?? [];
    this.filter = data?.filter ?? [];
    this.page = new Page(data?.page ?? {});
  }

  isValid(): boolean {
    return true;
  }

  toString(): string {
    const fields = (this.fields ?? []).join(', ');
    const filters = '';
    return `${fields}${filters}`;
  }
}
