diff --git a/src/features/createAssociation.ts b/src/features/association/createAssociation.ts similarity index 81% rename from src/features/createAssociation.ts rename to src/features/association/createAssociation.ts index d97720ba59979fbcf82ed3d45b016168b36353e2..6891f7765431fed582dafc48fecc7aa98bc25c9d 100644 --- a/src/features/createAssociation.ts +++ b/src/features/association/createAssociation.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleCreateAssociation } from '../handlers/association/associationHandlers.js' +import { handleCreateAssociation } from '../../handlers/association/associationHandlers.js' async function createAssociation (tezos: TezosToolkit): Promise<void> { await handleCreateAssociation(tezos).then(() => { diff --git a/src/features/joinAssociation.ts b/src/features/association/joinAssociation.ts similarity index 93% rename from src/features/joinAssociation.ts rename to src/features/association/joinAssociation.ts index d1637f924f1c3bbe7415594e779ec2b9345af727..7deff69db297da29273df93744b329ba2d44dbaf 100644 --- a/src/features/joinAssociation.ts +++ b/src/features/association/joinAssociation.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleGetAssociations, handleJoinAssociation } from '../handlers/association/associationHandlers.js' +import { handleGetAssociations, handleJoinAssociation } from '../../handlers/association/associationHandlers.js' async function joinAssociation (tezos: TezosToolkit): Promise<void> { await handleGetAssociations(tezos).then(async (response) => { diff --git a/src/features/showAssociationDetails.ts b/src/features/association/showAssociationDetails.ts similarity index 93% rename from src/features/showAssociationDetails.ts rename to src/features/association/showAssociationDetails.ts index bc7d1f4f5d00477366eb3a6c65d3a8d08e19b91b..cabe9ee948cf3c1d38153e265b7adb244a0fb2b0 100644 --- a/src/features/showAssociationDetails.ts +++ b/src/features/association/showAssociationDetails.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleGetAssociationDetails, handleGetAssociations } from '../handlers/association/associationHandlers.js' +import { handleGetAssociationDetails, handleGetAssociations } from '../../handlers/association/associationHandlers.js' async function showAssociationDetails (tezos: TezosToolkit): Promise<void> { await handleGetAssociations(tezos).then(async (response) => { diff --git a/src/features/showAssociations.ts b/src/features/association/showAssociations.ts similarity index 82% rename from src/features/showAssociations.ts rename to src/features/association/showAssociations.ts index 9a0409da69680626024982566cc1c87fb9bc4422..04f4985df83011698d409cdd0336511c8784ebdb 100644 --- a/src/features/showAssociations.ts +++ b/src/features/association/showAssociations.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleGetAssociations } from '../handlers/association/associationHandlers.js' +import { handleGetAssociations } from '../../handlers/association/associationHandlers.js' async function showAssociations (tezos: TezosToolkit): Promise<void> { await handleGetAssociations(tezos).then((response) => { diff --git a/src/features/showBalance.ts b/src/features/balance/showBalance.ts similarity index 82% rename from src/features/showBalance.ts rename to src/features/balance/showBalance.ts index d45be36e52310db4c96d2585217e219f3b933b0f..ebd9de1b6e8ac0799c7c2a14583303ae68c7ae3f 100644 --- a/src/features/showBalance.ts +++ b/src/features/balance/showBalance.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleGetBalance } from '../handlers/balance/balanceHandlers.js' +import { handleGetBalance } from '../../handlers/balance/balanceHandlers.js' async function showBalance (tezos: TezosToolkit): Promise<void> { await handleGetBalance(tezos).then((response) => { diff --git a/src/features/createProposal.ts b/src/features/proposal/createProposal.ts similarity index 82% rename from src/features/createProposal.ts rename to src/features/proposal/createProposal.ts index 99e4e5c515ecb92e3b7b0d4ecf9d06392c61f6d3..9a8dc2c7c3a07d9f8ce42575f1fdafd52993677c 100644 --- a/src/features/createProposal.ts +++ b/src/features/proposal/createProposal.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleCreateProposal } from '../handlers/proposal/proposalHandlers.js' +import { handleCreateProposal } from '../../handlers/proposal/proposalHandlers.js' async function createProposal (tezos: TezosToolkit): Promise<void> { await handleCreateProposal(tezos).then(() => { diff --git a/src/features/burnToken.ts b/src/features/token/burnToken.ts similarity index 83% rename from src/features/burnToken.ts rename to src/features/token/burnToken.ts index 5ebd2b4204ddef8bc9dbde560d384847cdfa05f4..a2bd04d67ae45e663a4e6c847e5f26cd5fc0e37e 100644 --- a/src/features/burnToken.ts +++ b/src/features/token/burnToken.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleBurnToken } from '../handlers/token/tokenHandlers.js' +import { handleBurnToken } from '../../handlers/token/tokenHandlers.js' async function burnToken (tezos: TezosToolkit): Promise<void> { await handleBurnToken(tezos).then(() => { diff --git a/src/features/createToken.ts b/src/features/token/createToken.ts similarity index 83% rename from src/features/createToken.ts rename to src/features/token/createToken.ts index 0f3a0339dc0b2afc3067be0314f8a48523997e44..4a780e498235aacd726968485856470bd47bec86 100644 --- a/src/features/createToken.ts +++ b/src/features/token/createToken.ts @@ -1,6 +1,6 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { handleCreateToken } from '../handlers/token/tokenHandlers.js' +import { handleCreateToken } from '../../handlers/token/tokenHandlers.js' async function createToken (tezos: TezosToolkit): Promise<void> { await handleCreateToken(tezos).then(() => { diff --git a/src/handlers/roleHandlers.ts b/src/handlers/roleHandlers.ts index 4aa5fa03bf06aaf574f48edf83f4831125a83f1e..2a37892313181fa4b36547830424cd8ee470e63f 100644 --- a/src/handlers/roleHandlers.ts +++ b/src/handlers/roleHandlers.ts @@ -1,13 +1,13 @@ import { type TezosToolkit } from '@taquito/taquito' import chalk from 'chalk' -import { showAssociations } from '../features/showAssociations.js' -import { showAssociationDetails } from '../features/showAssociationDetails.js' -import { showBalance } from '../features/showBalance.js' -import { joinAssociation } from '../features/joinAssociation.js' -import { createAssociation } from '../features/createAssociation.js' -import { burnToken } from '../features/burnToken.js' -import { createToken } from '../features/createToken.js' -import { createProposal } from '../features/createProposal.js' +import { showAssociations } from '../features/association/showAssociations.js' +import { showAssociationDetails } from '../features/association/showAssociationDetails.js' +import { showBalance } from '../features/balance/showBalance.js' +import { joinAssociation } from '../features/association/joinAssociation.js' +import { createAssociation } from '../features/association/createAssociation.js' +import { burnToken } from '../features/token/burnToken.js' +import { createToken } from '../features/token/createToken.js' +import { createProposal } from '../features/proposal/createProposal.js' /** * Handles fa token administrator actions based on the specified choice. diff --git a/src/utils/getRole.ts b/src/utils/getRole.ts index 8b0c0067692b276f3c02611c5656f7561add1d4d..e21034dc158515d6afc37015b9999c909fb262e2 100644 --- a/src/utils/getRole.ts +++ b/src/utils/getRole.ts @@ -9,5 +9,5 @@ export function getRole (tezos: TezosToolkit): Role { // ELSE -> CONNECTED // TEMPORARY - return 'ADHERENT' + return 'ADMIN_FA_TOKEN' } diff --git a/test/handlers/roleHandlers.spec.ts b/test/handlers/roleHandlers.spec.ts index 9a63f9daade4dc43fcd229263937b26b8c8eb67f..985ec19ac6dbf924931327f6eda4843569e6224f 100644 --- a/test/handlers/roleHandlers.spec.ts +++ b/test/handlers/roleHandlers.spec.ts @@ -2,43 +2,43 @@ import { type TezosToolkit } from '@taquito/taquito' import { handleAdminFATokenChoice, handleAdminAssociationChoice, handleAdherentChoice, handleConnectedChoice } from '../../src/handlers/roleHandlers' import { vi, describe, it, expect, beforeEach } from 'vitest' import chalk from 'chalk' -import { createAssociation } from '../../src/features/createAssociation' -import { burnToken } from '../../src/features/burnToken' -import { createToken } from '../../src/features/createToken' -import { showBalance } from '../../src/features/showBalance' -import { createProposal } from '../../src/features/createProposal' -import { joinAssociation } from '../../src/features/joinAssociation' -import { showAssociations } from '../../src/features/showAssociations' - -vi.mock('../../src/features/createAssociation', () => ({ +import { createAssociation } from '../../src/features/association/createAssociation' +import { burnToken } from '../../src/features/token/burnToken' +import { createToken } from '../../src/features/token/createToken' +import { showBalance } from '../../src/features/balance/showBalance' +import { createProposal } from '../../src/features/proposal/createProposal' +import { joinAssociation } from '../../src/features/association/joinAssociation' +import { showAssociations } from '../../src/features/association/showAssociations' + +vi.mock('../../src/features/association/createAssociation', () => ({ createAssociation: vi.fn() })) -vi.mock('../../src/features/burnToken', () => ({ +vi.mock('../../src/features/token/burnToken', () => ({ burnToken: vi.fn() })) -vi.mock('../../src/features/createProposal', () => ({ +vi.mock('../../src/features/proposal/createProposal', () => ({ createProposal: vi.fn() })) -vi.mock('../../src/features/createToken', () => ({ +vi.mock('../../src/features/token/createToken', () => ({ createToken: vi.fn() })) -vi.mock('../../src/features/joinAssociation', () => ({ +vi.mock('../../src/features/association/joinAssociation', () => ({ joinAssociation: vi.fn() })) -vi.mock('../../src/features/showAssociationDetails', () => ({ +vi.mock('../../src/features/association/showAssociationDetails', () => ({ showAssociationDetails: vi.fn() })) -vi.mock('../../src/features/showAssociations', () => ({ +vi.mock('../../src/features/association/showAssociations', () => ({ showAssociations: vi.fn() })) -vi.mock('../../src/features/showBalance', () => ({ +vi.mock('../../src/features/balance/showBalance', () => ({ showBalance: vi.fn() }))