{"action":"created","issue":{"url":"https://api.github.com/repos/flyvictor/fortune/issues/125","labels_url":"https://api.github.com/repos/flyvictor/fortune/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/flyvictor/fortune/issues/125/comments","events_url":"https://api.github.com/repos/flyvictor/fortune/issues/125/events","html_url":"https://github.com/flyvictor/fortune/issues/125","id":60129464,"number":125,"title":"Custom data type support","user":{"login":"craigedmunds","id":1453591,"avatar_url":"https://avatars.githubusercontent.com/u/1453591?v=3","gravatar_id":"","url":"https://api.github.com/users/craigedmunds","html_url":"https://github.com/craigedmunds","followers_url":"https://api.github.com/users/craigedmunds/followers","following_url":"https://api.github.com/users/craigedmunds/following{/other_user}","gists_url":"https://api.github.com/users/craigedmunds/gists{/gist_id}","starred_url":"https://api.github.com/users/craigedmunds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigedmunds/subscriptions","organizations_url":"https://api.github.com/users/craigedmunds/orgs","repos_url":"https://api.github.com/users/craigedmunds/repos","events_url":"https://api.github.com/users/craigedmunds/events{/privacy}","received_events_url":"https://api.github.com/users/craigedmunds/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/flyvictor/fortune/labels/Medium%20Complex","name":"Medium Complex","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-06T17:05:17Z","updated_at":"2015-07-09T09:32:59Z","closed_at":null,"body":"Fortune uses mongoose schema to describe the resources. A number of built in data types exist, like String, Date, Number and these can be assembled into resources and sub resources, etc.\r\n\r\nIn our usage of fortune we have a number of other datatypes that we use across our instances, for example prices, where we store the amount, and the currency it's in:\r\n\r\n.resource(\"resource-name\", {\r\n  field1 : String,\r\n  price : {\r\n    amount : Number,\r\n    currency : String\r\n  }\r\n}\r\n\r\nRather than re-define this within each resource and field it's used, it should be possible to instead define the price field as being of type \"price\", and fortune to take care of the plumbing:\r\n\r\n.resource(\"resource-name\", {\r\n  field1 : String,\r\n  price : \"price\"\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/flyvictor/fortune/issues/comments/119889382","html_url":"https://github.com/flyvictor/fortune/issues/125#issuecomment-119889382","issue_url":"https://api.github.com/repos/flyvictor/fortune/issues/125","id":119889382,"user":{"login":"craigedmunds","id":1453591,"avatar_url":"https://avatars.githubusercontent.com/u/1453591?v=3","gravatar_id":"","url":"https://api.github.com/users/craigedmunds","html_url":"https://github.com/craigedmunds","followers_url":"https://api.github.com/users/craigedmunds/followers","following_url":"https://api.github.com/users/craigedmunds/following{/other_user}","gists_url":"https://api.github.com/users/craigedmunds/gists{/gist_id}","starred_url":"https://api.github.com/users/craigedmunds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigedmunds/subscriptions","organizations_url":"https://api.github.com/users/craigedmunds/orgs","repos_url":"https://api.github.com/users/craigedmunds/repos","events_url":"https://api.github.com/users/craigedmunds/events{/privacy}","received_events_url":"https://api.github.com/users/craigedmunds/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T09:32:59Z","updated_at":"2015-07-09T09:32:59Z","body":"PR is https://github.com/flyvictor/fortune/pull/134"}}