add new entity customer_setting

This commit is contained in:
vchikalkin 2025-09-16 15:30:07 +03:00
parent 67da211238
commit 2cebfe90bd
4 changed files with 65 additions and 8 deletions

View 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"
}
}
}

View File

@ -87,6 +87,12 @@
"relation": "oneToMany",
"target": "api::subscription-reward.subscription-reward",
"mappedBy": "owner"
},
"customer_setting": {
"type": "relation",
"relation": "oneToOne",
"target": "api::customer.customer-setting",
"inversedBy": "customer"
}
}
}

View File

@ -26,11 +26,6 @@
"type": "datetime",
"required": true
},
"autoRenew": {
"type": "boolean",
"required": true,
"default": false
},
"subscription_history": {
"type": "relation",
"relation": "oneToOne",

View File

@ -390,6 +390,10 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
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',
@ -434,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: {
@ -728,9 +762,6 @@ export interface ApiSubscriptionSubscription
active: Schema.Attribute.Boolean &
Schema.Attribute.Required &
Schema.Attribute.DefaultTo<false>;
autoRenew: Schema.Attribute.Boolean &
Schema.Attribute.Required &
Schema.Attribute.DefaultTo<false>;
createdAt: Schema.Attribute.DateTime;
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
@ -1271,6 +1302,7 @@ declare module '@strapi/strapi' {
'admin::transfer-token-permission': AdminTransferTokenPermission;
'admin::user': AdminUser;
'api::customer.customer': ApiCustomerCustomer;
'api::customer.customer-setting': ApiCustomerCustomerSetting;
'api::order.order': ApiOrderOrder;
'api::service.service': ApiServiceService;
'api::slot.slot': ApiSlotSlot;