From 7436ad181b15ab6fa7f802e4914d7ceb0394dd44 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Mon, 8 Sep 2025 13:22:56 +0300 Subject: [PATCH] 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. --- src/api/customer/content-types/customer/schema.json | 8 ++++---- types/generated/contentTypes.d.ts | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api/customer/content-types/customer/schema.json b/src/api/customer/content-types/customer/schema.json index 6f11f2a..5ea221f 100644 --- a/src/api/customer/content-types/customer/schema.json +++ b/src/api/customer/content-types/customer/schema.json @@ -40,17 +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" + "mappedBy": "invited" }, "blocks": { "type": "relation", diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 8b4adf4..d0964e1 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -425,17 +425,20 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema { active: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo; 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; + 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<{