import { Customer } from './defs';
import { EntityState, createEntityAdapter } from '@ngrx/entity';

export interface CustomersState extends EntityState<Customer> {}

export const customersStateAdapter = createEntityAdapter<Customer>();

export const INITIAL_CUSTOMERS_STATE: CustomersState = {
  ...customersStateAdapter.getInitialState(),
};

export const INITIAL_CUSTOMER: Customer = {
  id: undefined,
  baseData: {},

  addresses: {
    generalAddress: {},
    shippingAddresses: [],
    payerAddresses: [],

    shippingAddressIds: [],
    payerAddressIds: [],
  },

  detailsLoaded: false,
};
