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.
This commit is contained in:
vchikalkin 2025-09-08 13:22:56 +03:00
parent 0cb35adefa
commit 7436ad181b
2 changed files with 9 additions and 6 deletions

View File

@ -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",

View File

@ -425,17 +425,20 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema {
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;
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<{