@coopenomics/desktop 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/extensions/powerup/boot.ts +1 -1
- package/package.json +6 -6
- package/src/app/App.vue +4 -2
- package/src/app/providers/card/store.ts +6 -3
- package/src/boot/branch-selector.ts +0 -2
- package/src/boot/navigation-guards.ts +5 -7
- package/src/components/menu/footerMobileMenu.vue +4 -2
- package/src/components/soviet/staff.vue +9 -7
- package/src/desktops/User/model/index.ts +94 -87
- package/src/entities/Request/api/index.ts +19 -19
- package/src/entities/Request/model/stores.ts +1 -0
- package/src/entities/User/model/entity.ts +1 -0
- package/src/features/Agreementer/GenerateAgreement/ui/AgreementReader.vue +4 -2
- package/src/features/Agreementer/SignAgreementDialog/model/index.ts +4 -3
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +4 -2
- package/src/features/Branch/CreateBranch/model/index.ts +4 -3
- package/src/features/Branch/EditBranch/model/index.ts +3 -2
- package/src/features/Decision/AuthorizeAndExecDecision/model/index.ts +6 -6
- package/src/features/Decision/VoteForDecision/model/index.ts +4 -2
- package/src/features/Installer/ui/RequestKeyForm/RequestKeyForm.vue +4 -2
- package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +4 -6
- package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +3 -2
- package/src/features/Request/AcceptRequest/api/index.ts +20 -21
- package/src/features/Request/CancelRequest/api/index.ts +13 -17
- package/src/features/Request/CompleteOnRequest/api/index.ts +13 -17
- package/src/features/Request/ConfirmRecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/ConfirmSupplyOnRequest/api/index.ts +17 -21
- package/src/features/Request/CreateChildOrder/api/index.ts +27 -30
- package/src/features/Request/CreateParentOffer/api/index.ts +4 -14
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +5 -2
- package/src/features/Request/DeclineRequest/api/index.ts +14 -18
- package/src/features/Request/DeliverOnRequest/api/index.ts +13 -17
- package/src/features/Request/DisputeOnRequest/api/index.ts +3 -7
- package/src/features/Request/ModerateRequest/api/index.ts +14 -18
- package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +4 -3
- package/src/features/Request/ProhibitRequest/api/index.ts +14 -18
- package/src/features/Request/PublishRequest/api/index.ts +13 -17
- package/src/features/Request/RecieveOnRequest/api/index.ts +17 -21
- package/src/features/Request/SupplyOnRequest/api/index.ts +3 -3
- package/src/features/Request/UnpublishRequest/api/index.ts +14 -17
- package/src/features/Request/UpdateRequest/api/index.ts +0 -4
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -2
- package/src/features/User/CreateUser/model/index.ts +10 -8
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +4 -2
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +4 -2
- package/src/pages/Cooperative/ListOfBranches/ui/ListOfBranchesPage.vue +4 -2
- package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +4 -2
- package/src/pages/Marketplace/CreateParentOffer/ui/CreateParentOfferPage.vue +3 -3
- package/src/pages/Marketplace/MainPage/ui/MainPage.vue +13 -13
- package/src/pages/Marketplace/Moderation/ui/ModerationPage.vue +7 -3
- package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +4 -2
- package/src/pages/Registrator/SignUp/PayInitial.vue +4 -2
- package/src/pages/Registrator/SignUp/ReadStatement.vue +7 -1
- package/src/pages/Registrator/SignUp/SelectBranch.vue +4 -2
- package/src/pages/Registrator/SignUp/SignUp.vue +7 -7
- package/src/pages/Registrator/SignUp/WaitingRegistration.vue +4 -2
- package/src/pages/Union/Connection/ConnectionPage.vue +1 -1
- package/src/pages/_layouts/default.vue +3 -2
- package/src/shared/store/index.ts +16 -18
- package/src/shared/ui/BaseDocument/BaseDocument.vue +1 -3
- package/src/shared/ui/Providers/Bank/Bank.vue +54 -2
- package/src/widgets/Agreementer/RequireAgreements/ui/RequireAgreements.vue +5 -3
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +11 -3
- package/src/widgets/Cooperative/Contacts/ui/ChangeContacts.vue +5 -3
- package/src/widgets/Cooperative/Contributions/ui/ChangeContributions.vue +6 -4
- package/src/widgets/Cooperative/Funds/ui/AccumulationFunds.vue +8 -7
- package/src/widgets/Cooperative/Funds/ui/AddAccumulationFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/AddExpenseFund.vue +5 -3
- package/src/widgets/Cooperative/Funds/ui/ExpenseFunds.vue +8 -7
- package/src/widgets/Cooperative/Members/ui/Members.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +4 -2
- package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +61 -62
- package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +5 -3
- package/src/widgets/Request/CreateChildOrderCard/CreateChildOrderCard.vue +5 -3
- package/src/widgets/Request/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +3 -3
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +4 -2
- package/src/shared/api/wif.ts +0 -9
@@ -2,16 +2,17 @@ import { ref, type Ref } from 'vue';
|
|
2
2
|
import type { Mutations } from '@coopenomics/sdk';
|
3
3
|
import { api } from '../api';
|
4
4
|
import { useBranchStore, type IBranch } from 'src/entities/Branch/model';
|
5
|
-
import { COOPNAME } from 'src/shared/config';
|
6
5
|
import { generateUsername } from 'src/shared/lib/utils/generateUsername';
|
6
|
+
import { useSystemStore } from 'src/entities/System/model';
|
7
7
|
|
8
8
|
export type ICreateBranchInput = Mutations.Branches.CreateBranch.IInput['data']
|
9
9
|
|
10
10
|
export function useCreateBranch() {
|
11
11
|
const store = useBranchStore();
|
12
|
+
const { info } = useSystemStore()
|
12
13
|
|
13
14
|
const initialCreateBranchInput: ICreateBranchInput = {
|
14
|
-
coopname:
|
15
|
+
coopname: info.coopname,
|
15
16
|
braname: '',
|
16
17
|
email: '',
|
17
18
|
fact_address: '',
|
@@ -37,7 +38,7 @@ export function useCreateBranch() {
|
|
37
38
|
data.full_name = `Кооперативный Участок "${data.short_name}"`
|
38
39
|
const branch = await api.createBranch(data);
|
39
40
|
|
40
|
-
await store.loadBranches({ coopname:
|
41
|
+
await store.loadBranches({ coopname: info.coopname });
|
41
42
|
|
42
43
|
// Сбрасываем createBranchInput после выполнения createBranch
|
43
44
|
resetInput(createBranchInput, initialCreateBranchInput);
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import type { Mutations } from '@coopenomics/sdk';
|
2
2
|
import { api } from '../api';
|
3
3
|
import { useBranchStore, type IBranch } from 'src/entities/Branch/model';
|
4
|
-
import {
|
4
|
+
import { useSystemStore } from 'src/entities/System/model';
|
5
5
|
|
6
6
|
export type IEditBranchInput = Mutations.Branches.EditBranch.IInput['data']
|
7
7
|
|
8
8
|
export function useEditBranch() {
|
9
9
|
const store = useBranchStore()
|
10
|
+
const { info } = useSystemStore()
|
10
11
|
|
11
12
|
async function editBranch(
|
12
13
|
branch: IBranch
|
@@ -26,7 +27,7 @@ export function useEditBranch() {
|
|
26
27
|
|
27
28
|
const result = await api.editBranch(data)
|
28
29
|
|
29
|
-
await store.loadBranches({ coopname:
|
30
|
+
await store.loadBranches({ coopname: info.coopname })
|
30
31
|
|
31
32
|
return result
|
32
33
|
}
|
@@ -2,10 +2,12 @@ import { TransactResult } from '@wharfkit/session';
|
|
2
2
|
import { Cooperative, SovietContract } from 'cooptypes';
|
3
3
|
import { DigitalDocument } from 'src/shared/lib/document';
|
4
4
|
import { useSessionStore } from 'src/entities/Session';
|
5
|
-
import { COOPNAME } from 'src/shared/config';
|
6
5
|
import { useGlobalStore } from 'src/shared/store';
|
6
|
+
import { useSystemStore } from 'src/entities/System/model';
|
7
7
|
|
8
8
|
export function useAuthorizeAndExecDecision() {
|
9
|
+
const { info } = useSystemStore()
|
10
|
+
|
9
11
|
async function authorizeAndExecDecision(
|
10
12
|
username: string,
|
11
13
|
registry_id: number,
|
@@ -14,11 +16,9 @@ export function useAuthorizeAndExecDecision() {
|
|
14
16
|
): Promise<TransactResult | undefined> {
|
15
17
|
const session = useSessionStore();
|
16
18
|
|
17
|
-
console.log('registri: ', registry_id)
|
18
|
-
|
19
19
|
const document = await new DigitalDocument().generate<Cooperative.Registry.DecisionOfParticipantApplication.Action>({
|
20
20
|
registry_id: registry_id,
|
21
|
-
coopname:
|
21
|
+
coopname: info.coopname,
|
22
22
|
username,
|
23
23
|
lang: 'ru',
|
24
24
|
decision_id,
|
@@ -40,7 +40,7 @@ export function useAuthorizeAndExecDecision() {
|
|
40
40
|
|
41
41
|
const authorizeData: SovietContract.Actions.Decisions.Authorize.IAuthorize =
|
42
42
|
{
|
43
|
-
coopname:
|
43
|
+
coopname: info.coopname,
|
44
44
|
chairman: session.username,
|
45
45
|
decision_id,
|
46
46
|
document: chainDocument,
|
@@ -48,7 +48,7 @@ export function useAuthorizeAndExecDecision() {
|
|
48
48
|
|
49
49
|
const execData: SovietContract.Actions.Decisions.Exec.IExec = {
|
50
50
|
executer: session.username,
|
51
|
-
coopname:
|
51
|
+
coopname: info.coopname,
|
52
52
|
decision_id: decision_id,
|
53
53
|
};
|
54
54
|
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { TransactResult } from '@wharfkit/session';
|
2
2
|
import { SovietContract } from 'cooptypes';
|
3
3
|
import { useSessionStore } from 'src/entities/Session';
|
4
|
-
import { COOPNAME } from 'src/shared/config';
|
5
4
|
import { useGlobalStore } from 'src/shared/store';
|
5
|
+
import { useSystemStore } from 'src/entities/System/model';
|
6
6
|
|
7
7
|
export function useVoteForDecision() {
|
8
|
+
const { info } = useSystemStore()
|
9
|
+
|
8
10
|
async function voteForDecision(
|
9
11
|
decision_id: number
|
10
12
|
): Promise<TransactResult | undefined> {
|
@@ -21,7 +23,7 @@ export function useVoteForDecision() {
|
|
21
23
|
],
|
22
24
|
data: {
|
23
25
|
member: session.username,
|
24
|
-
coopname:
|
26
|
+
coopname: info.coopname,
|
25
27
|
decision_id: decision_id,
|
26
28
|
},
|
27
29
|
});
|
@@ -26,7 +26,9 @@ form(@submit.prevent="submit").full-width
|
|
26
26
|
import { useInstallCooperativeStore } from 'src/entities/Installer/model';
|
27
27
|
import { FailAlert, isValidWif } from 'src/shared/api';
|
28
28
|
import { ref } from 'vue';
|
29
|
-
import {
|
29
|
+
import { useSystemStore } from 'src/entities/System/model';
|
30
|
+
const { info } = useSystemStore()
|
31
|
+
|
30
32
|
|
31
33
|
const privateKey = ref('')
|
32
34
|
const loading = ref(false)
|
@@ -36,7 +38,7 @@ form(@submit.prevent="submit").full-width
|
|
36
38
|
const submit = async () => {
|
37
39
|
loading.value = true
|
38
40
|
try {
|
39
|
-
const isValid = await isValidWif(
|
41
|
+
const isValid = await isValidWif(info.coopname, privateKey.value, 'active')
|
40
42
|
|
41
43
|
if (!isValid) {
|
42
44
|
loading.value = false
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useSessionStore } from 'src/entities/Session'
|
2
2
|
import { useWalletStore } from 'src/entities/Wallet'
|
3
3
|
import { sendPOST } from 'src/shared/api';
|
4
|
-
import {
|
4
|
+
import { useSystemStore } from 'src/entities/System/model';
|
5
5
|
|
6
6
|
export interface ISBPData {
|
7
7
|
phone: string;
|
@@ -30,11 +30,12 @@ export interface IAddPaymentMethod {
|
|
30
30
|
export function useAddPaymentMethod() {
|
31
31
|
const store = useWalletStore()
|
32
32
|
const session = useSessionStore()
|
33
|
+
const { info } = useSystemStore()
|
33
34
|
|
34
35
|
async function addPaymentMethod(params: IAddPaymentMethod) {
|
35
36
|
|
36
37
|
await store.loadUserWalet({
|
37
|
-
coopname:
|
38
|
+
coopname: info.coopname,
|
38
39
|
username: params.username,
|
39
40
|
})
|
40
41
|
|
@@ -42,10 +43,7 @@ export function useAddPaymentMethod() {
|
|
42
43
|
await sendPOST(`/v1/methods/${params.username}/add`, params)
|
43
44
|
|
44
45
|
await store.loadUserWalet({
|
45
|
-
coopname:
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
coopname: info.coopname,
|
49
47
|
username: session.username
|
50
48
|
})
|
51
49
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useSessionStore } from 'src/entities/Session'
|
2
2
|
import { useWalletStore } from 'src/entities/Wallet'
|
3
3
|
import { sendPOST } from 'src/shared/api';
|
4
|
-
import {
|
4
|
+
import { useSystemStore } from 'src/entities/System/model';
|
5
5
|
|
6
6
|
export interface IDeletePaymentMethod {
|
7
7
|
username: string;
|
@@ -14,11 +14,12 @@ export function useDeletePaymentMethod() {
|
|
14
14
|
|
15
15
|
async function deletePaymentMethod(params: IDeletePaymentMethod) {
|
16
16
|
const {username, method_id} = params
|
17
|
+
const { info } = useSystemStore()
|
17
18
|
|
18
19
|
await sendPOST(`/v1/methods/${username}/delete`, {method_id})
|
19
20
|
|
20
21
|
await store.loadUserWalet({
|
21
|
-
coopname:
|
22
|
+
coopname: info.coopname,
|
22
23
|
username: session.username
|
23
24
|
})
|
24
25
|
}
|
@@ -11,32 +11,31 @@ async function acceptRequest(
|
|
11
11
|
params: IAcceptRequest
|
12
12
|
): Promise<TransactResult | undefined> {
|
13
13
|
//TODO здесь нужно получить подписанный документ (заявление на взнос имуществом) и подставить
|
14
|
+
//сейчас установлены фейковые данные
|
14
15
|
const document = {
|
15
|
-
hash: '',
|
16
|
-
public_key: '',
|
17
|
-
signature: '',
|
16
|
+
hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
17
|
+
public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
|
18
|
+
signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
|
18
19
|
meta: '',
|
19
20
|
} as IDocument;
|
20
21
|
|
22
|
+
console.log(params)
|
23
|
+
|
21
24
|
const result = await transact({
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
document,
|
37
|
-
} as MarketContract.Actions.AcceptRequest.IAcceptRequest,
|
38
|
-
},
|
39
|
-
],
|
25
|
+
account: ContractsList.Marketplace,
|
26
|
+
name: MarketContract.Actions.AcceptRequest.actionName,
|
27
|
+
authorization: [
|
28
|
+
{
|
29
|
+
actor: params.username,
|
30
|
+
permission: 'active',
|
31
|
+
},
|
32
|
+
],
|
33
|
+
data: {
|
34
|
+
username: params.username,
|
35
|
+
coopname: params.coopname,
|
36
|
+
exchange_id: params.request_id,
|
37
|
+
document,
|
38
|
+
} as MarketContract.Actions.AcceptRequest.IAcceptRequest,
|
40
39
|
});
|
41
40
|
|
42
41
|
const requestsStore = useRequestStore();
|
@@ -10,23 +10,19 @@ async function cancelRequest(
|
|
10
10
|
params: ICancelRequest
|
11
11
|
): Promise<TransactResult | undefined> {
|
12
12
|
const result = await transact({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
exchange_id: params.request_id,
|
27
|
-
} as MarketContract.Actions.CancelRequest.ICancelRequest,
|
28
|
-
},
|
29
|
-
],
|
13
|
+
account: ContractsList.Marketplace,
|
14
|
+
name: MarketContract.Actions.CancelRequest.actionName,
|
15
|
+
authorization: [
|
16
|
+
{
|
17
|
+
actor: params.username,
|
18
|
+
permission: 'active',
|
19
|
+
},
|
20
|
+
],
|
21
|
+
data: {
|
22
|
+
username: params.username,
|
23
|
+
coopname: params.coopname,
|
24
|
+
exchange_id: params.request_id,
|
25
|
+
} as MarketContract.Actions.CancelRequest.ICancelRequest,
|
30
26
|
});
|
31
27
|
|
32
28
|
const requestsStore = useRequestStore();
|
@@ -10,23 +10,19 @@ async function complete(
|
|
10
10
|
params: ICompleteOnRequest
|
11
11
|
): Promise<TransactResult | undefined> {
|
12
12
|
const result = await transact({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
exchange_id: params.request_id,
|
27
|
-
} as MarketContract.Actions.CompleteRequest.ICompleteRequest,
|
28
|
-
},
|
29
|
-
],
|
13
|
+
account: ContractsList.Marketplace,
|
14
|
+
name: MarketContract.Actions.CompleteRequest.actionName,
|
15
|
+
authorization: [
|
16
|
+
{
|
17
|
+
actor: params.username,
|
18
|
+
permission: 'active',
|
19
|
+
},
|
20
|
+
],
|
21
|
+
data: {
|
22
|
+
username: params.username,
|
23
|
+
coopname: params.coopname,
|
24
|
+
exchange_id: params.request_id,
|
25
|
+
} as MarketContract.Actions.CompleteRequest.ICompleteRequest,
|
30
26
|
});
|
31
27
|
|
32
28
|
const requestsStore = useRequestStore();
|
@@ -12,31 +12,27 @@ async function confirmRecieve(
|
|
12
12
|
): Promise<TransactResult | undefined> {
|
13
13
|
//TODO здесь нужно получить подписанный документ (акт приёма-передачи) и подставить
|
14
14
|
const document = {
|
15
|
-
hash: '',
|
16
|
-
public_key: '',
|
17
|
-
signature: '',
|
15
|
+
hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
16
|
+
public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
|
17
|
+
signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
|
18
18
|
meta: '',
|
19
19
|
} as IDocument;
|
20
20
|
|
21
21
|
const result = await transact({
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
document,
|
37
|
-
} as MarketContract.Actions.ConfirmRecieve.IConfirmRecieve,
|
38
|
-
},
|
39
|
-
],
|
22
|
+
account: ContractsList.Marketplace,
|
23
|
+
name: MarketContract.Actions.ConfirmRecieve.actionName,
|
24
|
+
authorization: [
|
25
|
+
{
|
26
|
+
actor: params.username,
|
27
|
+
permission: 'active',
|
28
|
+
},
|
29
|
+
],
|
30
|
+
data: {
|
31
|
+
username: params.username,
|
32
|
+
coopname: params.coopname,
|
33
|
+
exchange_id: params.request_id,
|
34
|
+
document,
|
35
|
+
} as MarketContract.Actions.ConfirmRecieve.IConfirmRecieve,
|
40
36
|
});
|
41
37
|
|
42
38
|
const requestsStore = useRequestStore();
|
@@ -12,31 +12,27 @@ async function confirmSupplyOnRequest(
|
|
12
12
|
): Promise<TransactResult | undefined> {
|
13
13
|
//TODO получить подписанный акт имущественного взноса из кошелька
|
14
14
|
const document = {
|
15
|
-
hash: '',
|
16
|
-
public_key: '',
|
17
|
-
signature: '',
|
15
|
+
hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
16
|
+
public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
|
17
|
+
signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
|
18
18
|
meta: '',
|
19
19
|
} as IDocument;
|
20
20
|
|
21
21
|
const result = await transact({
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
document,
|
37
|
-
} as MarketContract.Actions.ConfirmSupply.IConfirmSupply,
|
38
|
-
},
|
39
|
-
],
|
22
|
+
account: ContractsList.Marketplace,
|
23
|
+
name: MarketContract.Actions.ConfirmSupply.actionName,
|
24
|
+
authorization: [
|
25
|
+
{
|
26
|
+
actor: params.username,
|
27
|
+
permission: 'active',
|
28
|
+
},
|
29
|
+
],
|
30
|
+
data: {
|
31
|
+
username: params.username,
|
32
|
+
coopname: params.coopname,
|
33
|
+
exchange_id: params.request_id,
|
34
|
+
document,
|
35
|
+
} as MarketContract.Actions.ConfirmSupply.IConfirmSupply,
|
40
36
|
});
|
41
37
|
|
42
38
|
const requestsStore = useRequestStore();
|
@@ -9,41 +9,38 @@ import { MarketContract } from 'cooptypes';
|
|
9
9
|
async function createChildOrder(
|
10
10
|
params: ICreateChildOrder
|
11
11
|
): Promise<TransactResult | undefined> {
|
12
|
-
//TODO здесь передаём
|
12
|
+
//TODO здесь передаём документ заявления на возврат имуществом (?)
|
13
13
|
const document = {
|
14
|
-
hash: '',
|
15
|
-
public_key: '',
|
16
|
-
signature: '',
|
14
|
+
hash: '33CBC662E606F23F332B442BAB84F2D05BD498B66EF61BC918740606B05BD565',
|
15
|
+
public_key: 'PUB_K1_8YWRWjCdUQubPoHzT5ndvfhGKDf1ZL7v7Ge9iHoLtNp7wnVfG1',
|
16
|
+
signature: 'SIG_K1_KWeGQ48n78ybpkuVDf1M7nuGnT8pkPXFbYYMUXtFTFv2dEReMEmwW89r19dKmAVSFZwHTdxdqkB3ZQJeAS9CcQwb92E398',
|
17
17
|
meta: '',
|
18
18
|
} as IDocument;
|
19
19
|
|
20
20
|
const result = await transact({
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
} as MarketContract.Actions.CreateOrder.ICreateOrder,
|
45
|
-
},
|
46
|
-
],
|
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
|
+
|
47
44
|
});
|
48
45
|
|
49
46
|
const requestsStore = useRequestStore();
|
@@ -4,22 +4,14 @@ import { transact } from 'src/shared/api';
|
|
4
4
|
import { ContractsList } from 'src/shared/config';
|
5
5
|
import { useRequestStore } from 'src/entities/Request/model/stores';
|
6
6
|
import { ILoadUserParentOffers } from 'src/entities/Request';
|
7
|
-
import { IDocument } from 'src/shared/lib/types/document';
|
8
7
|
import { MarketContract } from 'cooptypes';
|
9
8
|
|
10
9
|
async function createParentOffer(
|
11
10
|
params: ICreateOffer
|
12
11
|
): Promise<TransactResult | undefined> {
|
13
|
-
//TODO здесь передаём пустой документ
|
14
|
-
const document = {
|
15
|
-
hash: '',
|
16
|
-
public_key: '',
|
17
|
-
signature: '',
|
18
|
-
meta: '',
|
19
|
-
} as IDocument;
|
20
12
|
|
21
|
-
|
22
|
-
|
13
|
+
// здесь мы не передаём документ
|
14
|
+
const result = await transact(
|
23
15
|
{
|
24
16
|
account: ContractsList.Marketplace,
|
25
17
|
name: MarketContract.Actions.CreateOffer.actionName,
|
@@ -38,14 +30,12 @@ async function createParentOffer(
|
|
38
30
|
pieces: params.pieces,
|
39
31
|
unit_cost: params.unit_cost,
|
40
32
|
product_lifecycle_secs: params.product_lifecycle_secs,
|
41
|
-
document,
|
33
|
+
// document,
|
42
34
|
data: JSON.stringify(params.data),
|
43
35
|
meta: '',
|
44
36
|
},
|
45
37
|
} as MarketContract.Actions.CreateOffer.ICreateOffer,
|
46
|
-
}
|
47
|
-
],
|
48
|
-
});
|
38
|
+
});
|
49
39
|
|
50
40
|
const requestsStore = useRequestStore();
|
51
41
|
requestsStore.loadUserParentOffers({
|
package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import {
|
2
|
+
import { failAlert, SuccessAlert } from 'src/shared/api'
|
3
3
|
import { api } from '../../api'
|
4
4
|
import type { ICreateOffer, IFormData } from 'src/features/Request/CreateParentOffer/model'
|
5
5
|
import { computed, ref } from 'vue'
|
@@ -8,6 +8,7 @@ import { useCooperativeStore } from 'src/entities/Cooperative'
|
|
8
8
|
import { ImageUploaderWithPreview } from '../ImageUploaderWithPreview'
|
9
9
|
import { CURRENCY } from 'src/shared/config'
|
10
10
|
|
11
|
+
|
11
12
|
const props = defineProps({
|
12
13
|
username: {
|
13
14
|
type: String,
|
@@ -58,10 +59,12 @@ const handlerSubmit = async () => {
|
|
58
59
|
images: formData.value.images,
|
59
60
|
},
|
60
61
|
})
|
62
|
+
console.log(offerData)
|
61
63
|
await api.createParentOffer(offerData.value)
|
62
64
|
SuccessAlert('Объявление успешно создано')
|
63
65
|
} catch (e: any) {
|
64
|
-
|
66
|
+
console.log(e)
|
67
|
+
failAlert(e.message)
|
65
68
|
}
|
66
69
|
}
|
67
70
|
</script>
|
@@ -11,24 +11,20 @@ async function declineRequest(
|
|
11
11
|
params: IDeclineRequest
|
12
12
|
): Promise<TransactResult | undefined> {
|
13
13
|
const result = await transact({
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
meta: '',
|
29
|
-
} as MarketContract.Actions.DeclineRequest.IDeclineRequest,
|
30
|
-
},
|
31
|
-
],
|
14
|
+
account: ContractsList.Marketplace,
|
15
|
+
name: MarketContract.Actions.DeclineRequest.actionName,
|
16
|
+
authorization: [
|
17
|
+
{
|
18
|
+
actor: params.username,
|
19
|
+
permission: 'active',
|
20
|
+
},
|
21
|
+
],
|
22
|
+
data: {
|
23
|
+
username: params.username,
|
24
|
+
coopname: params.coopname,
|
25
|
+
exchange_id: params.request_id,
|
26
|
+
meta: '',
|
27
|
+
} as MarketContract.Actions.DeclineRequest.IDeclineRequest,
|
32
28
|
});
|
33
29
|
|
34
30
|
const requestsStore = useRequestStore();
|
@@ -10,23 +10,19 @@ async function deliverOnRequest(
|
|
10
10
|
params: IDeliverOnRequest
|
11
11
|
): Promise<TransactResult | undefined> {
|
12
12
|
const result = await transact({
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
exchange_id: params.request_id,
|
27
|
-
} as MarketContract.Actions.DeliverOnRequest.IDeliverOnRequest,
|
28
|
-
},
|
29
|
-
],
|
13
|
+
account: ContractsList.Marketplace,
|
14
|
+
name: MarketContract.Actions.DeliverOnRequest.actionName,
|
15
|
+
authorization: [
|
16
|
+
{
|
17
|
+
actor: params.username,
|
18
|
+
permission: 'active',
|
19
|
+
},
|
20
|
+
],
|
21
|
+
data: {
|
22
|
+
username: params.username,
|
23
|
+
coopname: params.coopname,
|
24
|
+
exchange_id: params.request_id,
|
25
|
+
} as MarketContract.Actions.DeliverOnRequest.IDeliverOnRequest,
|
30
26
|
});
|
31
27
|
|
32
28
|
const requestsStore = useRequestStore();
|