46 Commits

Author SHA1 Message Date
vchikalkin
01fbd1c696 feat: add price and description fields to service schema
- Introduced new fields 'price' and 'description' in the service schema to enhance service details.
- Updated TypeScript definitions to include these new attributes, ensuring type safety and consistency across the application.
2025-08-20 17:23:33 +03:00
vchikalkin
8a81a1e251 feat: update Telegram notification to list all services for orders
- Modified the notification message format to include a list of all services associated with an order instead of just the first service. This change enhances clarity for both clients and masters by providing comprehensive service details in notifications.
2025-08-19 19:27:54 +03:00
Vlad Chikalkin
9f1b13192f
Issues/76 (#6)
* refactor: consolidate order lifecycle validation logic and remove slot lifecycle

- Streamlined the order lifecycle by consolidating validation logic and removing redundant error handling.
- Deleted the slot lifecycle file to simplify the codebase, as its functionality is no longer needed.
- This change enhances maintainability and reduces complexity in the order management system.

* feat: enhance Telegram notification heading for order updates

- Updated the heading emoji logic to display a checkered flag for completed orders and a pencil for updates, improving clarity in notifications.
- Added specific handling for completed records in the notification heading to differentiate between updated and completed statuses.
2025-08-11 16:25:56 +03:00
vchikalkin
b0aa644435 feat: add update check to order and slot lifecycles
- Implemented a check in both order and slot lifecycles to skip validation if the record is being updated, identified by the presence of the 'publishedAt' field. This change prevents unnecessary validation for existing records.
2025-08-03 13:56:43 +03:00
vchikalkin
63a68c6089 refactor: comment out beforeDelete lifecycle method in slot API
- Temporarily disabled the beforeDelete method to prevent slot deletion checks related to existing orders. This change is intended for further review and potential reimplementation.
2025-08-02 19:26:38 +03:00
vchikalkin
7a89cfa7ce fix: update slot start time validation to check against the current day
- Modified the validation logic to ensure that the slot start time is not before the current day, preventing past slots from being created.
2025-08-02 18:37:42 +03:00
vchikalkin
cfa5a02ca9 feat: add validation to prevent order creation in the past
- Introduced a new error message for attempts to create orders with a start time in the past.
- Implemented a check in the order lifecycle to validate that the order start time is not before the current time.
2025-08-02 11:19:21 +03:00
vchikalkin
50f23f67b3 feat: update customer and service schemas to enforce maxLength and required attributes
- Added maxLength constraints to 'name' and 'phone' attributes in customer and service schemas.
- Marked 'name' as required in both schemas.
- Updated TypeScript definitions to reflect these changes.
2025-08-02 11:15:21 +03:00
vchikalkin
3833a1a23d feat: enhance extractId function to support 'connect' input for ID retrieval 2025-08-02 11:04:53 +03:00
Vlad Chikalkin
d592c9cf31
feat: add 'active' boolean attribute to content type schema and TypeScript definitions (#5) 2025-08-01 19:53:47 +03:00
vchikalkin
34fff838f9 fix: read botToken 2025-07-23 14:06:38 +03:00
Vlad Chikalkin
c22357b71e
feat: integrate Telegraf for Telegram notifications in order lifecycle (#4)
- Added Telegraf dependency to handle Telegram bot interactions.
- Updated order lifecycle methods to send notifications upon order creation and updates.
- Refactored datetime handling to use a consistent timezone.
- Removed unused utility functions to streamline codebase.
2025-07-23 13:14:02 +03:00
vchikalkin
7f57b03c88 order: remove field 'price' 2025-07-22 13:33:52 +03:00
vchikalkin
6dc36ebe89 refactor: remove service_description field from order schema and TypeScript definitions 2025-07-19 13:46:20 +03:00
Vlad Chikalkin
b0171aa079
Refactor/migrate to datetime (#2)
* feat: refactor order and slot lifecycles to use datetime fields for time validation

* refactor: remove time fields from order and slot schemas to streamline data structure

* fix: correct time validation logic in order and slot lifecycles to ensure proper datetime comparisons

* fix: update order lifecycle validation to exclude only 'cancelled' state

* fix: add validation to ensure order times fall within the specified slot boundaries

* feat: integrate dayjs for improved datetime handling in order lifecycles
Нельзя завершить запись до её наступления

* fix: enhance datetime validation in order and slot lifecycles to ensure accurate comparisons

* fix: standardize error messages in order and slot lifecycles for better clarity
2025-07-18 17:12:57 +03:00
vchikalkin
07b4239038 fix: update error handling in order lifecycle to check for missing time 2025-07-16 17:12:00 +03:00
vchikalkin
9f6d5fe11c fix: correct slot ID condition in order lifecycle validation 2025-07-11 16:28:57 +03:00
vchikalkin
a447f4bf1c feat: refactor slot lifecycle methods to include master validation and enhance time checks 2025-07-11 16:22:11 +03:00
vchikalkin
2686249cc9 feat: enhance order creation validation with additional checks for client, slot, and service 2025-07-11 13:38:42 +03:00
vchikalkin
c5d4ef3392 feat: add validation for slot time changes based on order status 2025-07-10 16:19:41 +03:00
vchikalkin
ed1fe77f62 set order_number if order state changes to completed 2025-06-27 14:42:49 +03:00
vchikalkin
c26ad36781 order: check client & master active before create 2025-06-27 12:35:04 +03:00
vchikalkin
b357571fea fix prev commit 2025-06-26 14:08:46 +03:00
vchikalkin
c5d4a2f782 fix update order via strapi ui 2025-06-26 13:57:25 +03:00
vchikalkin
2074955d19 order: fix order update state lifecycle 2025-06-25 12:20:14 +03:00
vchikalkin
065da3e275 order: rename cancellation ->cancelling 2025-06-24 12:32:36 +03:00
vchikalkin
af4196c685 order: add state 'cancellation' 2025-06-24 11:35:34 +03:00
vchikalkin
caa9fc54a7 order: fix lifecycle 2025-06-11 17:14:08 +03:00
vchikalkin
d62b9ad4b0 order: delete date field 2025-06-10 11:19:13 +03:00
vchikalkin
5e54c3f7e3 slot: disable beforeUpdate if no time_start & time_end 2025-05-21 12:24:27 +03:00
vchikalkin
f434f0e208 order: lifecycle checks 2025-05-09 18:48:49 +03:00
vchikalkin
797da91b8e service: add field 'duration' 2025-05-08 17:40:15 +03:00
vchikalkin
3c2c7701b1 customer::service relations 2025-05-07 17:46:58 +03:00
vchikalkin
970c391b0f order: add field 'date' 2025-05-07 17:46:45 +03:00
vchikalkin
7b4c5e280a slot: add beforeCreate check 2025-02-20 18:05:57 +03:00
vchikalkin
e64f5453de slot: beforeUpdate check 2025-02-19 18:14:28 +03:00
vchikalkin
554fa6adc0 add type 'service' 2025-02-12 11:16:44 +03:00
vchikalkin
b30e9e46fb fix fields types & names 2025-02-11 11:40:37 +03:00
vchikalkin
efe34ba945 upgrade for slots & orders functional 2025-01-30 18:56:18 +03:00
vchikalkin
844365c40a upgrade entities 2025-01-27 19:33:49 +03:00
vchikalkin
4001b68491 customer.active=false by default 2025-01-10 19:17:56 +03:00
vchikalkin
2580fedfd6 customer: add field "photoUrl" 2025-01-01 16:05:09 +03:00
vchikalkin
d14a8279c0 правки anna k 2024-12-04 19:04:41 +03:00
vchikalkin
d24eea9e25 day 2 2024-11-28 23:29:05 +03:00
vchikalkin
b907aa39f5 locale 'ru' 2024-11-28 21:53:42 +03:00
vchikalkin
dcfba2b22b Initial commit from Strapi 2024-11-28 21:48:58 +03:00