132 Commits

Author SHA1 Message Date
vchikalkin
719193f4b3 Revert "packages(apps/web): upgrade next@15.5.0"
This reverts commit 22e4f72ee6e36834672e44a25acf8a5797dcca8c.
2025-08-26 20:04:21 +03:00
vchikalkin
22e4f72ee6 packages(apps/web): upgrade next@15.5.0 2025-08-26 12:47:43 +03:00
vchikalkin
7c1f79db2a 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.
2025-08-26 12:32:22 +03:00
vchikalkin
5018560f29 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.
2025-08-25 19:15:00 +03:00
vchikalkin
bad65204c4 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.
2025-08-25 11:31:53 +03:00
vchikalkin
f9e50972cd fix(order-form): hide next button on success & error pages 2025-08-23 15:51:56 +03:00
vchikalkin
ad589e471c 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.
2025-08-23 14:40:09 +03:00
vchikalkin
73dd674815 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.
2025-08-22 13:17:32 +03:00
vchikalkin
2067beb05a 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.
2025-08-22 12:49:40 +03:00
vchikalkin
d985b18f25 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.
2025-08-22 12:39:19 +03:00
vchikalkin
412c033972 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.
2025-08-21 18:53:29 +03:00
vchikalkin
b56992a995 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.
2025-08-21 18:48:41 +03:00
vchikalkin
89b0f0badf 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.
2025-08-21 18:24:30 +03:00
vchikalkin
a220d0a369 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.
2025-08-21 14:04:28 +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
Vlad Chikalkin
ccfc65ca9b
Fix/bugs features pt 2 (#58)
* refactor(profile): comment out change role feature

* refactor(orders): update OrderServices and ServiceSelect components to utilize ServiceCard, and enhance service fields with duration in GraphQL types

* refactor(schedule): implement forbidden order states to disable editing slots with active orders

* fix(deploy): update SSH configuration to use dynamic port from secrets for improved flexibility

* refactor(api/orders): simplify order creation logic by removing unnecessary validations and improving error handling

* refactor(contact-row): replace role display logic with useIsMaster hook for improved clarity

* refactor(profile/orders-list): update header text from "Общие записи" to "Недавние записи" for better clarity
gql: GetOrders add sort slot.date:desc

* refactor(profile/orders-list): enhance OrderCard component by adding avatarSource prop based on user role

* feat(order-form): implement date selection with event highlighting and monthly view for available time slots

* refactor(i18n/config): update timeZone from 'Europe/Amsterdam' to 'Europe/Moscow'

* refactor(order-form/datetime-select): enhance date selection logic to include slot availability check

* refactor(datetime-format): integrate dayjs timezone support with default Moscow timezone for date and time formatting

* fix(contact-row): replace useIsMaster hook with isCustomerMaster utility for role display logic

* refactor(service-card): replace formatTime with getMinutes for duration display

* refactor(order-datetime): update date and time handling to use datetime_start and datetime_end for improved consistency

* refactor(profile): streamline profile and slot pages by integrating session user retrieval and updating booking logic with BookButton component

* fix(navigation): append query parameter to bottom-nav links and enhance back navigation logic in success page
2025-07-18 17:11:43 +03:00
Vlad Chikalkin
1075e47904
Update message.ts 2025-07-04 10:08:05 +03:00
vchikalkin
6a8804abb1 refactor(api/notify): format orderCreated method parameters for improved readability 2025-07-03 22:52:16 +03:00
vchikalkin
53af172e34 feat(api/notify): enhance order creation notifications with dynamic emoji and confirmation text based on creator role 2025-07-03 22:51:03 +03:00
vchikalkin
cc91c5cb30 feat(api/notify): update notification messages with dynamic emojis based on order state 2025-07-03 22:44:28 +03:00
vchikalkin
686fe60b80 feat(api/orders): add validation to prevent masters from recording other masters as clients 2025-07-03 22:31:41 +03:00
vchikalkin
1e4e4aa336 fix(bot): improve text clarity in messages and commands list 2025-07-03 22:03:09 +03:00
vchikalkin
1c295a4b41 refactor(bot): add comments 2025-07-03 21:36:44 +03:00
vchikalkin
d9b054df14 feat(bot): add phone number validation and error handling for contact messages
set active: true after full registration
2025-07-03 21:30:17 +03:00
vchikalkin
ac897a77f8 chore(docker-compose): remove build context and dockerfile references for web and bot services 2025-07-03 20:55:50 +03:00
vchikalkin
9efa022cd6 fix build 2025-07-03 20:54:08 +03:00
vchikalkin
33a20b9f2e refactor(bot): replace CustomersService with RegistrationService for customer management 2025-07-03 19:44:36 +03:00
vchikalkin
d41194f177 fix(bot): streamline customer creation logic by checking for existing customer before creating a new one 2025-07-03 19:02:25 +03:00
vchikalkin
28e88e02aa fix(bot): remove extra newline in commands list for improved formatting 2025-07-03 18:19:44 +03:00
vchikalkin
8feb0d3c05 feat(bot): add profile editing prompt to commands list 2025-07-03 18:03:33 +03:00
vchikalkin
339fff1879 fix(api/orders): refine permission checks for order access based on client and master roles 2025-07-03 17:23:36 +03:00