74 Commits

Author SHA1 Message Date
vchikalkin
a63eff9f46 customer: add field surname 2025-10-07 11:42:27 +03:00
Vlad Chikalkin
e0a9f55eeb
Feature/pro subscription (#8)
* feat: add subscription relation to customer schema and new subscription-related interfaces

- Introduced a one-to-one relation for 'subscription' in the customer schema to link customers with their subscriptions.
- Added new TypeScript interfaces for subscription-related entities, including Subscription, SubscriptionHistory, SubscriptionPrice, and SubscriptionSetting, ensuring type safety and consistency across the application.

* refactor: remove unused fields from subscription schema and TypeScript definitions

- Deleted the 'referralCode', 'subscription', 'referralCount', and 'referredBy' fields from the subscription schema to streamline the data model.
- Updated TypeScript definitions to reflect these changes, ensuring type safety and consistency across the application.

* feat: add 'days' field to subscription price schema and update TypeScript definitions

- Introduced a new 'days' integer field in the subscription price schema, marked as required to enhance subscription duration tracking.
- Removed unused 'description', 'trialPeriodDays', and 'trialEnabled' fields from the subscription setting schema to streamline the data model.
- Updated TypeScript definitions to reflect these changes, ensuring type safety and consistency across the application.

* refactor: rename relation fields in customer schema and update TypeScript definitions

- Changed 'clients' to 'invited' and 'masters' to 'invitedBy' in the customer schema to better reflect their purpose in the data model.
- Updated TypeScript definitions to include the new relation fields, ensuring type safety and consistency across the application.

* feat: add subscription_rewards relation to customer and subscription history schemas, and update TypeScript definitions

- Introduced a new 'subscription_rewards' relation in both the customer and subscription history schemas to link them with subscription rewards.
- Updated the 'expiresAt' field in the subscription schema to be required, ensuring better data integrity.
- Adjusted the default value for 'maxOrdersPerMonth' in the subscription setting schema from 30 to 20, and removed unused fields to streamline the model.
- Updated TypeScript definitions to reflect these changes, ensuring type safety and consistency across the application.

* SubscriptionPrice: rename price -> amount

* refactor: remove block-related schemas, controllers, routes, and services

- Deleted the block schema, controller, routes, and services to streamline the API structure.
- Updated customer and order schemas to remove references to the block relation, ensuring data integrity and clarity.
- Adjusted TypeScript definitions to reflect the removal of block-related entities, maintaining type safety across the application.

* SubscriptionHistory: change type to string

* add new entity customer_setting

* subscription settings: add field proEnabled
2025-09-17 14:46:39 +03:00
Vlad Chikalkin
ccd0947334
feat: add bannedUntil field to customer schema (#7)
- Introduced a new 'bannedUntil' datetime field in the customer schema to track when a customer is banned until.
- Updated TypeScript definitions to include the new 'bannedUntil' attribute, ensuring type safety and consistency across the application.
2025-08-26 13:18:12 +03:00
vchikalkin
37c28353a9 feat: enhance Telegram notification to include total service cost
- Updated the Telegram notification message to display the total cost of services associated with an order, improving transparency for clients and masters.
- Added logic to calculate the total price based on individual service prices and formatted the price for better readability.
2025-08-20 17:59:36 +03:00
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
vchikalkin
3fb75f5765 .gitignore: add *.cmd 2025-08-19 19:22:10 +03:00
vchikalkin
d9ac6858e7 chore: update Docker image configuration and enhance CI/CD workflow
- Changed the Docker image reference in docker-compose.yml to use dynamic environment variables for better flexibility.
- Updated the GitHub Actions workflow to set the image tag based on the commit SHA, ensuring unique tagging for each build.
- Added environment variable definitions for Docker Hub credentials and image tag in the deployment process.
2025-08-15 21:17:31 +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
vchikalkin
8b2c7396c3 fix: add BOT_TOKEN environment variable to docker-compose for Telegram integration 2025-07-23 13:27:58 +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
bbb697b159 docker-compose: expose 1337 port for 127.0.0.1 2025-07-13 11:23:39 +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
4ff50e42b9 fix: update deploy workflow to use dynamic SSH port 2025-07-10 16:27:17 +03:00
vchikalkin
c5d4ef3392 feat: add validation for slot time changes based on order status 2025-07-10 16:19:41 +03:00
vchikalkin
066de8ced8 docker-compose: comment ports 2025-07-02 21:53:37 +03:00
vchikalkin
ddc1f44fa0 Dockerfile: upgrade node.js
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 23:47:30 +03:00
vchikalkin
e799257dee finally: working deploy
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 21:01:43 +03:00
vchikalkin
a4bdfddc54 chore: add production environment to deploy workflow
Some checks failed
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 20:30:49 +03:00
vchikalkin
839f3445c7 refactor deploy workflow: comment out build-and-push job and add .env file creation and SCP steps for environment variables
Some checks failed
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 20:26:16 +03:00
vchikalkin
cb5aaeb412 fix Login and deploy on VPS
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 20:17:06 +03:00
vchikalkin
c852b95c43 deploy: add SSH checkout and ensure zapishis-strapi directory exists on VPS
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 20:05:08 +03:00
vchikalkin
879dcc2d62 deploy: fix copy docker-compose.yml to VPS
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 19:51:25 +03:00
vchikalkin
a22d2ff773 fix: deploy (login & sync file)
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 19:38:35 +03:00
vchikalkin
7a74fd7c28 deploy: strapi-app -> zapishis-strapi 2025-06-27 19:24:48 +03:00
vchikalkin
ed6da539ce deploy: use docker hub
Some checks failed
Build & Deploy Strapi from Docker Hub / Build and Push to Docker Hub (push) Has been cancelled
Build & Deploy Strapi from Docker Hub / Deploy to VPS (push) Has been cancelled
2025-06-27 19:11:18 +03:00
vchikalkin
3a20dc60b9 fix: deploy db secrets
Some checks failed
Deploy Strapi to VPS / deploy (push) Has been cancelled
2025-06-27 18:50:24 +03:00
vchikalkin
2300a7cc1c deploy: try .env - file pattern
Some checks failed
Deploy Strapi to VPS / deploy (push) Has been cancelled
2025-06-27 18:45:30 +03:00
vchikalkin
4686690c33 fix: deploy docker compose permission error
Some checks failed
Deploy Strapi to VPS / deploy (push) Has been cancelled
2025-06-27 18:36:33 +03:00
vchikalkin
4a5910611e fix: specify deploy branch 'master'
Some checks failed
Deploy Strapi to VPS / deploy (push) Has been cancelled
2025-06-27 18:32:44 +03:00
vchikalkin
1d50c3168f add github deploy files 2025-06-27 18:27:03 +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