@coopenomics/desktop 2.2.10 → 2025.4.29

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 (355) hide show
  1. package/.env-example +6 -1
  2. package/.env-testnet +8 -0
  3. package/Dockerfile +12 -0
  4. package/extensions/market/install.ts +78 -0
  5. package/extensions/market-admin/install.ts +42 -0
  6. package/extensions/participant/install.ts +125 -0
  7. package/extensions/powerup/install.ts +20 -0
  8. package/extensions/soviet/install.ts +83 -0
  9. package/package.json +6 -5
  10. package/quasar.config.cjs +5 -12
  11. package/src/app/App.vue +44 -73
  12. package/src/app/layouts/default.vue +40 -0
  13. package/src/app/layouts/useDefaultLayoutLogic.ts +59 -0
  14. package/src/app/providers/routes/index.ts +19 -34
  15. package/src/app/styles/style.css +4 -0
  16. package/src/boot/init.ts +6 -0
  17. package/src/boot/sentry.ts +1 -2
  18. package/src/desktops/index.ts +0 -6
  19. package/src/entities/Account/model/index.ts +1 -1
  20. package/src/entities/Agenda/api/index.ts +20 -0
  21. package/src/entities/Agenda/index.ts +2 -0
  22. package/src/entities/Agenda/model/index.ts +2 -0
  23. package/src/entities/Agenda/model/store.ts +36 -0
  24. package/src/entities/Agenda/model/types.ts +4 -0
  25. package/src/entities/Branch/model/index.ts +1 -1
  26. package/src/entities/Desktop/api/index.ts +16 -1
  27. package/src/entities/Desktop/model/store.ts +112 -106
  28. package/src/entities/Desktop/model/types.ts +14 -1
  29. package/src/entities/Document/api/index.ts +24 -0
  30. package/src/entities/Document/index.ts +2 -0
  31. package/src/entities/Document/model/store.ts +117 -0
  32. package/src/entities/Document/model/types.ts +18 -0
  33. package/src/entities/Meet/api/index.ts +58 -0
  34. package/src/entities/Meet/index.ts +2 -0
  35. package/src/entities/Meet/model/store.ts +72 -0
  36. package/src/entities/Meet/types/index.ts +7 -0
  37. package/src/entities/Payment/api/index.ts +20 -0
  38. package/src/entities/Payment/model/index.ts +2 -0
  39. package/src/entities/Payment/model/store.ts +62 -0
  40. package/src/entities/Payment/model/types.ts +7 -0
  41. package/src/entities/Session/model/store.ts +3 -3
  42. package/src/entities/System/model/store.ts +1 -1
  43. package/src/entities/User/model/stores.ts +3 -1
  44. package/src/entities/Wallet/api/index.ts +15 -33
  45. package/src/entities/Wallet/model/stores.ts +3 -23
  46. package/src/entities/Wallet/model/types.ts +2 -3
  47. package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +1 -1
  48. package/src/features/Branch/SelectBranch/index.ts +2 -0
  49. package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +52 -105
  50. package/src/features/Decision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +1 -1
  51. package/src/features/Decision/ParticipantApplication/model/index.ts +38 -0
  52. package/src/features/FreeDecision/CreateProject/model/index.ts +92 -0
  53. package/src/features/FreeDecision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +51 -0
  54. package/src/features/FreeDecision/CreateProject/ui/index.ts +1 -0
  55. package/src/features/FreeDecision/GenerateDecision/index.ts +1 -0
  56. package/src/features/FreeDecision/GenerateDecision/model/index.ts +36 -0
  57. package/src/features/FreeDecision/index.ts +2 -0
  58. package/src/features/Meet/CloseMeetWithDecision/index.ts +1 -0
  59. package/src/features/Meet/CloseMeetWithDecision/model/index.ts +92 -0
  60. package/src/features/Meet/CreateMeet/index.ts +2 -0
  61. package/src/features/Meet/CreateMeet/model/index.ts +65 -0
  62. package/src/features/Meet/CreateMeet/ui/CreateMeet.vue +34 -0
  63. package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +136 -0
  64. package/src/features/Meet/CreateMeet/ui/index.ts +2 -0
  65. package/src/features/Meet/GenerateAgenda/index.ts +1 -0
  66. package/src/features/Meet/GenerateAgenda/model/index.ts +18 -0
  67. package/src/features/Meet/GenerateBallot/index.ts +1 -0
  68. package/src/features/Meet/GenerateBallot/model/index.ts +18 -0
  69. package/src/features/Meet/GenerateNotification/index.ts +1 -0
  70. package/src/features/Meet/GenerateNotification/model/index.ts +18 -0
  71. package/src/features/Meet/GenerateSovietDecision/index.ts +1 -0
  72. package/src/features/Meet/GenerateSovietDecision/model/index.ts +48 -0
  73. package/src/features/Meet/MeetDetailsManagement/index.ts +1 -0
  74. package/src/features/Meet/MeetDetailsManagement/model/index.ts +121 -0
  75. package/src/features/Meet/RestartMeet/index.ts +2 -0
  76. package/src/features/Meet/RestartMeet/model/index.ts +54 -0
  77. package/src/features/Meet/RestartMeet/ui/RestartMeet.vue +46 -0
  78. package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +92 -0
  79. package/src/features/Meet/RestartMeet/ui/index.ts +2 -0
  80. package/src/features/Meet/VoteOnMeet/index.ts +1 -0
  81. package/src/features/Meet/VoteOnMeet/model/index.ts +18 -0
  82. package/src/features/Payment/SetStatus/api/index.ts +20 -0
  83. package/src/features/Payment/SetStatus/index.ts +1 -0
  84. package/src/features/Payment/SetStatus/model/index.ts +30 -0
  85. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/SetOrderPaidStatusButton.vue +7 -3
  86. package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +2 -2
  87. package/src/features/PaymentMethod/AddPaymentMethod/ui/AddPaymentButton.vue +1 -1
  88. package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +1 -1
  89. package/src/features/PaymentMethod/DeletePaymentMethod/ui/DeletePaymentMethodButton.vue +3 -1
  90. package/src/features/Request/CancelRequest/ui/CancelButton.vue +1 -1
  91. package/src/features/Request/ConfirmRecieveOnRequest/ui/ConfirmRecieveOnRequest.vue +1 -1
  92. package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +3 -5
  93. package/src/features/Request/CreateParentOffer/ui/ImageUploaderWithPreview/ImageUploaderWithPreview.vue +4 -3
  94. package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
  95. package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +2 -2
  96. package/src/features/Request/PublishRequest/ui/PublishRequestButton.vue +1 -1
  97. package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
  98. package/src/features/Request/UnpublishRequest/ui/UnpublishRequestButton.vue +1 -1
  99. package/src/features/Union/AddCooperative/model/index.ts +4 -5
  100. package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +5 -6
  101. package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -4
  102. package/src/features/User/LoginUser/model/index.ts +3 -3
  103. package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +0 -6
  104. package/src/features/User/Logout/model/index.ts +2 -0
  105. package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +8 -7
  106. package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +6 -7
  107. package/src/pages/Blank/index.ts +1 -0
  108. package/src/pages/Contacts/ContactsPage.vue +64 -0
  109. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/index.ts +0 -1
  110. package/src/{widgets/Cooperative/Contributions/ui/ChangeContributions.vue → pages/Cooperative/ChangeRegisterPayments/ui/ChangeRegisterPayments.vue} +10 -11
  111. package/src/pages/Cooperative/ChangeRegisterPayments/ui/index.ts +1 -0
  112. package/src/pages/Cooperative/ListOfAgenda/index.ts +1 -0
  113. package/src/pages/Cooperative/ListOfAgenda/ui/ListOfAgendaQuestions.vue +118 -0
  114. package/src/pages/Cooperative/ListOfAgenda/ui/index.ts +1 -0
  115. package/src/pages/Cooperative/ListOfDocuments/ListOfDocumentsPage.vue +24 -0
  116. package/src/pages/Cooperative/ListOfMeets/model/index.ts +1 -0
  117. package/src/pages/Cooperative/ListOfMeets/model/model.ts +117 -0
  118. package/src/pages/Cooperative/ListOfMeets/ui/ListOfMeetsPage.vue +90 -0
  119. package/src/pages/Cooperative/ListOfMeets/ui/index.ts +1 -0
  120. package/src/pages/Cooperative/ListOfOrders/index.ts +1 -1
  121. package/src/pages/Cooperative/ListOfOrders/ui/ListOfOrdersPage.vue +0 -4
  122. package/src/pages/Cooperative/ListOfParticipants/ui/ListOfParticipantsPage.vue +61 -10
  123. package/src/pages/Cooperative/ListOfParticipants/ui/index.ts +1 -1
  124. package/src/pages/Cooperative/MeetDetails/ui/MeetDetailsPage.vue +88 -0
  125. package/src/pages/Cooperative/MeetDetails/ui/index.ts +1 -0
  126. package/src/pages/Cooperative/MemberBranchList/ui/index.ts +1 -0
  127. package/src/pages/Cooperative/Payments/index.ts +1 -0
  128. package/src/pages/Cooperative/Payments/ui/PaymentsPage.vue +7 -0
  129. package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/ExtensionPage.vue +35 -20
  130. package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/ExtensionsShowcase.vue +2 -2
  131. package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/InstalledExtensions.vue +2 -2
  132. package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +1 -1
  133. package/src/pages/Marketplace/Showcase/ui/ShowcasePage.vue +1 -1
  134. package/src/pages/Marketplace/SuppliesList/ui/SuppliesListPage.vue +1 -1
  135. package/src/pages/Marketplace/UserParentOffers/ui/UserParentOffersPage.vue +1 -1
  136. package/src/pages/Marketplace/UserSuppliesList/ui/UserSuppliesListPage.vue +1 -1
  137. package/src/pages/PermissionDenied/index.ts +1 -0
  138. package/src/pages/Registrator/SignUp/EmailInput.vue +2 -3
  139. package/src/pages/Registrator/SignUp/GenerateAccount.vue +2 -3
  140. package/src/pages/Registrator/SignUp/PayInitial.vue +1 -1
  141. package/src/pages/Registrator/SignUp/ReadStatement.vue +2 -2
  142. package/src/pages/Registrator/SignUp/SelectBranch.vue +2 -2
  143. package/src/pages/Registrator/SignUp/SignStatement.vue +2 -2
  144. package/src/pages/Registrator/SignUp/SignUp.vue +5 -12
  145. package/src/pages/Registrator/SignUp/WaitingRegistration.vue +1 -5
  146. package/src/pages/Registrator/SignUp/Welcome.vue +4 -3
  147. package/src/pages/Union/ConnectionAgreement/index.ts +1 -0
  148. package/src/pages/Union/ListOfCooperatives/ui/UnionPageListOfCooperatives.vue +139 -6
  149. package/src/pages/User/DocumentsPage/UserDocumentsPage.vue +23 -0
  150. package/src/pages/User/DocumentsPage/index.ts +1 -0
  151. package/src/pages/User/PaymentsPage/ui/UserPayments.vue +11 -0
  152. package/src/pages/User/PaymentsPage/ui/index.ts +1 -0
  153. package/src/pages/User/ProfilePage/index.ts +1 -0
  154. package/src/pages/User/ProfilePage/ui/ProfilePage.vue +114 -0
  155. package/src/pages/User/ProfilePage/ui/index.ts +1 -0
  156. package/src/pages/User/SettingsPage/ui/index.ts +1 -1
  157. package/src/pages/User/WalletPage/index.ts +1 -0
  158. package/src/pages/User/WalletPage/ui/WalletPage.vue +72 -0
  159. package/src/pages/User/WalletPage/ui/index.ts +1 -0
  160. package/src/processes/init-app/index.ts +28 -0
  161. package/src/processes/init-installed-extensions/index.ts +25 -0
  162. package/src/processes/init-wallet/index.ts +40 -0
  163. package/src/processes/navigation-guard-setup/index.ts +45 -0
  164. package/src/processes/process-decisions/index.ts +275 -0
  165. package/src/processes/select-branch/index.ts +80 -0
  166. package/src/processes/watch-branch-overlay/index.ts +38 -0
  167. package/src/processes/watch-desktop-health/index.ts +33 -0
  168. package/src/shared/api/alerts.ts +2 -6
  169. package/src/shared/api/axios.ts +4 -5
  170. package/src/shared/api/client.ts +3 -4
  171. package/src/shared/api/eosio.ts +1 -2
  172. package/src/shared/api/utils.ts +1 -3
  173. package/src/shared/config/index.ts +0 -1
  174. package/src/shared/hooks/index.ts +2 -0
  175. package/src/shared/hooks/useAgendaPoints.ts +24 -0
  176. package/src/shared/hooks/useWindowSize.ts +13 -0
  177. package/src/shared/lib/composables/useDisplayName.ts +34 -0
  178. package/src/shared/lib/navigation/index.ts +2 -0
  179. package/src/shared/lib/navigation/routeUtils.ts +51 -0
  180. package/src/shared/lib/navigation/useBackButton.ts +63 -0
  181. package/src/shared/lib/utils/dates/validateDateWithinRange.ts +23 -0
  182. package/src/shared/ui/BaseDocument/BaseDocument.vue +120 -90
  183. package/src/{components/menu/blockchainStatus.vue → shared/ui/BlockchainStatusBar/BlockchainStatusBar.vue} +1 -0
  184. package/src/shared/ui/BlockchainStatusBar/index.ts +1 -0
  185. package/src/shared/ui/CardStyles/index.scss +61 -0
  186. package/src/shared/ui/ComplexDocument/ComplexDocument.vue +31 -8
  187. package/src/shared/ui/CopyableInput/index.ts +1 -0
  188. package/src/shared/ui/CopyableInput/ui/CopyableInput.vue +62 -0
  189. package/src/shared/ui/EditableEntrepreneurCard/EditableEntrepreneurCard.vue +9 -8
  190. package/src/shared/ui/EditableIndividualCard/EditableIndividualCard.vue +10 -10
  191. package/src/shared/ui/EditableOrganizationCard/EditableOrganizationCard.vue +57 -47
  192. package/src/shared/ui/Form/Form.vue +3 -1
  193. package/src/shared/ui/InputStyles/index.scss +29 -0
  194. package/src/shared/ui/TabStyles/index.scss +53 -0
  195. package/src/shared/ui/index.ts +1 -0
  196. package/src/{components/history/AccountEvents.vue → widgets/AccountActions/AccountActionsPage.vue} +2 -2
  197. package/src/widgets/AccountActions/index.ts +1 -0
  198. package/src/widgets/BankDetailsCard/ui/BankDetailsCard.vue +2 -2
  199. package/src/widgets/BranchCard/ui/BranchCard.vue +2 -2
  200. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentCard.vue +48 -0
  201. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentsTable.vue +162 -0
  202. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/ListOfDocumentsWidget.vue +77 -120
  203. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/index.ts +3 -1
  204. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/ListOfOrdersWidget.vue +135 -128
  205. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/OrderCard.vue +74 -0
  206. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/index.ts +2 -1
  207. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/ListOfPaymentsWidget.vue +216 -0
  208. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/PaymentCard.vue +73 -0
  209. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/index.ts +2 -0
  210. package/src/widgets/Cooperative/Payments/index.ts +1 -0
  211. package/src/widgets/Desktop/LeftDrawerMenu/LeftDrawerMenu.vue +3 -2
  212. package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +58 -91
  213. package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +114 -59
  214. package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/ExtensionCard.vue +12 -7
  215. package/src/widgets/Header/BackButton/BackButton.vue +25 -0
  216. package/src/widgets/Header/BackButton/index.ts +1 -0
  217. package/src/widgets/Header/CommonHeader/CooperativeSettingsHeader.vue +34 -0
  218. package/src/widgets/Header/CommonHeader/ExtstoreHeader.vue +41 -0
  219. package/src/widgets/Header/CommonHeader/Header.vue +33 -198
  220. package/src/widgets/Header/CommonHeader/HeaderStyles.scss +22 -0
  221. package/src/widgets/Header/CommonHeader/MainHeader.vue +87 -0
  222. package/src/widgets/Header/CommonHeader/UserSettingsHeader.vue +29 -0
  223. package/src/widgets/Header/CommonHeader/index.ts +1 -1
  224. package/src/widgets/Header/SettingsDropdown/SettingsDropdown.vue +0 -6
  225. package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/Base.vue +1 -2
  226. package/src/widgets/Meets/MeetDetailsActions/MeetDetailsActions.vue +51 -0
  227. package/src/widgets/Meets/MeetDetailsActions/index.ts +1 -0
  228. package/src/widgets/Meets/MeetDetailsActions/model.ts +46 -0
  229. package/src/widgets/Meets/MeetDetailsAgenda/MeetDetailsAgenda.vue +29 -0
  230. package/src/widgets/Meets/MeetDetailsAgenda/index.ts +1 -0
  231. package/src/widgets/Meets/MeetDetailsHeader/MeetDetailsHeader.vue +40 -0
  232. package/src/widgets/Meets/MeetDetailsHeader/index.ts +1 -0
  233. package/src/widgets/Meets/MeetDetailsVoting/MeetDetailsVoting.vue +77 -0
  234. package/src/widgets/Meets/MeetDetailsVoting/index.ts +1 -0
  235. package/src/widgets/Meets/MeetDetailsVoting/model.ts +117 -0
  236. package/src/widgets/Meets/MeetInfoCard/ui/MeetInfoCard.vue +38 -0
  237. package/src/widgets/Meets/MeetInfoCard/ui/index.ts +1 -0
  238. package/src/widgets/Meets/MeetsTable/ui/MeetsTable.vue +118 -0
  239. package/src/widgets/Meets/MeetsTable/ui/index.ts +1 -0
  240. package/src/widgets/Participants/index.ts +1 -0
  241. package/src/widgets/Participants/ui/ParticipantCard.vue +89 -0
  242. package/src/widgets/Participants/ui/ParticipantDetails.vue +79 -0
  243. package/src/widgets/Participants/ui/ParticipantsTable.vue +129 -0
  244. package/src/widgets/Participants/ui/index.ts +4 -0
  245. package/src/widgets/Questions/index.ts +3 -0
  246. package/src/widgets/Questions/ui/QuestionCard/QuestionCard.vue +109 -0
  247. package/src/widgets/Questions/ui/QuestionCard/index.ts +1 -0
  248. package/src/widgets/Questions/ui/QuestionsTable/QuestionsTable.vue +177 -0
  249. package/src/widgets/Questions/ui/QuestionsTable/index.ts +1 -0
  250. package/src/widgets/Questions/ui/VotingButtons/VotingButtons.vue +75 -0
  251. package/src/widgets/Questions/ui/VotingButtons/index.ts +1 -0
  252. package/src/widgets/Questions/ui/index.ts +3 -0
  253. package/src/widgets/RequireAgreements/index.ts +1 -0
  254. package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +81 -85
  255. package/tsconfig.json +1 -1
  256. package/extensions/powerup/boot.ts +0 -17
  257. package/src/app/providers/card/store.ts +0 -42
  258. package/src/boot/branch-selector.ts +0 -40
  259. package/src/boot/init-stores.ts +0 -51
  260. package/src/boot/navigation-guards.ts +0 -46
  261. package/src/components/menu/footerMobileMenu.vue +0 -79
  262. package/src/components/soviet/index.vue +0 -76
  263. package/src/components/soviet/staff.vue +0 -274
  264. package/src/desktops/User/index.ts +0 -1
  265. package/src/desktops/User/model/index.ts +0 -329
  266. package/src/entities/Menu/model/store.ts +0 -69
  267. package/src/entities/Menu/model/types.ts +0 -11
  268. package/src/entities/Menu/ui/index.ts +0 -1
  269. package/src/entities/Order/api/index.ts +0 -14
  270. package/src/entities/Order/model/store.ts +0 -87
  271. package/src/features/Order/SetStatus/api/index.ts +0 -7
  272. package/src/features/Order/SetStatus/model/index.ts +0 -23
  273. package/src/pages/Cooperative/Contacts/ui/ContactsPage.vue +0 -7
  274. package/src/pages/Cooperative/ListOfBranches/ui/index.ts +0 -1
  275. package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +0 -12
  276. package/src/pages/Union/Connection/index.ts +0 -1
  277. package/src/pages/_layouts/blank.vue +0 -24
  278. package/src/pages/_layouts/default.vue +0 -79
  279. package/src/types/index.ts +0 -3
  280. package/src/widgets/Commutator/Commutator.vue +0 -7
  281. package/src/widgets/Commutator/index.ts +0 -1
  282. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +0 -273
  283. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/index.ts +0 -1
  284. package/src/widgets/Cooperative/Contacts/ui/Contacts.vue +0 -52
  285. package/src/widgets/Cooperative/Contributions/ui/index.ts +0 -1
  286. package/src/widgets/Cooperative/Description/ui/SetDescription.vue +0 -4
  287. package/src/widgets/Cooperative/Description/ui/index.ts +0 -1
  288. package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/ListOfParticipantsWidget.vue +0 -186
  289. package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/index.ts +0 -1
  290. package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +0 -59
  291. package/src/widgets/Desktop/SecondLevelMenu/index.ts +0 -1
  292. package/src/widgets/IndividualCard/ui/IndividualCard.vue +0 -170
  293. package/src/widgets/IndividualCard/ui/index.ts +0 -1
  294. package/src/widgets/OrganizationCard/ui/OrganizationCard.vue +0 -44
  295. package/src/widgets/OrganizationCard/ui/index.ts +0 -1
  296. package/src/widgets/Union/ListOfCooperatives/ui/UnionListOfCooperatives.vue +0 -136
  297. package/src/widgets/Union/ListOfCooperatives/ui/index.ts +0 -1
  298. package/src/entities/{Menu → Document}/model/index.ts +0 -0
  299. package/src/entities/{Order → Meet}/model/index.ts +0 -0
  300. package/src/entities/{Order → Payment}/index.ts +0 -0
  301. package/src/features/{Order/SetStatus → Decision/ParticipantApplication}/index.ts +0 -0
  302. package/src/{widgets/Request/SupplyOrderRequestCard → features/FreeDecision/CreateProject}/index.ts +0 -0
  303. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/SetOrderCompletedStatusButton.vue +0 -0
  304. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/index.ts +0 -0
  305. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/index.ts +0 -0
  306. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/SetOrderRefundedStatusButton.vue +0 -0
  307. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/index.ts +0 -0
  308. package/src/pages/{blank/blank.vue → Blank/BlankPage.vue} +0 -0
  309. package/src/pages/{Cooperative/Contacts/ui → Contacts}/index.ts +0 -0
  310. package/src/pages/Cooperative/{Contacts → ChangeContacts}/index.ts +0 -0
  311. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/ChangeContacts.vue +0 -0
  312. package/src/pages/Cooperative/{ListOfBranches → ChangeRegisterPayments}/index.ts +0 -0
  313. package/src/pages/{Documentor → Cooperative}/ListOfDocuments/index.ts +0 -0
  314. package/src/pages/{Installer → Cooperative/ListOfMeets}/index.ts +0 -0
  315. package/src/{widgets/Cooperative/Agenda/ListOfQuestions → pages/Cooperative/MeetDetails}/index.ts +0 -0
  316. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/MemberBranchList}/index.ts +0 -0
  317. package/src/pages/Cooperative/{ListOfBranches/ui/ListOfBranchesPage.vue → MemberBranchList/ui/MemberBranchListPage.vue} +0 -0
  318. package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/ExtensionStoreBase.vue +0 -0
  319. package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/index.ts +0 -0
  320. package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/index.ts +0 -0
  321. package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/index.ts +0 -0
  322. package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/index.ts +0 -0
  323. package/src/pages/{_layouts/permissionDenied.vue → PermissionDenied/PermissionDenied.vue} +0 -0
  324. package/src/pages/Union/{Connection/ConnectionPage.vue → ConnectionAgreement/ConnectionAgreementPage.vue} +0 -0
  325. package/src/{widgets/Cooperative/Contributions → pages/Union/InstallCooperative}/index.ts +0 -0
  326. package/src/pages/{Installer → Union/InstallCooperative}/ui/InstallCooperativePage.vue +0 -0
  327. package/src/pages/{Installer → Union/InstallCooperative}/ui/index.ts +0 -0
  328. package/src/{widgets/Cooperative/Participants/ListOfParticipants → pages/User/PaymentsPage}/index.ts +0 -0
  329. package/src/{components/history → widgets/AccountActions}/AccountLink.vue +0 -0
  330. package/src/{components/history → widgets/AccountActions}/ActionCell.vue +0 -0
  331. package/src/{components/history → widgets/AccountActions}/DataCell.vue +0 -0
  332. package/src/widgets/{IndividualCard → Cooperative/Payments/ListOfPayments}/index.ts +0 -0
  333. package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/index.ts +0 -0
  334. package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/CreateChildOrderCard.vue +0 -0
  335. package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/index.ts +0 -0
  336. package/src/widgets/{Request → Marketplace}/RequestCard/RequestCard.vue +0 -0
  337. package/src/widgets/{Request → Marketplace}/RequestCard/index.ts +0 -0
  338. package/src/{entities/Menu → widgets/Marketplace/SupplyOrderRequestCard}/index.ts +1 -1
  339. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/index.ts +0 -0
  340. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/types.ts +0 -0
  341. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/index.ts +0 -0
  342. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/EightStep.vue +0 -0
  343. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FifthStep.vue +0 -0
  344. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +0 -0
  345. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FourthStep.vue +0 -0
  346. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SecondStep.vue +0 -0
  347. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SeventhStep.vue +0 -0
  348. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SixthStep.vue +0 -0
  349. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/ThirdStep.vue +0 -0
  350. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/index.ts +0 -0
  351. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/index.ts +0 -0
  352. /package/src/widgets/{OrganizationCard → Meets/MeetInfoCard}/index.ts +0 -0
  353. /package/src/widgets/{Union/ListOfCooperatives → Meets/MeetsTable}/index.ts +0 -0
  354. /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/RequireAgreements.vue +0 -0
  355. /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/index.ts +0 -0
@@ -0,0 +1,117 @@
1
+ import { defineStore } from 'pinia'
2
+ import { ref, type Ref } from 'vue'
3
+ import { api } from '../api'
4
+ import type { DocumentType, IGetDocuments, IPagination, IDocumentPackageAggregate } from './types'
5
+ import { FailAlert } from 'src/shared/api'
6
+
7
+ const namespace = 'documentStore'
8
+
9
+ interface IDocumentStore {
10
+ documents: Ref<IDocumentPackageAggregate[]>
11
+ loading: Ref<boolean>
12
+ documentType: Ref<DocumentType>
13
+ pagination: Ref<IPagination>
14
+ changePage: (page: number, username: string, filter: Record<string, any>, hidden?: boolean) => Promise<IDocumentPackageAggregate[]>
15
+ changeDocumentType: (type: DocumentType, username: string, filter: Record<string, any>) => Promise<void>
16
+ resetDocuments: () => void
17
+ }
18
+ /**
19
+ * Хранилище для работы с документами
20
+ */
21
+ export const useDocumentStore = defineStore(namespace, (): IDocumentStore => {
22
+ const documents = ref<IDocumentPackageAggregate[]>([])
23
+ const loading = ref(false)
24
+ const documentType = ref<DocumentType>('newsubmitted')
25
+
26
+ // Информация о пагинации
27
+ const pagination = ref<IPagination>({
28
+ totalCount: 0,
29
+ totalPages: 0,
30
+ currentPage: 1
31
+ })
32
+
33
+ /**
34
+ * Сброс состояния документов
35
+ */
36
+ const resetDocuments = () => {
37
+ documents.value = []
38
+ pagination.value = {
39
+ totalCount: 0,
40
+ totalPages: 0,
41
+ currentPage: 1
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Изменяет страницу для пагинации и загружает данные
47
+ * @param page номер страницы
48
+ * @param username имя пользователя или кооператива
49
+ * @param filter параметры фильтрации
50
+ * @param hidden флаг скрытой загрузки (без индикатора)
51
+ * @returns массив документов
52
+ */
53
+ const changePage = async (
54
+ page: number,
55
+ username: string,
56
+ filter: Record<string, any>,
57
+ hidden = false
58
+ ): Promise<IDocumentPackageAggregate[]> => {
59
+ try {
60
+ loading.value = hidden ? false : true
61
+
62
+ pagination.value.currentPage = page
63
+
64
+ const data: IGetDocuments = {
65
+ username,
66
+ filter,
67
+ type: documentType.value,
68
+ page: page,
69
+ limit: 10
70
+ }
71
+
72
+ const result = await api.loadDocuments(data)
73
+
74
+ // Если это первая страница, заменяем документы
75
+ // Иначе добавляем новые документы к существующим
76
+ if (page === 1) {
77
+ documents.value = result.items
78
+ } else {
79
+ documents.value = [...documents.value, ...result.items]
80
+ }
81
+
82
+ // Обновляем информацию о пагинации
83
+ pagination.value = {
84
+ totalCount: result.totalCount,
85
+ totalPages: result.totalPages,
86
+ currentPage: result.currentPage
87
+ }
88
+
89
+ loading.value = false
90
+ return documents.value
91
+ } catch (error: any) {
92
+ loading.value = false
93
+ console.error('Error loading documents:', error)
94
+ FailAlert(error)
95
+ return []
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Изменяет тип документов для отображения
101
+ */
102
+ const changeDocumentType = async (type: DocumentType, username: string, filter: Record<string, any>) => {
103
+ documentType.value = type
104
+ // Сбрасываем текущую страницу при смене типа и загружаем документы
105
+ await changePage(1, username, filter)
106
+ }
107
+
108
+ return {
109
+ documents,
110
+ loading,
111
+ documentType,
112
+ pagination,
113
+ changePage,
114
+ changeDocumentType,
115
+ resetDocuments
116
+ }
117
+ })
@@ -0,0 +1,18 @@
1
+ import type { Queries, Zeus } from '@coopenomics/sdk';
2
+
3
+ export type IDocumentPackageAggregate = Zeus.ModelTypes['DocumentPackageAggregate'];
4
+ export type IDocumentAggregate = Zeus.ModelTypes['DocumentAggregate'];
5
+ export type ZGetDocumentsResult = Queries.Documents.GetDocuments.IOutput[typeof Queries.Documents.GetDocuments.name];
6
+ export type IGetDocuments = Queries.Documents.GetDocuments.IInput['data']
7
+
8
+ // Информация о пагинации
9
+ export interface IPagination {
10
+ totalCount: number;
11
+ totalPages: number;
12
+ currentPage: number;
13
+ }
14
+
15
+ // Типы документов в системе
16
+ export type DocumentType = 'newsubmitted' | 'newresolved';
17
+
18
+
@@ -0,0 +1,58 @@
1
+ import { client } from 'src/shared/api/client';
2
+ import { Queries, Mutations } from '@coopenomics/sdk';
3
+ import type { IGetMeetsInput, IGetMeetInput, ICloseMeetInput, IRestartMeetInput } from '../types';
4
+
5
+ async function loadMeets(data: IGetMeetsInput) {
6
+ const { [Queries.Meet.GetMeets.name]: output } = await client.Query(
7
+ Queries.Meet.GetMeets.query,
8
+ {
9
+ variables: {
10
+ data
11
+ }
12
+ }
13
+ );
14
+ return output;
15
+ }
16
+
17
+ async function loadMeet(data: IGetMeetInput) {
18
+ const { [Queries.Meet.GetMeet.name]: output } = await client.Query(
19
+ Queries.Meet.GetMeet.query,
20
+ {
21
+ variables: {
22
+ data
23
+ }
24
+ }
25
+ );
26
+ return output;
27
+ }
28
+
29
+ async function closeMeet(data: ICloseMeetInput) {
30
+ const { [Mutations.Meet.SignByPresiderOnAnnualGeneralMeet.name]: output } = await client.Mutation(
31
+ Mutations.Meet.SignByPresiderOnAnnualGeneralMeet.mutation,
32
+ {
33
+ variables: {
34
+ data
35
+ }
36
+ }
37
+ );
38
+ return output;
39
+ }
40
+
41
+ async function restartMeet(data: IRestartMeetInput) {
42
+ const { [Mutations.Meet.RestartAnnualGeneralMeet.name]: output } = await client.Mutation(
43
+ Mutations.Meet.RestartAnnualGeneralMeet.mutation,
44
+ {
45
+ variables: {
46
+ data
47
+ }
48
+ }
49
+ );
50
+ return output;
51
+ }
52
+
53
+ export const api = {
54
+ loadMeets,
55
+ loadMeet,
56
+ closeMeet,
57
+ restartMeet
58
+ }
@@ -0,0 +1,2 @@
1
+ export * from './model'
2
+ export * from './types'
@@ -0,0 +1,72 @@
1
+ import { defineStore } from 'pinia'
2
+ import { ref, Ref } from 'vue'
3
+ import { api } from '../api'
4
+ import type { IMeet, IGetMeetsInput, IGetMeetInput, ICloseMeetInput, IRestartMeetInput } from '../types';
5
+
6
+ const namespace = 'meetStore';
7
+
8
+ interface IMeetStore {
9
+ meets: Ref<IMeet[]>
10
+ currentMeet: Ref<IMeet | null>
11
+ loading: Ref<boolean>
12
+ loadMeets: (data: IGetMeetsInput) => Promise<IMeet[]>;
13
+ loadMeet: (data: IGetMeetInput) => Promise<IMeet>;
14
+ closeMeet: (data: ICloseMeetInput) => Promise<IMeet>;
15
+ restartMeet: (data: IRestartMeetInput) => Promise<IMeet>;
16
+ }
17
+
18
+ export const useMeetStore = defineStore(namespace, (): IMeetStore => {
19
+ const meets = ref<IMeet[]>([])
20
+ const currentMeet = ref<IMeet | null>(null)
21
+ const loading = ref<boolean>(false)
22
+
23
+ const loadMeets = async (data: IGetMeetsInput) => {
24
+ loading.value = true
25
+ try {
26
+ const result = await api.loadMeets(data);
27
+ meets.value = result;
28
+ return result;
29
+ } finally {
30
+ loading.value = false
31
+ }
32
+ };
33
+
34
+ const loadMeet = async (data: IGetMeetInput) => {
35
+ loading.value = true
36
+ try {
37
+ const result = await api.loadMeet(data);
38
+ currentMeet.value = result;
39
+ return result;
40
+ } finally {
41
+ loading.value = false
42
+ }
43
+ };
44
+
45
+ const closeMeet = async (data: ICloseMeetInput) => {
46
+ loading.value = true
47
+ try {
48
+ return await api.closeMeet(data);
49
+ } finally {
50
+ loading.value = false
51
+ }
52
+ };
53
+
54
+ const restartMeet = async (data: IRestartMeetInput) => {
55
+ loading.value = true
56
+ try {
57
+ return await api.restartMeet(data);
58
+ } finally {
59
+ loading.value = false
60
+ }
61
+ };
62
+
63
+ return {
64
+ meets,
65
+ currentMeet,
66
+ loading,
67
+ loadMeets,
68
+ loadMeet,
69
+ closeMeet,
70
+ restartMeet
71
+ }
72
+ })
@@ -0,0 +1,7 @@
1
+ import type { Queries, Mutations } from '@coopenomics/sdk';
2
+
3
+ export type IMeet = Queries.Meet.GetMeet.IOutput[typeof Queries.Meet.GetMeet.name]
4
+ export type IGetMeetsInput = Queries.Meet.GetMeets.IInput['data']
5
+ export type IGetMeetInput = Queries.Meet.GetMeet.IInput['data']
6
+ export type ICloseMeetInput = Mutations.Meet.SignByPresiderOnAnnualGeneralMeet.IInput['data']
7
+ export type IRestartMeetInput = Mutations.Meet.RestartAnnualGeneralMeet.IInput['data']
@@ -0,0 +1,20 @@
1
+ import { client } from 'src/shared/api/client';
2
+ import { Queries } from '@coopenomics/sdk';
3
+ import type { IGetPaymentsInputData, IGetPaymentsInputOptions, IPaymentPaginationResult } from '../model/types';
4
+
5
+ /**
6
+ * Загружает список платежей с использованием GraphQL API
7
+ */
8
+ async function loadPayments(data?: IGetPaymentsInputData, options?: IGetPaymentsInputOptions): Promise<IPaymentPaginationResult> {
9
+ const variables: Queries.Payments.GetPayments.IInput = {data, options}
10
+
11
+ const { [Queries.Payments.GetPayments.name]: output } = await client.Query(
12
+ Queries.Payments.GetPayments.query,
13
+ {
14
+ variables
15
+ }
16
+ );
17
+ return output;
18
+ }
19
+
20
+ export const api = { loadPayments };
@@ -0,0 +1,2 @@
1
+ export * from './store'
2
+ export * from './types'
@@ -0,0 +1,62 @@
1
+ import { defineStore } from 'pinia';
2
+ import { Ref, ref } from 'vue';
3
+ import { api } from '../api';
4
+ import type { IGetPaymentsInputData, IGetPaymentsInputOptions, IPayment, IPaymentPaginationResult } from './types';
5
+
6
+ interface IPaymentStore {
7
+ payments: Ref<IPaymentPaginationResult | undefined>;
8
+ loadPayments: (data?: IGetPaymentsInputData, options?: IGetPaymentsInputOptions) => Promise<void>;
9
+ updatePayments: (data?: IGetPaymentsInputData, options?: IGetPaymentsInputOptions) => Promise<void>;
10
+ clear: () => void;
11
+ }
12
+
13
+ const namespace = 'payments';
14
+
15
+ export const usePaymentStore = defineStore(namespace, (): IPaymentStore => {
16
+ const payments: Ref<IPaymentPaginationResult | undefined> = ref();
17
+
18
+ const clear = () => {
19
+ payments.value = undefined;
20
+ };
21
+
22
+ // Функция для слияния массивов платежей по id
23
+ const mergePayments = (existingPayments: IPayment[], newPayments: IPayment[]) => {
24
+ const mergedPaymentsMap = new Map(existingPayments.map(payment => [payment.id, payment]));
25
+
26
+ newPayments.forEach(payment => {
27
+ mergedPaymentsMap.set(payment.id, payment); // Обновляем или добавляем новый платеж
28
+ });
29
+
30
+ return Array.from(mergedPaymentsMap.values()); // Возвращаем массив объединённых платежей
31
+ };
32
+
33
+ const updatePayments = async(data?: IGetPaymentsInputData, options?: IGetPaymentsInputOptions): Promise<void> => {
34
+ const newPaymentsResponse = await api.loadPayments(data, options);
35
+
36
+ if (payments.value) {
37
+ payments.value.items = mergePayments(payments.value.items, newPaymentsResponse.items);
38
+ } else {
39
+ payments.value = newPaymentsResponse;
40
+ }
41
+ };
42
+
43
+ // Функция для загрузки платежей
44
+ const loadPayments = async (data?: IGetPaymentsInputData, options?: IGetPaymentsInputOptions): Promise<void> => {
45
+ const newPaymentsResponse = await api.loadPayments(data, options);
46
+
47
+ if (payments.value) {
48
+ // Обновляем все свойства объекта payments
49
+ payments.value = {
50
+ ...payments.value,
51
+ items: mergePayments(payments.value.items, newPaymentsResponse.items),
52
+ currentPage: newPaymentsResponse.currentPage,
53
+ totalPages: newPaymentsResponse.totalPages,
54
+ totalCount: newPaymentsResponse.totalCount
55
+ };
56
+ } else {
57
+ payments.value = newPaymentsResponse;
58
+ }
59
+ };
60
+
61
+ return { payments, loadPayments, updatePayments, clear };
62
+ });
@@ -0,0 +1,7 @@
1
+ import type { Queries } from '@coopenomics/sdk';
2
+
3
+ export type IPaymentPaginationResult = Queries.Payments.GetPayments.IOutput[typeof Queries.Payments.GetPayments.name]
4
+ export type IPayment = IPaymentPaginationResult['items'][number]
5
+
6
+ export type IGetPaymentsInputData = Queries.Payments.GetPayments.IInput['data']
7
+ export type IGetPaymentsInputOptions = Queries.Payments.GetPayments.IInput['options']
@@ -4,7 +4,6 @@ import { computed, ComputedRef, Ref, ref } from 'vue';
4
4
  import { Session } from '@wharfkit/session';
5
5
  import { WalletPluginPrivateKey } from '@wharfkit/wallet-plugin-privatekey';
6
6
  import { FailAlert, readBlockchain } from 'src/shared/api';
7
- import { CHAIN_ID, CHAIN_URL } from 'src/shared/config';
8
7
  import { PrivateKey, Serializer } from '@wharfkit/antelope';
9
8
  import { GetInfoResult } from 'eosjs/dist/eosjs-rpc-interfaces';
10
9
 
@@ -49,6 +48,7 @@ export const useSessionStore = defineStore('session', (): ISessionStore => {
49
48
  const close = async (): Promise<void> => {
50
49
  isAuth.value = false;
51
50
  session.value = undefined;
51
+ globalStore.logout()
52
52
  };
53
53
 
54
54
  const init = async () => {
@@ -67,8 +67,8 @@ export const useSessionStore = defineStore('session', (): ISessionStore => {
67
67
  actor: globalStore.username,
68
68
  permission: 'active',
69
69
  chain: {
70
- id: CHAIN_ID,
71
- url: CHAIN_URL,
70
+ id: process.env.CHAIN_ID as string,
71
+ url: process.env.CHAIN_URL as string,
72
72
  },
73
73
  walletPlugin: new WalletPluginPrivateKey(
74
74
  globalStore.wif as PrivateKey
@@ -12,7 +12,7 @@ interface ISystemStore {
12
12
 
13
13
  export const useSystemStore = defineStore(namespace, (): ISystemStore => {
14
14
  const info = ref<ISystemInfo>({} as ISystemInfo)
15
- console.log('system: ', info)
15
+
16
16
  const loadSystemInfo = async () => {
17
17
  info.value = await api.loadSystemInfo();
18
18
  };
@@ -21,6 +21,7 @@ interface IUserStore {
21
21
  userAccount: Ref<IUserAccountData | null>;
22
22
  isRegistrationComplete: ComputedRef<boolean>;
23
23
  isChairman: ComputedRef<boolean>;
24
+ isMember: ComputedRef<boolean>;
24
25
  }
25
26
 
26
27
  const namespaceCurrentUser = 'currentUser';
@@ -43,7 +44,8 @@ export const useCurrentUserStore = defineStore(
43
44
  (userEntity.userAccount.value || false) &&
44
45
  userEntity.participantAccount.value != null
45
46
  ),
46
- isChairman: computed(() => userEntity.userAccount.value?.role === 'chairman')
47
+ isChairman: computed(() => userEntity.userAccount.value?.role === 'chairman'),
48
+ isMember: computed(() => userEntity.userAccount.value?.role === 'member'),
47
49
  };
48
50
  }
49
51
  );
@@ -1,14 +1,11 @@
1
1
  import { fetchTable, sendGET } from '../../../shared/api';
2
2
 
3
3
  import {
4
- ContractsList,
5
- TablesList,
6
4
  LimitsList,
7
5
  SecondaryIndexesNumbers,
8
6
  } from 'src/shared/config';
9
7
 
10
8
  import {
11
- IWalletData,
12
9
  IDepositData,
13
10
  IWithdrawData,
14
11
  IProgramWalletData,
@@ -20,7 +17,6 @@ import {
20
17
  } from '../model';
21
18
 
22
19
  import {
23
- ILoadSingleUserWallet,
24
20
  ILoadSingleUserDeposit,
25
21
  ILoadSingleUserProgramWallet,
26
22
  ILoadSingleUserWithdraw,
@@ -28,31 +24,16 @@ import {
28
24
  ILoadUserProgramWallets,
29
25
  ILoadUserWithdraws,
30
26
  } from '../model';
31
- import { SovietContract } from 'cooptypes';
32
-
33
- async function loadSingleUserWalletData(
34
- params: ILoadSingleUserWallet
35
- ): Promise<IWalletData> {
36
- return (
37
- await fetchTable(
38
- ContractsList.Soviet,
39
- params.coopname,
40
- TablesList.Wallets,
41
- params.username,
42
- params.username,
43
- LimitsList.One
44
- )
45
- )[0] as IWalletData;
46
- }
27
+ import { GatewayContract, SovietContract } from 'cooptypes';
47
28
 
48
29
  async function loadSingleUserDepositData(
49
30
  params: ILoadSingleUserDeposit
50
31
  ): Promise<IDepositData> {
51
32
  return (
52
33
  await fetchTable(
53
- ContractsList.Gateway,
34
+ GatewayContract.contractName.production,
54
35
  params.coopname,
55
- TablesList.Deposits,
36
+ GatewayContract.Tables.Incomes.tableName,
56
37
  params.username,
57
38
  params.username,
58
39
  LimitsList.One
@@ -65,9 +46,9 @@ async function loadSingleUserProgramWalletData(
65
46
  ): Promise<IProgramWalletData> {
66
47
  return (
67
48
  await fetchTable(
68
- ContractsList.Soviet,
49
+ SovietContract.contractName.production,
69
50
  params.coopname,
70
- TablesList.ProgramWallets,
51
+ SovietContract.Tables.ProgramWallets.tableName,
71
52
  params.wallet_id,
72
53
  params.wallet_id,
73
54
  LimitsList.One
@@ -80,9 +61,9 @@ async function loadSingleUserWithdrawData(
80
61
  ): Promise<IWithdrawData> {
81
62
  return (
82
63
  await fetchTable(
83
- ContractsList.Gateway,
64
+ GatewayContract.contractName.production,
84
65
  params.coopname,
85
- TablesList.Withdraws,
66
+ GatewayContract.Tables.Outcomes.tableName,
86
67
  params.withdraw_id,
87
68
  params.withdraw_id,
88
69
  LimitsList.One
@@ -94,9 +75,9 @@ async function loadUserDepositsData(
94
75
  params: ILoadUserDeposits
95
76
  ): Promise<IDepositData[]> {
96
77
  return (await fetchTable(
97
- ContractsList.Gateway,
78
+ GatewayContract.contractName.production,
98
79
  params.coopname,
99
- TablesList.Deposits,
80
+ GatewayContract.Tables.Incomes.tableName,
100
81
  params.username,
101
82
  params.username,
102
83
  LimitsList.None,
@@ -108,9 +89,9 @@ async function loadUserWithdrawsData(
108
89
  params: ILoadUserWithdraws
109
90
  ): Promise<IWithdrawData[]> {
110
91
  return (await fetchTable(
111
- ContractsList.Gateway,
92
+ GatewayContract.contractName.production,
112
93
  params.coopname,
113
- TablesList.Withdraws,
94
+ GatewayContract.Tables.Outcomes.tableName,
114
95
  params.username,
115
96
  params.username,
116
97
  LimitsList.None,
@@ -157,10 +138,12 @@ async function loadUserProgramWalletsData(
157
138
  }
158
139
 
159
140
  async function loadMethods(params: IGetPaymentMethods): Promise<IPaymentMethodData[]> {
160
- const {username} = params
141
+ const { username } = params;
161
142
  const methods = (await sendGET(`/v1/methods/${username}`)) as IGetResponsePaymentMethodData;
162
143
 
163
- return methods.results;
144
+ //тут стоит костыль, т.к. method_id это string, а фабрика документов не возвращает платежные методы с ID в виде number, по которым можно отсортировать.
145
+ //и дат там тоже нет. Как появятся даты/номера - так и сортировку эту поправим.
146
+ return methods.results.sort((a, b) => b.method_id.localeCompare(a.method_id));
164
147
  }
165
148
 
166
149
  async function loadUserAgreements(coopname: string, username: string): Promise<SovietContract.Tables.Agreements.IAgreement[]> {
@@ -180,7 +163,6 @@ async function loadUserAgreements(coopname: string, username: string): Promise<S
180
163
 
181
164
 
182
165
  export const api = {
183
- loadSingleUserWalletData,
184
166
  loadSingleUserDepositData,
185
167
  loadSingleUserProgramWalletData,
186
168
  loadSingleUserWithdrawData,
@@ -18,14 +18,13 @@ const namespace = 'wallet';
18
18
 
19
19
  interface IWalletStore {
20
20
  /* доменный интерфейс кошелька пользователя */
21
- // wallet: Ref<IWalletData>;
22
21
  program_wallets: Ref<ExtendedProgramWalletData[]>;
23
22
  deposits: Ref<IDepositData[]>;
24
23
  withdraws: Ref<IWithdrawData[]>;
25
24
  methods: Ref<IPaymentMethodData[]>;
26
25
  agreements: Ref<SovietContract.Tables.Agreements.IAgreement[]>;
27
26
 
28
- loadUserWalet: (params: ILoadUserWallet) => Promise<void>;
27
+ loadUserWallet: (params: ILoadUserWallet) => Promise<void>;
29
28
 
30
29
  //TODO move to features
31
30
  createDeposit: (params: ICreateDeposit) => Promise<IPaymentOrder>;
@@ -33,14 +32,6 @@ interface IWalletStore {
33
32
  }
34
33
 
35
34
  export const useWalletStore = defineStore(namespace, (): IWalletStore => {
36
- // const wallet = ref<IWalletData>({
37
- // username: '',
38
- // coopname: '',
39
- // available: `0.0000 ${CURRENCY}`,
40
- // blocked: `0.0000 ${CURRENCY}`,
41
- // minimum: `0.0000 ${CURRENCY}`,
42
- // initial: `0.0000 ${CURRENCY}`,
43
- // });
44
35
 
45
36
  const deposits = ref<IDepositData[]>([]);
46
37
  const withdraws = ref<IWithdrawData[]>([]);
@@ -49,20 +40,10 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
49
40
  const agreements = ref<SovietContract.Tables.Agreements.IAgreement[]>([]);
50
41
 
51
42
 
52
- const loadUserWalet = async (params: ILoadUserWallet) => {
53
-
54
- // const createEmptyWallet = (): IWalletData => ({
55
- // username: '',
56
- // coopname: '',
57
- // available: `0.0000 ${CURRENCY}`,
58
- // blocked: `0.0000 ${CURRENCY}`,
59
- // minimum: `0.0000 ${CURRENCY}`,
60
- // initial: `0.0000 ${CURRENCY}`,
61
- // });
43
+ const loadUserWallet = async (params: ILoadUserWallet) => {
62
44
 
63
45
  try {
64
46
  const data = await Promise.all([
65
- // api.loadSingleUserWalletData(params),
66
47
  api.loadUserDepositsData(params),
67
48
  api.loadUserWithdrawsData(params),
68
49
  api.loadUserProgramWalletsData(params),
@@ -70,7 +51,6 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
70
51
  api.loadUserAgreements(params.coopname, params.username)
71
52
  ]);
72
53
 
73
- // wallet.value = data[0] ?? createEmptyWallet();
74
54
  deposits.value = data[0] ?? [];
75
55
  withdraws.value = data[1] ?? [];
76
56
  program_wallets.value = data[2] ?? [];
@@ -99,7 +79,7 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
99
79
  withdraws,
100
80
  methods,
101
81
  agreements,
102
- loadUserWalet,
82
+ loadUserWallet,
103
83
  createDeposit,
104
84
  createWithdraw,
105
85
  };
@@ -11,9 +11,8 @@ export type ExtendedProgramWalletData = IProgramWalletData & {
11
11
  program_details: ICoopProgramData; // | или другие типы будущих программ
12
12
  };
13
13
 
14
- export type IDepositData = GatewayContract.Tables.Deposits.IDeposits;
15
- export type IWithdrawData = GatewayContract.Tables.Withdraws.IWithdraws;
16
- export type IWalletData = SovietContract.Tables.Wallets.IWallets;
14
+ export type IDepositData = GatewayContract.Tables.Incomes.IIncome;
15
+ export type IWithdrawData = GatewayContract.Tables.Outcomes.IOutcome;
17
16
 
18
17
  export interface ILoadSingleUserWallet {
19
18
  coopname: string;
@@ -56,7 +56,7 @@ const sign = async () => {
56
56
  try {
57
57
  isSubmitting.value = true
58
58
  await signAgreement(session.username, props.agreement.type, agreementOnSign.value)
59
- await useWalletStore().loadUserWalet({coopname: info.coopname, username: session.username})
59
+ await useWalletStore().loadUserWallet({coopname: info.coopname, username: session.username})
60
60
  isSubmitting.value = false
61
61
  show.value = false
62
62
  SuccessAlert('Документ принят')
@@ -1 +1,3 @@
1
1
  export * from './ui'
2
+ export * from './model'
3
+ export * from './api'