enum PATHS {
  HOME = '/',
  OPERATIONS_HISTORY = '/activity-feed',
  PAYMENTS = '/payments',
  STATEMENTS_AND_INQUIRIES = '/statements-and-inquiries',
  ACCOUNTS = '/accounts',
  DEPOSITS = '/deposits',
  FEA = '/fea',
  SALARY_PROJECT = '/salary-project',
  CREDIT_ACCOUNT = '/credit-account',
  ACQUIRING = '/acquiring',
  CONTACT = '/communication-with-the-bank',
  SERVICES = '/services',
  PARTNER_CHECK = '/partner-check',
  BUSINESS_CARDS = '/business-cards',
  WEB_DEALING = '/web-dealing',
}

enum PATHS_PROFILE {
  PROFILE = '/profile',
  ORGANIZATIONS = '/profile/organizations',
  AGREEMENTS = '/profile/agreements',
}

const PATHS_DEPOSITS = {
  HOME: PATHS.DEPOSITS,
  PRODUCTS: `${PATHS.DEPOSITS}/products`,
  TREASURY_DEALS: `${PATHS.DEPOSITS}/treasury-deals`,
  CONFIRMATION: `${PATHS.DEPOSITS}/confirmation`,
  CANCEL_DOCUMENT: `${PATHS.DEPOSITS}/products/cancel`,
  EARLY_REFUND: `${PATHS.DEPOSITS}/products/early-refund`,
  ACCOUNTS: `${PATHS.DEPOSITS}/accounts`,
  AGREEMENTS: `${PATHS.DEPOSITS}/agreements`,
  ACCOUNTS_CREATE_INTERNAL: `${PATHS.DEPOSITS}/accounts/create/internal`,
  ACCOUNTS_CREATE_EXTERNAL: `${PATHS.DEPOSITS}/accounts/create/external`,
  OPEN_PRODUCT: `${PATHS.DEPOSITS}/`,
} as const;

const PATHS_PAYMENTS = {
  HOME: PATHS.PAYMENTS,
  EDIT_OR_DETAILS: `${PATHS.PAYMENTS}/:id`,
  PAYMENT_ORDER: `${PATHS.PAYMENTS}/payment-order`,
  TEMPLATES: `${PATHS.PAYMENTS}/templates`,
  CREATE_TEMPLATE: `${PATHS.PAYMENTS}/templates/new`,
  EDIT_TEMPLATE: `${PATHS.PAYMENTS}/templates/:id`,
  IMPORT_PROTOCOL: `${PATHS.PAYMENTS}/import/:id/protocol`,
} as const;

const STATEMENTS_AND_INQUIRIES_PATHS = {
  STATEMENTS_AND_INQUIRIES: PATHS.STATEMENTS_AND_INQUIRIES,
  STATEMENTS: `${PATHS.STATEMENTS_AND_INQUIRIES}/statements`,
  INQUIRIES: `${PATHS.STATEMENTS_AND_INQUIRIES}/inquiries`,
  STATEMENT_CREATE: `${PATHS.STATEMENTS_AND_INQUIRIES}/statement-create`,
  INQUIRIES_CREATE: `${PATHS.STATEMENTS_AND_INQUIRIES}/inquiries-create`,
  INQUIRIES_VIEW: `${PATHS.STATEMENTS_AND_INQUIRIES}/inquiries-view`,
  INQUIRIES_EDIT: `${PATHS.STATEMENTS_AND_INQUIRIES}/inquiries-edit/:id`,
  INQUIRIES_REPEAT: `${PATHS.STATEMENTS_AND_INQUIRIES}/inquiries-repeat`,
} as const;

const ACCOUNTS_PATHS = {
  HOME: PATHS.ACCOUNTS,
  OPEN_ACCOUNT: `${PATHS.ACCOUNTS}/open-account/new`,
  OPEN_ACCOUNT_CARD: `${PATHS.ACCOUNTS}/open-account/:id`,
  OPEN_ACCOUNT_ORDERS_LIST: `${PATHS.ACCOUNTS}/open-account`,
} as const;

const BUSINESS_CARDS_PATHS = {
  HOME: `${PATHS.BUSINESS_CARDS}/cards`,
  DETAILS: `${PATHS.BUSINESS_CARDS}/cards-view/:id`,
} as const;

const ECO_CLIENT_ENDPOINT = process.env.ECO_CLIENT_ENDPOINT || '';

const EXTERNAL_PATHS = {
  MAIN_PAGE: `${ECO_CLIENT_ENDPOINT}/mainpage`,
  CREDIT_ACCOUNT: `${ECO_CLIENT_ENDPOINT}/ucc`,
  BUSINESS_CARDS: `${ECO_CLIENT_ENDPOINT}/business-cards/cards`,
  ACQUIRING: `${ECO_CLIENT_ENDPOINT}/paymenthub/lk`,
  LETTERS: `${ECO_CLIENT_ENDPOINT}/letter`,
  SALARY_PROJECT: `${ECO_CLIENT_ENDPOINT}/zp`,
  CREDIT_CABINET: `${ECO_CLIENT_ENDPOINT}/credit-cabinet/msb`,
  OPEN_NEW_ACCOUNT: `${ECO_CLIENT_ENDPOINT}/open-account/new`,
  CLOSE_ACCOUNT: `${ECO_CLIENT_ENDPOINT}/closing-account/new`,
  GPB_TARIFFS_LINK: 'https://www.gazprombank.ru/business/',
  OFFICES: `${ECO_CLIENT_ENDPOINT}/offices`,
  USER: `${ECO_CLIENT_ENDPOINT}/user`,
} as const;

const ECO_SERVICES_PATHS = {
  PRODUCTS: `${ECO_CLIENT_ENDPOINT}/mainpage/products`,
  OPEN_ACCOUNT: `${ECO_CLIENT_ENDPOINT}/open-account`,
  CREDITING: `${ECO_CLIENT_ENDPOINT}/credit-cabinet`,
  BANK_GUARANTEES: `${ECO_CLIENT_ENDPOINT}/credit-cabinet/limits`,
  BUSINESS_CARDS: `${ECO_CLIENT_ENDPOINT}/business-cards/cards`,
  ACQUIRING: `${ECO_CLIENT_ENDPOINT}/paymenthub/lk`,
  CURRENCY_TRANSACTIONS: `${ECO_CLIENT_ENDPOINT}/currency-transfer/paydoccurr`,
  CUSTOMS_PAYMENTS: `${ECO_CLIENT_ENDPOINT}/partners/cp-retail`,
  LEASING: `${ECO_CLIENT_ENDPOINT}/leasing`,
  ONLINE_COLLECTION: `${ECO_CLIENT_ENDPOINT}/adm`,
  BROKERAGE_SERVICES: `${ECO_CLIENT_ENDPOINT}/brokerage/contract-application`,
  ONLINE_ACCOUNTING: `${ECO_CLIENT_ENDPOINT}/partners/online-accounting`,
  ACCOUNTING_SERVICES: `${ECO_CLIENT_ENDPOINT}/partners/accounting/knopka`,
  WORKING_SELF_EMPLOYED: `${ECO_CLIENT_ENDPOINT}/partners/performer-search`,
  CONFIRMATION_FEDERAL_TAX_SERVICE: `${ECO_CLIENT_ENDPOINT}/partners/egrul-egrip`,
  DOCUMENT_COPIES: `${ECO_CLIENT_ENDPOINT}/doc-copy-request`,
  BANKING_SUPPORT_CONTRACTS: `${ECO_CLIENT_ENDPOINT}/partners/bsk`,
  GPB_TRADING_PLATFORM: `${ECO_CLIENT_ENDPOINT}/partners/etp`,
  ULK_VED: `${ECO_CLIENT_ENDPOINT}/ulk_ved_eco/ru_RU/`,
  CURRENCY_CONVERSION: `${ECO_CLIENT_ENDPOINT}/vrko-currency-conversion`,
  CURRENCY_TRANSFER: `${ECO_CLIENT_ENDPOINT}/currency-transfer/paydoccurr`,
  TRANSIT_ACCOUNT_DOCUMENTS: `${ECO_CLIENT_ENDPOINT}/transit-account-debit/documents`,
  TREASURY_AGREEMENT: `${ECO_CLIENT_ENDPOINT}/treasury-agreement/deposit/new`,
  WEB_DEALING: `${ECO_CLIENT_ENDPOINT}/web-dealing`,
  WEB_DEALING_REPORTS: `${ECO_CLIENT_ENDPOINT}/web-dealing/reports`,
  WEB_DEALING_DEPOSITS: `${ECO_CLIENT_ENDPOINT}/web-dealing/deposits`,
  WEB_DEALING_ACCOUNTS: `${ECO_CLIENT_ENDPOINT}/web-dealing/accounts`,
  WEB_DEALING_AGREEMENTS: `${ECO_CLIENT_ENDPOINT}/web-dealing/agreements`,
  RUPAYMENT: `${ECO_CLIENT_ENDPOINT}/rupayment`,
  RUPAYMENT_TEMPLATES: `${ECO_CLIENT_ENDPOINT}/rupayment/templates`,
  SBP: `${ECO_CLIENT_ENDPOINT}/sbp`,
  SBP_CONTRACTS: `${ECO_CLIENT_ENDPOINT}/sbp/contracts`,
  OFFER_LIST: `${ECO_CLIENT_ENDPOINT}/offer/list`,
  STATEMENTS_SCHEDULE: `${ECO_CLIENT_ENDPOINT}/account-statement/schedule/history`,
} as const;

const EXTERNAL_LINKS = {
  CONNECT_ONLINE_COLLECTION: 'https://www.gazprombank.ru/business/adm/',
  PURCHASES_GAZPROM_GROUP: 'https://etpgaz.gazprombank.ru/#auth/gpbidplink',
  ONBOARDING_SERVICE: 'https://gbo.gazprombank.ru/onboarding/new',
  HELP: 'https://gbo.gazprombank.ru/help',
  PERSONAL_ACCOUNT_GPB_ETP:
    'https://id.etpgpb.ru/auth/realms/master/protocol/openid-connect/auth?client_id=elk&redirect_uri=https%3A%2F%2Fpassport.etpgpb.ru%2F',
  PARTNER_CHECK_AGREEMENT: 'https://www.gazprombank.ru/upload/files/iblock/888/Soglashenie-o-podklyuchenii-k-servisu-18102023.pdf',
  AGREEMENTS: 'https://dbo.gazprombank.ru/profile/agreements',
};

const CROSS_SALE_PATHS = {
  FUEL_CARD: 'https://www.gazprombank.ru/special/a/toplivnaya-karta/',
  AVITO: 'https://www.avito.ru/general/gazprombank/',
};

const CROSS_SELLING_JSON = {
  PRODUCT_CAROUSEL: '/product-carousel/product-carousel-data.json',
};

const CROSS_BORDER_AB_PAYMENTS = {
  AUTH: 'https://app.ab-payments.ru/auth',
};

const IB_MODULE_VERSION = process.env.IB_MODULE_VERSION ?? '';

const queryStringVersion = `${IB_MODULE_VERSION ? `?version=${IB_MODULE_VERSION}` : ''}`;

export {
  PATHS,
  PATHS_PROFILE,
  PATHS_PAYMENTS,
  PATHS_DEPOSITS,
  STATEMENTS_AND_INQUIRIES_PATHS,
  EXTERNAL_PATHS,
  ECO_SERVICES_PATHS,
  ECO_CLIENT_ENDPOINT,
  CROSS_SELLING_JSON,
  CROSS_BORDER_AB_PAYMENTS,
  ACCOUNTS_PATHS,
  BUSINESS_CARDS_PATHS,
  CROSS_SALE_PATHS,
  EXTERNAL_LINKS,
  queryStringVersion,
};
