@ozdao/prometheus-framework 0.2.64 → 0.2.66

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. package/dist/main-BoybHtmb.mjs +13753 -0
  2. package/dist/main-CJ7URLjm.js +91 -0
  3. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Block/Block.vue.js +3 -3
  5. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +1 -55
  7. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +55 -1
  9. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -97
  11. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +97 -1
  13. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +46 -1
  15. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +1 -46
  17. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  36. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  37. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  38. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  39. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  47. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/icons/icons.client.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/icons/icons.client.js +59 -58
  55. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  77. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +78 -74
  79. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +117 -76
  83. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
  89. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  97. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
  99. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  101. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  103. package/dist/prometheus-framework.cjs.js +1 -1
  104. package/dist/prometheus-framework.es.js +1 -1
  105. package/dist/style.css +1 -1
  106. package/dist/web-B9Vtg5cN.mjs +54 -0
  107. package/dist/web-ZM1AOTc1.js +1 -0
  108. package/package.json +1 -1
  109. package/src/components/Block/Block.vue +1 -1
  110. package/src/components/Feed/Feed.vue +17 -18
  111. package/src/components/Field/Field.vue +1 -0
  112. package/src/components/Tooltip/Tooltip.vue +1 -1
  113. package/src/modules/globals/components/blocks/CardHeader.vue +6 -3
  114. package/src/modules/globals/controllers/utils/queryProcessor.js +2 -1
  115. package/src/modules/globals/store/globals.js +3 -4
  116. package/src/modules/icons/icons.client.js +1 -0
  117. package/src/modules/products/components/blocks/CardLeftover.vue +47 -27
  118. package/src/modules/products/components/blocks/CardPosition.vue +57 -51
  119. package/src/modules/products/components/pages/EditLeftover.vue +77 -16
  120. package/src/modules/products/components/pages/Leftovers.vue +3 -3
  121. package/src/modules/products/components/pages/Products.vue +1 -1
  122. package/src/modules/products/controllers/leftovers.controller.js +54 -17
  123. package/src/modules/products/models/leftover.model.js +5 -0
  124. package/src/modules/products/routes/leftovers.routes.js +1 -1
  125. package/src/styles/config.scss +2 -2
@@ -1,55 +1,61 @@
1
1
  <template>
2
- <div class="gap-thin flex-nowrap flex">
3
- <SelectMulti
4
- v-model="productSelected"
5
- :options="products"
6
- label="name"
7
- :multiple="false"
8
- :taggable="false"
9
- placeholder="Select a product"
10
- class="bg-white pd-small radius-small"
11
- />
12
- <Field
13
- v-model:field="productPrice"
14
- type="number"
15
- label="Price"
16
- :symbol="returnCurrency()"
17
- class="bg-white pd-small radius-small"
18
- />
19
- <Field
20
- v-model:field="productQuantity"
21
- type="number"
22
- label="Qty"
23
- class="bg-white pd-small radius-small"
24
- >
25
- <Select
26
- v-model:select="productQuantityType"
27
- :options="[
28
- 'pcs',
29
- 'g',
30
- 'ml'
31
- ]"
32
- class="bg-grey pd-thin radius-thin"
33
- />
34
-
35
- </Field>
36
-
37
- <button
38
- v-if="!product"
39
- :disabled="!isProductValid"
40
- @click="addProduct"
41
- class="bg-main aspect-1x1 radius-small pd-small"
42
- >
43
- <IconAdd class="i-semi"/>
44
- </button>
45
-
46
- <button
47
- v-if="product"
48
- @click="deleteProduct"
49
- class="bg-red aspect-1x1 radius-small pd-small"
50
- >
51
- <IconDelete class="i-semi"/>
52
- </button>
2
+ <div class="gap-thin">
3
+ <div class="gap-thin mn-b-thin flex-nowrap flex">
4
+ <SelectMulti
5
+ v-model="productSelected"
6
+ :options="products"
7
+ label="name"
8
+ :multiple="false"
9
+ :taggable="false"
10
+ placeholder="Select a product"
11
+ class="bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"
12
+ />
13
+ <button
14
+ v-if="!product"
15
+ :disabled="!isProductValid"
16
+ @click="addProduct"
17
+ class="bg-main aspect-1x1 radius-small pd-small"
18
+ >
19
+ <IconAdd class="i-semi"/>
20
+ </button>
21
+
22
+ <button
23
+ v-if="product"
24
+ @click="deleteProduct"
25
+ class="bg-red aspect-1x1 radius-small pd-small"
26
+ >
27
+ <IconDelete class="i-semi"/>
28
+ </button>
29
+ </div>
30
+ <div class="gap-thin flex-nowrap flex">
31
+ <Field
32
+ v-model:field="productPrice"
33
+ type="number"
34
+ label="Price"
35
+ :symbol="returnCurrency()"
36
+ class="bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
37
+ />
38
+ <Field
39
+ v-model:field="productQuantity"
40
+ type="number"
41
+ label="Qty"
42
+ class="bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
43
+ >
44
+ <Select
45
+ v-model:select="productQuantityType"
46
+ :options="[
47
+ 'pcs',
48
+ 'g',
49
+ 'ml'
50
+ ]"
51
+ class="bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"
52
+ />
53
+
54
+ </Field>
55
+ </div>
56
+
57
+
58
+
53
59
  </div>
54
60
  </template>
55
61
 
@@ -13,22 +13,60 @@
13
13
  class="bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
14
14
  />
15
15
  </header>
16
-
17
- <Block
18
- title="Add Position"
19
- class="mn-b-semi"
16
+
17
+ <Popup
18
+ title="Add position"
19
+ @close-popup="closeProductsPopup"
20
+ :isPopupOpen="isOpenProductsPopup"
21
+ class="bg-white w-min-30r w-max-30r radius-big pd-medium"
20
22
  >
21
- <CardPosition
22
- @add="(item) => globals.actions.add(
23
- leftovers.state.current.positions,
24
- item
25
- )"
26
- :products="Products"
27
- />
28
- </Block>
23
+
24
+ <h3 class="mn-b-small">Add to order</h3>
25
+
26
+ <div class="bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big">
27
+ <Feed
28
+ :search="true"
29
+ :states="{
30
+ empty: {
31
+ title: 'No Products Found',
32
+ description: 'Currently, there are no such products available.'
33
+ }
34
+ }"
35
+ :store="{
36
+ read: (options) => products.actions.read(options),
37
+ state: null
38
+ }"
39
+ :options="{
40
+ organization: route.params._id
41
+ }"
42
+ v-slot="{
43
+ items
44
+ }"
45
+ class=""
46
+ >
47
+ <CardOrderItem
48
+ v-for="(product, index) in items" :key="product._id"
49
+ :editable="false"
50
+ :product="product"
51
+ @click="() => {
52
+ let p = { ...product };
53
+ p.quantity = 1;
54
+ p.type = 'pcs'
55
+ globals.actions.add(leftovers.state.current.positions, p)
56
+ closeProductsPopup();
57
+ }"
58
+ class="bg-white pd-thin radius-medium w-100 mn-b-thin"
59
+ />
60
+ </Feed>
61
+ </div>
62
+ </Popup>
29
63
 
30
64
  <Block
31
65
  title="Invetory Sheet"
66
+ :actions="[{
67
+ label: '+',
68
+ function: () => openProductsPopup()
69
+ }]"
32
70
  placeholder="No positions added yet"
33
71
  class="mn-b-semi"
34
72
  >
@@ -38,10 +76,6 @@
38
76
  :product="product"
39
77
  :array="leftovers.state.current.positions"
40
78
  :products="Products"
41
- @add="(item) => globals.actions.add(
42
- leftovers.state.current.positions,
43
- item
44
- )"
45
79
  @update="(item) => globals.actions.update(
46
80
  leftovers.state.current.positions,
47
81
  item,
@@ -52,8 +86,22 @@
52
86
  item,
53
87
  index
54
88
  )"
89
+ class="mn-b-small radius-medium bg-white pd-small"
55
90
  />
56
91
  </Block>
92
+
93
+ <Block
94
+ title="Comment"
95
+ class="mn-b-semi"
96
+ >
97
+ <Field
98
+ v-model:field="leftovers.state.current.comment"
99
+ label="Comment"
100
+ type="textarea"
101
+ class="w-100 bg-white radius-small pd-medium"
102
+ />
103
+
104
+ </Block>
57
105
 
58
106
  <Block class="">
59
107
  <section class="gap-thin flex-v-center flex-nojustify flex">
@@ -93,10 +141,13 @@
93
141
  import Block from '@pf/src/components/Block/Block.vue';
94
142
 
95
143
  import Field from '@pf/src/components/Field/Field.vue';
144
+ import Feed from '@pf/src/components/Feed/Feed.vue'
96
145
  import Select from '@pf/src/components/Select/Select.vue';
146
+ import Popup from '@pf/src/components/Popup/Popup.vue';
97
147
  import SelectMulti from '@pf/src/components/SelectMulti/SelectMulti.vue';
98
148
 
99
149
  import CardPosition from '@pf/src/modules/products/components/blocks/CardPosition.vue';
150
+ import CardOrderItem from '@pf/src/modules/orders/components/blocks/CardOrderItem.vue'
100
151
 
101
152
  import { computed, onMounted, ref, reactive } from 'vue';
102
153
  import { useRoute, useRouter } from 'vue-router';
@@ -118,6 +169,16 @@
118
169
  }, 0));
119
170
  });
120
171
 
172
+ const isOpenProductsPopup = ref(false);
173
+
174
+ function openProductsPopup() {
175
+ isOpenProductsPopup.value = true;
176
+ }
177
+
178
+ function closeProductsPopup() {
179
+ isOpenProductsPopup.value = false;
180
+ }
181
+
121
182
  onMounted(async () => {
122
183
  if (route.params.leftover) {
123
184
  try {
@@ -12,7 +12,7 @@
12
12
  </header>
13
13
 
14
14
  <section class="mn-b-semi pd-medium bg-grey radius-big">
15
- <p class="mn-b-thin">Spended:</p>
15
+ <p class="mn-b-thin">Balance:</p>
16
16
  <h3>{{formatPrice(totalPrice)}}</h3>
17
17
  </section>
18
18
 
@@ -47,6 +47,7 @@
47
47
  />
48
48
 
49
49
  <Feed
50
+ :search="true"
50
51
  :states="{
51
52
  empty: {
52
53
  title: 'No Leftovers Found',
@@ -58,9 +59,8 @@
58
59
  }"
59
60
  :options="{
60
61
  limit: 15,
61
- organization: route.params._id,
62
+ owner: route.params._id,
62
63
  ...(tab !== 'all' && { type: tab })
63
- // user: user
64
64
  }"
65
65
  v-slot="{
66
66
  items
@@ -62,7 +62,7 @@
62
62
  v-slot="{
63
63
  items
64
64
  }"
65
- class="cols-3 gap-thin"
65
+ class="cols-4 gap-thin"
66
66
  >
67
67
  <CardProduct
68
68
  v-for="product in items"
@@ -1,29 +1,66 @@
1
+ const queryProcessorGlobals = require('@pf/src/modules/globals/controllers/utils/queryProcessor');
2
+
1
3
  const controllerFactory = (db) => {
2
4
  const Leftover = db.leftover;
3
5
 
4
- const getAll = async (req, res) => {
6
+ const read = async (req, res) => {
5
7
  try {
6
- let query = {};
7
- let options = {};
8
8
 
9
- // Проверка наличия req.query.organization
10
- if (req.query.organization) {
11
- // Создание ObjectId из строки
12
- query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
13
- }
9
+ let matchConditions = [];
10
+
11
+ const search = req.query.search;
12
+
13
+ if (search) {
14
+ const parts = search.split('.');
14
15
 
15
- if (req.query.type) {
16
- query.type = req.query.type;
16
+ let regexPattern = '';
17
+
18
+ if (parts.length === 2) {
19
+ // Создаем паттерн, который допускает замену одного символа в каждой части
20
+ regexPattern = parts.map(part => part.substr(0, part.length - 1) + '.{1}').join('\\.');
21
+ } else {
22
+ // Если нет точки, применяем аналогичный подход к всей строке
23
+ regexPattern = search.substr(0, search.length - 1) + '.{1}';
24
+ }
25
+
26
+ matchConditions.push({
27
+ $or: [
28
+ { "comment": { $regex: regexPattern, $options: 'i' } },
29
+ { "positions.name": { $regex: regexPattern, $options: 'i' } }
30
+ ]
31
+ });
17
32
  }
18
33
 
19
- console.log(query);
34
+ const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
35
+
36
+ let stages = [
37
+ ...queryProcessorGlobals.getBasicOptions(
38
+ req.query
39
+ ),
40
+ // For creator
41
+ queryProcessorGlobals.getCreatorUserLookupStage(),
42
+ queryProcessorGlobals.getCreatorOrganizationLookupStage(),
43
+ // For owner
44
+ queryProcessorGlobals.getOwnerUserLookupStage(),
45
+ queryProcessorGlobals.getOwnerOrganizationLookupStage(),
46
+ queryProcessorGlobals.getAddFieldsCreatorOwnerStage(),
47
+
48
+ ...(matchStage != null ? [matchStage] : []),
49
+ // Pagination
50
+ ...queryProcessorGlobals.getSortingOptions(
51
+ req.query.sortParam,
52
+ req.query.sortOrder,
53
+ ),
54
+ ...queryProcessorGlobals.getPaginationOptions(
55
+ req.query.skip,
56
+ req.query.limit
57
+ )
58
+ ];
20
59
 
21
- const leftoveres = await Leftover.find(query, null, options)
22
- .sort({ createdAt: "desc" })
23
- .exec();
60
+ const leftoveres = await Leftover.aggregate(stages).exec();
24
61
 
25
- if (!leftoveres) {
26
- return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
62
+ if (!leftoveres.length) {
63
+ return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
27
64
  }
28
65
 
29
66
  res.status(200).send(leftoveres);
@@ -93,7 +130,7 @@ const controllerFactory = (db) => {
93
130
  };
94
131
 
95
132
  return {
96
- getAll,
133
+ read,
97
134
  create,
98
135
  get,
99
136
  update,
@@ -13,11 +13,16 @@ module.exports = (db) => {
13
13
  required: true,
14
14
  },
15
15
  order: {
16
+ type: db.mongoose.Schema.Types.ObjectId,
17
+ ref: 'Order',
18
+ },
19
+ comment: {
16
20
  type: String
17
21
  },
18
22
  store: {
19
23
  type: Object
20
24
  },
25
+
21
26
  positions: [{
22
27
  _id: {
23
28
  type: db.mongoose.Schema.Types.ObjectId,
@@ -10,7 +10,7 @@ module.exports = function(app, db) {
10
10
 
11
11
  app.get(
12
12
  "/leftovers",
13
- controller.getAll
13
+ controller.read
14
14
  );
15
15
 
16
16
 
@@ -91,8 +91,8 @@
91
91
  // Tones
92
92
  --red: 360, 70, 90;
93
93
  --red-nice: 354, 80, 100;
94
- --green: 120, 58, 70;
95
- --green-nice: 126, 70, 80;
94
+ --green: 88, 207, 57;
95
+ --green-nice: 35, 226, 0;
96
96
  --orange: 8, 72, 94;
97
97
  --orange-nice: 13, 70, 100;
98
98
  --yellow: 38, 100, 100;