@coopenomics/desktop 2.2.9 → 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 (366) hide show
  1. package/.env-example +6 -1
  2. package/.env-testnet +8 -0
  3. package/CHANGELOG.md +11 -0
  4. package/Dockerfile +12 -0
  5. package/extensions/market/install.ts +78 -0
  6. package/extensions/market-admin/install.ts +42 -0
  7. package/extensions/participant/install.ts +125 -0
  8. package/extensions/powerup/install.ts +20 -0
  9. package/extensions/soviet/install.ts +83 -0
  10. package/package.json +6 -5
  11. package/quasar.config.cjs +5 -12
  12. package/src/app/App.vue +44 -73
  13. package/src/app/layouts/default.vue +40 -0
  14. package/src/app/layouts/useDefaultLayoutLogic.ts +59 -0
  15. package/src/app/providers/routes/index.ts +19 -34
  16. package/src/app/styles/style.css +4 -0
  17. package/src/boot/init.ts +6 -0
  18. package/src/boot/sentry.ts +1 -2
  19. package/src/desktops/index.ts +0 -6
  20. package/src/entities/Account/api/index.ts +11 -2
  21. package/src/entities/Account/model/index.ts +1 -1
  22. package/src/entities/Account/model/store.ts +15 -5
  23. package/src/entities/Account/types/index.ts +9 -1
  24. package/src/entities/Agenda/api/index.ts +20 -0
  25. package/src/entities/Agenda/index.ts +2 -0
  26. package/src/entities/Agenda/model/index.ts +2 -0
  27. package/src/entities/Agenda/model/store.ts +36 -0
  28. package/src/entities/Agenda/model/types.ts +4 -0
  29. package/src/entities/Branch/model/index.ts +1 -1
  30. package/src/entities/Desktop/api/index.ts +16 -1
  31. package/src/entities/Desktop/model/store.ts +112 -106
  32. package/src/entities/Desktop/model/types.ts +14 -1
  33. package/src/entities/Document/api/index.ts +24 -0
  34. package/src/entities/Document/index.ts +2 -0
  35. package/src/entities/Document/model/store.ts +117 -0
  36. package/src/entities/Document/model/types.ts +18 -0
  37. package/src/entities/Meet/api/index.ts +58 -0
  38. package/src/entities/Meet/index.ts +2 -0
  39. package/src/entities/Meet/model/store.ts +72 -0
  40. package/src/entities/Meet/types/index.ts +7 -0
  41. package/src/entities/Payment/api/index.ts +20 -0
  42. package/src/entities/Payment/model/index.ts +2 -0
  43. package/src/entities/Payment/model/store.ts +62 -0
  44. package/src/entities/Payment/model/types.ts +7 -0
  45. package/src/entities/Session/model/store.ts +5 -6
  46. package/src/entities/System/model/store.ts +1 -1
  47. package/src/entities/User/model/stores.ts +3 -1
  48. package/src/entities/Wallet/api/index.ts +15 -33
  49. package/src/entities/Wallet/model/stores.ts +3 -23
  50. package/src/entities/Wallet/model/types.ts +2 -3
  51. package/src/features/Account/UpdateAccount/api/index.ts +14 -0
  52. package/src/features/Account/UpdateAccount/index.ts +1 -0
  53. package/src/features/Account/UpdateAccount/model/index.ts +16 -0
  54. package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +1 -1
  55. package/src/features/Branch/SelectBranch/index.ts +2 -0
  56. package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +52 -104
  57. package/src/features/Decision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +1 -1
  58. package/src/features/Decision/ParticipantApplication/model/index.ts +38 -0
  59. package/src/features/FreeDecision/CreateProject/model/index.ts +92 -0
  60. package/src/features/FreeDecision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +51 -0
  61. package/src/features/FreeDecision/CreateProject/ui/index.ts +1 -0
  62. package/src/features/FreeDecision/GenerateDecision/index.ts +1 -0
  63. package/src/features/FreeDecision/GenerateDecision/model/index.ts +36 -0
  64. package/src/features/FreeDecision/index.ts +2 -0
  65. package/src/features/Meet/CloseMeetWithDecision/index.ts +1 -0
  66. package/src/features/Meet/CloseMeetWithDecision/model/index.ts +92 -0
  67. package/src/features/Meet/CreateMeet/index.ts +2 -0
  68. package/src/features/Meet/CreateMeet/model/index.ts +65 -0
  69. package/src/features/Meet/CreateMeet/ui/CreateMeet.vue +34 -0
  70. package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +136 -0
  71. package/src/features/Meet/CreateMeet/ui/index.ts +2 -0
  72. package/src/features/Meet/GenerateAgenda/index.ts +1 -0
  73. package/src/features/Meet/GenerateAgenda/model/index.ts +18 -0
  74. package/src/features/Meet/GenerateBallot/index.ts +1 -0
  75. package/src/features/Meet/GenerateBallot/model/index.ts +18 -0
  76. package/src/features/Meet/GenerateNotification/index.ts +1 -0
  77. package/src/features/Meet/GenerateNotification/model/index.ts +18 -0
  78. package/src/features/Meet/GenerateSovietDecision/index.ts +1 -0
  79. package/src/features/Meet/GenerateSovietDecision/model/index.ts +48 -0
  80. package/src/features/Meet/MeetDetailsManagement/index.ts +1 -0
  81. package/src/features/Meet/MeetDetailsManagement/model/index.ts +121 -0
  82. package/src/features/Meet/RestartMeet/index.ts +2 -0
  83. package/src/features/Meet/RestartMeet/model/index.ts +54 -0
  84. package/src/features/Meet/RestartMeet/ui/RestartMeet.vue +46 -0
  85. package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +92 -0
  86. package/src/features/Meet/RestartMeet/ui/index.ts +2 -0
  87. package/src/features/Meet/VoteOnMeet/index.ts +1 -0
  88. package/src/features/Meet/VoteOnMeet/model/index.ts +18 -0
  89. package/src/features/Payment/SetStatus/api/index.ts +20 -0
  90. package/src/features/Payment/SetStatus/index.ts +1 -0
  91. package/src/features/Payment/SetStatus/model/index.ts +30 -0
  92. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/SetOrderPaidStatusButton.vue +7 -3
  93. package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +2 -2
  94. package/src/features/PaymentMethod/AddPaymentMethod/ui/AddPaymentButton.vue +1 -1
  95. package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +1 -1
  96. package/src/features/PaymentMethod/DeletePaymentMethod/ui/DeletePaymentMethodButton.vue +3 -1
  97. package/src/features/Request/CancelRequest/ui/CancelButton.vue +1 -1
  98. package/src/features/Request/ConfirmRecieveOnRequest/ui/ConfirmRecieveOnRequest.vue +1 -1
  99. package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +3 -5
  100. package/src/features/Request/CreateParentOffer/ui/ImageUploaderWithPreview/ImageUploaderWithPreview.vue +4 -3
  101. package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
  102. package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +2 -2
  103. package/src/features/Request/PublishRequest/ui/PublishRequestButton.vue +1 -1
  104. package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
  105. package/src/features/Request/UnpublishRequest/ui/UnpublishRequestButton.vue +1 -1
  106. package/src/features/Union/AddCooperative/model/index.ts +4 -5
  107. package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +5 -6
  108. package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +7 -4
  109. package/src/features/User/LoginUser/model/index.ts +3 -3
  110. package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +0 -6
  111. package/src/features/User/Logout/model/index.ts +5 -3
  112. package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +8 -7
  113. package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +6 -7
  114. package/src/pages/Blank/index.ts +1 -0
  115. package/src/pages/Contacts/ContactsPage.vue +64 -0
  116. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/index.ts +0 -1
  117. package/src/{widgets/Cooperative/Contributions/ui/ChangeContributions.vue → pages/Cooperative/ChangeRegisterPayments/ui/ChangeRegisterPayments.vue} +10 -11
  118. package/src/pages/Cooperative/ChangeRegisterPayments/ui/index.ts +1 -0
  119. package/src/pages/Cooperative/ListOfAgenda/index.ts +1 -0
  120. package/src/pages/Cooperative/ListOfAgenda/ui/ListOfAgendaQuestions.vue +118 -0
  121. package/src/pages/Cooperative/ListOfAgenda/ui/index.ts +1 -0
  122. package/src/pages/Cooperative/ListOfDocuments/ListOfDocumentsPage.vue +24 -0
  123. package/src/pages/Cooperative/ListOfMeets/model/index.ts +1 -0
  124. package/src/pages/Cooperative/ListOfMeets/model/model.ts +117 -0
  125. package/src/pages/Cooperative/ListOfMeets/ui/ListOfMeetsPage.vue +90 -0
  126. package/src/pages/Cooperative/ListOfMeets/ui/index.ts +1 -0
  127. package/src/pages/Cooperative/ListOfOrders/index.ts +1 -1
  128. package/src/pages/Cooperative/ListOfOrders/ui/ListOfOrdersPage.vue +0 -4
  129. package/src/pages/Cooperative/ListOfParticipants/ui/ListOfParticipantsPage.vue +61 -10
  130. package/src/pages/Cooperative/ListOfParticipants/ui/index.ts +1 -1
  131. package/src/pages/Cooperative/MeetDetails/ui/MeetDetailsPage.vue +88 -0
  132. package/src/pages/Cooperative/MeetDetails/ui/index.ts +1 -0
  133. package/src/pages/Cooperative/{ListOfBranches/ui/ListOfBranchesPage.vue → MemberBranchList/ui/MemberBranchListPage.vue} +2 -4
  134. package/src/pages/Cooperative/MemberBranchList/ui/index.ts +1 -0
  135. package/src/pages/Cooperative/Payments/index.ts +1 -0
  136. package/src/pages/Cooperative/Payments/ui/PaymentsPage.vue +7 -0
  137. package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/ExtensionPage.vue +35 -20
  138. package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/ExtensionsShowcase.vue +2 -2
  139. package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/InstalledExtensions.vue +2 -2
  140. package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +1 -1
  141. package/src/pages/Marketplace/Showcase/ui/ShowcasePage.vue +1 -1
  142. package/src/pages/Marketplace/SuppliesList/ui/SuppliesListPage.vue +1 -1
  143. package/src/pages/Marketplace/UserParentOffers/ui/UserParentOffersPage.vue +1 -1
  144. package/src/pages/Marketplace/UserSuppliesList/ui/UserSuppliesListPage.vue +1 -1
  145. package/src/pages/PermissionDenied/index.ts +1 -0
  146. package/src/pages/Registrator/SignUp/EmailInput.vue +2 -3
  147. package/src/pages/Registrator/SignUp/GenerateAccount.vue +2 -3
  148. package/src/pages/Registrator/SignUp/PayInitial.vue +1 -1
  149. package/src/pages/Registrator/SignUp/ReadStatement.vue +2 -2
  150. package/src/pages/Registrator/SignUp/SelectBranch.vue +2 -2
  151. package/src/pages/Registrator/SignUp/SignStatement.vue +2 -2
  152. package/src/pages/Registrator/SignUp/SignUp.vue +5 -12
  153. package/src/pages/Registrator/SignUp/WaitingRegistration.vue +1 -5
  154. package/src/pages/Registrator/SignUp/Welcome.vue +4 -3
  155. package/src/pages/Union/ConnectionAgreement/index.ts +1 -0
  156. package/src/pages/Union/ListOfCooperatives/ui/UnionPageListOfCooperatives.vue +139 -6
  157. package/src/pages/User/DocumentsPage/UserDocumentsPage.vue +23 -0
  158. package/src/pages/User/DocumentsPage/index.ts +1 -0
  159. package/src/pages/User/PaymentsPage/ui/UserPayments.vue +11 -0
  160. package/src/pages/User/PaymentsPage/ui/index.ts +1 -0
  161. package/src/pages/User/ProfilePage/index.ts +1 -0
  162. package/src/pages/User/ProfilePage/ui/ProfilePage.vue +114 -0
  163. package/src/pages/User/ProfilePage/ui/index.ts +1 -0
  164. package/src/pages/User/SettingsPage/ui/index.ts +1 -1
  165. package/src/pages/User/WalletPage/index.ts +1 -0
  166. package/src/pages/User/WalletPage/ui/WalletPage.vue +72 -0
  167. package/src/pages/User/WalletPage/ui/index.ts +1 -0
  168. package/src/processes/init-app/index.ts +28 -0
  169. package/src/processes/init-installed-extensions/index.ts +25 -0
  170. package/src/processes/init-wallet/index.ts +40 -0
  171. package/src/processes/navigation-guard-setup/index.ts +45 -0
  172. package/src/processes/process-decisions/index.ts +275 -0
  173. package/src/processes/select-branch/index.ts +80 -0
  174. package/src/processes/watch-branch-overlay/index.ts +38 -0
  175. package/src/processes/watch-desktop-health/index.ts +33 -0
  176. package/src/shared/api/alerts.ts +2 -6
  177. package/src/shared/api/axios.ts +4 -5
  178. package/src/shared/api/client.ts +3 -4
  179. package/src/shared/api/eosio.ts +1 -2
  180. package/src/shared/api/utils.ts +1 -3
  181. package/src/shared/config/index.ts +0 -1
  182. package/src/shared/hooks/index.ts +2 -0
  183. package/src/shared/hooks/useAgendaPoints.ts +24 -0
  184. package/src/shared/hooks/useWindowSize.ts +13 -0
  185. package/src/shared/lib/composables/useDisplayName.ts +34 -0
  186. package/src/shared/lib/composables/useEditableData.ts +1 -1
  187. package/src/shared/lib/navigation/index.ts +2 -0
  188. package/src/shared/lib/navigation/routeUtils.ts +51 -0
  189. package/src/shared/lib/navigation/useBackButton.ts +63 -0
  190. package/src/shared/lib/utils/dates/validateDateWithinRange.ts +23 -0
  191. package/src/shared/ui/BaseDocument/BaseDocument.vue +120 -90
  192. package/src/{components/menu/blockchainStatus.vue → shared/ui/BlockchainStatusBar/BlockchainStatusBar.vue} +1 -0
  193. package/src/shared/ui/BlockchainStatusBar/index.ts +1 -0
  194. package/src/shared/ui/CardStyles/index.scss +61 -0
  195. package/src/shared/ui/ComplexDocument/ComplexDocument.vue +31 -8
  196. package/src/shared/ui/CopyableInput/index.ts +1 -0
  197. package/src/shared/ui/CopyableInput/ui/CopyableInput.vue +62 -0
  198. package/src/shared/ui/EditableEntrepreneurCard/EditableEntrepreneurCard.vue +171 -0
  199. package/src/shared/ui/EditableEntrepreneurCard/index.ts +1 -0
  200. package/src/{widgets/IndividualCard/ui/IndividualCard.vue → shared/ui/EditableIndividualCard/EditableIndividualCard.vue} +101 -68
  201. package/src/shared/ui/EditableIndividualCard/index.ts +1 -0
  202. package/src/shared/ui/EditableOrganizationCard/EditableOrganizationCard.vue +225 -0
  203. package/src/shared/ui/EditableOrganizationCard/index.ts +1 -0
  204. package/src/shared/ui/Form/Form.vue +3 -1
  205. package/src/shared/ui/InputStyles/index.scss +29 -0
  206. package/src/shared/ui/TabStyles/index.scss +53 -0
  207. package/src/shared/ui/UserDataForm/OrganizationDataForm/OrganizationDataForm.vue +1 -0
  208. package/src/shared/ui/index.ts +1 -0
  209. package/src/{components/history/AccountEvents.vue → widgets/AccountActions/AccountActionsPage.vue} +2 -2
  210. package/src/widgets/AccountActions/index.ts +1 -0
  211. package/src/widgets/BankDetailsCard/ui/BankDetailsCard.vue +2 -2
  212. package/src/widgets/BranchCard/ui/BranchCard.vue +2 -2
  213. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentCard.vue +48 -0
  214. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentsTable.vue +162 -0
  215. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/ListOfDocumentsWidget.vue +77 -120
  216. package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/index.ts +3 -1
  217. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/ListOfOrdersWidget.vue +135 -128
  218. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/OrderCard.vue +74 -0
  219. package/src/widgets/Cooperative/Orders/ListOfOrders/ui/index.ts +2 -1
  220. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/ListOfPaymentsWidget.vue +216 -0
  221. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/PaymentCard.vue +73 -0
  222. package/src/widgets/Cooperative/Payments/ListOfPayments/ui/index.ts +2 -0
  223. package/src/widgets/Cooperative/Payments/index.ts +1 -0
  224. package/src/widgets/Desktop/LeftDrawerMenu/LeftDrawerMenu.vue +3 -2
  225. package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +58 -91
  226. package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +114 -59
  227. package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/ExtensionCard.vue +12 -7
  228. package/src/widgets/Header/BackButton/BackButton.vue +25 -0
  229. package/src/widgets/Header/BackButton/index.ts +1 -0
  230. package/src/widgets/Header/CommonHeader/CooperativeSettingsHeader.vue +34 -0
  231. package/src/widgets/Header/CommonHeader/ExtstoreHeader.vue +41 -0
  232. package/src/widgets/Header/CommonHeader/Header.vue +33 -198
  233. package/src/widgets/Header/CommonHeader/HeaderStyles.scss +22 -0
  234. package/src/widgets/Header/CommonHeader/MainHeader.vue +87 -0
  235. package/src/widgets/Header/CommonHeader/UserSettingsHeader.vue +29 -0
  236. package/src/widgets/Header/CommonHeader/index.ts +1 -1
  237. package/src/widgets/Header/SettingsDropdown/SettingsDropdown.vue +0 -6
  238. package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/Base.vue +1 -2
  239. package/src/widgets/Meets/MeetDetailsActions/MeetDetailsActions.vue +51 -0
  240. package/src/widgets/Meets/MeetDetailsActions/index.ts +1 -0
  241. package/src/widgets/Meets/MeetDetailsActions/model.ts +46 -0
  242. package/src/widgets/Meets/MeetDetailsAgenda/MeetDetailsAgenda.vue +29 -0
  243. package/src/widgets/Meets/MeetDetailsAgenda/index.ts +1 -0
  244. package/src/widgets/Meets/MeetDetailsHeader/MeetDetailsHeader.vue +40 -0
  245. package/src/widgets/Meets/MeetDetailsHeader/index.ts +1 -0
  246. package/src/widgets/Meets/MeetDetailsVoting/MeetDetailsVoting.vue +77 -0
  247. package/src/widgets/Meets/MeetDetailsVoting/index.ts +1 -0
  248. package/src/widgets/Meets/MeetDetailsVoting/model.ts +117 -0
  249. package/src/widgets/Meets/MeetInfoCard/ui/MeetInfoCard.vue +38 -0
  250. package/src/widgets/Meets/MeetInfoCard/ui/index.ts +1 -0
  251. package/src/widgets/Meets/MeetsTable/ui/MeetsTable.vue +118 -0
  252. package/src/widgets/Meets/MeetsTable/ui/index.ts +1 -0
  253. package/src/widgets/Participants/index.ts +1 -0
  254. package/src/widgets/Participants/ui/ParticipantCard.vue +89 -0
  255. package/src/widgets/Participants/ui/ParticipantDetails.vue +79 -0
  256. package/src/widgets/Participants/ui/ParticipantsTable.vue +129 -0
  257. package/src/widgets/Participants/ui/index.ts +4 -0
  258. package/src/widgets/Questions/index.ts +3 -0
  259. package/src/widgets/Questions/ui/QuestionCard/QuestionCard.vue +109 -0
  260. package/src/widgets/Questions/ui/QuestionCard/index.ts +1 -0
  261. package/src/widgets/Questions/ui/QuestionsTable/QuestionsTable.vue +177 -0
  262. package/src/widgets/Questions/ui/QuestionsTable/index.ts +1 -0
  263. package/src/widgets/Questions/ui/VotingButtons/VotingButtons.vue +75 -0
  264. package/src/widgets/Questions/ui/VotingButtons/index.ts +1 -0
  265. package/src/widgets/Questions/ui/index.ts +3 -0
  266. package/src/widgets/RequireAgreements/index.ts +1 -0
  267. package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +81 -85
  268. package/tsconfig.json +1 -1
  269. package/extensions/powerup/boot.ts +0 -17
  270. package/src/app/providers/card/store.ts +0 -42
  271. package/src/boot/branch-selector.ts +0 -40
  272. package/src/boot/init-stores.ts +0 -45
  273. package/src/boot/navigation-guards.ts +0 -46
  274. package/src/components/menu/footerMobileMenu.vue +0 -79
  275. package/src/components/soviet/index.vue +0 -76
  276. package/src/components/soviet/staff.vue +0 -274
  277. package/src/desktops/User/index.ts +0 -1
  278. package/src/desktops/User/model/index.ts +0 -328
  279. package/src/entities/Menu/model/store.ts +0 -69
  280. package/src/entities/Menu/model/types.ts +0 -11
  281. package/src/entities/Menu/ui/index.ts +0 -1
  282. package/src/entities/Order/api/index.ts +0 -14
  283. package/src/entities/Order/model/store.ts +0 -87
  284. package/src/features/Order/SetStatus/api/index.ts +0 -7
  285. package/src/features/Order/SetStatus/model/index.ts +0 -23
  286. package/src/pages/Cooperative/Contacts/ui/ContactsPage.vue +0 -7
  287. package/src/pages/Cooperative/ListOfBranches/ui/index.ts +0 -1
  288. package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +0 -12
  289. package/src/pages/Union/Connection/index.ts +0 -1
  290. package/src/pages/_layouts/blank.vue +0 -24
  291. package/src/pages/_layouts/default.vue +0 -79
  292. package/src/types/index.ts +0 -3
  293. package/src/widgets/Commutator/Commutator.vue +0 -7
  294. package/src/widgets/Commutator/index.ts +0 -1
  295. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +0 -273
  296. package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/index.ts +0 -1
  297. package/src/widgets/Cooperative/Contacts/ui/Contacts.vue +0 -52
  298. package/src/widgets/Cooperative/Contributions/ui/index.ts +0 -1
  299. package/src/widgets/Cooperative/Description/ui/SetDescription.vue +0 -4
  300. package/src/widgets/Cooperative/Description/ui/index.ts +0 -1
  301. package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/ListOfParticipantsWidget.vue +0 -103
  302. package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/index.ts +0 -1
  303. package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +0 -59
  304. package/src/widgets/Desktop/SecondLevelMenu/index.ts +0 -1
  305. package/src/widgets/IndividualCard/ui/index.ts +0 -1
  306. package/src/widgets/OrganizationCard/ui/OrganizationCard.vue +0 -44
  307. package/src/widgets/OrganizationCard/ui/index.ts +0 -1
  308. package/src/widgets/Union/ListOfCooperatives/ui/UnionListOfCooperatives.vue +0 -136
  309. package/src/widgets/Union/ListOfCooperatives/ui/index.ts +0 -1
  310. package/src/entities/{Menu → Document}/model/index.ts +0 -0
  311. package/src/entities/{Order → Meet}/model/index.ts +0 -0
  312. package/src/entities/{Order → Payment}/index.ts +0 -0
  313. package/src/features/{Order/SetStatus → Decision/ParticipantApplication}/index.ts +0 -0
  314. package/src/{widgets/Request/SupplyOrderRequestCard → features/FreeDecision/CreateProject}/index.ts +0 -0
  315. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/SetOrderCompletedStatusButton.vue +0 -0
  316. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/index.ts +0 -0
  317. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/index.ts +0 -0
  318. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/SetOrderRefundedStatusButton.vue +0 -0
  319. package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/index.ts +0 -0
  320. package/src/pages/{blank/blank.vue → Blank/BlankPage.vue} +0 -0
  321. package/src/pages/{Cooperative/Contacts/ui → Contacts}/index.ts +0 -0
  322. package/src/pages/Cooperative/{Contacts → ChangeContacts}/index.ts +0 -0
  323. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/ChangeContacts.vue +0 -0
  324. package/src/pages/Cooperative/{ListOfBranches → ChangeRegisterPayments}/index.ts +0 -0
  325. package/src/pages/{Documentor → Cooperative}/ListOfDocuments/index.ts +0 -0
  326. package/src/pages/{Installer → Cooperative/ListOfMeets}/index.ts +0 -0
  327. package/src/{widgets/Cooperative/Agenda/ListOfQuestions → pages/Cooperative/MeetDetails}/index.ts +0 -0
  328. package/src/{widgets/Cooperative/Contacts → pages/Cooperative/MemberBranchList}/index.ts +0 -0
  329. package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/ExtensionStoreBase.vue +0 -0
  330. package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/index.ts +0 -0
  331. package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/index.ts +0 -0
  332. package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/index.ts +0 -0
  333. package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/index.ts +0 -0
  334. package/src/pages/{_layouts/permissionDenied.vue → PermissionDenied/PermissionDenied.vue} +0 -0
  335. package/src/pages/Union/{Connection/ConnectionPage.vue → ConnectionAgreement/ConnectionAgreementPage.vue} +0 -0
  336. package/src/{widgets/Cooperative/Contributions → pages/Union/InstallCooperative}/index.ts +0 -0
  337. package/src/pages/{Installer → Union/InstallCooperative}/ui/InstallCooperativePage.vue +0 -0
  338. package/src/pages/{Installer → Union/InstallCooperative}/ui/index.ts +0 -0
  339. package/src/{widgets/Cooperative/Participants/ListOfParticipants → pages/User/PaymentsPage}/index.ts +0 -0
  340. package/src/{components/history → widgets/AccountActions}/AccountLink.vue +0 -0
  341. package/src/{components/history → widgets/AccountActions}/ActionCell.vue +0 -0
  342. package/src/{components/history → widgets/AccountActions}/DataCell.vue +0 -0
  343. package/src/widgets/{IndividualCard → Cooperative/Payments/ListOfPayments}/index.ts +0 -0
  344. package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/index.ts +0 -0
  345. package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/CreateChildOrderCard.vue +0 -0
  346. package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/index.ts +0 -0
  347. package/src/widgets/{Request → Marketplace}/RequestCard/RequestCard.vue +0 -0
  348. package/src/widgets/{Request → Marketplace}/RequestCard/index.ts +0 -0
  349. package/src/{entities/Menu → widgets/Marketplace/SupplyOrderRequestCard}/index.ts +1 -1
  350. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/index.ts +0 -0
  351. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/types.ts +0 -0
  352. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/index.ts +0 -0
  353. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/EightStep.vue +0 -0
  354. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FifthStep.vue +0 -0
  355. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +0 -0
  356. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FourthStep.vue +0 -0
  357. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SecondStep.vue +0 -0
  358. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SeventhStep.vue +0 -0
  359. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SixthStep.vue +0 -0
  360. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/ThirdStep.vue +0 -0
  361. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/index.ts +0 -0
  362. /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/index.ts +0 -0
  363. /package/src/widgets/{OrganizationCard → Meets/MeetInfoCard}/index.ts +0 -0
  364. /package/src/widgets/{Union/ListOfCooperatives → Meets/MeetsTable}/index.ts +0 -0
  365. /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/RequireAgreements.vue +0 -0
  366. /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/index.ts +0 -0
@@ -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 () => {
@@ -57,8 +57,6 @@ export const useSessionStore = defineStore('session', (): ISessionStore => {
57
57
  await globalStore.init();
58
58
  isAuth.value = globalStore.hasCreditials;
59
59
 
60
- //TODO добавить более детальную проверку авторизации
61
-
62
60
  getInfo();
63
61
 
64
62
  try {
@@ -69,8 +67,8 @@ export const useSessionStore = defineStore('session', (): ISessionStore => {
69
67
  actor: globalStore.username,
70
68
  permission: 'active',
71
69
  chain: {
72
- id: CHAIN_ID,
73
- url: CHAIN_URL,
70
+ id: process.env.CHAIN_ID as string,
71
+ url: process.env.CHAIN_URL as string,
74
72
  },
75
73
  walletPlugin: new WalletPluginPrivateKey(
76
74
  globalStore.wif as PrivateKey
@@ -80,7 +78,8 @@ export const useSessionStore = defineStore('session', (): ISessionStore => {
80
78
  } catch (e: any) {
81
79
  console.error(e);
82
80
  FailAlert(e.message);
83
- //TODO logout
81
+ close()
82
+ globalStore.logout()
84
83
  }
85
84
  }
86
85
  };
@@ -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;
@@ -0,0 +1,14 @@
1
+ import { client } from 'src/shared/api/client'
2
+ import { Mutations } from '@coopenomics/sdk'
3
+
4
+ async function updateAccount(data: Mutations.Accounts.UpdateAccount.IInput['data']): Promise<Mutations.Accounts.UpdateAccount.IOutput[[typeof Mutations.Accounts.UpdateAccount.name][number]]>{
5
+ const {[Mutations.Accounts.UpdateAccount.name]: result} = await client.Mutation(Mutations.Accounts.UpdateAccount.mutation, {variables: {
6
+ data
7
+ }})
8
+
9
+ return result
10
+ }
11
+
12
+ export const api = {
13
+ updateAccount
14
+ }
@@ -0,0 +1 @@
1
+ export * from './model'
@@ -0,0 +1,16 @@
1
+ import type { Mutations } from '@coopenomics/sdk';
2
+ import { api } from '../api'
3
+ import { IAccount } from 'src/entities/Account/types';
4
+
5
+ export type IUpdateAccountInput = Mutations.Accounts.UpdateAccount.IInput['data']
6
+
7
+ export function useUpdateAccount() {
8
+
9
+ async function updateAccount(data: IUpdateAccountInput): Promise<IAccount> {
10
+ const account = await api.updateAccount(data);
11
+
12
+ return account;
13
+ }
14
+
15
+ return { updateAccount };
16
+ }
@@ -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'
@@ -1,107 +1,55 @@
1
1
  <template lang="pug">
2
- div
3
- q-dialog(v-model="isVisible" persistent :maximized="true" )
4
- ModalBase(:title="title" :show_close="false")
5
- div.row.justify-center
6
- div(style="padding-bottom: 100px;").col-md-8.col-col-xs-12
7
-
8
- div(v-if="step == 1")
9
- p.q-mt-lg Кооператив перешёл на двухэтапную систему управления на основании общего собрания уполномоченных председателей кооперативных участков. На первом этапе пайщики принимают участие в голосовии при выбранном кооперативном участке, а на втором - уполномоченный ими председатель голосует на общем собрании уполномоченных. В связи с этим, выберите кооперативный участок, который наиболее удобен по местоположению:
10
- Form(:handler-submit="next" :is-submitting="isSubmitting" :showSubmit="!isLoading" :showCancel="false" :button-submit-txt="'Продолжить'" @cancel="clear").q-pa-md
11
- BranchSelector(
12
- v-model:selectedBranch="selectedBranch"
13
- :branches="branches"
14
- ).q-mb-md
15
-
16
- div(v-if="step == 2")
17
- Loader(v-if="isLoading" :text='`Формируем документ...`')
18
-
19
- div(v-else)
20
- DocumentHtmlReader(:html="document.html")
21
- q-btn(@click="back" flat size="sm") назад
22
- q-btn(@click="sign" color="primary" size="sm") подписать
23
-
2
+ q-dialog(v-model="isVisible" persistent :maximized="true")
3
+ ModalBase(:title="title" :show_close="false")
4
+ div.row.justify-center
5
+ div(style="padding-bottom: 100px;").col-md-8.col-col-xs-12
6
+
7
+ div(v-if="step === 1")
8
+ p.q-mt-lg
9
+ | Кооператив перешёл на двухэтапную систему управления на основании общего собрания уполномоченных председателей кооперативных участков...
10
+ Form(
11
+ :handler-submit="next"
12
+ :is-submitting="isSubmitting"
13
+ :showSubmit="!isLoading"
14
+ :showCancel="false"
15
+ :button-submit-txt="'Продолжить'"
16
+ ).q-pa-md
17
+ BranchSelector(
18
+ v-model:selectedBranch="selectedBranch"
19
+ :branches="branches"
20
+ ).q-mb-md
21
+
22
+ div(v-else-if="step === 2")
23
+ Loader(v-if="isLoading" :text="`Формируем документ...`")
24
+
25
+ div(v-else)
26
+ DocumentHtmlReader(:html="document.html")
27
+ q-btn(@click="back" flat size="sm") назад
28
+ q-btn(@click="sign" color="primary" size="sm") подписать
24
29
  </template>
25
30
 
26
- <script lang="ts" setup>
27
- import { ModalBase } from 'src/shared/ui/ModalBase';
28
- import { Form } from 'src/shared/ui/Form';
29
- import { failAlert, SuccessAlert } from 'src/shared/api';
30
- import { Loader } from 'src/shared/ui/Loader';
31
- import { useSelectBranch } from '../model';
32
- import { DocumentHtmlReader } from 'src/shared/ui/DocumentHtmlReader';
33
- import { computed, ref } from 'vue';
34
- import { DigitalDocument } from 'src/shared/lib/document';
35
- import { useSystemStore } from 'src/entities/System/model';
36
- import { useSessionStore } from 'src/entities/Session';
37
- import { Cooperative } from 'cooptypes'
38
- import { useBranchStore } from 'src/entities/Branch/model';
39
- import { BranchSelector } from 'src/shared/ui/BranchSelector';
40
- const {isVisible} = useSelectBranch()
41
-
42
- const title = ref('Выберите кооперативный участок');
43
- const step = ref(1)
44
- const digitalDocument = new DigitalDocument()
45
-
46
- const document = ref()
47
- const isSubmitting = ref(false)
48
- const isLoading = ref(false)
49
- const system = useSystemStore()
50
- const session = useSessionStore()
51
- const branchStore = useBranchStore()
52
- const selectedBranch = ref('')
53
-
54
- // Массив используется без изменений
55
- const branches = computed(() => branchStore.publicBranches)
56
-
57
- const next = async() => {
58
- generate()
59
- step.value++
60
- }
61
-
62
- const back = () => step.value--
63
-
64
- branchStore.loadPublicBranches({ coopname: system.info.coopname })
65
-
66
- const generate = async () => {
67
- isLoading.value = true
68
- document.value = await digitalDocument.generate<Cooperative.Registry.SelectBranchStatement.Action>({
69
- registry_id: Cooperative.Registry.SelectBranchStatement.registry_id,
70
- coopname: system.info.coopname,
71
- username: session.username,
72
- braname: selectedBranch.value
73
- })
74
-
75
- isLoading.value = false
76
- }
77
-
78
- const sign = async () => {
79
-
80
- try {
81
- isSubmitting.value = true
82
- isSubmitting.value = false
83
-
84
- const document = await digitalDocument.sign()
85
- const {selectBranch} = useSelectBranch()
86
-
87
- await selectBranch({
88
- braname: selectedBranch.value,
89
- coopname: system.info.coopname,
90
- document,
91
- username: session.username,
92
- })
93
- isVisible.value = false
94
- SuccessAlert('Кооперативный участок выбран')
95
- } catch(e: any){
96
- isSubmitting.value = false
97
- console.error(e)
98
- failAlert(e)
99
- }
100
-
101
- }
102
-
103
- const clear = () => {
104
- console.log('clear')
105
- }
106
-
107
- </script>
31
+ <script setup lang="ts">
32
+ import { ModalBase } from 'src/shared/ui/ModalBase'
33
+ import { Form } from 'src/shared/ui/Form'
34
+ import { Loader } from 'src/shared/ui/Loader'
35
+ import { BranchSelector } from 'src/shared/ui/BranchSelector'
36
+ import { DocumentHtmlReader } from 'src/shared/ui/DocumentHtmlReader'
37
+
38
+ import { useSelectBranch } from '../model'
39
+ import { useSelectBranchProcess } from 'src/processes/select-branch'
40
+
41
+ const { isVisible } = useSelectBranch()
42
+ const {
43
+ title,
44
+ step,
45
+ selectedBranch,
46
+ branches,
47
+ document,
48
+ isSubmitting,
49
+ isLoading,
50
+ next,
51
+ back,
52
+ sign
53
+ } = useSelectBranchProcess()
54
+
55
+ </script>
@@ -1,6 +1,6 @@
1
1
  <template lang="pug">
2
2
  div
3
- q-btn(@click="show = true" color="primary" size="sm" icon="add") предложить повестку
3
+ q-btn(@click="show = true" color="primary" icon="add") предложить повестку
4
4
  q-dialog(v-model="show" persistent :maximized="false" )
5
5
  ModalBase(style="width: 500px; max-width: 100% !important;" :title="'Предложить повестку'" :show_close="true")
6
6
  Form(:handler-submit="create" :is-submitting="isSubmitting" :showSubmit="!isLoading" :showCancel="true" :button-submit-txt="'Создать'" @cancel="clear" ).q-pa-md
@@ -0,0 +1,38 @@
1
+ import { client } from 'src/shared/api/client'
2
+ import { Mutations } from '@coopenomics/sdk'
3
+ import { useSystemStore } from 'src/entities/System/model'
4
+
5
+ export type IGenerateParticipantApplicationDecisionData = Mutations.Participants.GenerateParticipantApplicationDecision.IInput['data']
6
+ export type IGenerateParticipantApplicationDecisionResult = Mutations.Participants.GenerateParticipantApplicationDecision.IOutput[typeof Mutations.Participants.GenerateParticipantApplicationDecision.name]
7
+
8
+ export function useGenerateParticipantApplicationDecision() {
9
+ const { info } = useSystemStore()
10
+
11
+ /**
12
+ * Генерирует документ для решения по заявлению о вступлении в кооператив
13
+ */
14
+ async function generateParticipantApplicationDecision(
15
+ data: Omit<IGenerateParticipantApplicationDecisionData, 'coopname'>
16
+ ): Promise<IGenerateParticipantApplicationDecisionResult> {
17
+ const { [Mutations.Participants.GenerateParticipantApplicationDecision.name]: result } = await client.Mutation(
18
+ Mutations.Participants.GenerateParticipantApplicationDecision.mutation,
19
+ {
20
+ variables: {
21
+ data: {
22
+ coopname: info.coopname,
23
+ ...data
24
+ },
25
+ options: {
26
+ lang: 'ru'
27
+ }
28
+ }
29
+ }
30
+ )
31
+
32
+ return result
33
+ }
34
+
35
+ return {
36
+ generateParticipantApplicationDecision
37
+ }
38
+ }
@@ -0,0 +1,92 @@
1
+ import { client } from 'src/shared/api/client'
2
+ import { Mutations } from '@coopenomics/sdk'
3
+ import { ref } from 'vue'
4
+ import type { Ref } from 'vue'
5
+ import type { ICreatedProjectDecisionData, IGeneratedProjectDecisionDocument } from 'src/entities/Decision/model'
6
+ import { useSignDocument } from 'src/shared/lib/document'
7
+
8
+ export type ICreateProjectDecisionData = Mutations.FreeDecisions.CreateProjectOfFreeDecision.IInput['data']
9
+
10
+ export function useCreateProjectOfFreeDecision() {
11
+ const createProjectInput: Ref<ICreateProjectDecisionData> = ref({
12
+ decision: '',
13
+ question: ''
14
+ })
15
+
16
+ /**
17
+ * Создает проект свободного решения
18
+ */
19
+ async function createProject(coopname: string, username: string) {
20
+ const createdProject = await createProjectOfFreeDecision()
21
+
22
+ const generatedDocument = await generateProjectDocumentOfFreeDecision({
23
+ coopname: coopname,
24
+ project_id: createdProject.id,
25
+ username: username
26
+ })
27
+
28
+ const { signDocument } = useSignDocument()
29
+
30
+ const signedDocument = await signDocument(generatedDocument)
31
+
32
+ await publishProjectOfFreeDecision({
33
+ coopname: coopname,
34
+ document: signedDocument,
35
+ meta: '',
36
+ username: username
37
+ })
38
+ }
39
+
40
+ async function createProjectOfFreeDecision(): Promise<ICreatedProjectDecisionData> {
41
+ const { [Mutations.FreeDecisions.CreateProjectOfFreeDecision.name]: project } = await client.Mutation(
42
+ Mutations.FreeDecisions.CreateProjectOfFreeDecision.mutation,
43
+ {
44
+ variables: {
45
+ data: createProjectInput.value,
46
+ },
47
+ }
48
+ )
49
+
50
+ return project
51
+ }
52
+
53
+ /**
54
+ * Генерирует документ проекта свободного решения
55
+ */
56
+ async function generateProjectDocumentOfFreeDecision(data: Mutations.FreeDecisions.GenerateProjectOfFreeDecision.IInput['data']): Promise<IGeneratedProjectDecisionDocument> {
57
+ const { [Mutations.FreeDecisions.GenerateProjectOfFreeDecision.name]: document } = await client.Mutation(
58
+ Mutations.FreeDecisions.GenerateProjectOfFreeDecision.mutation,
59
+ {
60
+ variables: {
61
+ data,
62
+ },
63
+ }
64
+ )
65
+
66
+ return document
67
+ }
68
+
69
+ /**
70
+ * Публикует проект свободного решения
71
+ */
72
+ async function publishProjectOfFreeDecision(data: Mutations.FreeDecisions.PublishProjectOfFreeDecision.IInput['data']): Promise<Mutations.FreeDecisions.PublishProjectOfFreeDecision.IOutput[typeof Mutations.FreeDecisions.PublishProjectOfFreeDecision.name]> {
73
+ const { [Mutations.FreeDecisions.PublishProjectOfFreeDecision.name]: result } = await client.Mutation(
74
+ Mutations.FreeDecisions.PublishProjectOfFreeDecision.mutation,
75
+ {
76
+ variables: {
77
+ data,
78
+ },
79
+ }
80
+ )
81
+
82
+ return result
83
+ }
84
+
85
+ return {
86
+ createProjectInput,
87
+ createProject,
88
+ createProjectOfFreeDecision,
89
+ generateProjectDocumentOfFreeDecision,
90
+ publishProjectOfFreeDecision
91
+ }
92
+ }