Compare commits

..

4 Commits

Author SHA1 Message Date
vchikalkin
6b788a9024 add docker-compose.dev.yml 2025-10-11 14:16:05 +03:00
vchikalkin
0e58a8cef7 subscription-price: add period 'day' 2025-10-09 16:19:03 +03:00
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
4 changed files with 39 additions and 1 deletions

28
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,28 @@
services:
postgres:
image: postgres
ports:
- '127.0.0.1:5432:5432'
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
strapi:
build: .
ports:
- '127.0.0.1:1337:1337'
environment:
APP_KEYS: ${APP_KEYS}
API_TOKEN_SALT: ${API_TOKEN_SALT}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
JWT_SECRET: ${JWT_SECRET}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_SSL: 'false'
BOT_TOKEN: ${BOT_TOKEN}

View File

@ -17,6 +17,11 @@
"maxLength": 100,
"required": true
},
"surname": {
"type": "string",
"maxLength": 100,
"required": false
},
"telegramId": {
"type": "biginteger",
"unique": true

View File

@ -16,6 +16,7 @@
"required": true,
"enum": [
"trial",
"day",
"week",
"month",
"half_year",

View File

@ -431,6 +431,10 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
'oneToMany',
'api::subscription.subscription'
>;
surname: Schema.Attribute.String &
Schema.Attribute.SetMinMaxLength<{
maxLength: 100;
}>;
telegramId: Schema.Attribute.BigInteger & Schema.Attribute.Unique;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
@ -665,7 +669,7 @@ export interface ApiSubscriptionPriceSubscriptionPrice
> &
Schema.Attribute.Private;
period: Schema.Attribute.Enumeration<
['trial', 'week', 'month', 'half_year', 'year']
['trial', 'day', 'week', 'month', 'half_year', 'year']
> &
Schema.Attribute.Required;
publishedAt: Schema.Attribute.DateTime;