@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.
- package/dist/main-BoybHtmb.mjs +13753 -0
- package/dist/main-CJ7URLjm.js +91 -0
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +3 -3
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +1 -55
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +55 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -97
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +97 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +46 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +1 -46
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/icons/icons.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/icons.client.js +59 -58
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +78 -74
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +117 -76
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-B9Vtg5cN.mjs +54 -0
- package/dist/web-ZM1AOTc1.js +1 -0
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/components/Feed/Feed.vue +17 -18
- package/src/components/Field/Field.vue +1 -0
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/modules/globals/components/blocks/CardHeader.vue +6 -3
- package/src/modules/globals/controllers/utils/queryProcessor.js +2 -1
- package/src/modules/globals/store/globals.js +3 -4
- package/src/modules/icons/icons.client.js +1 -0
- package/src/modules/products/components/blocks/CardLeftover.vue +47 -27
- package/src/modules/products/components/blocks/CardPosition.vue +57 -51
- package/src/modules/products/components/pages/EditLeftover.vue +77 -16
- package/src/modules/products/components/pages/Leftovers.vue +3 -3
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/products/controllers/leftovers.controller.js +54 -17
- package/src/modules/products/models/leftover.model.js +5 -0
- package/src/modules/products/routes/leftovers.routes.js +1 -1
- package/src/styles/config.scss +2 -2
@@ -1,55 +1,61 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="gap-thin
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
<
|
18
|
-
title="Add
|
19
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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">
|
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
|
-
|
62
|
+
owner: route.params._id,
|
62
63
|
...(tab !== 'all' && { type: tab })
|
63
|
-
// user: user
|
64
64
|
}"
|
65
65
|
v-slot="{
|
66
66
|
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
|
6
|
+
const read = async (req, res) => {
|
5
7
|
try {
|
6
|
-
let query = {};
|
7
|
-
let options = {};
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
let matchConditions = [];
|
10
|
+
|
11
|
+
const search = req.query.search;
|
12
|
+
|
13
|
+
if (search) {
|
14
|
+
const parts = search.split('.');
|
14
15
|
|
15
|
-
|
16
|
-
|
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
|
-
|
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.
|
22
|
-
.sort({ createdAt: "desc" })
|
23
|
-
.exec();
|
60
|
+
const leftoveres = await Leftover.aggregate(stages).exec();
|
24
61
|
|
25
|
-
if (!leftoveres) {
|
26
|
-
|
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
|
-
|
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,
|
package/src/styles/config.scss
CHANGED