/*jslint indent: 2, nomen: true, maxlen: 100 */
/*global require, applicationContext */

(function () {
  "use strict";
  var FoxxGenerator = require('./foxx_generator').Generator,
    generator;

  generator = new FoxxGenerator({
    mediaType: 'application/vnd.api+json',
    applicationContext: applicationContext,
  });

  generator.addState('todos', {
    attributes: {
      title: { type: 'string', required: true }
    },

    transitions: [
      { to: 'people', via: 'AssignedTo' }
    ]
  });

  generator.addState('people', {
    attributes: {
      name: { type: 'string', required: true }
    }
  });

  generator.addTransition('AssignedTo', {
    relation: 'assignedTo',
    description: 'Get the person this object is assigned to',
    // parameters: {},

    // condition: function(environment) {
    //   return environment.currentUser === this.to.owner;
    // },

    // action: function() { this.to.destroy();
    // },

    method: 'GET'
  });

  generator.addRepository('TodoRepository', {
    contains: 'todos',

    // Should be:
    // transitions: [
    //   { to: 'todos', via 'Contains' }
    // ]

    collectionName: 'todos',
    per_page: 10
  });
}());

@@ -345,16 +345,20 @@
 e('todos
+/:id
 ', %7B%0A   
@@ -530,16 +530,20 @@
 ('people
+/:id
 ', %7B%0A   
@@ -999,22 +999,13 @@
 ry('
-TodoRepository
+todos
 ', %7B
@@ -1025,16 +1025,20 @@
 : 'todos
+/:id
 ',%0A%0A    
@@ -1094,22 +1094,27 @@
 : 'todos
+/:id
 ', via
+:
  'Contai
@@ -1127,16 +1127,17 @@
     // %5D
+,
 %0A%0A    co

Clarify names of states