@coopenomics/desktop 2.2.6 → 2.2.8

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 (41) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +5 -5
  3. package/src/boot/init-stores.ts +5 -3
  4. package/src/desktops/Chairman/model/index.ts +0 -23
  5. package/src/desktops/Member/model/index.ts +0 -23
  6. package/src/desktops/Setup/model/index.ts +0 -23
  7. package/src/desktops/User/model/index.ts +7 -12
  8. package/src/entities/System/model/store.ts +1 -1
  9. package/src/entities/Wallet/model/stores.ts +25 -27
  10. package/src/entities/Wallet/ui/index.ts +0 -1
  11. package/src/features/Branch/SelectBranch/model/index.ts +1 -1
  12. package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +5 -7
  13. package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +2 -2
  14. package/src/features/Request/CreateChildOrder/api/index.ts +73 -48
  15. package/src/features/Request/CreateChildOrder/model/index.ts +46 -0
  16. package/src/features/Request/CreateChildOrder/model/types.ts +1 -1
  17. package/src/features/Request/CreateChildOrder/ui/CreateChildOrderButton/CreateChildOrderButton.vue +28 -4
  18. package/src/features/Request/CreateParentOffer/api/index.ts +1 -1
  19. package/src/features/Request/CreateParentOffer/model/types.ts +2 -2
  20. package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +3 -3
  21. package/src/features/Request/RecieveOnRequest/api/index.ts +2 -2
  22. package/src/features/Request/SupplyOnRequest/api/index.ts +1 -1
  23. package/src/features/Request/UpdateRequest/api/index.ts +2 -2
  24. package/src/pages/Registrator/SignUp/SelectBranch.vue +1 -1
  25. package/src/shared/ui/UserDataForm/OrganizationDataForm/OrganizationDataForm.vue +1 -1
  26. package/src/widgets/User/CoopCard/ui/CoopCard.vue +41 -3
  27. package/src/entities/Wallet/ui/WalletBalance/WalletBalance.vue +0 -35
  28. package/src/entities/Wallet/ui/WalletBalance/index.ts +0 -1
  29. package/src/pages/User/IdentityPage/index.ts +0 -1
  30. package/src/pages/User/IdentityPage/ui/IdentityPage.vue +0 -15
  31. package/src/pages/User/IdentityPage/ui/index.ts +0 -1
  32. package/src/pages/User/WalletPage/index.ts +0 -1
  33. package/src/pages/User/WalletPage/ui/WalletPage.vue +0 -14
  34. package/src/pages/User/WalletPage/ui/index.ts +0 -1
  35. package/src/widgets/User/PersonalCard/index.ts +0 -1
  36. package/src/widgets/User/PersonalCard/ui/PersonalCard.vue +0 -109
  37. package/src/widgets/User/PersonalCard/ui/UserQR.vue +0 -5
  38. package/src/widgets/User/PersonalCard/ui/index.ts +0 -2
  39. package/src/widgets/User/WalletCard/index.ts +0 -1
  40. package/src/widgets/User/WalletCard/ui/WalletCard.vue +0 -26
  41. package/src/widgets/User/WalletCard/ui/index.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.8](https://github.com/coopenomics/monocoop/compare/v2.2.7...v2.2.8) (2025-02-10)
7
+
8
+ **Note:** Version bump only for package @coopenomics/desktop
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.2.7](https://github.com/coopenomics/monocoop/compare/v2.2.6...v2.2.7) (2025-02-07)
15
+
16
+ **Note:** Version bump only for package @coopenomics/desktop
17
+
18
+
19
+
20
+
21
+
6
22
  ## [2.2.6](https://github.com/coopenomics/monocoop/compare/v2.2.6-alpha.0...v2.2.6) (2025-01-27)
7
23
 
8
24
  **Note:** Version bump only for package @coopenomics/desktop
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coopenomics/desktop",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
4
4
  "description": "A Desktop Project",
5
5
  "productName": "Desktop App",
6
6
  "author": "Alex Ant <dacom.dark.sun@gmail.com>",
@@ -20,8 +20,8 @@
20
20
  "prepublishOnly": "npm run build:lib"
21
21
  },
22
22
  "dependencies": {
23
- "@coopenomics/controller": "2.2.6",
24
- "@coopenomics/sdk": "2.2.6",
23
+ "@coopenomics/controller": "2.2.8",
24
+ "@coopenomics/sdk": "2.2.8",
25
25
  "@dicebear/collection": "^9.0.1",
26
26
  "@dicebear/core": "^9.0.1",
27
27
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
@@ -45,7 +45,7 @@
45
45
  "@wharfkit/wallet-plugin-privatekey": "^1.1.0",
46
46
  "axios": "^1.2.1",
47
47
  "compression": "^1.7.4",
48
- "cooptypes": "2.2.6",
48
+ "cooptypes": "2.2.8",
49
49
  "dompurify": "^3.1.7",
50
50
  "dotenv": "^16.4.5",
51
51
  "email-regex": "^5.0.0",
@@ -94,5 +94,5 @@
94
94
  "npm": ">= 6.13.4",
95
95
  "yarn": ">= 1.21.1"
96
96
  },
97
- "gitHead": "d0bd4428bebd6971c23c27d8d26643d72e3f07cb"
97
+ "gitHead": "973590281c916620f866b9e39253c6b5bf85f9d4"
98
98
  }
@@ -8,14 +8,16 @@ import { useAccountStore } from 'src/entities/Account/model';
8
8
  import { useSessionStore } from 'src/entities/Session';
9
9
 
10
10
  export default boot(async ({ router }) => {
11
+ const system = useSystemStore();
12
+ //Инициализация системного стора
13
+ await system.loadSystemInfo();
14
+
15
+ // инициализация всего остального
11
16
  const desktops = useDesktopStore();
12
17
  const cardStore = useCardStore();
13
- const system = useSystemStore();
14
18
  const account = useAccountStore();
15
19
  const session = useSessionStore();
16
20
 
17
- //Инициализация системного стора
18
- await system.loadSystemInfo();
19
21
 
20
22
  // Инициализация стора desktops
21
23
  await desktops.healthCheck();
@@ -1,6 +1,4 @@
1
- import { UserIdentityPage } from 'src/pages/User/IdentityPage';
2
1
  import { UserPaymentMethodsPage } from 'src/pages/User/PaymentMethodsPage';
3
- import { UserWalletPage } from 'src/pages/User/WalletPage';
4
2
  import { markRaw } from 'vue';
5
3
 
6
4
  export const manifest = {
@@ -18,27 +16,6 @@ export const manifest = {
18
16
  path: '/:coopname/user',
19
17
  name: 'home',
20
18
  children: [{
21
- meta: {
22
- title: 'Удостоверение',
23
- icon: '',
24
- roles: [],
25
- },
26
- path: 'identity',
27
- name: 'user-identity',
28
- component: markRaw(UserIdentityPage),
29
- children: [],
30
- },{
31
- meta: {
32
- title: 'Кошелёк',
33
- icon: '',
34
- roles: [],
35
- },
36
- path: 'wallet',
37
- name: 'user-wallet',
38
- component: markRaw(UserWalletPage),
39
- children: [],
40
- },
41
- {
42
19
  meta: {
43
20
  title: 'Реквизиты',
44
21
  icon: '',
@@ -1,6 +1,4 @@
1
- import { UserIdentityPage } from 'src/pages/User/IdentityPage';
2
1
  import { UserPaymentMethodsPage } from 'src/pages/User/PaymentMethodsPage';
3
- import { UserWalletPage } from 'src/pages/User/WalletPage';
4
2
  import { markRaw } from 'vue';
5
3
 
6
4
  export const manifest = {
@@ -18,27 +16,6 @@ export const manifest = {
18
16
  path: '/:coopname/user',
19
17
  name: 'home',
20
18
  children: [{
21
- meta: {
22
- title: 'Удостоверение',
23
- icon: '',
24
- roles: [],
25
- },
26
- path: 'identity',
27
- name: 'user-identity',
28
- component: markRaw(UserIdentityPage),
29
- children: [],
30
- },{
31
- meta: {
32
- title: 'Кошелёк',
33
- icon: '',
34
- roles: [],
35
- },
36
- path: 'wallet',
37
- name: 'user-wallet',
38
- component: markRaw(UserWalletPage),
39
- children: [],
40
- },
41
- {
42
19
  meta: {
43
20
  title: 'Реквизиты',
44
21
  icon: '',
@@ -1,6 +1,4 @@
1
- import { UserIdentityPage } from 'src/pages/User/IdentityPage';
2
1
  import { UserPaymentMethodsPage } from 'src/pages/User/PaymentMethodsPage';
3
- import { UserWalletPage } from 'src/pages/User/WalletPage';
4
2
  import { markRaw } from 'vue';
5
3
 
6
4
  export const manifest = {
@@ -18,27 +16,6 @@ export const manifest = {
18
16
  path: '/:coopname/user',
19
17
  name: 'home',
20
18
  children: [{
21
- meta: {
22
- title: 'Удостоверение',
23
- icon: '',
24
- roles: [],
25
- },
26
- path: 'identity',
27
- name: 'user-identity',
28
- component: markRaw(UserIdentityPage),
29
- children: [],
30
- },{
31
- meta: {
32
- title: 'Кошелёк',
33
- icon: '',
34
- roles: [],
35
- },
36
- path: 'wallet',
37
- name: 'user-wallet',
38
- component: markRaw(UserWalletPage),
39
- children: [],
40
- },
41
- {
42
19
  meta: {
43
20
  title: 'Реквизиты',
44
21
  icon: '',
@@ -8,13 +8,13 @@ import { agreementsBase } from 'src/shared/lib/consts/workspaces';
8
8
  import { ConnectionPage } from 'src/pages/Union/Connection';
9
9
  import { ListOfDocumentsPage } from 'src/pages/Documentor/ListOfDocuments';
10
10
  import { CoopCardPage } from 'src/pages/User/CardPage';
11
- import { MainMarketplacePage } from 'src/pages/Marketplace/MainPage';
12
- import { ModerationPage } from 'src/pages/Marketplace/Moderation';
13
- import { CreateParentOfferPage } from 'src/pages/Marketplace/CreateParentOffer';
14
- import { ShowcasePage } from 'src/pages/Marketplace/Showcase';
15
- import { UserParentOffersPage } from 'src/pages/Marketplace/UserParentOffers';
16
- import { UserSuppliesListPage } from 'src/pages/Marketplace/UserSuppliesList';
17
- import { SuppliesListPage } from 'src/pages/Marketplace/SuppliesList';
11
+ // import { MainMarketplacePage } from 'src/pages/Marketplace/MainPage';
12
+ // import { ModerationPage } from 'src/pages/Marketplace/Moderation';
13
+ // import { CreateParentOfferPage } from 'src/pages/Marketplace/CreateParentOffer';
14
+ // import { ShowcasePage } from 'src/pages/Marketplace/Showcase';
15
+ // import { UserParentOffersPage } from 'src/pages/Marketplace/UserParentOffers';
16
+ // import { UserSuppliesListPage } from 'src/pages/Marketplace/UserSuppliesList';
17
+ // import { SuppliesListPage } from 'src/pages/Marketplace/SuppliesList';
18
18
 
19
19
  export const manifest = {
20
20
  'name': 'UserDesktop',
@@ -171,11 +171,6 @@ export const manifest = {
171
171
  },
172
172
  },
173
173
  // {
174
- // meta: {
175
- // title: 'Маркетплейс',
176
- // icon: 'fa-solid fa-cog',
177
- // roles: [],
178
- // },
179
174
  // path: '/:coopname/marketplace',
180
175
  // name: 'marketplace',
181
176
  // component: markRaw(MainMarketplacePage),
@@ -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
-
15
+ console.log('system: ', info)
16
16
  const loadSystemInfo = async () => {
17
17
  info.value = await api.loadSystemInfo();
18
18
  };
@@ -1,7 +1,6 @@
1
1
  import { defineStore } from 'pinia';
2
2
  import { api } from '../api';
3
3
  import {
4
- IWalletData,
5
4
  IDepositData,
6
5
  IWithdrawData,
7
6
  ExtendedProgramWalletData,
@@ -13,14 +12,13 @@ import { ILoadUserWallet } from './types';
13
12
  import { ICreateDeposit } from 'src/shared/lib/types/payments';
14
13
  import { Ref, ref } from 'vue';
15
14
  import { sendPOST } from 'src/shared/api';
16
- import { CURRENCY } from 'src/shared/config';
17
15
  import type { SovietContract } from 'cooptypes';
18
16
 
19
17
  const namespace = 'wallet';
20
18
 
21
19
  interface IWalletStore {
22
20
  /* доменный интерфейс кошелька пользователя */
23
- wallet: Ref<IWalletData>;
21
+ // wallet: Ref<IWalletData>;
24
22
  program_wallets: Ref<ExtendedProgramWalletData[]>;
25
23
  deposits: Ref<IDepositData[]>;
26
24
  withdraws: Ref<IWithdrawData[]>;
@@ -35,14 +33,14 @@ interface IWalletStore {
35
33
  }
36
34
 
37
35
  export const useWalletStore = defineStore(namespace, (): IWalletStore => {
38
- const wallet = ref<IWalletData>({
39
- username: '',
40
- coopname: '',
41
- available: `0.0000 ${CURRENCY}`,
42
- blocked: `0.0000 ${CURRENCY}`,
43
- minimum: `0.0000 ${CURRENCY}`,
44
- initial: `0.0000 ${CURRENCY}`,
45
- });
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
+ // });
46
44
 
47
45
  const deposits = ref<IDepositData[]>([]);
48
46
  const withdraws = ref<IWithdrawData[]>([]);
@@ -53,18 +51,18 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
53
51
 
54
52
  const loadUserWalet = async (params: ILoadUserWallet) => {
55
53
 
56
- const createEmptyWallet = (): IWalletData => ({
57
- username: '',
58
- coopname: '',
59
- available: `0.0000 ${CURRENCY}`,
60
- blocked: `0.0000 ${CURRENCY}`,
61
- minimum: `0.0000 ${CURRENCY}`,
62
- initial: `0.0000 ${CURRENCY}`,
63
- });
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
+ // });
64
62
 
65
63
  try {
66
64
  const data = await Promise.all([
67
- api.loadSingleUserWalletData(params),
65
+ // api.loadSingleUserWalletData(params),
68
66
  api.loadUserDepositsData(params),
69
67
  api.loadUserWithdrawsData(params),
70
68
  api.loadUserProgramWalletsData(params),
@@ -72,12 +70,12 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
72
70
  api.loadUserAgreements(params.coopname, params.username)
73
71
  ]);
74
72
 
75
- wallet.value = data[0] ?? createEmptyWallet();
76
- deposits.value = data[1] ?? [];
77
- withdraws.value = data[2] ?? [];
78
- program_wallets.value = data[3] ?? [];
79
- methods.value = data[4] ?? [];
80
- agreements.value = data[5] ?? [];
73
+ // wallet.value = data[0] ?? createEmptyWallet();
74
+ deposits.value = data[0] ?? [];
75
+ withdraws.value = data[1] ?? [];
76
+ program_wallets.value = data[2] ?? [];
77
+ methods.value = data[3] ?? [];
78
+ agreements.value = data[4] ?? [];
81
79
 
82
80
  } catch (e: any) {
83
81
  console.log(e);
@@ -95,7 +93,7 @@ export const useWalletStore = defineStore(namespace, (): IWalletStore => {
95
93
  };
96
94
 
97
95
  return {
98
- wallet,
96
+ // wallet,
99
97
  program_wallets,
100
98
  deposits,
101
99
  withdraws,
@@ -1,2 +1 @@
1
- export * from './WalletBalance'
2
1
  export * from './WalletProgramsList'
@@ -2,7 +2,7 @@ import type { Mutations } from '@coopenomics/sdk';
2
2
  import { ref } from 'vue';
3
3
  import { api } from '../api';
4
4
 
5
- export type ISelectBranchInput = Mutations.Branches.SelectBranch.IInput
5
+ export type ISelectBranchInput = Mutations.Branches.SelectBranch.IInput['data']
6
6
 
7
7
  const isVisible = ref(false);
8
8
 
@@ -85,19 +85,17 @@ div
85
85
  const {selectBranch} = useSelectBranch()
86
86
 
87
87
  await selectBranch({
88
- data: {
89
- braname: selectedBranch.value,
90
- coopname: system.info.coopname,
91
- document,
92
- username: session.username,
93
- }
88
+ braname: selectedBranch.value,
89
+ coopname: system.info.coopname,
90
+ document,
91
+ username: session.username,
94
92
  })
95
93
  isVisible.value = false
96
94
  SuccessAlert('Кооперативный участок выбран')
97
95
  } catch(e: any){
98
96
  isSubmitting.value = false
99
97
  console.error(e)
100
- failAlert(`Ошибка подписи документа: ${e.message}`)
98
+ failAlert(e)
101
99
  }
102
100
 
103
101
  }
@@ -20,7 +20,7 @@ async function confirmRecieve(
20
20
 
21
21
  const result = await transact({
22
22
  account: ContractsList.Marketplace,
23
- name: MarketContract.Actions.ConfirmRecieve.actionName,
23
+ name: MarketContract.Actions.ConfirmReceive.actionName,
24
24
  authorization: [
25
25
  {
26
26
  actor: params.username,
@@ -32,7 +32,7 @@ async function confirmRecieve(
32
32
  coopname: params.coopname,
33
33
  exchange_id: params.request_id,
34
34
  document,
35
- } as MarketContract.Actions.ConfirmRecieve.IConfirmRecieve,
35
+ } as MarketContract.Actions.ConfirmReceive.IConfirmReceive,
36
36
  });
37
37
 
38
38
  const requestsStore = useRequestStore();
@@ -1,57 +1,82 @@
1
- import { TransactResult } from '@wharfkit/session';
2
- import { ICreateChildOrder } from '../model';
3
- import { transact } from 'src/shared/api';
4
- import { ContractsList } from 'src/shared/config';
5
- import { useRequestStore } from 'src/entities/Request/model/stores';
6
- import { IDocument } from 'src/shared/lib/types/document';
7
- import { MarketContract } from 'cooptypes';
1
+ import { Mutations } from '@coopenomics/sdk';
2
+ import { client } from 'src/shared/api/client';
8
3
 
9
4
  async function createChildOrder(
10
- params: ICreateChildOrder
11
- ): Promise<TransactResult | undefined> {
12
- //TODO здесь передаём документ заявления на возврат имуществом (?)
13
- const document = {
14
- hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
15
- public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
16
- signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
17
- meta: '',
18
- } as IDocument;
19
-
20
- const result = await transact({
21
- account: ContractsList.Marketplace,
22
- name: MarketContract.Actions.CreateOrder.actionName,
23
- authorization: [
24
- {
25
- actor: params.username,
26
- permission: 'active',
27
- },
28
- ],
29
- data: {
30
- params: {
31
- username: params.username,
32
- coopname: params.coopname,
33
- parent_id: params.parent_id,
34
- program_id: params.program_id,
35
- pieces: params.pieces,
36
- unit_cost: params.unit_cost,
37
- product_lifecycle_secs: 0,
38
- document,
39
- data: '',
40
- meta: '',
41
- },
42
- } as MarketContract.Actions.CreateOrder.ICreateOrder,
43
-
44
- });
45
-
46
- const requestsStore = useRequestStore();
47
- requestsStore.loadUserChildOrders({
48
- coopname: params.coopname,
49
- username: params.username,
50
- });
5
+ data: Mutations.Cooplace.CreateChildOrder.IInput['data']
6
+ ): Promise<Mutations.Cooplace.CreateChildOrder.IOutput[typeof Mutations.Cooplace.CreateChildOrder.name]> {
7
+
8
+ const {[Mutations.Cooplace.CreateChildOrder.name]: result} = await client.Mutation(Mutations.Cooplace.CreateChildOrder.mutation, {
9
+ variables: {
10
+ data
11
+ }
12
+ })
13
+
51
14
 
52
15
  return result;
53
16
  }
54
17
 
18
+ async function generateReturnByAssetStatement(
19
+ data: Mutations.Cooplace.GenerateReturnByAssetStatement.IInput['data']
20
+ ): Promise<Mutations.Cooplace.GenerateReturnByAssetStatement.IOutput[typeof Mutations.Cooplace.GenerateReturnByAssetStatement.name]> {
21
+ const {[Mutations.Cooplace.GenerateReturnByAssetStatement.name]: result} = await client.Mutation(Mutations.Cooplace.GenerateReturnByAssetStatement.mutation, {
22
+ variables: {
23
+ data
24
+ }
25
+ })
26
+
27
+ return result;
28
+ }
29
+
30
+ // async function createChildOrder(
31
+ // params: ICreateChildOrder
32
+ // ): Promise<TransactResult | undefined> {
33
+ // //TODO здесь передаём документ заявления на возврат имуществом (?)
34
+ // const document = {
35
+ // hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
36
+ // public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
37
+ // signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
38
+ // meta: '',
39
+ // } as IDocument;
40
+
41
+
42
+
43
+
44
+ // const result = await transact({
45
+ // account: ContractsList.Marketplace,
46
+ // name: MarketContract.Actions.CreateOrder.actionName,
47
+ // authorization: [
48
+ // {
49
+ // actor: params.username,
50
+ // permission: 'active',
51
+ // },
52
+ // ],
53
+ // data: {
54
+ // params: {
55
+ // username: params.username,
56
+ // coopname: params.coopname,
57
+ // parent_id: params.parent_id,
58
+ // program_id: params.program_id,
59
+ // units: params.units,
60
+ // unit_cost: params.unit_cost,
61
+ // product_lifecycle_secs: 0,
62
+ // document,
63
+ // data: '',
64
+ // meta: '',
65
+ // },
66
+ // } as MarketContract.Actions.CreateOrder.ICreateOrder,
67
+
68
+ // });
69
+
70
+ // const requestsStore = useRequestStore();
71
+ // requestsStore.loadUserChildOrders({
72
+ // coopname: params.coopname,
73
+ // username: params.username,
74
+ // });
75
+
76
+ // return result;
77
+ // }
78
+
55
79
  export const api = {
56
80
  createChildOrder,
81
+ generateReturnByAssetStatement
57
82
  };
@@ -1 +1,47 @@
1
+ import { Mutations } from '@coopenomics/sdk';
2
+ import { useRequestStore } from 'src/entities/Request/model/stores';
3
+ import { api } from '../api';
4
+ import { client } from 'src/shared/api/client';
5
+
1
6
  export * from './types'
7
+
8
+ export function useCreateChildOrder() {
9
+ async function createChildOrder(
10
+ //TODO перевести id на хэши
11
+ data: Mutations.Cooplace.GenerateReturnByAssetStatement.IInput['data'] & {parent_id: number}
12
+ ): Promise<Mutations.Cooplace.CreateChildOrder.IOutput[typeof Mutations.Cooplace.CreateChildOrder.name]> {
13
+
14
+ const returnByAssetStatement = await api.generateReturnByAssetStatement({
15
+ coopname: data.coopname,
16
+ username: data.username,
17
+ request: data.request,
18
+ })
19
+
20
+ const document = await client.Document.signDocument(returnByAssetStatement)
21
+
22
+ //TODO здесь же нужно передать распоряжение на использование средств цифрового кошелька
23
+
24
+ const result = await api.createChildOrder({
25
+ coopname: data.coopname,
26
+ data: '',
27
+ meta: '',
28
+ parent_id: data.parent_id,
29
+ product_lifecycle_secs: 0,
30
+ program_id: data.request.program_id,
31
+ unit_cost: data.request.unit_cost,
32
+ units: data.request.units,
33
+ username: data.username,
34
+ document
35
+ })
36
+
37
+ const requestsStore = useRequestStore();
38
+ requestsStore.loadUserChildOrders({
39
+ coopname: data.coopname,
40
+ username: data.username,
41
+ });
42
+
43
+
44
+ return result;
45
+ }
46
+ return { createChildOrder };
47
+ }
@@ -5,7 +5,7 @@ export interface ICreateChildOrder {
5
5
  coopname: string;
6
6
  parent_id: string | number;
7
7
  program_id: string | number;
8
- pieces: string | number;
8
+ units: string | number;
9
9
  unit_cost: string;
10
10
  }
11
11
 
@@ -4,19 +4,43 @@
4
4
  import type { ICreateChildOrderProps } from '../../model'
5
5
  import { withDefaults } from 'vue'
6
6
  import { useRouter } from 'vue-router'
7
+ import { client } from 'src/shared/api/client'
7
8
 
8
9
  const router = useRouter()
9
10
  const props = withDefaults(defineProps<ICreateChildOrderProps>(), {})
10
11
 
11
12
  const createOrder = async () => {
12
13
  try {
14
+
15
+ const document = await api.generateReturnByAssetStatement({
16
+ coopname: props.coopname,
17
+ request: {
18
+ currency: 'RUB',
19
+ hash: 'hash',
20
+ program_id: 1,
21
+ title: 'test',
22
+ total_cost: '10.0000 RUB',
23
+ type: '',
24
+ unit_cost: props.offer.unit_cost,
25
+ unit_of_measurement: '',
26
+ units: props.units
27
+ },
28
+ username: props.username
29
+ })
30
+
31
+ const signedDocument = await client.Document.signDocument(document)
32
+
13
33
  await api.createChildOrder({
14
34
  coopname: props.coopname,
15
35
  username: props.username,
16
- parent_id: props.offer.id,
17
- program_id: props.offer.program_id,
18
- pieces: props.units,
36
+ parent_id: Number(props.offer.id),
37
+ program_id: Number(props.offer.program_id),
38
+ units: props.units,
19
39
  unit_cost: props.offer.unit_cost,
40
+ data: '',
41
+ document: signedDocument,
42
+ meta: '',
43
+ product_lifecycle_secs: 100
20
44
  })
21
45
  SuccessAlert('Заказ создан')
22
46
  router.push({ name: 'marketplace-user-supplies' }) //TODO роутинг
@@ -26,5 +50,5 @@
26
50
  }
27
51
  </script>
28
52
  <template lang="pug">
29
- q-btn(size="lg" @click="createOrder") оплатить
53
+ q-btn(size="lg" @click="createOrder") оплатить
30
54
  </template>
@@ -27,7 +27,7 @@ async function createParentOffer(
27
27
  coopname: params.coopname,
28
28
  parent_id: 0,
29
29
  program_id: params.program_id,
30
- pieces: params.pieces,
30
+ units: params.units,
31
31
  unit_cost: params.unit_cost,
32
32
  product_lifecycle_secs: params.product_lifecycle_secs,
33
33
  // document,
@@ -4,7 +4,7 @@ export interface ICreateOffer {
4
4
  username: string;
5
5
  coopname: string;
6
6
  program_id: string | number;
7
- pieces: string | number;
7
+ units: string | number;
8
8
  unit_cost: string;
9
9
  product_lifecycle_secs: string | number;
10
10
  data: IRequestObjectData;
@@ -13,7 +13,7 @@ export interface ICreateOffer {
13
13
  export interface IFormData {
14
14
  title: string;
15
15
  description: string;
16
- pieces: number;
16
+ units: number;
17
17
  unit_cost_number: number;
18
18
  product_lifecycle_days: number;
19
19
  program_id: number;
@@ -34,7 +34,7 @@ const updateImages = (previewImage: string, images: string[]) => {
34
34
  const formData = ref<IFormData>({
35
35
  title: '',
36
36
  description: '',
37
- pieces: 1,
37
+ units: 1,
38
38
  unit_cost_number: 0,
39
39
  product_lifecycle_days: 3,
40
40
  program_id: 0,
@@ -49,7 +49,7 @@ const handlerSubmit = async () => {
49
49
  username: props.username,
50
50
  coopname: props.coopname,
51
51
  program_id: formData.value.program_id,
52
- pieces: formData.value.pieces,
52
+ units: formData.value.units,
53
53
  unit_cost: parseFloat(unit_cost.toString()).toFixed(4) + ' ' + CURRENCY,
54
54
  product_lifecycle_secs: 86400 * formData.value.product_lifecycle_days,
55
55
  data: {
@@ -73,7 +73,7 @@ q-card(bordered flat)
73
73
  Form(:handler-submit="handlerSubmit" :is-submitting="isSubmitting" :show-cancel="false" :button-cancel-txt="'Отменить'" :button-submit-txt="'Создать объявление'").q-mt-lg
74
74
  q-input(v-model="formData.title" square standout="bg-teal text-white" label="Заголовок").q-ma-md
75
75
  q-input(v-model="formData.description" square standout="bg-teal text-white" label="Описание" type="textarea").q-ma-md
76
- q-input(v-model="formData.pieces" square standout="bg-teal text-white" label="Количество единиц" type="number").q-ma-md
76
+ q-input(v-model="formData.units" square standout="bg-teal text-white" label="Количество единиц" type="number").q-ma-md
77
77
  q-input(v-model="formData.unit_cost_number" square standout="bg-teal text-white" type="number" controls-position="right" :precision="4" :step="1.0000" :min="0" label="Введите сумму:").q-ma-md
78
78
  q-input(v-model="formData.product_lifecycle_days" square standout="bg-teal text-white" label="Гарантийный срок в днях" ).q-pa-md
79
79
  q-select(v-model="formData.program_id" square standout="bg-teal text-white" :options="programs" map-options emit-value option-label="title" option-value="id" label="Целевая программа").q-ma-md
@@ -20,7 +20,7 @@ async function recieve(
20
20
 
21
21
  const result = await transact({
22
22
  account: ContractsList.Marketplace,
23
- name: MarketContract.Actions.RecieveOnRequest.actionName,
23
+ name: MarketContract.Actions.ReceiveOnRequest.actionName,
24
24
  authorization: [
25
25
  {
26
26
  actor: params.username,
@@ -32,7 +32,7 @@ async function recieve(
32
32
  coopname: params.coopname,
33
33
  exchange_id: params.request_id,
34
34
  document,
35
- } as MarketContract.Actions.RecieveOnRequest.IRecieveOnRequest,
35
+ } as MarketContract.Actions.ReceiveOnRequest.IReceiveOnRequest,
36
36
  });
37
37
 
38
38
  const requestsStore = useRequestStore();
@@ -10,7 +10,7 @@ import { TransactResult } from '@wharfkit/session';
10
10
  async function supplyOnRequest(
11
11
  params: ISupplyOnRequest
12
12
  ): Promise<TransactResult | undefined> {
13
- //TODO получить подписанное заявление на имущественный взнос из кошелька
13
+ //TODO получить подписанный акт приёма-передачи имущества
14
14
  const document = {
15
15
  hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
16
16
  public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
@@ -11,7 +11,7 @@ async function updateRequestData(
11
11
  ): Promise<TransactResult | undefined> {
12
12
  const result = await transact({
13
13
  account: ContractsList.Marketplace,
14
- name: MarketContract.Actions.UpdateRequests.actionName,
14
+ name: MarketContract.Actions.UpdateRequest.actionName,
15
15
  authorization: [
16
16
  {
17
17
  actor: params.username,
@@ -26,7 +26,7 @@ async function updateRequestData(
26
26
  unit_cost: params.unitCost,
27
27
  data: JSON.stringify(params.data),
28
28
  meta: '',
29
- } as MarketContract.Actions.UpdateRequests.IUpdateRequest,
29
+ } as MarketContract.Actions.UpdateRequest.IUpdateRequest,
30
30
  });
31
31
 
32
32
  const requestsStore = useRequestStore();
@@ -2,7 +2,7 @@
2
2
  div(v-if="store")
3
3
  q-step(
4
4
  :name="store.steps.SelectBranch"
5
- title="Выберите ближайший кооперативный участок"
5
+ title="Выберите кооперативный участок"
6
6
  :done="store.isStepDone('SelectBranch')"
7
7
  )
8
8
  BranchSelector(
@@ -4,7 +4,7 @@ div(v-if="userData.organization_data").q-gutter-sm.q-mt-md
4
4
  v-model="userData.organization_data.type"
5
5
  label="Выберите тип организации"
6
6
  standout="bg-teal text-white"
7
- :options="[{ label: 'Потребительский Кооператив', value: 'coop' }, { label: 'ООО', value: 'ooo' }]"
7
+ :options="[{ label: 'Потребительский Кооператив', value: 'coop' }, { label: 'Производственный Кооператив', value: 'prodcoop' }, { label: 'ООО', value: 'ooo' }]"
8
8
  emit-value
9
9
  map-options).q-mb-md
10
10
  q-input(v-model="userData.organization_data.short_name" standout="bg-teal text-white" hint="ПК Ромашка" label="Краткое наименование организации" :rules="[val => notEmpty(val)]" autocomplete="off")
@@ -8,12 +8,45 @@ div.q-pa-md
8
8
  AutoAvatar(style="width: 60px; border-radius: 50%;" :username="currentUser.username")
9
9
  div.col-12.col-md-9.q-mt-sm.q-mt-md-0
10
10
  q-badge(color="primary" style="font-size: 12px; margin-bottom: 4px;") {{role}}
11
- div.text-h6 {{displayName}}
11
+ div.text-h6
12
+ span(v-if="isIP").q-mr-sm ИП
13
+ | {{displayName}}
12
14
  div.row
13
15
  DepositButton.col-6.border-left-radius-buttons
14
16
  WithdrawButton.col-6.border-right-radius-buttons
15
17
 
16
- WalletBalance.q-mt-lg
18
+ div.col-md-4.col-xs-12
19
+
20
+
21
+ q-list(flat).q-gutter-sm
22
+ q-item
23
+ q-item-section
24
+ q-item-label(caption) Имя аккаунта
25
+ q-item-label(style="font-size: 20px;").text-bold {{ currentUser.username }}
26
+
27
+ //- q-item
28
+ //- q-item-section
29
+ //- q-item-label(caption) Паевый счёт
30
+ //- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.available }}
31
+
32
+ q-item
33
+ q-item-section
34
+ q-item-label(caption) Минимальный паевый счёт
35
+ q-item-label(style="font-size: 20px;").text-bold {{ currentUser.participantAccount?.minimum_amount }}
36
+
37
+ //- q-item
38
+ //- q-item-section
39
+ //- q-item-label(caption) Заблокировано в целевых программах
40
+ //- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.blocked }}
41
+
42
+
43
+ q-item(v-for="program_wallet of walletStore.program_wallets" :key="program_wallet.id")
44
+ q-item-section
45
+ q-item-label(caption) {{ program_wallet.program_details.title }}
46
+
47
+ q-item-label(style="font-size: 20px;").text-bold {{program_wallet.available}}
48
+
49
+
17
50
 
18
51
 
19
52
  //- div.col-md-6.col-xs-12.q-mt-lg
@@ -22,10 +55,12 @@ div.q-pa-md
22
55
  </template>
23
56
 
24
57
  <script lang="ts" setup>
25
- import { WalletBalance } from 'src/entities/Wallet/ui'
58
+
26
59
  import { DepositButton } from 'src/features/Wallet/DepositToWallet'
27
60
  import { WithdrawButton } from 'src/features/Wallet/WithdrawFromWallet'
28
61
  import { AutoAvatar } from 'src/shared/ui/AutoAvatar';
62
+ import { useWalletStore } from 'src/entities/Wallet';
63
+ const walletStore = useWalletStore()
29
64
 
30
65
  import { useCurrentUserStore } from 'src/entities/User'
31
66
  import type { IEntrepreneurData, IIndividualData, IOrganizationData } from 'src/shared/lib/types/user/IUserData';
@@ -34,6 +69,9 @@ const currentUser = useCurrentUserStore()
34
69
 
35
70
  const userType = computed(() => currentUser.userAccount?.type)
36
71
 
72
+ const isIP = computed(() => currentUser.userAccount?.type === 'entrepreneur')
73
+
74
+
37
75
  const role = computed(() => {
38
76
  if (currentUser.userAccount?.role === 'user')
39
77
  return 'Пайщик'
@@ -1,35 +0,0 @@
1
- <script setup lang="ts">
2
- import { useWalletStore } from '../../model'
3
- const walletStore = useWalletStore()
4
- </script>
5
-
6
- <template lang="pug">
7
- q-list(flat).q-gutter-sm
8
- q-item
9
- q-item-section
10
- q-item-label(caption) Имя аккаунта
11
- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.username }}
12
-
13
- q-item
14
- q-item-section
15
- q-item-label(caption) Паевый счёт
16
- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.available }}
17
-
18
- q-item
19
- q-item-section
20
- q-item-label(caption) Минимальный паевый счёт
21
- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.minimum }}
22
-
23
- q-item
24
- q-item-section
25
- q-item-label(caption) Заблокировано в целевых программах
26
- q-item-label(style="font-size: 20px;").text-bold {{ walletStore.wallet.blocked }}
27
-
28
-
29
- q-item(v-for="program_wallet of walletStore.program_wallets" :key="program_wallet.id")
30
- q-item-section
31
- q-item-label(caption) {{ program_wallet.program_details.title }}
32
-
33
- q-item-label(style="font-size: 20px;").text-bold {{program_wallet.available}}
34
-
35
- </template>
@@ -1 +0,0 @@
1
- export { default as WalletBalance } from './WalletBalance.vue'
@@ -1 +0,0 @@
1
- export * from './ui'
@@ -1,15 +0,0 @@
1
- <template lang="pug">
2
- PersonalCard(:username="username")
3
-
4
- </template>
5
- <script lang="ts" setup>
6
- import { PersonalCard } from 'src/widgets/User/PersonalCard/ui'
7
-
8
- import { computed } from 'vue';
9
- import { useCurrentUserStore } from 'src/entities/User';
10
-
11
- const currentUser = useCurrentUserStore()
12
-
13
- const username = computed(() => currentUser.username)
14
-
15
- </script>
@@ -1 +0,0 @@
1
- export {default as UserIdentityPage} from './IdentityPage.vue'
@@ -1 +0,0 @@
1
- export * from './ui'
@@ -1,14 +0,0 @@
1
- <template lang="pug">
2
- WalletCard(:username="username")
3
- </template>
4
- <script lang="ts" setup>
5
- import { WalletCard } from 'src/widgets/User/WalletCard'
6
-
7
- import { computed } from 'vue';
8
- import { useCurrentUserStore } from 'src/entities/User';
9
-
10
- const currentUser = useCurrentUserStore()
11
-
12
- const username = computed(() => currentUser.username)
13
-
14
- </script>
@@ -1 +0,0 @@
1
- export {default as UserWalletPage} from './WalletPage.vue'
@@ -1 +0,0 @@
1
- export * from './ui'
@@ -1,109 +0,0 @@
1
- <template lang="pug">
2
- div(v-if="currentUser?.username" flat bordered).q-pa-md
3
- div.row
4
- div.col-md-4.col-xs-12
5
- div(style="flex-grow: 1; display: flex; justify-content: center;")
6
- //- UserQR
7
-
8
- AutoAvatar(style="width: 125px;" :username="currentUser.username").q-pa-sm.q-pt-lg
9
-
10
- div.col-md-8.col-xs-12
11
- div
12
- div
13
- q-item
14
- q-item-section
15
- q-item-label(caption) Пайщик
16
- q-item-label {{ displayName }}
17
-
18
-
19
- q-item
20
- q-item-section
21
- q-item-label(caption) Зарегистрирован как
22
- q-item-label(v-if="userType === 'individual'") физическое лицо
23
- q-item-label(v-if="userType === 'entrepreneur'") индивидуальный предприниматель
24
- q-item-label(v-if="userType === 'organization'") юридическое лицо
25
-
26
- q-item
27
- q-item-section
28
- q-item-label(caption) Имя аккаунта
29
- q-item-label {{ currentUser.username }}
30
-
31
- q-item(v-if="userType === 'individual' && individualProfile")
32
- q-item-section
33
- q-item-label(caption) Дата рождения
34
- q-item-label {{ individualProfile.birthdate }}
35
-
36
- q-item(v-if="userType === 'organization' && organizationProfile")
37
- q-item-section
38
- q-item-label(caption) ИНН / ОГРН
39
- q-item-label {{ inn_ogrn }}
40
-
41
- q-item(v-if="userProfile")
42
- q-item-section
43
- q-item-label(caption) Телефон
44
- q-item-label {{ userProfile.phone }}
45
-
46
- q-item(v-if="userProfile")
47
- q-item-section
48
- q-item-label(caption) Почта
49
- q-item-label {{ userProfile.email }}
50
-
51
- </template>
52
-
53
- <script lang="ts" setup>
54
- import { AutoAvatar } from 'src/shared/ui/AutoAvatar';
55
- import { useCurrentUserStore } from 'src/entities/User'
56
- import type { IEntrepreneurData, IIndividualData, IOrganizationData } from 'src/shared/lib/types/user/IUserData';
57
- import { computed } from 'vue';
58
- const currentUser = useCurrentUserStore()
59
-
60
- const userType = computed(() => currentUser.userAccount?.type)
61
-
62
- const individualProfile = computed(() => {
63
- if (userType.value === 'individual') {
64
- return currentUser.userAccount?.private_data as IIndividualData
65
- }
66
- return null
67
- })
68
-
69
- const entrepreneurProfile = computed(() => {
70
- if (userType.value === 'entrepreneur') {
71
- return currentUser.userAccount?.private_data as IEntrepreneurData
72
- }
73
- return null
74
- })
75
-
76
- const organizationProfile = computed(() => {
77
- if (userType.value === 'organization') {
78
- return currentUser.userAccount?.private_data as IOrganizationData
79
- }
80
- return null
81
- })
82
-
83
- const userProfile = computed(() => {
84
- if (userType.value === 'individual' || userType.value === 'entrepreneur') {
85
- return individualProfile?.value || entrepreneurProfile?.value
86
- }
87
- return organizationProfile?.value
88
- })
89
-
90
- const displayName = computed(() => {
91
- if (userType.value === 'individual') {
92
- return `${individualProfile.value?.last_name} ${individualProfile.value?.first_name} ${individualProfile.value?.middle_name}`
93
- } else if (userType.value === 'entrepreneur') {
94
- return `${entrepreneurProfile.value?.last_name} ${entrepreneurProfile.value?.first_name} ${entrepreneurProfile.value?.middle_name}`
95
- } else {
96
- return organizationProfile.value?.short_name
97
- }
98
- })
99
-
100
- const inn_ogrn = computed(() => {
101
- if (organizationProfile.value)
102
- return `${organizationProfile.value.details.inn} / ${organizationProfile.value.details.ogrn}`
103
- else return ''
104
- })
105
-
106
- </script>
107
- <style>
108
-
109
- </style>
@@ -1,5 +0,0 @@
1
- <template lang="pug">
2
- div qr
3
- </template>
4
- <script lang="ts" setup>
5
- </script>
@@ -1,2 +0,0 @@
1
- export { default as PersonalCard } from './PersonalCard.vue'
2
- export { default as UserQR } from './UserQR.vue'
@@ -1 +0,0 @@
1
- export * from './ui'
@@ -1,26 +0,0 @@
1
- <template lang="pug">
2
- div.q-pa-md
3
- div.flex
4
- DepositButton.q-ma-sm
5
- WithdrawButton.q-ma-sm
6
-
7
- div.row.justify-between.q-mt-lg
8
- div.col-md-4.col-xs-12
9
- WalletBalance
10
- div.col-md-4.col-xs-12.q-mt-lg
11
-
12
- </template>
13
-
14
- <script lang="ts" setup>
15
- import { WalletBalance } from 'src/entities/Wallet/ui'
16
- import { DepositButton } from 'src/features/Wallet/DepositToWallet'
17
- import { WithdrawButton } from 'src/features/Wallet/WithdrawFromWallet'
18
-
19
- defineProps({
20
- username: {
21
- type: String,
22
- required: true,
23
- },
24
- })
25
-
26
- </script>
@@ -1 +0,0 @@
1
- export { default as WalletCard } from './WalletCard.vue'