148 Commits

Author SHA1 Message Date
vchikalkin
30bdc0447f feat(contacts): enhance contact display and improve user experience
- Updated ContactsList to include a description prop in ContactRow for better service representation.
- Renamed header in OrderContacts from "Контакты" to "Участники" for clarity.
- Replaced Avatar components with UserAvatar in various components for consistent user representation.
- Filtered active contacts in MastersGrid and ClientsGrid to improve data handling.
- Adjusted customer query logic to ensure proper handling of telegramId.
2025-09-09 11:23:35 +03:00
vchikalkin
de7cdefcd5 feat(contacts): add DataNotFound component for empty states in contacts and services grids
- Integrated DataNotFound component to display a message when no contacts or services are found in the respective grids.
- Enhanced loading state handling in ServicesSelect and ScheduleCalendar components to improve user experience during data fetching.
2025-09-08 18:35:52 +03:00
vchikalkin
92035a4ff8 feat(contacts): add showServices prop to ContactRow for conditional rendering
- Updated ContactsList to pass showServices prop to ContactRow.
- Modified ContactRow to conditionally render services based on the showServices prop, enhancing the display of contact information.
2025-09-08 14:50:31 +03:00
vchikalkin
4e37146214 feat(order): enhance order initialization logic with additional client selection step
- Added a new step for client selection in the order initialization process when only a masterId is present.
- Disabled cognitive complexity checks for improved code maintainability.
2025-09-08 14:44:36 +03:00
vchikalkin
c9a4c23564 refactor(contacts): update grid components and improve customer role handling
- Renamed InvitedByGrid to MastersGrid and InvitedGrid to ClientsGrid for clarity.
- Enhanced customer role checks by using documentId for identifying the current user.
- Updated the contacts passed to grid components to reflect the new naming and role structure.
- Adjusted titles in grid components for better user experience.
2025-09-08 14:36:12 +03:00
vchikalkin
201ccaeea5 feat(profile): enhance user role checks in subscription and links components
- Added conditional rendering in SubscriptionInfoBar and LinksCard to hide components for users with the Client role.
- Updated ProfileDataCard to use Enum_Customer_Role for role management.
- Improved error handling in OrdersService to differentiate between master and client order limit errors.
2025-09-08 14:14:45 +03:00
vchikalkin
0b188ee5ed refactor(contacts): rename masters to invited and update related functionality
- Changed the terminology from "masters" to "invited" and "invitedBy" across the codebase for clarity and consistency.
- Updated the `addContact` function to reflect the new naming convention.
- Refactored API actions and server methods to support the new invited structure.
- Adjusted components and hooks to utilize the updated invited data, enhancing user experience and simplifying logic.
2025-09-08 13:42:30 +03:00
vchikalkin
5dfef524e2 refactor(contact): remove customer master role checks and simplify contact addition
- Updated the `addContact` function to allow all users to add contacts, removing the previous restriction that only masters could do so.
- Deleted the `become-master` feature and related utility functions, streamlining the codebase.
- Adjusted command settings to reflect the removal of the master role functionality.
- Refactored components and hooks to eliminate dependencies on the master role, enhancing user experience and simplifying logic.
2025-09-08 12:51:35 +03:00
vchikalkin
49c43296e4 fix(typo): rename updateSlot to updateOrder for clarity 2025-09-07 20:28:50 +03:00
vchikalkin
3eb302a5d9 fix tests 2025-09-07 19:33:09 +03:00
vchikalkin
7af67b1910 feat(profile): conditionally render SubscriptionInfoBar based on user role
- Updated ProfilePage to check if the user is a master and conditionally render the SubscriptionInfoBar component.
- Refactored customer fetching logic to include a utility function for determining user role.
2025-09-07 16:57:48 +03:00
vchikalkin
04739612ca feat(profile): add MasterServicesList component to display services for profile masters
- Introduced the MasterServicesList component to show services associated with a master profile.
- Updated ProfilePage to conditionally render MasterServicesList based on user role.
- Refactored services fetching logic into a new useMasterServices hook for better reusability.
2025-09-07 16:57:48 +03:00
vchikalkin
d870fa5a21 fix(docker-compose): update healthcheck endpoint to include API path 2025-09-07 16:57:48 +03:00
vchikalkin
4cff4c8bbe order-card: fix order_number badge overlays navigation bar 2025-09-07 16:57:47 +03:00
vchikalkin
b94937b706 feat(orders): implement order limit checks for clients and masters
- Added order limit validation in the `OrdersService` to check if a master has reached their monthly order limit.
- Introduced new error messages for exceeding order limits, enhancing user feedback for both clients and masters.
- Integrated `SubscriptionsService` to manage subscription status and remaining order counts effectively.
2025-09-07 16:57:47 +03:00
vchikalkin
db9788132d feat(subscriptions): enhance error handling with centralized error messages
- Introduced a centralized `ERRORS` object in the `subscriptions.ts` file to standardize error messages related to trial subscriptions.
- Updated error handling in the `createSubscription` method to utilize the new error messages, improving maintainability and clarity for subscription-related errors.
2025-09-07 16:57:47 +03:00
vchikalkin
f2ad3dff17 feat(orders, subscriptions): implement banned user checks and improve remaining orders calculation
- Added `checkIsBanned` method calls in the `createOrder`, `getOrder`, `getOrders`, and `updateOrder` methods of the `OrdersService` to prevent actions from banned users.
- Updated the calculation of `remainingOrdersCount` in the `SubscriptionsService` to ensure it does not go below zero, enhancing subscription management accuracy.
2025-09-07 16:57:47 +03:00
vchikalkin
fd3785a436 style(pro-page, subscription-bar): enhance dark mode support and improve styling consistency
- Updated gradient backgrounds in ProPage and SubscriptionInfoBar to support dark mode variations.
- Refactored class names for better conditional styling based on subscription activity.
- Improved text color handling for better readability in both active and inactive states.
2025-09-07 16:57:46 +03:00
vchikalkin
da51d45882 feat(subscriptions): add trial period validation for subscriptions
- Implemented a check to verify if a user has already utilized their trial period before allowing access to subscription services.
- Enhanced error handling to provide a clear message when a trial period has been previously used, improving user experience and subscription management.
2025-09-07 16:57:46 +03:00
vchikalkin
9903fe4233 refactor(pro-page): streamline ProPage layout and improve bottom navigation visibility
- Consolidated the main container for the ProPage to enhance layout consistency.
- Updated the BottomNav component to conditionally hide on the Pro page, improving navigation clarity for users.
2025-09-07 16:57:46 +03:00
vchikalkin
81e223c69b feat(subscriptions): add trial subscription functionality
- Implemented `createTrialSubscription` action in the API for initiating trial subscriptions.
- Enhanced the Pro page to include a `TryFreeButton` for users to activate their trial.
- Updated GraphQL operations and types to support trial subscription features.
- Improved subscription messaging and user experience across relevant components.
2025-09-07 16:57:45 +03:00
vchikalkin
63ff021916 fix(pro-page): adjust hero section layout for improved visual consistency
- Reduced margin in the hero section to enhance alignment and overall aesthetics of the Pro page.
2025-09-07 16:57:45 +03:00
vchikalkin
10d47d260a feat(pro-page): enhance subscription messaging and add benefits section
- Updated subscription status messaging for clarity and conciseness.
- Improved button styling based on trial availability.
- Added a new benefits section for non-active subscribers, highlighting key features of the Pro subscription.
2025-09-07 16:57:45 +03:00
vchikalkin
ef5e509d6a feat(pro-page): use next/link 2025-09-07 16:57:44 +03:00
vchikalkin
4336cf5e60 feat(env): add BOT_URL to environment variables and update related configurations
- Introduced BOT_URL to the environment schema for enhanced configuration management.
- Updated turbo.json to include BOT_URL in the environment variables list.
- Modified subscription-bar.tsx to improve user messaging for subscription availability.
2025-09-07 16:57:44 +03:00
vchikalkin
812a77406c refactor(tests): remove BOT_TOKEN from environment mocks in order and slots tests
- Eliminated the hardcoded BOT_TOKEN from the environment mock in both orders.test.js and slots.test.js to streamline test configurations and improve security practices.
2025-09-07 16:57:44 +03:00
vchikalkin
38251cd0e8 feat(profile): add subscription information to profile page
- Integrated `SubscriptionInfoBar` component into the profile page for displaying subscription details.
- Updated GraphQL types to include subscription-related fields and filters.
- Enhanced the profile data management by adding subscription handling capabilities.
- Added a new utility function `getRemainingDays` to calculate remaining days until a specified date.
2025-09-07 16:57:43 +03:00
Vlad Chikalkin
3d0f74ef62
Hotfix/bot registraion add contact (#99)
* refactor(registration): remove checkBanStatus method and related logic

* fix(BaseService): streamline customer permission checks by consolidating conditions

* bot: remove logger from context

* refactor(bot): update conversation handling and middleware integration

- Replaced the previous conversations middleware with the Grammy framework's implementation.
- Introduced a loop to register custom conversations, enhancing the bot's conversation management capabilities.
- Removed the addContact feature implementation from the add-contact file, streamlining the codebase.

* feat(bot): add cancel command to conversation middleware

- Implemented a '/cancel' command in the bot's conversation middleware to allow users to exit all conversations gracefully.
- Removed the manual cancellation check from the addContact conversation, streamlining the code and improving user experience.

* fix(bot): conversations register - disable minification in build configuration
2025-09-07 16:36:31 +03:00
Vlad Chikalkin
0934417aaf
Fix/rc 1 (#89)
* Revert "packages(apps/web): upgrade next@15.5.0"

This reverts commit 22e4f72ee6e36834672e44a25acf8a5797dcca8c.

* docker-compose: add volumes

* Update Dockerfiles to install specific version of turbo (2.3.2) for consistent dependency management

* .github\workflows\deploy.yml: remove REDIS_PASSWORD env variable

* Update deploy.yml to add REDIS_PASSWORD environment variable for improved configuration management

* Reapply "packages(apps/web): upgrade next@15.5.0"

This reverts commit bcb9be88dfd1b57d6ce6f47bedca4aa3e8db0eae.

* refactor(bot): remove Redis integration from bot configuration

- Eliminated Redis instance and related storage client from the bot's configuration, streamlining the setup and reducing dependencies.
- Updated bot middleware to enhance performance and maintainability.

* Revert "refactor(bot): remove Redis integration from bot configuration"

This reverts commit 4fbbccb0a2967af0c92ff19fe337467347d9a91a.

* docker compose: format

* bot: fix production run (logger problem)

* docker-compose: add app network to redis
2025-08-27 11:37:15 +03:00
Vlad Chikalkin
81fa32c3d2
Release/rc 1 (#87)
* feat(profile): implement local hooks for profile and service data editing

- Added `useProfileEdit` and `useServiceEdit` hooks to manage pending changes and save functionality for profile and service data cards.
- Updated `ProfileDataCard` and `ServiceDataCard` components to utilize these hooks, enhancing user experience with save and cancel options.
- Introduced buttons for saving and canceling changes, improving the overall interactivity of the forms.
- Refactored input handling to use `updateField` for better state management.

* feat(bot): integrate Redis and update bot configuration

- Added Redis service to both docker-compose files for local development and production environments.
- Updated bot configuration to utilize the Grammy framework, replacing Telegraf.
- Implemented graceful shutdown for the bot, ensuring proper resource management.
- Refactored bot commands and removed deprecated message handling logic.
- Enhanced environment variable management for Redis connection settings.
- Updated dependencies in package.json to include new Grammy-related packages.

* fix(registration): improve error handling for customer creation

- Updated error handling in the registration feature to return a generic error message when documentId is not present, enhancing user experience by providing clearer feedback.

* feat(bot): add unhandled command message and integrate unhandled feature

- Introduced a new message for unhandled commands in Russian localization to improve user feedback.
- Integrated the unhandled feature into the bot's middleware for better command handling.

* feat(locales): update Russian localization with additional contact information

- Enhanced the short description in the Russian localization file to include a contact note for user inquiries, improving user support accessibility.

* feat(help): enhance help command with support information

- Updated the help command to include a support message in the Russian localization, providing users with a contact point for inquiries.
- Improved the command response by combining the list of available commands with the new support information, enhancing user experience.

* fix(orders): update default sorting order for orders

- Changed the default sorting order for orders from 'datetime_start:asc' to 'datetime_start:desc' to ensure the most recent orders are displayed first, improving the user experience in order management.

* refactor(orders): remove ClientsOrdersList and streamline OrdersList component

- Eliminated the ClientsOrdersList component to simplify the orders page structure.
- Updated OrdersList to handle both client and master views, enhancing code reusability.
- Improved order fetching logic and UI rendering for better performance and user experience.

* fix(order-form): hide next button on success & error pages

* refactor(bot): streamline bot middleware and improve key generator function

- Removed unused session middleware and sequentialize function from the bot's error boundary.
- Simplified the key generator function for rate limiting by condensing its implementation.
- Enhanced overall code clarity and maintainability in the bot's configuration.

* feat(customer): implement banned customer check and enhance customer data handling

- Added `isCustomerBanned` function to determine if a customer is banned based on the `bannedUntil` field.
- Updated the `BaseService` to throw an error if a banned customer attempts to access certain functionalities.
- Enhanced the GraphQL operations to include the `bannedUntil` field in customer queries and mutations, improving data integrity and user experience.
- Integrated the `CheckBanned` component in the layout to manage banned customer states effectively.

* feat(ban-system): implement multi-level user ban checks across services

- Added a comprehensive ban checking system to prevent access for banned users at multiple levels, including database, API, and client-side.
- Introduced `bannedUntil` field in the customer model to manage temporary and permanent bans effectively.
- Enhanced `BaseService` and various service classes to include ban checks, ensuring that banned users cannot perform actions or access data.
- Updated error handling to provide consistent feedback for banned users across the application.
- Improved user experience with a dedicated ban check component and a user-friendly ban notification page.

* packages(apps/web): upgrade next@15.5.0
2025-08-26 13:23:52 +03:00
vchikalkin
2e849857f2 feat(number-field): add min prop to NumberField and implement minimum value validation in ServiceDataCard
- Introduced a `min` prop to the NumberField component to enforce minimum value constraints.
- Updated ServiceDataCard to set the minimum price to 0, enhancing input validation for service pricing.
2025-08-20 17:57:12 +03:00
vchikalkin
c52e991e3f fix build 2025-08-20 17:47:47 +03:00
vchikalkin
3f7d1526da fix(service-card): remove unnecessary padding from expand button for improved layout 2025-08-20 17:35:10 +03:00
vchikalkin
7960323c0a fix(service-card): improve expand button visibility logic for service description
- Added logic to determine when to show the expand button based on description length and line breaks.
- Enhanced user experience by ensuring the button appears only when necessary, improving readability of service descriptions.
2025-08-20 17:31:15 +03:00
vchikalkin
540145d80a feat(service-card): add price and description fields to service data card
- Introduced NumberField for price input and TextareaField for service description in the ServiceDataCard component.
- Updated ServiceCard component to display the new description and price fields, enhancing service details visibility.
- Added formatMoney utility for consistent currency formatting across the application.
- Updated GraphQL fragments and types to include price and description fields for services.
2025-08-20 17:22:51 +03:00
vchikalkin
6ba18cb87d refactor(order-card): enhance layout and styling for order state display
- Updated the layout of the OrderCard component to improve responsiveness and visual clarity.
- Adjusted flex properties for better alignment and spacing of elements.
- Moved the order state badge into a dedicated div for improved styling control.
2025-08-19 19:45:54 +03:00
vchikalkin
64dfec1355 refactor(order-form): update service handling to support multiple services
- Renamed `ServiceSelect` to `ServicesSelect` for clarity.
- Updated state management to handle multiple service IDs instead of a single service ID.
- Adjusted related components (`DateSelect`, `TimeSelect`, `SubmitButton`, and `NextButton`) to accommodate the new services structure.
- Removed the deprecated `service-select.tsx` file and refactored related logic in the order store and API to support multiple services.
- Enhanced error handling in the slots service to validate multiple services correctly.
2025-08-19 19:14:14 +03:00
vchikalkin
b7554b89c8 .gitignore: add *.cmd 2025-08-19 12:09:57 +03:00
vchikalkin
b44d92cef3 Update Docker images in docker-compose and GitHub Actions workflow to use dynamic tags
- Changed Docker image references in docker-compose.yml to utilize environment variables for versioning.
- Updated GitHub Actions workflow to generate and use dynamic image tags based on the commit SHA for both web and bot images.
- Ensured that the .env file is populated with the new image tags during the deployment process.
2025-08-15 21:15:10 +03:00
Vlad Chikalkin
7d94521c8b
Issues/76 (#77)
* fix(jwt): update import path for isTokenExpired function to remove file extension

* packages/graphql: add slot tests

* fix(slots): update error handling for customer and slot retrieval, enhance time validation in slot updates

* fix(slots): update error messages for missing datetime fields and improve validation logic in slot updates

* fix(slots): update error messages and validation logic for slot creation and updates, including handling of datetime fields and master status

* refactor(slots): rename checkUpdateIsTimeChanging to checkUpdateDatetime for clarity in slot update validation

* test(slots): add comprehensive tests for getAvailableTimeSlots method, including edge cases and error handling

* fix(api): standardize error messages for customer and slot retrieval, and improve validation logic in slots service

* refactor(slots): rename validation methods for clarity and consistency in slot service

* OrdersService: add checkBeforeCreate

* add orders.test.js

* test(orders): add validation test for missing datetime_end in order creation

* feat(orders): implement updateOrder functionality with comprehensive validation tests

- Added updateOrder method in OrdersService with checks for permissions, order state, and datetime validation.
- Implemented tests for various scenarios including successful updates, permission errors, and validation failures.
- Enhanced error handling for overlapping time and invalid state changes.
- Updated GraphQL operations to support sorting in GetOrders query.

* fix(orders): update datetime validation logic and test cases for order creation and completion

- Modified order creation tests to set datetime_start to one hour in the past for past orders.
- Updated the OrdersService to use isNowOrAfter for validating order completion against the start time.
- Enhanced datetime utility function to accept a unit parameter for more flexible comparisons.

* fix(calendar): initialize selected date in ScheduleCalendar component if not set

- Added useEffect to set the selected date to the current date if it is not already defined.
- Imported useEffect alongside useState for managing component lifecycle.

* fix(order-form): initialize selected date in DateSelect component if not set

- Added useEffect to set the selected date to the current date if it is not already defined.
- Renamed setDate to setSelectedDate for clarity in state management.

* refactor(orders): streamline order creation logic and enhance test setup

- Removed redundant variable assignments in the createOrder method for cleaner code.
- Updated test setup in orders.test.js to use global mocks for user and service retrieval, improving test clarity and maintainability.
- Added checks for required fields in order creation to ensure data integrity.
2025-08-11 16:25:14 +03:00
vchikalkin
ba88305bbf feat(orders, slots, schedule): enhance order and slot button functionality with date validation and conditional rendering 2025-08-02 20:40:09 +03:00
vchikalkin
ee6ccbef84 feat(slots): add error handling for slot deletion when orders are present 2025-08-02 19:28:38 +03:00
vchikalkin
6c4e6113f6 refactor(api): replace CustomerProfile with UserProfile and streamline user retrieval across services 2025-08-02 18:53:23 +03:00
vchikalkin
25fb9269fc refactor(calendar): comment out past date disabling logic for calendar component; refactor day slots list to improve slot display and add conditional rendering for add form 2025-08-02 18:07:00 +03:00
Vlad Chikalkin
ed197143d6
Feature/tma back button (#70)
* feat(layout): integrate TelegramProvider and BackButton into main layout for enhanced navigation

* refactor(layout): remove BackButton from main layout and update navigation imports

* use ui back button for non tma mode
2025-08-02 15:42:06 +03:00
vchikalkin
278da049a5 refactor(service-card): add text truncation to service name for improved layout 2025-08-02 11:11:29 +03:00
vchikalkin
9061c6eda3 feat(slots): add time validation to prevent past slot selection 2025-08-02 11:07:18 +03:00
Vlad Chikalkin
10981e2afb
Issues/66 (#67)
* feat(profile): add 'Услуги' link button to LinksCard for service management

* feat(services): add create and update service functionalities with corresponding API actions and hooks
2025-08-01 19:54:10 +03:00
Vlad Chikalkin
fde9305632
Fix/bugs features pt 3 (#64)
* chore(docker): add healthcheck to service in docker-compose.yml and update deploy workflow to include docker compose down

* refactor(orders): add useOrdersInfiniteQuery for improved pagination and add load more button in orders list components

* refactor(graphql): remove NotifyService and related notification logic from orders and API, clean up unused dependencies

* refactor(api): streamline customer, order, service, and slot actions by wrapping server functions with client action utility to rethrow error messages to client
2025-07-23 13:15:08 +03:00
vchikalkin
ae0e7cc1a7 refactor(orders-list): replace HorizontalCalendar with Calendar component and update date selection logic for improved clarity and functionality 2025-07-19 16:52:52 +03:00