import { Factory, faker } from 'ember-cli-mirage';

export default Factory.extend({
  channelId(i) {
    return i.toString();
  },
  active: false,
  config: {},
  token: faker.random.number,

  afterCreate(extensionInstallation, server) {
    if (!extensionInstallation.extension) {
      extensionInstallation.extension = server.create('extension', { extensionInstallations: [ extensionInstallation ]});
      extensionInstallation.save();
    }
  }
});
