{"action":"created","issue":{"url":"https://api.github.com/repos/atk4/data/issues/308","repository_url":"https://api.github.com/repos/atk4/data","labels_url":"https://api.github.com/repos/atk4/data/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/atk4/data/issues/308/comments","events_url":"https://api.github.com/repos/atk4/data/issues/308/events","html_url":"https://github.com/atk4/data/issues/308","id":307218957,"number":308,"title":"Standard types overhaul","user":{"login":"romaninsh","id":453929,"avatar_url":"https://avatars0.githubusercontent.com/u/453929?v=4","gravatar_id":"","url":"https://api.github.com/users/romaninsh","html_url":"https://github.com/romaninsh","followers_url":"https://api.github.com/users/romaninsh/followers","following_url":"https://api.github.com/users/romaninsh/following{/other_user}","gists_url":"https://api.github.com/users/romaninsh/gists{/gist_id}","starred_url":"https://api.github.com/users/romaninsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaninsh/subscriptions","organizations_url":"https://api.github.com/users/romaninsh/orgs","repos_url":"https://api.github.com/users/romaninsh/repos","events_url":"https://api.github.com/users/romaninsh/events{/privacy}","received_events_url":"https://api.github.com/users/romaninsh/received_events","type":"User","site_admin":false},"labels":[{"id":425009560,"url":"https://api.github.com/repos/atk4/data/labels/POLL","name":"POLL","color":"fbca04","default":false},{"id":572120252,"url":"https://api.github.com/repos/atk4/data/labels/Refactoring","name":"Refactoring","color":"1d76db","default":false},{"id":359551129,"url":"https://api.github.com/repos/atk4/data/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-21T12:09:19Z","updated_at":"2018-03-22T16:39:50Z","closed_at":null,"author_association":"OWNER","body":"The [current fields types](http://agile-data.readthedocs.io/en/develop/typecasting.html) are not sufficiently flexible and not contain enough information and options for field use cases. \r\n\r\nAfter #307 is done I look to break down \"Field\" class into multiple ones focus on various parameters where user can define types.\r\n\r\nThe definition would remain as before, however based on type, presence of \"enum\" and \"values\" properties an appropriate field class would be used, so making this possible:\r\n\r\n``` php\r\n$model->addField('age', ['type'=>'integer', 'min'=>14]);\r\n$model->addField('height', ['type'=>'length', 'units'=>['m','cm']]);\r\n```\r\n\r\nHere are some of the use-cases that new implementation should support:\r\n\r\nField\\Boolean:\r\n - contain yes/no values for the database (1/0)\r\n - contain yes/no values for the UI (yes/)\r\n\r\nField\\List:\r\n - supporting enum, values and hard-coded lists\r\n - add ability to specify colors\r\n\r\nField\\Date:\r\n - add fields for default UI formatting\r\n - support date, datetime and time types\r\n - support min/max dates\r\n\r\nField\\Number:\r\n - specify how many decimal numbers\r\n - is negative permitted\r\n - formatting style (e.g. xx-xxxx)\r\n - generic prefix and postfix\r\n - support types 'money', 'percent', 'decimal', 'float', 'rating'\r\n - allow min/max\r\n\r\nField\\Measurement:\r\n - support values that are expressed in units\r\n - duration: s, m, d, w\r\n - weight: g, kg\r\n - length: mm, cm, m, km\r\n - imperial units\r\n - set to (1cm) stored as (100).\r\n - automatically reformats for ui\r\n - types: 'duration', 'length'\r\n\r\n# PLEASE SUGGEST MORE TYPES IN THE COMMENTS."},"comment":{"url":"https://api.github.com/repos/atk4/data/issues/comments/375373686","html_url":"https://github.com/atk4/data/issues/308#issuecomment-375373686","issue_url":"https://api.github.com/repos/atk4/data/issues/308","id":375373686,"user":{"login":"romaninsh","id":453929,"avatar_url":"https://avatars0.githubusercontent.com/u/453929?v=4","gravatar_id":"","url":"https://api.github.com/users/romaninsh","html_url":"https://github.com/romaninsh","followers_url":"https://api.github.com/users/romaninsh/followers","following_url":"https://api.github.com/users/romaninsh/following{/other_user}","gists_url":"https://api.github.com/users/romaninsh/gists{/gist_id}","starred_url":"https://api.github.com/users/romaninsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaninsh/subscriptions","organizations_url":"https://api.github.com/users/romaninsh/orgs","repos_url":"https://api.github.com/users/romaninsh/repos","events_url":"https://api.github.com/users/romaninsh/events{/privacy}","received_events_url":"https://api.github.com/users/romaninsh/received_events","type":"User","site_admin":false},"created_at":"2018-03-22T16:39:50Z","updated_at":"2018-03-22T16:39:50Z","author_association":"OWNER","body":"Hey @FrancessFractal and welcome ! \r\n\r\nThe relevant documentation is here: http://agile-data.readthedocs.io/en/develop/typecasting.html#supported-algorithms\r\n\r\np.s. A better place to ask general questions would be in our forum (https://forum.agiletoolkit.org)."}}
{"actor":{"display_login":"romaninsh"}}