{"action":"opened","issue":{"url":"https://api.github.com/repos/romandev/absolute/issues/352","repository_url":"https://api.github.com/repos/romandev/absolute","labels_url":"https://api.github.com/repos/romandev/absolute/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/romandev/absolute/issues/352/comments","events_url":"https://api.github.com/repos/romandev/absolute/issues/352/events","html_url":"https://github.com/romandev/absolute/issues/352","id":241427026,"number":352,"title":"Need discussion of architecture for custom schema","user":{"login":"coconutperm","id":23692226,"avatar_url":"https://avatars2.githubusercontent.com/u/23692226?v=3","gravatar_id":"","url":"https://api.github.com/users/coconutperm","html_url":"https://github.com/coconutperm","followers_url":"https://api.github.com/users/coconutperm/followers","following_url":"https://api.github.com/users/coconutperm/following{/other_user}","gists_url":"https://api.github.com/users/coconutperm/gists{/gist_id}","starred_url":"https://api.github.com/users/coconutperm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coconutperm/subscriptions","organizations_url":"https://api.github.com/users/coconutperm/orgs","repos_url":"https://api.github.com/users/coconutperm/repos","events_url":"https://api.github.com/users/coconutperm/events{/privacy}","received_events_url":"https://api.github.com/users/coconutperm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-08T05:25:53Z","updated_at":"2017-07-08T05:25:53Z","closed_at":null,"body":"We have to provide a solution for defining more free Scheme in our own constraints.\r\nSo we provide the following basic product schemes and the developer can define an extended scheme if \r\ndesired.\r\n\r\n* Example for default product scheme\r\n```\r\nexport default class ProductBase {\r\n  @schemetype.mandatory name;\r\n  @schemetype.mandatory amount;\r\n}\r\n```\r\n\r\n* Example for extended product scheme what delevoper can define\r\n```\r\n@scheme('product')\r\nexport default class CustomProduct extends ProductBase {\r\n  @schemetype.mandatory category;\r\n  @schemetype.optional size;\r\n}\r\n```\r\n\r\nAnd the @scheme annotation defined above can help define the scheme in mongoose.\r\n\r\n```\r\n  static scheme(tableName) {\r\n    return function(SchemeClass) {\r\n        // it may return scheme model class\r\n        mongoose.model(tableName, new SchemeClass());\r\n    };\r\n  }\r\n```\r\n\r\nHowever, Developer must use the scheme returned by mongoose.model, which causes a problem here. I would appreciate your feedback.\r\n"}}
{"actor":{"display_login":"coconutperm"}}