{"action":"created","issue":{"url":"https://api.github.com/repos/littlerobot/slims/issues/30","labels_url":"https://api.github.com/repos/littlerobot/slims/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/littlerobot/slims/issues/30/comments","events_url":"https://api.github.com/repos/littlerobot/slims/issues/30/events","html_url":"https://github.com/littlerobot/slims/issues/30","id":55421751,"number":30,"title":"Store samples","user":{"login":"StuBez","id":910068,"avatar_url":"https://avatars.githubusercontent.com/u/910068?v=3","gravatar_id":"","url":"https://api.github.com/users/StuBez","html_url":"https://github.com/StuBez","followers_url":"https://api.github.com/users/StuBez/followers","following_url":"https://api.github.com/users/StuBez/following{/other_user}","gists_url":"https://api.github.com/users/StuBez/gists{/gist_id}","starred_url":"https://api.github.com/users/StuBez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuBez/subscriptions","organizations_url":"https://api.github.com/users/StuBez/orgs","repos_url":"https://api.github.com/users/StuBez/repos","events_url":"https://api.github.com/users/StuBez/events{/privacy}","received_events_url":"https://api.github.com/users/StuBez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/littlerobot/slims/milestones/7","html_url":"https://github.com/littlerobot/slims/milestones/v0.7","labels_url":"https://api.github.com/repos/littlerobot/slims/milestones/7/labels","id":1000234,"number":7,"title":"v0.7","description":null,"creator":{"login":"StuBez","id":910068,"avatar_url":"https://avatars.githubusercontent.com/u/910068?v=3","gravatar_id":"","url":"https://api.github.com/users/StuBez","html_url":"https://github.com/StuBez","followers_url":"https://api.github.com/users/StuBez/followers","following_url":"https://api.github.com/users/StuBez/following{/other_user}","gists_url":"https://api.github.com/users/StuBez/gists{/gist_id}","starred_url":"https://api.github.com/users/StuBez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuBez/subscriptions","organizations_url":"https://api.github.com/users/StuBez/orgs","repos_url":"https://api.github.com/users/StuBez/repos","events_url":"https://api.github.com/users/StuBez/events{/privacy}","received_events_url":"https://api.github.com/users/StuBez/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-02-28T21:31:22Z","updated_at":"2015-02-28T21:31:22Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2015-01-25T17:02:20Z","updated_at":"2015-05-02T07:28:04Z","closed_at":null,"body":"Storing a sample records the physical samples that are stored in the containers. Each sample will have a [sample type](https://github.com/littlerobot/slims/issues/36) and a [sample instance template](https://github.com/littlerobot/slims/issues/32).\r\n\r\n# User process\r\n1. Select a **sample type**. This loads a non-editable table with the label and value for that sample type.\r\n2. Select a **sample instance template**. This loads the form elements so that the user can enter the details for the samples they are storing.\r\n3. Select the container and then positions where the samples will be stored. Multiple positions can be selected, as long as no other samples are already stored there.\r\n4. The user confirms the selected positions and the entered details. This displays an editable table on the right side of the page where they can edit any entered values. This allows them to set values that are different for each sample.\r\n5. The user saves the sample information.\r\n\r\n## Notes\r\n* A sample can have a colour associated with it. A colour picker should be added for all sample types. It should be on the left so the same colour can be selected for all samples. It does not have to be added to the right if this is difficult.\r\n\r\n# APIs\r\n## Store samples\r\n`/api/samples [POST]`\r\n```json\r\n[\r\n  {\r\n    \"container\": 5,\r\n    \"row\": 7,\r\n    \"column\": 7,\r\n    \"colour\": null,\r\n    \"attributes\": [\r\n      {\r\n        \"sample_instance_attribute\": 12,\r\n        \"value\": \"Los Angeles\"\r\n      },\r\n      {\r\n        \"sample_instance_attribute\": 1,\r\n        \"filename\": \"Manufacturer information.pdf\",\r\n        \"mime_type\": \"application/pdf\",\r\n        \"value\": \"<base 64 encoded file content>\"\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    \"container\": 5,\r\n    \"row\": 7,\r\n    \"column\": 8,\r\n    \"colour\": \"#36f23a\",\r\n    \"attributes\": [\r\n      {\r\n        \"sample_instance_attribute\": 12,\r\n        \"value\": \"New York\"\r\n      },\r\n      {\r\n        \"sample_instance_attribute\": 1,\r\n        \"filename\": \"Manufacturer information.pdf\",\r\n        \"mime_type\": \"application/pdf\",\r\n        \"value\": \"<base 64 encoded file content>\"\r\n      }\r\n    ]\r\n  },\r\n  {\r\n    ...\r\n  }\r\n]\r\n```\r\n\r\n## List sample types\r\n`/api/sample-types [GET]`\r\n```json\r\n{\r\n  \"success\": true,\r\n  \"sample_types\": [\r\n    {\r\n      \"id\": 10,\r\n      \"name\": \"Mouse embryos\",\r\n      \"sample_type_template_id\": 1,\r\n      \"attributes\": [\r\n        {\r\n          \"id\": 12,\r\n          \"label\": \"Foo\",\r\n          \"sample_type_template_attribute_id\": 1,\r\n          \"value\": \"Trypsin\"\r\n        },\r\n        {\r\n          \"id\": 13,\r\n          \"label\": \"Bar\",\r\n          \"sample_type_template_attribute_id\": 2,\r\n          \"value\": \"Typice, tam asinos esset mortuis, sicut stupri frixam gallinaceo, sed tu accidere ad detrahendum hoc cacas Dum ego in a transeuntem, tempus sic non wanna te occidere, volo te adjuvet. Sed non hoc tibi, quod mihi non sunt. Praeterea, Ive 'iam fuerunt nimio cacas hoc mane super hoc casu eam tradere vestris mutum asinum.\"\r\n        },\r\n        {\r\n          \"id\": 14,\r\n          \"label\": \"Baz\",\r\n          \"sample_type_template_attribute_id\": 3,\r\n          \"filename\": \"spreadsheet.xls\",\r\n          \"url\": \"http://www.../spreadsheet.xls\"\r\n        },\r\n        {\r\n          \"id\": 15,\r\n          \"label\": \"FooBar\",\r\n          \"sample_type_template_attribute_id\": 4,\r\n          \"value\": \"2015-02-01\",\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      ...\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n## Get sample type\r\n`/api/sample-types/[id] [GET]`\r\n```json\r\n{\r\n  \"success\": true,\r\n  \"sample_type\": {\r\n    \"id\": 10,\r\n    \"name\": \"Mouse embryos\",\r\n    \"sample_type_template_id\": 1,\r\n    \"attributes\": [\r\n      {\r\n        \"id\": 12,\r\n        \"label\": \"Foo\",\r\n        \"sample_type_template_attribute_id\": 1,\r\n        \"value\": \"Trypsin\"\r\n      },\r\n      {\r\n        \"id\": 13,\r\n        \"label\": \"Bar\",\r\n        \"sample_type_template_attribute_id\": 2,\r\n        \"value\": \"Typice, tam asinos esset mortuis, sicut stupri frixam gallinaceo, sed tu accidere ad detrahendum hoc cacas Dum ego in a transeuntem, tempus sic non wanna te occidere, volo te adjuvet. Sed non hoc tibi, quod mihi non sunt. Praeterea, Ive 'iam fuerunt nimio cacas hoc mane super hoc casu eam tradere vestris mutum asinum.\"\r\n      },\r\n      {\r\n        \"id\": 14,\r\n        \"label\": \"Baz\",\r\n        \"sample_type_template_attribute_id\": 3,\r\n        \"filename\": \"spreadsheet.xls\",\r\n        \"url\": \"http://www.../spreadsheet.xls\"\r\n      },\r\n      {\r\n        \"id\": 15,\r\n        \"label\": \"FooBar\",\r\n        \"sample_type_template_attribute_id\": 4,\r\n        \"value\": \"2015-02-01\",\r\n      }\r\n    ]\r\n  }\r\n}\r\n```\r\n\r\n## List sample instances\r\n`/api/sample-instance-template [GET]`\r\n```json\r\n{\r\n  \"success\": true,\r\n  \"sample_instance_templates\": [\r\n    {\r\n      \"name\": \"Template name\",\r\n      \"attributes\": {\r\n        \"store\": [\r\n          {\r\n            \"order\": 1,\r\n            \"label\": \"Sex\",\r\n            \"type\": \"option\",\r\n            \"options\": [\r\n              \"Male\",\r\n              \"Female\"\r\n            ]\r\n          },\r\n          {\r\n            \"order\": 2,\r\n            \"label\": \"Age\",\r\n            \"type\": \"brief-text\"\r\n          },\r\n          {\r\n            \"order\": 3,\r\n            \"label\": \"Comment\",\r\n            \"type\": \"long-text\"\r\n          },\r\n          {\r\n            \"order\": 4,\r\n            \"label\": \"Stored by\",\r\n            \"type\": \"user\"\r\n          },\r\n          {\r\n            \"order\": 5,\r\n            \"label\": \"Date stored\",\r\n            \"type\": \"date\"\r\n          }\r\n        ]\r\n      },\r\n      \"remove\": [\r\n        {\r\n          \"order\": 1,\r\n          \"label\": \"Reason\",\r\n          \"type\": \"long-text\"\r\n        },\r\n        {\r\n          \"order\": 2,\r\n          \"label\": \"Removed by\",\r\n          \"type\": \"user\"\r\n        },\r\n        {\r\n          \"order\": 3,\r\n          \"label\": \"Date removed\",\r\n          \"type\": \"date\"\r\n        }\r\n      ]\r\n    },\r\n    {\r\n      ...\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n## Get sample instance\r\n*To be developed*\r\n\r\n## List containers\r\n`/api/containers [GET]`\r\n```json\r\n{\r\n  \"success\": true,\r\n  \"data\": [\r\n    {\r\n      \"leaf\": false,\r\n      \"sample_remaining_capacity\": 1429,\r\n      \"sample_total_capacity\": 1429,\r\n      \"samples_stored\": 0,\r\n      \"id\": 1,\r\n      \"name\": \"Aut aut.\",\r\n      \"research_group\": {\r\n        \"id\": 25,\r\n        \"name\": \"Research group AAA\"\r\n      },\r\n      \"rows\": 1,\r\n      \"columns\": 10,\r\n      \"stores\": \"containers\",\r\n      \"comment\": \"Molestiae voluptatem totam aut quae.\",\r\n      \"data\": [\r\n        {\r\n          \"leaf\": false,\r\n          \"sample_remaining_capacity\": 391,\r\n          \"sample_total_capacity\": 391,\r\n          \"samples_stored\": 0,\r\n          \"id\": 7,\r\n          \"name\": \"Sed dolorem.\",\r\n          \"research_group\": {\r\n            \"id\": 28,\r\n            \"name\": \"Research group D\"\r\n          },\r\n          \"rows\": 8,\r\n          \"columns\": 3,\r\n          \"stores\": \"containers\",\r\n          \"comment\": \"Enim officia et sit aut voluptates et.\",\r\n          \"colour\": \"#c331b6\"\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n*Needs further development*\r\n\r\n> Can the current sample positions be included in the containers API response or should it be separate to reduce the amount of data? It will need to include at least a row, a column and a colour.\r\n\r\n# Mockup\r\n![store samples](https://cloud.githubusercontent.com/assets/910068/5892351/c88ba48c-a4b3-11e4-904c-6607f925d32d.png)"},"comment":{"url":"https://api.github.com/repos/littlerobot/slims/issues/comments/98326005","html_url":"https://github.com/littlerobot/slims/issues/30#issuecomment-98326005","issue_url":"https://api.github.com/repos/littlerobot/slims/issues/30","id":98326005,"user":{"login":"StuBez","id":910068,"avatar_url":"https://avatars.githubusercontent.com/u/910068?v=3","gravatar_id":"","url":"https://api.github.com/users/StuBez","html_url":"https://github.com/StuBez","followers_url":"https://api.github.com/users/StuBez/followers","following_url":"https://api.github.com/users/StuBez/following{/other_user}","gists_url":"https://api.github.com/users/StuBez/gists{/gist_id}","starred_url":"https://api.github.com/users/StuBez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StuBez/subscriptions","organizations_url":"https://api.github.com/users/StuBez/orgs","repos_url":"https://api.github.com/users/StuBez/repos","events_url":"https://api.github.com/users/StuBez/events{/privacy}","received_events_url":"https://api.github.com/users/StuBez/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T07:28:04Z","updated_at":"2015-05-02T07:28:04Z","body":"Could you add full examples of the API requests and responses you want and\nI'll make those changes?\n\nOn Saturday, 2 May 2015, chuckn0rris <notifications@github.com> wrote:\n\n> I think we should add sizes of positions container\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/littlerobot/slims/issues/30#issuecomment-98325949>.\n>\n\n-- \n\n\nlittle robot Limited is a company registered in England and Wales. \nRegistered number: 8923395. Registered office: CPC1, Capital Park, \nFulbourn, Cambridgeshire, CB21 5XE.\n"}}