137 Commits

Author SHA1 Message Date
vchikalkin
7ecf72656b chore: update type definitions and react dependencies to latest versions 2025-12-30 16:50:24 +03:00
vchikalkin
64c9134cc2 feat: add URL_FAQ environment variable and update bot localization
- Introduced a new environment variable URL_FAQ for FAQ links.
- Updated Russian localization to include a button for FAQ access.
- Modified the main menu to include a URL button for the FAQ section.
2025-10-27 13:43:22 +03:00
vchikalkin
19b53db5f3 refactor: rename OFFER_URL and PRIVACY_URL to URL_OFFER and URL_PRIVACY
- Updated environment variable names for consistency across the application.
- Modified references in the deployment workflow, bot conversations, and web components to use the new variable names.
2025-10-27 13:26:00 +03:00
vchikalkin
3ac86cfeb0 mdx: whitespace fix 2025-10-14 20:06:33 +03:00
vchikalkin
02e9d5c529 refactor: update contact information in offer and privacy documents
- Simplified contact information sections in both the offer and privacy policy documents.
- Removed specific Telegram link references and replaced them with a general note directing users to the bot description for contact details.
2025-10-14 16:42:46 +03:00
vchikalkin
f45140ef04 remove comment 2025-10-14 16:30:13 +03:00
vchikalkin
6a0d34d37b refactor: update MDX link handling and improve document formatting
- Removed the custom link component in MDX and replaced it with standard anchor tags for external links.
- Updated offer and privacy policy documents to use environment variables for dynamic URLs instead of custom components.
- Improved formatting for better readability in the offer and privacy policy sections.
2025-10-14 16:16:30 +03:00
Vlad Chikalkin
2df80c90f6
Feature/mdx (#128)
* convert /documents/privacy to .mdx

* fix: update h2 styling in MDX components

- Changed h2 font weight from bold to semibold for improved visual hierarchy in rendered content.

* fix build

* feat: implement public offer document and layout

- Added a new layout component for the public offer document.
- Created the public offer page in MDX format, detailing terms and conditions for service usage.
- Removed the old offer page in TSX format.
- Updated links for offer and support to a new shared component for better maintainability.
- Integrated Tailwind CSS typography plugin for improved text styling.

* fix: correct formatting in privacy policy terms section

- Adjusted the formatting of terms and definitions in the privacy policy to ensure consistent presentation and clarity.
- Removed unnecessary hyphenation in the definition of "Разработчик" and "Политика" for improved readability.
2025-10-14 15:43:51 +03:00
vchikalkin
03145534a1 feat: update queryTTL for customer-related queries
- Added 12-hour TTL for GetCustomer and GetSubscriptionSettings queries to improve caching strategy.
- Ensured other queries remain unchanged with their TTL set to false.
2025-10-12 17:12:08 +03:00
vchikalkin
6a21f5911e feat: add libphonenumber-js for phone number parsing and validation
- Integrated libphonenumber-js to handle phone number parsing and validation in the addContact and registration features.
- Removed deprecated phone validation and normalization functions from utils.
- Updated contact handling logic to ensure valid phone numbers are processed correctly.
2025-10-12 13:41:48 +03:00
vchikalkin
b88ac07ba3 refactor: simplify profile button logic and remove unused components
- Consolidated booking logic into a single handleBook function based on customer role.
- Removed unused Drawer and Button components to streamline the ProfileButtons component.
- Added loading state handling for improved user experience.
2025-10-12 09:03:30 +03:00
vchikalkin
b517519e7e feat: conditionally render services list based on customer role
- Added a check to prevent rendering the ReadonlyServicesList component for users with the 'Client' role, ensuring a tailored experience based on user permissions.
2025-10-11 14:21:37 +03:00
vchikalkin
a1af00af69 feat: allow order with inactive contacts 2025-10-11 14:09:18 +03:00
vchikalkin
311f6c183d fix: prevent subscription info bar from rendering for client role users
- Added a condition to return null for the SubscriptionInfoBar component if the customer role is 'Client', ensuring that clients do not see the subscription information.
2025-10-11 13:37:37 +03:00
vchikalkin
ee4e70f43d feat: integrate customer data into subscription invoice
- Added CustomersService to retrieve customer information based on telegramId.
- Enhanced invoice provider data to include customer phone and item details for improved payment processing.
- Updated the subscription function to utilize the new customer data in the invoice generation.
2025-10-09 18:04:38 +03:00
vchikalkin
4d40230864 fix: back button mounts after first app launch 2025-10-09 12:01:06 +03:00
vchikalkin
92119baa5e GQL: rename CheckCustomerExists -> _NOCACHE_GetCustomer 2025-10-09 11:26:28 +03:00
vchikalkin
1e9fd66e27 Refactor customer retrieval in addContact function to use RegistrationService
- Replaced the use of CustomersService.getCustomer with RegistrationService.checkCustomerExists for improved consistency in customer existence checks.
- Introduced a new instance of CustomersService for adding invited users, maintaining functionality while enhancing code clarity.
2025-10-09 09:44:43 +03:00
vchikalkin
aa11ecfcec fix "registrationService.getCustomer is not a function" 2025-10-09 00:33:25 +03:00
vchikalkin
8e61fbbb40 Fix: Refactor customer retrieval logic to use checkCustomerExists method
- Updated the addContact and registration features to replace getCustomer calls with checkCustomerExists, improving consistency in customer existence checks.
- Modified GraphQL operations to remove deprecated getCustomer queries and introduced a new checkCustomerExists query for better clarity and efficiency.
- Adjusted queryTTL configuration in cache-proxy to reflect the removal of unused endpoints.
2025-10-09 00:20:37 +03:00
vchikalkin
d32a7dc54e fix registration error 2025-10-08 22:43:24 +03:00
vchikalkin
0a43d63c2c bot: msg-contact-forward: use parse_mode HTML 2025-10-08 22:04:15 +03:00
vchikalkin
20b2b44572 Update queryTTL configuration in cache-proxy to include new endpoints and set default values to false
- Added new entries for `GetCustomers`, `GetInvited`, `GetInvitedBy`, `GetOrders`, `GetServices`, `GetSlots`, and `GetSubscriptionHistory` with default values set to false.
- Removed the `Login` entry from the previous configuration, ensuring clarity in the query time-to-live settings.
2025-10-08 12:14:51 +03:00
vchikalkin
7fe1b89f5b Update PageHeader component to conditionally hide BackButton based on environment and TMA status
- Modified the logic in the PageHeader component to hide the BackButton when in production or when the TMA status is 'simple', improving user experience by reducing unnecessary navigation options.
2025-10-07 19:31:40 +03:00
vchikalkin
4a98ac5d3e Update middleware matcher to exclude 'offer' from routing
- Modified the middleware configuration to exclude the 'offer' path from the matcher, ensuring that requests to this route are handled appropriately.
2025-10-07 19:26:36 +03:00
Vlad Chikalkin
0b64d8086c
Feature/documents pages (#118)
* apps/web: add generic privacy & offer pages

* Update environment variables and enhance offer and privacy pages

- Added `OFFER_URL` and `SUPPORT_TELEGRAM_URL` to environment variable configuration for better flexibility.
- Updated the offer page to dynamically link to the offer URL and improved contact information presentation with a direct link to the support Telegram.
- Revised the privacy policy page to reflect the service name and updated contact details, ensuring clarity and consistency in communication.

* move offer & privacy -> (documents) sub directory

* Update offer and privacy pages to include user consent for third-party data sharing

- Added a clause in the offer page requiring users to ensure consent from third parties when adding their contact information.
- Updated the privacy policy to clarify that users can share third-party data, emphasizing the need for consent for data processing within the service.

* Add privacy agreement and update environment variables

- Introduced `PRIVACY_URL` to the environment configuration for dynamic linking.
- Updated localization files to include a user consent agreement for sharing phone numbers, linking to the offer and privacy URLs.
- Enhanced welcome and contact addition messages to incorporate the new consent clause, improving user clarity on data handling.

* Refactor phone agreement localization and enhance user consent messaging

- Updated the Russian localization file to streamline the phone sharing agreement, improving clarity on user consent for data processing.
- Modified the contact addition and welcome messages to incorporate the new agreement format, ensuring users are informed about their consent to share personal data.

* Enhance Russian localization and update message formatting

- Added a new payment agreement clause in the Russian localization file, clarifying user consent for payments.
- Updated message formatting in the contact addition and subscription processes to support HTML parsing, improving message presentation and user experience.
- Incorporated the new payment agreement into the subscription flow, ensuring users are informed about their consent to the terms.

* Refactor Russian localization for contact agreements and enhance user consent messaging

- Updated the Russian localization file to separate and clarify the phone sharing and contact sharing agreements, improving user understanding of consent requirements.
- Modified the contact addition and welcome messages to utilize the new agreement format, ensuring users are informed about their consent to share personal data in a more structured manner.

* Enhance Russian localization and add document handling features

- Updated the Russian localization file to include new entries for privacy policy and public offer documents, improving user access to important information.
- Added 'documents' command to the bot's command list, allowing users to easily access document-related features.
- Integrated document handling in the main menu and handlers, enhancing user experience and navigation within the bot.
2025-10-07 19:13:41 +03:00
vchikalkin
458a06a620 Refactor async components to synchronous functions for improved performance
- Converted several async components to synchronous functions, including `Layout`, `AddOrdersPage`, `ProfilePage`, `SlotPage`, and `ServicePage`, enhancing rendering efficiency.
- Removed unnecessary prefetching logic and hydration boundaries, simplifying component structure and improving maintainability.
- Updated the `TelegramProvider` to return null during the initial mount instead of a loading message, streamlining the loading state handling.
- Enhanced loading state management in order-related components by adding loading spinners and data not found alerts, improving user experience during data fetching.
2025-10-07 13:28:40 +03:00
vchikalkin
c7648e8bf9 Enhance contact management by adding surname input and updating customer handling
- Introduced a new input for capturing the surname of the user during contact addition.
- Updated the contact parsing logic to include surname alongside name and phone number.
- Modified the customer creation and update processes to accommodate surname, ensuring full name is used in confirmation messages.
- Adjusted localization files to reflect the new surname input prompt and updated confirmation messages.
- Refactored components to utilize a unified method for retrieving full customer names, improving consistency across the application.
2025-10-07 12:36:03 +03:00
vchikalkin
9244eaec26 2025-10-07 11:25:59 +03:00
vchikalkin
d109d50120 Add QuickAppointment component to profile page and integrate Radix UI Drawer
- Introduced a new `QuickAppointment` component for scheduling appointments directly from the profile page.
- Integrated the `QuickAppointment` component into the profile layout, allowing users to book appointments with a selected master or client.
- Implemented a Radix UI Drawer for the appointment booking interface, enhancing user experience with a modal-like interaction.
- Updated `pnpm-lock.yaml` and `package.json` to include new dependencies for the Radix UI components and the `vaul` library.
2025-10-07 11:04:56 +03:00
vchikalkin
cb4763e32b env(cache-proxy): fix missing REDIS_HOST 2025-10-06 23:34:56 +03:00
Vlad Chikalkin
2836153887
Feature/caching (#117)
* Refactor GraphQL client usage in services to improve consistency

- Replaced direct calls to `getClientWithToken` with a new method `getGraphQLClient` across multiple services, ensuring a unified approach to obtaining the GraphQL client.
- Updated the `BaseService` to manage the GraphQL client instance, enhancing performance by reusing the client when available.

* Refactor UpdateProfile component to use useClientOnce for initial profile update

- Replaced useEffect with useClientOnce to handle the first login profile update more efficiently.
- Removed local state management for hasUpdated, simplifying the component logic.
- Updated localStorage handling to ensure the profile update occurs only on the first login.

* Refactor Apollo Client setup to improve modularity and maintainability

- Introduced a new `createLink` function to encapsulate the link creation logic for Apollo Client.
- Updated `createApolloClient` to utilize the new `createLink` function, enhancing code organization.
- Simplified the handling of authorization headers by moving it to the link configuration.

* Add cache-proxy application with initial setup and configuration

- Created a new cache-proxy application using NestJS, including essential files such as Dockerfile, .gitignore, and .eslintrc.js.
- Implemented core application structure with AppModule, ProxyModule, and ProxyController for handling GraphQL requests.
- Configured caching with Redis and established environment variable management using Zod for validation.
- Added utility functions for query handling and time management, enhancing the application's functionality.
- Included README.md for project documentation and setup instructions.

* Add cache-proxy service to Docker configurations and update deployment workflow</message>

<message>
- Introduced a new cache-proxy service in both `docker-compose.dev.yml` and `docker-compose.yml`, with dependencies on Redis and integration into the web and bot services.
- Updated GitHub Actions workflow to include build and push steps for the cache-proxy image, ensuring it is deployed alongside web and bot services.
- Modified environment variable management to accommodate the cache-proxy, enhancing the overall deployment process.
- Adjusted GraphQL cached URL to point to the cache-proxy service for improved request handling.

* Add health check endpoint and controller to cache-proxy service

- Implemented a new HealthController in the cache-proxy application to provide a health check endpoint at `/api/health`, returning a simple status response.
- Updated the AppModule to include the HealthController, ensuring it is registered within the application.
- Configured a health check in the Docker Compose file for the cache-proxy service, allowing for automated health monitoring.

* Update proxy controller and environment variable for cache-proxy service

- Changed the route prefix of the ProxyController from `/proxy` to `/api` to align with the new API structure.
- Updated the default value of the `URL_GRAPHQL_CACHED` environment variable to reflect the new route, ensuring proper integration with the GraphQL service.

* Update cache proxy configuration for query time-to-live settings

- Increased the time-to-live for `GetCustomer`, `GetOrder`, `GetService`, and `GetSlot` queries to 24 hours, enhancing cache efficiency and performance.
- Maintained the existing setting for `GetSubscriptions`, which remains at 12 hours.

* Enhance subscription management and configuration settings

- Added new query time-to-live settings for `GetSlotsOrders`, `GetSubscriptionPrices`, and `GetSubscriptions` to improve caching strategy.
- Implemented `hasTrialSubscription` method in `SubscriptionsService` to check for trial subscriptions based on user history, enhancing subscription management capabilities.
- Updated GraphQL operations to reflect the change from `getSubscriptionSettings` to `GetSubscriptionSettings`, ensuring consistency in naming conventions.

* fix build

* Refactor subscription settings naming

- Updated the naming of `getSubscriptionSettings` to `GetSubscriptionSettings` in the cache-proxy configuration for consistency with other settings.
2025-10-06 23:26:03 +03:00
vchikalkin
1c669f04dd optimize: skip has getSubscription request if user has no subscriptions 2025-09-27 16:52:14 +03:00
vchikalkin
047a9b1956 hide TryFreeButton if user had any subscription 2025-09-27 16:42:13 +03:00
vchikalkin
d9e67bf4ba Refactor registration feature to improve reply handling
- Updated the registration feature to use KEYBOARD_REMOVE before sending the support message, enhancing user interaction flow.
- Ensured consistent reply structure by replacing direct message returns with await calls for better asynchronous handling.
2025-09-20 12:44:27 +03:00
vchikalkin
80d29af1b4 Update registration and welcome features to use mainMenu for replies
- Modified the registration feature to replace KEYBOARD_REMOVE with mainMenu in reply messages.
- Updated the welcome feature to use mainMenu instead of combining messages for a cleaner response structure.
2025-09-20 12:11:08 +03:00
vchikalkin
d191be03e8 Refactor welcome feature to use RegistrationService for customer retrieval
- Replaced CustomersService with RegistrationService in the welcome feature to streamline customer data retrieval.
- Updated the command handler to ensure proper integration with the new service.
2025-09-20 11:58:04 +03:00
vchikalkin
900cfe2cc2 Enhance subscription handling in bot and GraphQL API
- Updated the `createOrUpdateSubscription` method in the SubscriptionsService to accept an optional `paymentId` parameter for better tracking of payment transactions.
- Modified the bot's subscription feature to pass the `provider_payment_charge_id` when creating or updating subscriptions, improving payment processing accuracy.
2025-09-20 11:51:19 +03:00
vchikalkin
1f168df095 Refactor ProPage and improve back button logic
- Removed the unused PageHeader component from ProPage for a cleaner layout.
- Updated the isRootLevelPage function to enhance path exclusion logic, ensuring it correctly identifies root level pages.
2025-09-19 16:21:12 +03:00
vchikalkin
3e0ac818f2 bot(priceButtons): продлить/доступ 2025-09-18 19:41:05 +03:00
vchikalkin
29ecc47822 Fix logic in isRootLevelPage function to correctly identify root level pages 2025-09-18 19:31:27 +03:00
vchikalkin
86f0d87c31 Refactor subscription logic to remove unused trial subscription variable
- Eliminated the `usedTrialSubscription` variable from the subscription function.
- Updated the subscription period condition to directly reference `GQL.Enum_Subscriptionprice_Period.Trial` for clarity.
2025-09-18 19:18:58 +03:00
vchikalkin
a9fd9808ec shorter msg-invalid-phone 2025-09-18 19:06:02 +03:00
vchikalkin
31adf7e7b3 Update Russian localization and enhance contact addition flow
- Changed terminology from "клиент" to "пользователь" for consistency in user interactions.
- Updated messages to clarify user instructions for adding contacts and handling phone numbers.
- Added validation to prevent users from adding their own phone number as a contact.
- Improved conversation prompts for better user experience during contact addition.
2025-09-18 19:00:35 +03:00
vchikalkin
ec3c2869c1 Update bot features and localization
- Added new buttons and messages in Russian localization for improved user interaction.
- Integrated '@grammyjs/menu' version 1.3.1 to enhance menu functionality.
- Refactored bot command handlers to streamline conversation flows and improve code organization.
- Updated the main menu structure to include new options for adding contacts and subscription information.
2025-09-18 18:09:35 +03:00
vchikalkin
24aabae434 Enhance ProPage: Add subscription pricing display and update layout
- Integrated subscription pricing information by fetching active subscription prices and displaying them on the ProPage.
- Adjusted layout margins for improved visual consistency in the header and benefits sections.
- Enhanced user experience by conditionally rendering the pricing section based on available subscription prices.
2025-09-18 15:47:45 +03:00
vchikalkin
81e0168e44 Enhance ProPage: Update bot URL handling for trial subscriptions
- Introduced a new URL construction for the bot link, incorporating a 'start' parameter set to 'pro' for improved trial subscription management.
- Updated the link in the ProPage to utilize the newly constructed bot URL, ensuring users are directed correctly for Pro access through the bot.
2025-09-18 15:30:06 +03:00
vchikalkin
eb0ad25c3c fix back-button on /pro 2025-09-18 15:12:58 +03:00
vchikalkin
7c7ddcf0d5 typo: Pro Доступ 2025-09-18 14:17:14 +03:00
vchikalkin
106fdc0da5 refactor(profile): simplify profile page structure and enhance loading states
- Removed unnecessary data fetching and hydration logic from the main profile page.
- Updated the rendering of components to improve clarity and performance.
- Enhanced loading states in various profile components for better user experience.
- Refactored service list handling to utilize telegramId instead of masterId for consistency.
2025-09-18 14:02:10 +03:00