import { HttpErrorResponse } from '@angular/common/http';
import { PayerStatus } from './payer-status.model';
import { CustomerType } from './customer-type.model';

export interface User {
  id?: number;
  first_name: string;
  last_name: string;
  title?: string;
  gender?: string;
  date_of_birth?: string;
  email?: string;
  mobile_number?: string;
  phone_number?: string;
  base_addres?: Address;
  delivery_addres?: Address;
  invoice_address?: Address;
  shop?: boolean;
  newsletter?: boolean;
  tolino?: boolean;
  customer_card?: boolean;
  payement_method?: string;
  poossible_invoice_addresses?: Address[];
  poossible_delivery_addresses?: Address[];
  newUser?: boolean;
  notificationSms?: boolean;
  notificationEmail?: boolean;
  createdInBranch?: number;
  customerId?: string;
  hasOnlineAccount?: boolean;
  isGuestAccount?: boolean;
  features?: Features[];
  changed?: string;
  created?: string;
  customerNumber?: string;
  organisation?: Organisation;
  error?: HttpErrorResponse;
}

export class Address {
  constructor(
    public id: number,
    public first_name: string,
    public last_name: string,
    public street: string,
    public streetNo: number,
    public zip: string,
    public city: string,
    public country: string,
    public company_name?: string,
    public company_department?: string,
    public note?: string,
    public company_tax_number?: string,
    public title?: string,
    public gender?: string,
    public payer_number?: string,
    public payer_status?: PayerStatus,
    public payer_type?: CustomerType,
    public defaultSince?: Date,
    public synced?: boolean
  ) {}
}

export class Organisation {
  constructor(public name?: string, public extraAddress?: string, public department?: string, public vatId?: string) {}
}

export class Features {
  key: string;
  value: string;
  description: string;
}
