import Waterline from 'waterline';
import uuid from 'uuid';

const Action = Waterline.Collection.extend({
  identity: 'action',
  connection: 'default',
  attributes: {
    id: {
      type: 'text',
      primaryKey: true,
      unique: true,
      defaultsTo: () => (uuid.v4()),
    },
    uid: {
      model: 'user',
    },
    details: {
      type: 'json',
      required: true,
    },
  },
});

export default Action;
