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
This commit is contained in:
parent
ccd0947334
commit
e0a9f55eeb
@ -1,60 +0,0 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "blocks",
|
||||
"info": {
|
||||
"singularName": "block",
|
||||
"pluralName": "blocks",
|
||||
"displayName": "Block",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"datetime_start": {
|
||||
"type": "datetime",
|
||||
"required": true
|
||||
},
|
||||
"datetime_end": {
|
||||
"type": "datetime",
|
||||
"required": true
|
||||
},
|
||||
"state": {
|
||||
"type": "enumeration",
|
||||
"enum": [
|
||||
"created",
|
||||
"paid",
|
||||
"deleted"
|
||||
],
|
||||
"default": "created"
|
||||
},
|
||||
"sessions_total": {
|
||||
"type": "integer",
|
||||
"default": 10,
|
||||
"required": true
|
||||
},
|
||||
"sessions_completed": {
|
||||
"type": "integer",
|
||||
"default": 0
|
||||
},
|
||||
"master": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "blocks"
|
||||
},
|
||||
"client": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "blocks"
|
||||
},
|
||||
"orders": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::order.order",
|
||||
"mappedBy": "block"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* block controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::block.block');
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* block router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::block.block');
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* block service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::block.block');
|
||||
24
src/api/customer/content-types/customer-setting/schema.json
Normal file
24
src/api/customer/content-types/customer-setting/schema.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "customer_settings",
|
||||
"info": {
|
||||
"singularName": "customer-setting",
|
||||
"pluralName": "customer-settings",
|
||||
"displayName": "CustomerSettings"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": false
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"autoRenewSubscription": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"customer": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::customer.customer",
|
||||
"mappedBy": "customer_setting"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,23 +40,17 @@
|
||||
"required": false,
|
||||
"default": false
|
||||
},
|
||||
"clients": {
|
||||
"invited": {
|
||||
"type": "relation",
|
||||
"relation": "manyToMany",
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "masters"
|
||||
"inversedBy": "invitedBy"
|
||||
},
|
||||
"masters": {
|
||||
"invitedBy": {
|
||||
"type": "relation",
|
||||
"relation": "manyToMany",
|
||||
"target": "api::customer.customer",
|
||||
"mappedBy": "clients"
|
||||
},
|
||||
"blocks": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::block.block",
|
||||
"mappedBy": "client"
|
||||
"mappedBy": "invited"
|
||||
},
|
||||
"slots": {
|
||||
"type": "relation",
|
||||
@ -79,8 +73,26 @@
|
||||
"target": "api::service.service",
|
||||
"mappedBy": "master"
|
||||
},
|
||||
"subscriptions": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::subscription.subscription",
|
||||
"mappedBy": "customer"
|
||||
},
|
||||
"bannedUntil": {
|
||||
"type": "datetime"
|
||||
},
|
||||
"subscription_rewards": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::subscription-reward.subscription-reward",
|
||||
"mappedBy": "owner"
|
||||
},
|
||||
"customer_setting": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::customer.customer-setting",
|
||||
"inversedBy": "customer"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,12 +30,6 @@
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "orders"
|
||||
},
|
||||
"block": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::block.block",
|
||||
"inversedBy": "orders"
|
||||
},
|
||||
"order_number": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"info": {
|
||||
"singularName": "service",
|
||||
"pluralName": "services",
|
||||
"displayName": "service",
|
||||
"displayName": "Service",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "settings",
|
||||
"info": {
|
||||
"singularName": "setting",
|
||||
"pluralName": "settings",
|
||||
"displayName": "Setting",
|
||||
"description": ""
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"recording_by_blocks": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* setting controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::setting.setting');
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* setting router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::setting.setting');
|
||||
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* setting service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::setting.setting');
|
||||
@ -0,0 +1,67 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "subscription_histories",
|
||||
"info": {
|
||||
"singularName": "subscription-history",
|
||||
"pluralName": "subscription-histories",
|
||||
"displayName": "SubscriptionHistory"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"subscription": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::subscription.subscription",
|
||||
"mappedBy": "subscription_history"
|
||||
},
|
||||
"subscription_price": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::subscription-price.subscription-price"
|
||||
},
|
||||
"amount": {
|
||||
"type": "decimal",
|
||||
"required": true
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"default": "RUB",
|
||||
"required": false
|
||||
},
|
||||
"state": {
|
||||
"type": "enumeration",
|
||||
"required": true,
|
||||
"enum": [
|
||||
"success",
|
||||
"failed",
|
||||
"pending"
|
||||
]
|
||||
},
|
||||
"paymentId": {
|
||||
"type": "string",
|
||||
"required": false
|
||||
},
|
||||
"source": {
|
||||
"type": "enumeration",
|
||||
"required": true,
|
||||
"default": "payment",
|
||||
"enum": [
|
||||
"payment",
|
||||
"trial",
|
||||
"reward",
|
||||
"admin",
|
||||
"renewal"
|
||||
]
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"period": {
|
||||
"type": "string",
|
||||
"maxLength": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-history controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::subscription-history.subscription-history');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-history router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::subscription-history.subscription-history');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-history service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::subscription-history.subscription-history');
|
||||
@ -0,0 +1,47 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "subscription_prices",
|
||||
"info": {
|
||||
"singularName": "subscription-price",
|
||||
"pluralName": "subscription-prices",
|
||||
"displayName": "SubscriptionPrice"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"period": {
|
||||
"type": "enumeration",
|
||||
"required": true,
|
||||
"enum": [
|
||||
"trial",
|
||||
"week",
|
||||
"month",
|
||||
"half_year",
|
||||
"year"
|
||||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "decimal",
|
||||
"required": true
|
||||
},
|
||||
"currency": {
|
||||
"type": "string",
|
||||
"default": "RUB",
|
||||
"required": false
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"default": true
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"days": {
|
||||
"type": "integer",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-price controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::subscription-price.subscription-price');
|
||||
7
src/api/subscription-price/routes/subscription-price.ts
Normal file
7
src/api/subscription-price/routes/subscription-price.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-price router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::subscription-price.subscription-price');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-price service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::subscription-price.subscription-price');
|
||||
@ -0,0 +1,47 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "subscription_rewards",
|
||||
"info": {
|
||||
"singularName": "subscription-reward",
|
||||
"pluralName": "subscription-rewards",
|
||||
"displayName": "SubscriptionReward"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"activated": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"owner": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "subscription_rewards"
|
||||
},
|
||||
"invited": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::customer.customer"
|
||||
},
|
||||
"days": {
|
||||
"type": "integer",
|
||||
"required": true
|
||||
},
|
||||
"expiresAt": {
|
||||
"type": "datetime",
|
||||
"required": true
|
||||
},
|
||||
"description": {
|
||||
"type": "text"
|
||||
},
|
||||
"subscription": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::subscription.subscription",
|
||||
"inversedBy": "subscription_rewards"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-reward controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::subscription-reward.subscription-reward');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-reward router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::subscription-reward.subscription-reward');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-reward service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::subscription-reward.subscription-reward');
|
||||
@ -0,0 +1,29 @@
|
||||
{
|
||||
"kind": "singleType",
|
||||
"collectionName": "subscription_settings",
|
||||
"info": {
|
||||
"singularName": "subscription-setting",
|
||||
"pluralName": "subscription-settings",
|
||||
"displayName": "SubscriptionSettings"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"maxOrdersPerMonth": {
|
||||
"type": "integer",
|
||||
"required": true,
|
||||
"default": 20
|
||||
},
|
||||
"referralRewardDays": {
|
||||
"type": "integer",
|
||||
"required": true,
|
||||
"default": 1
|
||||
},
|
||||
"proEnabled": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-setting controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::subscription-setting.subscription-setting');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-setting router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::subscription-setting.subscription-setting');
|
||||
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription-setting service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::subscription-setting.subscription-setting');
|
||||
47
src/api/subscription/content-types/subscription/schema.json
Normal file
47
src/api/subscription/content-types/subscription/schema.json
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"kind": "collectionType",
|
||||
"collectionName": "subscriptions",
|
||||
"info": {
|
||||
"singularName": "subscription",
|
||||
"pluralName": "subscriptions",
|
||||
"displayName": "Subscription"
|
||||
},
|
||||
"options": {
|
||||
"draftAndPublish": true
|
||||
},
|
||||
"pluginOptions": {},
|
||||
"attributes": {
|
||||
"customer": {
|
||||
"type": "relation",
|
||||
"relation": "manyToOne",
|
||||
"target": "api::customer.customer",
|
||||
"inversedBy": "subscriptions"
|
||||
},
|
||||
"active": {
|
||||
"type": "boolean",
|
||||
"required": true,
|
||||
"default": false
|
||||
},
|
||||
"expiresAt": {
|
||||
"type": "datetime",
|
||||
"required": true
|
||||
},
|
||||
"subscription_history": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::subscription-history.subscription-history",
|
||||
"inversedBy": "subscription"
|
||||
},
|
||||
"subscription_rewards": {
|
||||
"type": "relation",
|
||||
"relation": "oneToMany",
|
||||
"target": "api::subscription-reward.subscription-reward",
|
||||
"mappedBy": "subscription"
|
||||
},
|
||||
"nextSubscription": {
|
||||
"type": "relation",
|
||||
"relation": "oneToOne",
|
||||
"target": "api::subscription.subscription"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
src/api/subscription/controllers/subscription.ts
Normal file
7
src/api/subscription/controllers/subscription.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription controller
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi'
|
||||
|
||||
export default factories.createCoreController('api::subscription.subscription');
|
||||
7
src/api/subscription/routes/subscription.ts
Normal file
7
src/api/subscription/routes/subscription.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription router
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreRouter('api::subscription.subscription');
|
||||
7
src/api/subscription/services/subscription.ts
Normal file
7
src/api/subscription/services/subscription.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* subscription service
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
export default factories.createCoreService('api::subscription.subscription');
|
||||
334
types/generated/contentTypes.d.ts
vendored
334
types/generated/contentTypes.d.ts
vendored
@ -373,43 +373,6 @@ export interface AdminUser extends Struct.CollectionTypeSchema {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiBlockBlock extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'blocks';
|
||||
info: {
|
||||
description: '';
|
||||
displayName: 'Block';
|
||||
pluralName: 'blocks';
|
||||
singularName: 'block';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
client: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
datetime_end: Schema.Attribute.DateTime & Schema.Attribute.Required;
|
||||
datetime_start: Schema.Attribute.DateTime & Schema.Attribute.Required;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<'oneToMany', 'api::block.block'> &
|
||||
Schema.Attribute.Private;
|
||||
master: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>;
|
||||
orders: Schema.Attribute.Relation<'oneToMany', 'api::order.order'>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
sessions_completed: Schema.Attribute.Integer &
|
||||
Schema.Attribute.DefaultTo<0>;
|
||||
sessions_total: Schema.Attribute.Integer &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.DefaultTo<10>;
|
||||
state: Schema.Attribute.Enumeration<['created', 'paid', 'deleted']> &
|
||||
Schema.Attribute.DefaultTo<'created'>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'customers';
|
||||
info: {
|
||||
@ -424,18 +387,24 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
|
||||
attributes: {
|
||||
active: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||
bannedUntil: Schema.Attribute.DateTime;
|
||||
blocks: Schema.Attribute.Relation<'oneToMany', 'api::block.block'>;
|
||||
clients: Schema.Attribute.Relation<'manyToMany', 'api::customer.customer'>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
customer_setting: Schema.Attribute.Relation<
|
||||
'oneToOne',
|
||||
'api::customer.customer-setting'
|
||||
>;
|
||||
invited: Schema.Attribute.Relation<'manyToMany', 'api::customer.customer'>;
|
||||
invitedBy: Schema.Attribute.Relation<
|
||||
'manyToMany',
|
||||
'api::customer.customer'
|
||||
>;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::customer.customer'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
masters: Schema.Attribute.Relation<'manyToMany', 'api::customer.customer'>;
|
||||
name: Schema.Attribute.String &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.SetMinMaxLength<{
|
||||
@ -454,6 +423,14 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
|
||||
Schema.Attribute.Required;
|
||||
services: Schema.Attribute.Relation<'oneToMany', 'api::service.service'>;
|
||||
slots: Schema.Attribute.Relation<'oneToMany', 'api::slot.slot'>;
|
||||
subscription_rewards: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-reward.subscription-reward'
|
||||
>;
|
||||
subscriptions: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription.subscription'
|
||||
>;
|
||||
telegramId: Schema.Attribute.BigInteger & Schema.Attribute.Unique;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
@ -461,6 +438,36 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiCustomerCustomerSetting
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'customer_settings';
|
||||
info: {
|
||||
displayName: 'CustomerSettings';
|
||||
pluralName: 'customer-settings';
|
||||
singularName: 'customer-setting';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: false;
|
||||
};
|
||||
attributes: {
|
||||
autoRenewSubscription: Schema.Attribute.Boolean;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
customer: Schema.Attribute.Relation<'oneToOne', 'api::customer.customer'>;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::customer.customer-setting'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiOrderOrder extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'orders';
|
||||
info: {
|
||||
@ -473,7 +480,6 @@ export interface ApiOrderOrder extends Struct.CollectionTypeSchema {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
block: Schema.Attribute.Relation<'manyToOne', 'api::block.block'>;
|
||||
client: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
@ -508,7 +514,7 @@ export interface ApiServiceService extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'services';
|
||||
info: {
|
||||
description: '';
|
||||
displayName: 'service';
|
||||
displayName: 'Service';
|
||||
pluralName: 'services';
|
||||
singularName: 'service';
|
||||
};
|
||||
@ -551,36 +557,6 @@ export interface ApiServiceService extends Struct.CollectionTypeSchema {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSettingSetting extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'settings';
|
||||
info: {
|
||||
description: '';
|
||||
displayName: 'Setting';
|
||||
pluralName: 'settings';
|
||||
singularName: 'setting';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::setting.setting'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
recording_by_blocks: Schema.Attribute.Boolean &
|
||||
Schema.Attribute.DefaultTo<false>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSlotSlot extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'slots';
|
||||
info: {
|
||||
@ -611,6 +587,212 @@ export interface ApiSlotSlot extends Struct.CollectionTypeSchema {
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSubscriptionHistorySubscriptionHistory
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'subscription_histories';
|
||||
info: {
|
||||
displayName: 'SubscriptionHistory';
|
||||
pluralName: 'subscription-histories';
|
||||
singularName: 'subscription-history';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
amount: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
currency: Schema.Attribute.String & Schema.Attribute.DefaultTo<'RUB'>;
|
||||
description: Schema.Attribute.Text;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-history.subscription-history'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
paymentId: Schema.Attribute.String;
|
||||
period: Schema.Attribute.String &
|
||||
Schema.Attribute.SetMinMaxLength<{
|
||||
maxLength: 20;
|
||||
}>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
source: Schema.Attribute.Enumeration<
|
||||
['payment', 'trial', 'reward', 'admin', 'renewal']
|
||||
> &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.DefaultTo<'payment'>;
|
||||
state: Schema.Attribute.Enumeration<['success', 'failed', 'pending']> &
|
||||
Schema.Attribute.Required;
|
||||
subscription: Schema.Attribute.Relation<
|
||||
'oneToOne',
|
||||
'api::subscription.subscription'
|
||||
>;
|
||||
subscription_price: Schema.Attribute.Relation<
|
||||
'oneToOne',
|
||||
'api::subscription-price.subscription-price'
|
||||
>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSubscriptionPriceSubscriptionPrice
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'subscription_prices';
|
||||
info: {
|
||||
displayName: 'SubscriptionPrice';
|
||||
pluralName: 'subscription-prices';
|
||||
singularName: 'subscription-price';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
active: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<true>;
|
||||
amount: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
currency: Schema.Attribute.String & Schema.Attribute.DefaultTo<'RUB'>;
|
||||
days: Schema.Attribute.Integer & Schema.Attribute.Required;
|
||||
description: Schema.Attribute.Text;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-price.subscription-price'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
period: Schema.Attribute.Enumeration<
|
||||
['trial', 'week', 'month', 'half_year', 'year']
|
||||
> &
|
||||
Schema.Attribute.Required;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSubscriptionRewardSubscriptionReward
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'subscription_rewards';
|
||||
info: {
|
||||
displayName: 'SubscriptionReward';
|
||||
pluralName: 'subscription-rewards';
|
||||
singularName: 'subscription-reward';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
activated: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
days: Schema.Attribute.Integer & Schema.Attribute.Required;
|
||||
description: Schema.Attribute.Text;
|
||||
expiresAt: Schema.Attribute.DateTime & Schema.Attribute.Required;
|
||||
invited: Schema.Attribute.Relation<'oneToOne', 'api::customer.customer'>;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-reward.subscription-reward'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
owner: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
subscription: Schema.Attribute.Relation<
|
||||
'manyToOne',
|
||||
'api::subscription.subscription'
|
||||
>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSubscriptionSettingSubscriptionSetting
|
||||
extends Struct.SingleTypeSchema {
|
||||
collectionName: 'subscription_settings';
|
||||
info: {
|
||||
displayName: 'SubscriptionSettings';
|
||||
pluralName: 'subscription-settings';
|
||||
singularName: 'subscription-setting';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-setting.subscription-setting'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
maxOrdersPerMonth: Schema.Attribute.Integer &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.DefaultTo<20>;
|
||||
proEnabled: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
referralRewardDays: Schema.Attribute.Integer &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.DefaultTo<1>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ApiSubscriptionSubscription
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'subscriptions';
|
||||
info: {
|
||||
displayName: 'Subscription';
|
||||
pluralName: 'subscriptions';
|
||||
singularName: 'subscription';
|
||||
};
|
||||
options: {
|
||||
draftAndPublish: true;
|
||||
};
|
||||
attributes: {
|
||||
active: Schema.Attribute.Boolean &
|
||||
Schema.Attribute.Required &
|
||||
Schema.Attribute.DefaultTo<false>;
|
||||
createdAt: Schema.Attribute.DateTime;
|
||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
customer: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>;
|
||||
expiresAt: Schema.Attribute.DateTime & Schema.Attribute.Required;
|
||||
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||
localizations: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription.subscription'
|
||||
> &
|
||||
Schema.Attribute.Private;
|
||||
nextSubscription: Schema.Attribute.Relation<
|
||||
'oneToOne',
|
||||
'api::subscription.subscription'
|
||||
>;
|
||||
publishedAt: Schema.Attribute.DateTime;
|
||||
subscription_history: Schema.Attribute.Relation<
|
||||
'oneToOne',
|
||||
'api::subscription-history.subscription-history'
|
||||
>;
|
||||
subscription_rewards: Schema.Attribute.Relation<
|
||||
'oneToMany',
|
||||
'api::subscription-reward.subscription-reward'
|
||||
>;
|
||||
updatedAt: Schema.Attribute.DateTime;
|
||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||
Schema.Attribute.Private;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PluginContentReleasesRelease
|
||||
extends Struct.CollectionTypeSchema {
|
||||
collectionName: 'strapi_releases';
|
||||
@ -1120,12 +1302,16 @@ declare module '@strapi/strapi' {
|
||||
'admin::transfer-token': AdminTransferToken;
|
||||
'admin::transfer-token-permission': AdminTransferTokenPermission;
|
||||
'admin::user': AdminUser;
|
||||
'api::block.block': ApiBlockBlock;
|
||||
'api::customer.customer': ApiCustomerCustomer;
|
||||
'api::customer.customer-setting': ApiCustomerCustomerSetting;
|
||||
'api::order.order': ApiOrderOrder;
|
||||
'api::service.service': ApiServiceService;
|
||||
'api::setting.setting': ApiSettingSetting;
|
||||
'api::slot.slot': ApiSlotSlot;
|
||||
'api::subscription-history.subscription-history': ApiSubscriptionHistorySubscriptionHistory;
|
||||
'api::subscription-price.subscription-price': ApiSubscriptionPriceSubscriptionPrice;
|
||||
'api::subscription-reward.subscription-reward': ApiSubscriptionRewardSubscriptionReward;
|
||||
'api::subscription-setting.subscription-setting': ApiSubscriptionSettingSubscriptionSetting;
|
||||
'api::subscription.subscription': ApiSubscriptionSubscription;
|
||||
'plugin::content-releases.release': PluginContentReleasesRelease;
|
||||
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
||||
'plugin::i18n.locale': PluginI18NLocale;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user