@ozdao/prometheus-framework 0.2.61 → 0.2.63

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/dist/auth.server.js +37 -8
  2. package/dist/auth.server.mjs +37 -8
  3. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +1 -55
  5. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +55 -1
  7. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +72 -1
  9. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -72
  11. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -46
  13. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +46 -1
  15. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
  17. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
  21. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  31. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
  37. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  39. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  43. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  45. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  51. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  53. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  55. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  65. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  71. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  77. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
  85. package/dist/style.css +1 -1
  86. package/package.json +1 -1
  87. package/src/components/Feed/Feed.vue +2 -1
  88. package/src/modules/auth/auth.server.js +1 -0
  89. package/src/modules/products/components/pages/EditLeftover.vue +98 -86
  90. package/src/modules/products/components/pages/Leftovers.vue +3 -3
  91. package/src/modules/products/components/pages/Product.vue +2 -2
  92. package/src/modules/products/components/pages/Products.vue +12 -11
  93. package/src/modules/products/controllers/leftovers.controller.js +10 -1
  94. package/src/modules/products/store/leftovers.js +2 -2
@@ -1,90 +1,91 @@
1
1
  <template>
2
- <header class="mn-b-medium gap-small flex-v-center flex-nowrap flex">
3
- <h2 class="">{{route.params.leftover ? 'Edit ' : 'Add ' }} Inventory</h2>
4
-
5
- <Select
6
- v-model:select="leftovers.state.current.type"
7
- :options="[
8
- 'stock-in',
9
- 'stock-out',
10
- 'write-off'
11
- ]"
12
- :placeholder="'Select type'"
13
- class="bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
14
- />
15
- </header>
16
-
17
- <Block
18
- title="Add Position"
19
- class="mn-b-semi"
20
- >
21
- <CardPosition
22
- @add="(item) => globals.actions.add(
23
- leftovers.state.current.positions,
24
- item
25
- )"
26
- :products="Products"
27
- />
28
- </Block>
29
-
30
- <Block
31
- title="Invetory Sheet"
32
- placeholder="No positions added yet"
33
- class="mn-b-semi"
34
- >
35
- <CardPosition
36
- v-for="(product, index) in leftovers.state.current.positions"
37
- :key="product._id"
38
- :product="product"
39
- :array="leftovers.state.current.positions"
40
- :products="Products"
41
- @add="(item) => globals.actions.add(
42
- leftovers.state.current.positions,
43
- item
44
- )"
45
- @update="(item) => globals.actions.update(
46
- leftovers.state.current.positions,
47
- item,
48
- index
49
- )"
50
- @delete="(item) => globals.actions.delete(
51
- leftovers.state.current.positions,
52
- item,
53
- index
54
- )"
55
- />
56
- </Block>
57
-
58
- <Block class="">
59
- <section class="gap-thin flex-v-center flex-nojustify flex">
60
-
61
- <h3 class="mn-r-auto">
62
- In total: {{formatPrice(totalPrice)}}
63
- </h3>
64
-
65
- <a
66
- @click="onSubmit()"
67
- class="bg-main button"
68
- >
69
- Save
70
- </a>
71
-
72
- <a
73
- class="t-white bg-second button"
74
- @click="onReset()"
75
- >
76
- Reset
77
- </a>
78
-
79
- <a
80
- v-if="route.params.leftover"
81
- @click="onDelete()"
82
- class="t-white bg-red button"
83
- >
84
- Delete
85
- </a>
86
- </section>
87
- </Block>
2
+ <div class="pd-thin">
3
+ <header class="mn-b-medium gap-small flex-v-center flex-nowrap flex">
4
+ <h2 class="">{{route.params.leftover ? 'Edit ' : 'Add ' }} Inventory</h2>
5
+
6
+ <Select
7
+ v-model:select="leftovers.state.current.type"
8
+ :options="[
9
+ 'stock-in',
10
+ 'stock-out'
11
+ ]"
12
+ :placeholder="'Select type'"
13
+ class="bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
14
+ />
15
+ </header>
16
+
17
+ <Block
18
+ title="Add Position"
19
+ class="mn-b-semi"
20
+ >
21
+ <CardPosition
22
+ @add="(item) => globals.actions.add(
23
+ leftovers.state.current.positions,
24
+ item
25
+ )"
26
+ :products="Products"
27
+ />
28
+ </Block>
29
+
30
+ <Block
31
+ title="Invetory Sheet"
32
+ placeholder="No positions added yet"
33
+ class="mn-b-semi"
34
+ >
35
+ <CardPosition
36
+ v-for="(product, index) in leftovers.state.current.positions"
37
+ :key="product._id"
38
+ :product="product"
39
+ :array="leftovers.state.current.positions"
40
+ :products="Products"
41
+ @add="(item) => globals.actions.add(
42
+ leftovers.state.current.positions,
43
+ item
44
+ )"
45
+ @update="(item) => globals.actions.update(
46
+ leftovers.state.current.positions,
47
+ item,
48
+ index
49
+ )"
50
+ @delete="(item) => globals.actions.delete(
51
+ leftovers.state.current.positions,
52
+ item,
53
+ index
54
+ )"
55
+ />
56
+ </Block>
57
+
58
+ <Block class="">
59
+ <section class="gap-thin flex-v-center flex-nojustify flex">
60
+
61
+ <h3 class="mn-r-auto">
62
+ In total: {{formatPrice(totalPrice)}}
63
+ </h3>
64
+
65
+ <a
66
+ @click="onSubmit()"
67
+ class="bg-main button"
68
+ >
69
+ Save
70
+ </a>
71
+
72
+ <a
73
+ class="t-white bg-second button"
74
+ @click="onReset()"
75
+ >
76
+ Reset
77
+ </a>
78
+
79
+ <a
80
+ v-if="route.params.leftover"
81
+ @click="onDelete()"
82
+ class="t-white bg-red button"
83
+ >
84
+ Delete
85
+ </a>
86
+ </section>
87
+ </Block>
88
+ </div>
88
89
  </template>
89
90
 
90
91
 
@@ -101,6 +102,7 @@
101
102
  import { useRoute, useRouter } from 'vue-router';
102
103
 
103
104
  import * as globals from '@pf/src/modules/globals/store/globals';
105
+ import * as auth from '@pf/src/modules/auth/store/auth';
104
106
  import * as leftovers from '@pf/src/modules/products/store/leftovers';
105
107
  import * as products from '@pf/src/modules/products/store/products';
106
108
 
@@ -155,6 +157,16 @@
155
157
  (error) => console.error('error')
156
158
  );
157
159
  } else {
160
+ leftovers.state.current.creator = {
161
+ type: 'user',
162
+ target: auth.state.user._id
163
+ }
164
+ leftovers.state.current.owner = {
165
+ type: 'organization',
166
+ target: route.params._id
167
+ }
168
+
169
+ console.log('leftover state is', leftovers.state.current)
158
170
  leftovers.actions.create(leftovers.state.current).then(
159
171
  () => router.push({ name: 'Leftovers', params: {_id: route.params._id} }),
160
172
  (error) => console.error('error')
@@ -41,8 +41,7 @@
41
41
  :tabs="[
42
42
  { name: 'All', value: 'all' },
43
43
  { name: 'Stock-In', value: 'stock-in' },
44
- { name: 'Stock-Out', value: 'stock-out' },
45
- { name: 'Write-Off', value: 'write-off' },
44
+ { name: 'Stock-Out', value: 'stock-out' }
46
45
  ]"
47
46
  class="mn-b-small o-hidden h5 radius-big bg-grey"
48
47
  />
@@ -59,7 +58,8 @@
59
58
  }"
60
59
  :options="{
61
60
  limit: 15,
62
- organization: route.params._id
61
+ organization: route.params._id,
62
+ ...(tab !== 'all' && { type: tab })
63
63
  // user: user
64
64
  }"
65
65
  v-slot="{
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <div class="flex flex-column w-100 o-hidden gap-thin pd-thin">
3
3
  <!-- <Breadcrumbs class="bg-grey radius-big pd-small"/> -->
4
- {{product.quantity}}
4
+ <!-- {{product.quantity}}
5
5
  <div v-if="product.ingredients">
6
6
  {{product?.ingredients[0]?._id}}
7
7
  {{product?.ingredients[0]?.quantity}}
8
8
  {{product?.ingredients[1]?.quantity}}
9
- </div>
9
+ </div> -->
10
10
  <SectionProduct v-if="product" :product="product" :user="auth.state.user" class="pos-relative"/>
11
11
 
12
12
  <PopularProducts />
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <div class="pd-thin">
2
3
  <header
3
4
  v-if="route.name !== 'Organization'"
4
5
  class="mn-b-medium flex-v-center flex-nowrap flex"
@@ -6,16 +7,16 @@
6
7
  <h2 class="mn-r-medium">Products</h2>
7
8
  <button
8
9
  @click="$router.push({
9
- name: 'AddProduct'
10
+ name: 'ProductAdd'
10
11
  })"
11
12
  class="radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second">
12
13
  +
13
14
  </button>
14
15
  </header>
15
- <!--
16
+
16
17
  <Tab
17
18
  v-if="route.name !== 'Organization'"
18
- v-model:selected="tab"
19
+ v-model:selected="tabProducts"
19
20
  :tabs="[
20
21
  { name: 'All', value: 'all' },
21
22
  { name: 'Published', value: 'published' },
@@ -24,7 +25,7 @@
24
25
  ]"
25
26
  class="mn-b-small o-hidden h5 radius-big bg-grey"
26
27
  />
27
- -->
28
+
28
29
  <div class="cols-2-1_3 bg-grey pd-thin radius-big gap-thin">
29
30
 
30
31
  <FilterProducts
@@ -37,7 +38,6 @@
37
38
  placeholder="Enter product name"
38
39
  class="bg-white mn-b-thin"
39
40
  />
40
- {{tab}}
41
41
  <Feed
42
42
  :states="{
43
43
  empty: {
@@ -56,7 +56,7 @@
56
56
  prices: route.query.prices,
57
57
  delivery: route.query.delivery,
58
58
  search: route.query.search,
59
- status: tab === 'all' ? '' : tab ? tab : ''
59
+ ...(tabProducts !== 'all' && { status: tabProducts })
60
60
  // user: user
61
61
  }"
62
62
  v-slot="{
@@ -80,6 +80,7 @@
80
80
  </Feed>
81
81
  </div>
82
82
  </div>
83
+ </div>
83
84
  </template>
84
85
 
85
86
 
@@ -104,13 +105,13 @@
104
105
  const router = useRouter()
105
106
 
106
107
  // Tab logic
107
- // const tab = ref(route.query.tab ? route.query.tab : 'all')
108
+ const tabProducts = ref(route.query.tabProducts ? route.query.tabProducts : 'all')
108
109
 
109
- // route.query.tab = tab.value
110
+ route.query.tabProducts = tabProducts.value
110
111
 
111
- // watch(tab, (newValue) => {
112
- // router.replace({ query: { ...route.query, tab: newValue } });
113
- // });
112
+ watch(tabProducts, (newValue) => {
113
+ router.replace({ query: { ...route.query, tabProducts: newValue } });
114
+ });
114
115
 
115
116
  function updateSearch(search) {
116
117
  let query = { ...route.query}
@@ -12,6 +12,10 @@ const controllerFactory = (db) => {
12
12
  query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
13
13
  }
14
14
 
15
+ if (req.query.type) {
16
+ query.type = req.query.type;
17
+ }
18
+
15
19
  console.log(query);
16
20
 
17
21
  const leftoveres = await Leftover.find(query, null, options)
@@ -31,17 +35,22 @@ const controllerFactory = (db) => {
31
35
 
32
36
  const create = async (req, res) => {
33
37
  try {
38
+
39
+ console.log(req.body)
34
40
  const leftover = await Leftover.create({
35
41
  organization: req.body.organization,
36
42
  type: req.body.type,
37
43
  order: req.body.order,
38
- positions: req.body.positions
44
+ positions: req.body.positions,
45
+ creator: req.body.creator,
46
+ owner: req.body.owner
39
47
  });
40
48
  if (!leftover) {
41
49
  return res.status(404).send({ message: "ERROR_CREATING_LEFTOVER" });
42
50
  }
43
51
  res.status(200).send(leftover);
44
52
  } catch (err) {
53
+ console.log(err)
45
54
  res.status(500).send({ message: "ERROR_CREATE_LEFTOVER" });
46
55
  }
47
56
  };
@@ -41,9 +41,9 @@ const actions = {
41
41
  }
42
42
  },
43
43
 
44
- async create({ organization, type, order, positions }) {
44
+ async create({ organization, type, order, positions, creator, owner }) {
45
45
  try {
46
- const response = await $axios.post('/leftovers', { organization, type, order, positions });
46
+ const response = await $axios.post('/leftovers', { organization, type, order, positions, creator, owner });
47
47
  state.all.push(response.data);
48
48
  return response.data;
49
49
  } catch (error) {