import { Injectable } from '@nestjs/common';
import { Organizer } from './models/Organizer';
import { Client } from '../client';
import {Service} from '../global/service'

@Injectable()
export class OrganizerService extends Service<Organizer> {
  constructor() {
    super();
    this.collection = 'organizer';
  }

  async create(client: Client, name: string, plz?: number, ort?: string): Promise<Organizer> {
    const neu = {
      name,
      plz: plz || null,
      ort: ort || null,
    }

    return super.insert(client, neu);
  }
}