Archived
2

adapted existing /sample methods to condition, removed /condition route

This commit is contained in:
VLE2FE
2020-05-27 14:31:17 +02:00
parent 2829752d0c
commit 0acb9dd6fc
34 changed files with 1753 additions and 1374 deletions

View File

@ -7,6 +7,11 @@
"type": "granulate",
"color": "black",
"batch": "",
"condition": {
"material": "copper",
"weeks": 3,
"condition_template": {"$oid":"200000000000000000000001"}
},
"material_id": {"$oid":"100000000000000000000004"},
"note_id": null,
"user_id": {"$oid":"000000000000000000000002"},
@ -19,6 +24,11 @@
"type": "granulate",
"color": "natural",
"batch": "1560237365",
"condition": {
"material": "copper",
"weeks": 3,
"condition_template": {"$oid":"200000000000000000000001"}
},
"material_id": {"$oid":"100000000000000000000001"},
"note_id": {"$oid":"500000000000000000000001"},
"user_id": {"$oid":"000000000000000000000002"},
@ -31,6 +41,11 @@
"type": "part",
"color": "black",
"batch": "1704-005",
"condition": {
"material": "copper",
"weeks": 3,
"condition_template": {"$oid":"200000000000000000000001"}
},
"material_id": {"$oid":"100000000000000000000005"},
"note_id": {"$oid":"500000000000000000000002"},
"user_id": {"$oid":"000000000000000000000003"},
@ -43,6 +58,11 @@
"type": "granulate",
"color": "black",
"batch": "1653000308",
"condition": {
"material": "hot air",
"weeks": 5,
"condition_template": {"$oid":"200000000000000000000001"}
},
"material_id": {"$oid":"100000000000000000000005"},
"note_id": {"$oid":"500000000000000000000003"},
"user_id": {"$oid":"000000000000000000000003"},
@ -55,11 +75,27 @@
"type": "granulate",
"color": "black",
"batch": "1653000308",
"condition": {
"condition_template": {"$oid":"200000000000000000000003"}
},
"material_id": {"$oid":"100000000000000000000005"},
"note_id": {"$oid":"500000000000000000000003"},
"note_id": null,
"user_id": {"$oid":"000000000000000000000003"},
"status": -1,
"__v": 0
},
{
"_id": {"$oid":"400000000000000000000006"},
"number": "Rng36",
"type": "granulate",
"color": "black",
"batch": "",
"condition": {},
"material_id": {"$oid":"100000000000000000000004"},
"note_id": null,
"user_id": {"$oid":"000000000000000000000002"},
"status": 0,
"__v": 0
}
],
"notes": [
@ -73,7 +109,7 @@
"_id": {"$oid":"500000000000000000000002"},
"comment": "",
"sample_references": [{
"id": {"$oid":"400000000000000000000004"},
"sample_id": {"$oid":"400000000000000000000004"},
"relation": "granulate to sample"
}],
"custom_fields": {
@ -85,7 +121,7 @@
"_id": {"$oid":"500000000000000000000003"},
"comment": "",
"sample_references": [{
"id": {"$oid":"400000000000000000000003"},
"sample_id": {"$oid":"400000000000000000000003"},
"relation": "part to sample"
}],
"custom_fields": {
@ -234,60 +270,10 @@
"__v": 0
}
],
"conditions": [
{
"_id": {"$oid":"700000000000000000000001"},
"sample_id": {"$oid":"400000000000000000000001"},
"number": "A1",
"parameters": {
"material": "copper",
"weeks": 3
},
"treatment_template": {"$oid":"200000000000000000000001"},
"status": 10,
"__v": 0
},
{
"_id": {"$oid":"700000000000000000000002"},
"sample_id": {"$oid":"400000000000000000000002"},
"number": "A1",
"parameters": {
"material": "copper",
"weeks": 3
},
"treatment_template": {"$oid":"200000000000000000000001"},
"status": 10,
"__v": 0
},
{
"_id": {"$oid":"700000000000000000000003"},
"sample_id": {"$oid":"400000000000000000000004"},
"number": "A1",
"parameters": {
"material": "copper",
"weeks": 3
},
"treatment_template": {"$oid":"200000000000000000000001"},
"status": 10,
"__v": 0
},
{
"_id": {"$oid":"700000000000000000000004"},
"sample_id": {"$oid":"400000000000000000000001"},
"number": "A2",
"parameters": {
"material": "hot air",
"weeks": 5
},
"treatment_template": {"$oid":"200000000000000000000001"},
"status": 10,
"__v": 0
}
],
"measurements": [
{
"_id": {"$oid":"800000000000000000000001"},
"condition_id": {"$oid":"700000000000000000000001"},
"sample_id": {"$oid":"400000000000000000000001"},
"values": {
"dpt": [
[3997.12558,98.00555],
@ -301,7 +287,7 @@
},
{
"_id": {"$oid":"800000000000000000000002"},
"condition_id": {"$oid":"700000000000000000000002"},
"sample_id": {"$oid":"400000000000000000000002"},
"values": {
"weight %": 0.5,
"standard deviation": 0.2
@ -312,7 +298,7 @@
},
{
"_id": {"$oid":"800000000000000000000003"},
"condition_id": {"$oid":"700000000000000000000003"},
"sample_id": {"$oid":"400000000000000000000003"},
"values": {
"val1": 1
},
@ -321,12 +307,11 @@
"__v": 0
}
],
"treatment_templates": [
"condition_templates": [
{
"_id": {"$oid":"200000000000000000000001"},
"name": "heat treatment",
"version": 1,
"number_prefix": "A",
"parameters": [
{
"name": "material",
@ -351,7 +336,6 @@
"_id": {"$oid":"200000000000000000000002"},
"name": "heat treatment 2",
"version": 2,
"number_prefix": "B",
"parameters": [
{
"name": "material",
@ -359,6 +343,14 @@
}
],
"__v": 0
},
{
"_id": {"$oid":"200000000000000000000003"},
"name": "raw material",
"version": 1,
"parameters": [
],
"__v": 0
}
],
"measurement_templates": [

View File

@ -10,6 +10,7 @@ export default class TestHelper {
user: {pass: 'Xyz890*)', key: '000000000000000000001001'},
johnnydoe: {pass: 'Xyz890*)', key: '000000000000000000001004'}
}
public static res = { // default responses
400: {status: 'Bad request'},
401: {status: 'Unauthorized'},