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
..
2024-11-28 23:29:05 +03:00