183 Commits

Author SHA1 Message Date
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
a26c0eab8a hotfix: getRemainingOrdersCount: add master to filter 2025-10-16 17:28:59 +03:00
vchikalkin
3ac86cfeb0 mdx: whitespace fix 2025-10-14 20:06:33 +03:00
vchikalkin
d895433a65 chore: update deploy.yml to enhance .env file creation process
- Renamed steps for clarity in the deployment workflow.
- Updated the creation of the .env files to use secrets for sensitive URLs instead of hardcoded values, improving security and flexibility.
2025-10-14 20:01:12 +03:00
vchikalkin
3064887ecf Revert "chore: update deploy.yml to create .env files with improved variable handling"
This reverts commit bdcd11d97e59affe3d16a65e81b142dc486b889e.
2025-10-14 19:59:11 +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
bdcd11d97e chore: update deploy.yml to create .env files with improved variable handling
- Renamed steps for clarity in the deployment workflow.
- Updated the creation of the fake and real .env files to include necessary environment variables and secrets.
- Removed hardcoded URLs and replaced them with references to secrets for better security and flexibility.
2025-10-14 16:28:01 +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
67cf9a8e26 feat: add subscription_price to subscription history
- Included subscription_price in the subscription history object to enhance tracking of trial subscriptions.
2025-10-11 13:36:54 +03:00
vchikalkin
6080aadc93 chore: add workflow_dispatch trigger to deploy.yml for manual deployment 2025-10-09 18:19:57 +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
01d8bb20d5 Enhance GitHub Actions workflow for conditional builds and environment file management
- Introduced path filtering using `dorny/paths-filter` to conditionally build and push Docker images for web, bot, and cache-proxy projects based on changes.
- Added outputs to track which projects were built and modified the build and push steps to execute conditionally.
- Created separate environment files for each project tag and implemented logic to merge these files into a main `.env` file during deployment.
- Improved the deployment process by conditionally copying environment files to the VPS based on whether the corresponding project was built.
2025-10-08 18:13:09 +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
vchikalkin
f8d0b7619f fix build 2025-10-07 19:17:31 +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
8aaae245a7 Refactor Apollo Client setup by removing createLink function
- Updated the `createApolloClient` function to directly handle authorization headers and GraphQL URI configuration, improving modularity and reducing complexity.
- Removed the `createLink` function, streamlining the client setup process and enhancing maintainability.
- Renamed type `Parameters` to `Parameters_` for clarity in the client function signature.
2025-10-07 10:14:09 +03:00
vchikalkin
c4b76a4755 docker-compose: comment healthcheck 2025-10-06 23:46:33 +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