@coopenomics/desktop 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/extensions/powerup/boot.ts +1 -1
  3. package/package.json +6 -6
  4. package/src/app/App.vue +4 -2
  5. package/src/app/providers/card/store.ts +6 -3
  6. package/src/boot/branch-selector.ts +0 -2
  7. package/src/boot/navigation-guards.ts +5 -7
  8. package/src/components/menu/footerMobileMenu.vue +4 -2
  9. package/src/components/soviet/staff.vue +9 -7
  10. package/src/desktops/User/model/index.ts +94 -87
  11. package/src/entities/Request/api/index.ts +19 -19
  12. package/src/entities/Request/model/stores.ts +1 -0
  13. package/src/entities/User/model/entity.ts +1 -0
  14. package/src/features/Agreementer/GenerateAgreement/ui/AgreementReader.vue +4 -2
  15. package/src/features/Agreementer/SignAgreementDialog/model/index.ts +4 -3
  16. package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +4 -2
  17. package/src/features/Branch/CreateBranch/model/index.ts +4 -3
  18. package/src/features/Branch/EditBranch/model/index.ts +3 -2
  19. package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -6
  20. package/src/features/Decision/VoteForDecision/model/index.ts +4 -2
  21. package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +4 -2
  22. package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +4 -6
  23. package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +3 -2
  24. package/src/features/Request/AcceptRequest/api/index.ts +20 -21
  25. package/src/features/Request/CancelRequest/api/index.ts +13 -17
  26. package/src/features/Request/CompleteOnRequest/api/index.ts +13 -17
  27. package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +17 -21
  28. package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +17 -21
  29. package/src/features/Request/CreateChildOrder/api/index.ts +27 -30
  30. package/src/features/Request/CreateParentOffer/api/index.ts +4 -14
  31. package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +5 -2
  32. package/src/features/Request/DeclineRequest/api/index.ts +14 -18
  33. package/src/features/Request/DeliverOnRequest/api/index.ts +13 -17
  34. package/src/features/Request/DisputeOnRequest/api/index.ts +3 -7
  35. package/src/features/Request/ModerateRequest/api/index.ts +14 -18
  36. package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +4 -3
  37. package/src/features/Request/ProhibitRequest/api/index.ts +14 -18
  38. package/src/features/Request/PublishRequest/api/index.ts +13 -17
  39. package/src/features/Request/RecieveOnRequest/api/index.ts +17 -21
  40. package/src/features/Request/SupplyOnRequest/api/index.ts +3 -3
  41. package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
  42. package/src/features/Request/UpdateRequest/api/index.ts +0 -4
  43. package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -2
  44. package/src/features/User/CreateUser/model/index.ts +10 -8
  45. package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +4 -2
  46. package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +4 -2
  47. package/src/pages/Cooperative/ListOfBranches/ui/ListOfBranchesPage.vue +4 -2
  48. package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +4 -2
  49. package/src/pages/Marketplace/CreateParentOffer/ui/CreateParentOfferPage.vue +3 -3
  50. package/src/pages/Marketplace/MainPage/ui/MainPage.vue +13 -13
  51. package/src/pages/Marketplace/Moderation/ui/ModerationPage.vue +7 -3
  52. package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +4 -2
  53. package/src/pages/Registrator/SignUp/PayInitial.vue +4 -2
  54. package/src/pages/Registrator/SignUp/ReadStatement.vue +7 -1
  55. package/src/pages/Registrator/SignUp/SelectBranch.vue +4 -2
  56. package/src/pages/Registrator/SignUp/SignUp.vue +7 -7
  57. package/src/pages/Registrator/SignUp/WaitingRegistration.vue +4 -2
  58. package/src/pages/Union/Connection/ConnectionPage.vue +1 -1
  59. package/src/pages/_layouts/default.vue +3 -2
  60. package/src/shared/store/index.ts +16 -18
  61. package/src/shared/ui/BaseDocument/BaseDocument.vue +1 -3
  62. package/src/shared/ui/Providers/Bank/Bank.vue +54 -2
  63. package/src/widgets/Agreementer/RequireAgreements/ui/RequireAgreements.vue +5 -3
  64. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +11 -3
  65. package/src/widgets/Cooperative/Contacts/ui/ChangeContacts.vue +5 -3
  66. package/src/widgets/Cooperative/Contributions/ui/ChangeContributions.vue +6 -4
  67. package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +8 -7
  68. package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +5 -3
  69. package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +5 -3
  70. package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +8 -7
  71. package/src/widgets/Cooperative/Members/ui/Members.vue +4 -2
  72. package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +4 -2
  73. package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +61 -62
  74. package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +5 -3
  75. package/src/widgets/Request/CreateChildOrderCard/CreateChildOrderCard.vue +5 -3
  76. package/src/widgets/Request/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +3 -3
  77. package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
  78. package/src/shared/api/wif.ts +0 -9
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.6](https://github.com/coopenomics/monocoop/compare/v2.2.6-alpha.0...v2.2.6) (2025-01-27)
7
+
8
+ **Note:** Version bump only for package @coopenomics/desktop
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.2.5](https://github.com/coopenomics/monocoop/compare/v2.2.4...v2.2.5) (2025-01-18)
7
15
 
8
16
  **Note:** Version bump only for package @coopenomics/desktop
@@ -13,5 +13,5 @@ export default boot(({ app, router }: { app: App<Element>; router: Router }) =>
13
13
  // component: () => import('./MyExtensionPage.vue')
14
14
  // })
15
15
 
16
- console.log('Расширение загружено успешно')
16
+ console.log('Расширение powerup загружено успешно')
17
17
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coopenomics/desktop",
3
- "version": "2.2.5",
3
+ "version": "2.2.6",
4
4
  "description": "A Desktop Project",
5
5
  "productName": "Desktop App",
6
6
  "author": "Alex Ant <dacom.dark.sun@gmail.com>",
@@ -20,8 +20,8 @@
20
20
  "prepublishOnly": "npm run build:lib"
21
21
  },
22
22
  "dependencies": {
23
- "@coopenomics/controller": "2.2.5",
24
- "@coopenomics/sdk": "2.2.5",
23
+ "@coopenomics/controller": "2.2.6",
24
+ "@coopenomics/sdk": "2.2.6",
25
25
  "@dicebear/collection": "^9.0.1",
26
26
  "@dicebear/core": "^9.0.1",
27
27
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
@@ -45,7 +45,7 @@
45
45
  "@wharfkit/wallet-plugin-privatekey": "^1.1.0",
46
46
  "axios": "^1.2.1",
47
47
  "compression": "^1.7.4",
48
- "cooptypes": "2.2.5",
48
+ "cooptypes": "2.2.6",
49
49
  "dompurify": "^3.1.7",
50
50
  "dotenv": "^16.4.5",
51
51
  "email-regex": "^5.0.0",
@@ -76,7 +76,7 @@
76
76
  "@types/node": "^12.20.21",
77
77
  "@typescript-eslint/eslint-plugin": "^5.10.0",
78
78
  "@typescript-eslint/parser": "^5.10.0",
79
- "@vue/language-plugin-pug": "^1.0.0",
79
+ "@vue/language-plugin-pug": "^1.8.27",
80
80
  "autoprefixer": "^10.4.2",
81
81
  "concurrently": "^8.2.2",
82
82
  "eslint": "^8.57.0",
@@ -94,5 +94,5 @@
94
94
  "npm": ">= 6.13.4",
95
95
  "yarn": ">= 1.21.1"
96
96
  },
97
- "gitHead": "97b21a9d69b6c387a1a7f2c32642d29c0898694e"
97
+ "gitHead": "d0bd4428bebd6971c23c27d8d26643d72e3f07cb"
98
98
  }
package/src/app/App.vue CHANGED
@@ -12,9 +12,11 @@ import { useRoute } from 'vue-router'
12
12
  import 'src/app/styles/quasar-variables.sass'
13
13
  import { useDesktopStore } from 'src/entities/Desktop/model';
14
14
  import { Cookies, LocalStorage, QSpinnerGears, useQuasar } from 'quasar';
15
- import { COOPNAME } from 'src/shared/config';
15
+
16
16
  import { RequireAgreements } from 'src/widgets/Agreementer/RequireAgreements/ui';
17
17
  import { SelectBranchOverlay } from 'src/features/Branch/SelectBranch';
18
+ import { useSystemStore } from 'src/entities/System/model';
19
+ const { info } = useSystemStore()
18
20
 
19
21
  const $q = useQuasar()
20
22
 
@@ -56,7 +58,7 @@ onMounted(async () => {
56
58
  const ref = Cookies.get('referer') || String(route.query.r || '')
57
59
 
58
60
  if (ref) {
59
- LocalStorage.setItem(`${COOPNAME}:referer`, ref)
61
+ LocalStorage.setItem(`${info.coopname}:referer`, ref)
60
62
  }
61
63
  } catch (e: unknown) {
62
64
 
@@ -2,7 +2,8 @@ import { defineStore } from 'pinia'
2
2
  import { useSessionStore } from 'src/entities/Session';
3
3
  import { useCurrentUserStore } from 'src/entities/User';
4
4
  import { useWalletStore } from 'src/entities/Wallet';
5
- import { COOPNAME } from 'src/shared/config';
5
+
6
+ import { useSystemStore } from 'src/entities/System/model';
6
7
 
7
8
  const namespace = 'cardstore'
8
9
 
@@ -18,12 +19,14 @@ export const useCardStore = defineStore(namespace, (): ICardStore => {
18
19
  const session = useSessionStore();
19
20
 
20
21
  async function initWallet(): Promise<void> {
22
+ const { info } = useSystemStore()
23
+
21
24
  // if (!session.isAuth && !currentUser.userAccount){
22
25
  await session.init()
23
26
  if (session.isAuth)
24
27
  try{
25
- await currentUser.loadProfile(session.username, COOPNAME)
26
- await userWallet.loadUserWalet({coopname: COOPNAME, username: session.username})
28
+ await currentUser.loadProfile(session.username, info.coopname)
29
+ await userWallet.loadUserWalet({coopname: info.coopname, username: session.username})
27
30
  session.loadComplete = true
28
31
 
29
32
  } catch(e: any){
@@ -20,9 +20,7 @@ export default async () => {
20
20
  account.account.participant_account.braname === ''//у пользователя нет установленного кооперативного участка
21
21
  ) {
22
22
  isVisible.value = true;
23
- console.log('on select branch', isVisible);
24
23
  } else {
25
- console.log('not need select branch');
26
24
  isVisible.value = false;
27
25
  }
28
26
  };
@@ -1,9 +1,9 @@
1
1
  // src/boot/navigation-guards.js
2
2
  import { boot } from 'quasar/wrappers';
3
- import { COOPNAME } from 'src/shared/config';
4
3
  import { useSessionStore } from 'src/entities/Session';
5
4
  import { useCurrentUserStore } from 'src/entities/User';
6
5
  import { useDesktopStore } from 'src/entities/Desktop/model';
6
+ import { useSystemStore } from 'src/entities/System/model';
7
7
 
8
8
  // Function to handle access logic
9
9
  function hasAccess(to, userAccount) {
@@ -17,13 +17,13 @@ export default boot(async ({ router }) => {
17
17
  const desktops = useDesktopStore();
18
18
  const session = useSessionStore();
19
19
  const currentUser = useCurrentUserStore();
20
+ const { info } = useSystemStore()
20
21
 
21
22
  router.beforeEach(async (to, from, next) => {
22
23
  await desktops.healthCheck();
23
- console.log('to', to)
24
+
24
25
  if (desktops.health?.status === 'install' && to.name !== 'install') {
25
- console.log(1)
26
- next({ name: 'install', params: { coopname: COOPNAME } });
26
+ next({ name: 'install', params: { coopname: info.coopname } });
27
27
  return;
28
28
  }
29
29
 
@@ -33,9 +33,7 @@ export default boot(async ({ router }) => {
33
33
  ? desktops.currentDesktop?.authorizedHome
34
34
  : desktops.currentDesktop?.nonAuthorizedHome;
35
35
 
36
- console.log('homePage: ', homePage)
37
- // next();
38
- next({ name: homePage, params: { coopname: COOPNAME } });
36
+ next({ name: homePage, params: { coopname: info.coopname } });
39
37
  return;
40
38
  }
41
39
 
@@ -28,7 +28,9 @@ import { useRouter } from 'vue-router'
28
28
  import { useQuasar } from 'quasar'
29
29
  import { useMenuStore } from 'src/entities/Menu'
30
30
  import type { IMenu } from 'src/entities/Menu'
31
- import { COOPNAME } from 'src/shared/config'
31
+ import { useSystemStore } from 'src/entities/System/model';
32
+ const { info } = useSystemStore()
33
+
32
34
  import { useCurrentUserStore } from 'src/entities/User'
33
35
  const emit = defineEmits(['toogleMore'])
34
36
  const $q = useQuasar()
@@ -47,7 +49,7 @@ const headerClass = (route: IMenu) => {
47
49
  }
48
50
 
49
51
  const open = (route: IMenu) => {
50
- router.push({ name: route.name, params: { coopname: COOPNAME } })
52
+ router.push({ name: route.name, params: { coopname: info.coopname } })
51
53
  }
52
54
  </script>
53
55
 
@@ -106,7 +106,9 @@ const username = computed(() => session.username)
106
106
  const showAdd = ref(false);
107
107
  import moment from 'moment-with-locales-es6'
108
108
  import { useAddAdmin } from 'src/features/Cooperative/AddAdmin';
109
- import { COOPNAME } from 'src/shared/config';
109
+ import { useSystemStore } from 'src/entities/System/model';
110
+ const { info } = useSystemStore()
111
+
110
112
  import { useCooperativeStore } from 'src/entities/Cooperative';
111
113
  import { useSetRights } from 'src/features/Cooperative/SetRights';
112
114
  const cooperativeStore = useCooperativeStore()
@@ -115,7 +117,7 @@ const staff = computed(() => cooperativeStore.admins)
115
117
  const loadStaff = async () => {
116
118
 
117
119
  try {
118
- await cooperativeStore.loadAdmins(COOPNAME)
120
+ await cooperativeStore.loadAdmins(info.coopname)
119
121
  } catch (e: any) {
120
122
 
121
123
  Notify.create({
@@ -157,14 +159,14 @@ const rmRight = (rightIndex: number, username: string) => {
157
159
  const addStaff = async () => {
158
160
  try {
159
161
  useAddAdmin().addAdmin({
160
- coopname: COOPNAME,
162
+ coopname: info.coopname,
161
163
  chairman: username.value,
162
164
  username: newPersona.value.username,
163
165
  rights: [],
164
166
  position_title: newPersona.value.position_title,
165
167
  })
166
168
 
167
- cooperativeStore.loadAdmins(COOPNAME)
169
+ cooperativeStore.loadAdmins(info.coopname)
168
170
 
169
171
  newPersona.value = {
170
172
  username: '',
@@ -193,12 +195,12 @@ const addStaff = async () => {
193
195
  // const rmStaff = async (username) => {
194
196
  // try {
195
197
  // await useDeleteAdmin().deleteAdmin({
196
- // coopname: COOPNAME,
198
+ // coopname: info.coopname,
197
199
  // chairman: session.username,
198
200
  // username
199
201
  // })
200
202
 
201
- // cooperativeStore.loadAdmins(COOPNAME)
203
+ // cooperativeStore.loadAdmins(info.coopname)
202
204
 
203
205
  // Notify.create({
204
206
  // message: 'Администратор уволен',
@@ -227,7 +229,7 @@ const setRights = async (newUsername: string) => {
227
229
  const user = staff.value.find(u => u.username === newUsername);
228
230
 
229
231
  await useSetRights().setRights({
230
- coopname: COOPNAME,
232
+ coopname: info.coopname,
231
233
  chairman: username.value,
232
234
  username: newUsername,
233
235
  rights: user?.rights as { contract: string; action_name: string; }[]
@@ -8,6 +8,13 @@ import { agreementsBase } from 'src/shared/lib/consts/workspaces';
8
8
  import { ConnectionPage } from 'src/pages/Union/Connection';
9
9
  import { ListOfDocumentsPage } from 'src/pages/Documentor/ListOfDocuments';
10
10
  import { CoopCardPage } from 'src/pages/User/CardPage';
11
+ import { MainMarketplacePage } from 'src/pages/Marketplace/MainPage';
12
+ import { ModerationPage } from 'src/pages/Marketplace/Moderation';
13
+ import { CreateParentOfferPage } from 'src/pages/Marketplace/CreateParentOffer';
14
+ import { ShowcasePage } from 'src/pages/Marketplace/Showcase';
15
+ import { UserParentOffersPage } from 'src/pages/Marketplace/UserParentOffers';
16
+ import { UserSuppliesListPage } from 'src/pages/Marketplace/UserSuppliesList';
17
+ import { SuppliesListPage } from 'src/pages/Marketplace/SuppliesList';
11
18
 
12
19
  export const manifest = {
13
20
  'name': 'UserDesktop',
@@ -163,7 +170,92 @@ export const manifest = {
163
170
  roles: [],
164
171
  },
165
172
  },
166
-
173
+ // {
174
+ // meta: {
175
+ // title: 'Маркетплейс',
176
+ // icon: 'fa-solid fa-cog',
177
+ // roles: [],
178
+ // },
179
+ // path: '/:coopname/marketplace',
180
+ // name: 'marketplace',
181
+ // component: markRaw(MainMarketplacePage),
182
+ // children: [
183
+ // {
184
+ // path: 'moderation',
185
+ // name: 'marketplace-moderation',
186
+ // component: markRaw(ModerationPage),
187
+ // meta: {
188
+ // title: 'Модерация',
189
+ // icon: '',
190
+ // roles: ['member', 'chairman'],
191
+ // },
192
+ // },
193
+ // {
194
+ // path: 'create-offer',
195
+ // name: 'marketplace-create-offer',
196
+ // component: markRaw(CreateParentOfferPage),
197
+ // meta: {
198
+ // title: 'Создать объявление',
199
+ // icon: '',
200
+ // roles: [],
201
+ // },
202
+ // },
203
+ // {
204
+ // path: 'showcase',
205
+ // name: 'marketplace-showcase',
206
+ // component: markRaw(ShowcasePage),
207
+ // children: [
208
+ // {
209
+ // path: ':id',
210
+ // name: 'marketplace-showcase-id',
211
+ // component: markRaw(ShowcasePage),
212
+ // },
213
+ // ],
214
+ // meta: {
215
+ // title: 'Витрина',
216
+ // icon: '',
217
+ // roles: [],
218
+ // },
219
+ // },
220
+ // {
221
+ // path: 'user-offers',
222
+ // name: 'marketplace-user-offers',
223
+ // component: markRaw(UserParentOffersPage),
224
+ // children: [
225
+ // {
226
+ // path: ':id',
227
+ // name: 'marketplace-user-offer-id',
228
+ // component: markRaw(UserParentOffersPage),
229
+ // },
230
+ // ],
231
+ // meta: {
232
+ // title: 'Мои объявления',
233
+ // icon: '',
234
+ // roles: [],
235
+ // },
236
+ // },
237
+ // {
238
+ // path: 'supplies',
239
+ // name: 'marketplace-supplies',
240
+ // component: markRaw(SuppliesListPage),
241
+ // meta: {
242
+ // title: 'Все заказы',
243
+ // icon: '',
244
+ // roles: ['member', 'chairman'],
245
+ // },
246
+ // },
247
+ // {
248
+ // path: 'user-supplies',
249
+ // name: 'marketplace-user-supplies',
250
+ // component: markRaw(UserSuppliesListPage),
251
+ // meta: {
252
+ // title: 'Мои заказы',
253
+ // icon: '',
254
+ // roles: [],
255
+ // },
256
+ // },
257
+ // ],
258
+ // },
167
259
  // {
168
260
  // meta: {
169
261
  // title: 'Поддержка',
@@ -207,92 +299,7 @@ export const manifest = {
207
299
 
208
300
 
209
301
 
210
- // {
211
- // meta: {
212
- // title: 'Маркетплейс',
213
- // icon: 'fa-solid fa-cog',
214
- // roles: [],
215
- // },
216
- // path: '/:coopname/marketplace',
217
- // name: 'marketplace',
218
- // component: markRaw(MainMarketplacePage),
219
- // children: [
220
- // {
221
- // path: 'moderation',
222
- // name: 'marketplace-moderation',
223
- // component: markRaw(ModerationPage),
224
- // meta: {
225
- // title: 'Модерация',
226
- // icon: '',
227
- // roles: ['member', 'chairman'],
228
- // },
229
- // },
230
- // {
231
- // path: 'create-offer',
232
- // name: 'marketplace-create-offer',
233
- // component: markRaw(CreateParentOfferPage),
234
- // meta: {
235
- // title: 'Создать объявление',
236
- // icon: '',
237
- // roles: [],
238
- // },
239
- // },
240
- // {
241
- // path: 'showcase',
242
- // name: 'marketplace-showcase',
243
- // component: markRaw(ShowcasePage),
244
- // children: [
245
- // {
246
- // path: ':id',
247
- // name: 'marketplace-showcase-id',
248
- // component: markRaw(ShowcasePage),
249
- // },
250
- // ],
251
- // meta: {
252
- // title: 'Витрина',
253
- // icon: '',
254
- // roles: [],
255
- // },
256
- // },
257
- // {
258
- // path: 'user-offers',
259
- // name: 'marketplace-user-offers',
260
- // component: markRaw(UserParentOffersPage),
261
- // children: [
262
- // {
263
- // path: ':id',
264
- // name: 'marketplace-user-offer-id',
265
- // component: markRaw(UserParentOffersPage),
266
- // },
267
- // ],
268
- // meta: {
269
- // title: 'Мои объявления',
270
- // icon: '',
271
- // roles: [],
272
- // },
273
- // },
274
- // {
275
- // path: 'supplies',
276
- // name: 'marketplace-supplies',
277
- // component: markRaw(SuppliesListPage),
278
- // meta: {
279
- // title: 'Все заказы',
280
- // icon: '',
281
- // roles: ['member', 'chairman'],
282
- // },
283
- // },
284
- // {
285
- // path: 'user-supplies',
286
- // name: 'marketplace-user-supplies',
287
- // component: markRaw(UserSuppliesListPage),
288
- // meta: {
289
- // title: 'Мои заказы',
290
- // icon: '',
291
- // roles: [],
292
- // },
293
- // },
294
- // ],
295
- // },
302
+
296
303
  //страница контактов
297
304
  // {
298
305
  // path: ':coopname/contacts',
@@ -1,9 +1,8 @@
1
+ import { MarketContract } from 'cooptypes';
1
2
  import { fetchTable } from '../../../shared/api';
2
3
  import {
3
- ContractsList,
4
4
  LimitsList,
5
5
  SecondaryIndexesNumbers,
6
- TablesList,
7
6
  } from '../../../shared/config';
8
7
  import { ILoadAllRequests, IUpdateOneRequest } from '../model';
9
8
  import type {
@@ -27,9 +26,9 @@ async function loadAllRequests(
27
26
  params: ILoadAllRequests
28
27
  ): Promise<IRequestData[]> {
29
28
  const requests = (await fetchTable(
30
- ContractsList.Marketplace,
29
+ MarketContract.contractName.production,
31
30
  params.coopname,
32
- TablesList.CoopMarketRequests
31
+ MarketContract.Tables.Requests.tableName,
33
32
  )) as any[];
34
33
 
35
34
  requests.map((el) => (el.data = parseRequestObjectData(el.data)));
@@ -42,9 +41,9 @@ async function loadOneRequest(
42
41
  ): Promise<IRequestData> {
43
42
  const request = (
44
43
  await fetchTable(
45
- ContractsList.Marketplace,
44
+ MarketContract.contractName.production,
46
45
  params.coopname,
47
- TablesList.CoopMarketRequests,
46
+ MarketContract.Tables.Requests.tableName,
48
47
  params.request_id,
49
48
  params.request_id,
50
49
  1
@@ -55,9 +54,9 @@ async function loadOneRequest(
55
54
  if (request.parent_id !== 0) {
56
55
  const parent_request = (
57
56
  (await fetchTable(
58
- ContractsList.Marketplace,
57
+ MarketContract.contractName.production,
59
58
  params.coopname,
60
- TablesList.CoopMarketRequests,
59
+ MarketContract.Tables.Requests.tableName,
61
60
  request.parent_id,
62
61
  request.parent_id,
63
62
  1
@@ -74,16 +73,17 @@ async function loadOneRequest(
74
73
  async function loadAllParentOffers(
75
74
  params: ILoadAllParentOffers
76
75
  ): Promise<IRequestData[]> {
76
+ console.log(params)
77
77
  const requests = (await fetchTable(
78
- ContractsList.Marketplace,
78
+ MarketContract.contractName.production,
79
79
  params.coopname,
80
- TablesList.CoopMarketRequests,
80
+ MarketContract.Tables.Requests.tableName,
81
81
  0,
82
82
  0,
83
83
  LimitsList.None,
84
84
  SecondaryIndexesNumbers.Six
85
85
  )) as any[];
86
-
86
+ console.log('loaded:', requests)
87
87
  requests.map((el) => (el.data = parseRequestObjectData(el.data)));
88
88
 
89
89
  return requests as IRequestData[];
@@ -94,9 +94,9 @@ async function loadAllChildOrders(
94
94
  ): Promise<IRequestData[]> {
95
95
  const child_requests = (
96
96
  (await fetchTable(
97
- ContractsList.Marketplace,
97
+ MarketContract.contractName.production,
98
98
  params.coopname,
99
- TablesList.CoopMarketRequests,
99
+ MarketContract.Tables.Requests.tableName,
100
100
  1,
101
101
  -1,
102
102
  LimitsList.None,
@@ -119,9 +119,9 @@ async function loadUserParentOffers(
119
119
  ): Promise<IRequestData[]> {
120
120
  const requests = (
121
121
  (await fetchTable(
122
- ContractsList.Marketplace,
122
+ MarketContract.contractName.production,
123
123
  params.coopname,
124
- TablesList.CoopMarketRequests,
124
+ MarketContract.Tables.Requests.tableName,
125
125
  params.username,
126
126
  params.username,
127
127
  LimitsList.None,
@@ -142,9 +142,9 @@ async function loadUserChildOrders(
142
142
  // получаем встречные заявки, в которых пользователь - родитель
143
143
  const user_incoming_requests = (
144
144
  (await fetchTable(
145
- ContractsList.Marketplace,
145
+ MarketContract.contractName.production,
146
146
  params.coopname,
147
- TablesList.CoopMarketRequests,
147
+ MarketContract.Tables.Requests.tableName,
148
148
  params.username,
149
149
  params.username,
150
150
  LimitsList.None,
@@ -158,9 +158,9 @@ async function loadUserChildOrders(
158
158
  //получаем исходящие заявки пользователя
159
159
  const user_outcoming_requests = (
160
160
  (await fetchTable(
161
- ContractsList.Marketplace,
161
+ MarketContract.contractName.production,
162
162
  params.coopname,
163
- TablesList.CoopMarketRequests,
163
+ MarketContract.Tables.Requests.tableName,
164
164
  params.username,
165
165
  params.username,
166
166
  LimitsList.None,
@@ -81,6 +81,7 @@ export const useRequestStore = defineStore(namespace, (): IRequestsStore => {
81
81
  allParentOffers.value = (await api.loadAllParentOffers(params)).sort(
82
82
  (a, b) => Number(b.id) - Number(a.id)
83
83
  )
84
+ console.log('on load', params, allParentOffers.value)
84
85
  }
85
86
 
86
87
  const loadAllChildOrders = async (params: ILoadAllChildOrders): Promise<void> => {
@@ -32,6 +32,7 @@ export class UserEntity {
32
32
  username,
33
33
  coopname
34
34
  );
35
+
35
36
  }
36
37
 
37
38
  async loadPrivateProfile(username: string): Promise<void> {
@@ -4,7 +4,9 @@ div(v-if="agreement")
4
4
  </template>
5
5
 
6
6
  <script setup lang="ts">
7
- import { COOPNAME } from 'src/shared/config';
7
+ import { useSystemStore } from 'src/entities/System/model';
8
+ const { info } = useSystemStore()
9
+
8
10
  import { useGenerateAgreement } from '../model';
9
11
  import { useSessionStore } from 'src/entities/Session';
10
12
  import { computed, onMounted } from 'vue';
@@ -28,7 +30,7 @@ div(v-if="agreement")
28
30
 
29
31
  onMounted(async () => {
30
32
  try {
31
- await generateAgreement(COOPNAME, session.username, Number(props.agreement.draft_id));
33
+ await generateAgreement(info.coopname, session.username, Number(props.agreement.draft_id));
32
34
  } catch(e: any){
33
35
  FailAlert(`Возникла ошибка при генерации соглашения, пожалуйста, обратитесь в поддержку с сообщением: ${e.message}`);
34
36
  }
@@ -1,8 +1,9 @@
1
1
  import { DigitalDocument, type IGeneratedDocument } from 'src/shared/lib/document';
2
2
  import { api } from '../api';
3
- import { COOPNAME } from 'src/shared/config';
3
+ import { useSystemStore } from 'src/entities/System/model';
4
4
 
5
5
  export const useSignAgreement = () => {
6
+ const { info } = useSystemStore()
6
7
 
7
8
  const signAgreement = async(username: string, agreement_type: string, agreement: IGeneratedDocument) => {
8
9
  const document = new DigitalDocument(agreement);
@@ -13,8 +14,8 @@ export const useSignAgreement = () => {
13
14
 
14
15
 
15
16
  await api.sendAgreement({
16
- coopname: COOPNAME,
17
- administrator: COOPNAME,
17
+ coopname: info.coopname,
18
+ administrator: info.coopname,
18
19
  username,
19
20
  agreement_type,
20
21
  document: {...document.signedDocument, meta: JSON.stringify(document.signedDocument.meta)}
@@ -17,7 +17,9 @@ import { SovietContract } from 'cooptypes';
17
17
  import { FailAlert, SuccessAlert } from 'src/shared/api';
18
18
  import { useSignAgreement } from '../model';
19
19
  import { useWalletStore } from 'src/entities/Wallet';
20
- import { COOPNAME } from 'src/shared/config';
20
+ import { useSystemStore } from 'src/entities/System/model';
21
+ const { info } = useSystemStore()
22
+
21
23
  import { useSessionStore } from 'src/entities/Session';
22
24
  import { Loader } from 'src/shared/ui/Loader';
23
25
 
@@ -54,7 +56,7 @@ const sign = async () => {
54
56
  try {
55
57
  isSubmitting.value = true
56
58
  await signAgreement(session.username, props.agreement.type, agreementOnSign.value)
57
- await useWalletStore().loadUserWalet({coopname: COOPNAME, username: session.username})
59
+ await useWalletStore().loadUserWalet({coopname: info.coopname, username: session.username})
58
60
  isSubmitting.value = false
59
61
  show.value = false
60
62
  SuccessAlert('Документ принят')