diff --git a/src/api/customer/content-types/customer/schema.json b/src/api/customer/content-types/customer/schema.json index 88923f0..a0b2823 100644 --- a/src/api/customer/content-types/customer/schema.json +++ b/src/api/customer/content-types/customer/schema.json @@ -70,6 +70,12 @@ }, "photoUrl": { "type": "string" + }, + "services": { + "type": "relation", + "relation": "oneToMany", + "target": "api::service.service", + "mappedBy": "master" } } } diff --git a/src/api/service/content-types/service/schema.json b/src/api/service/content-types/service/schema.json index 4d57222..2bfef79 100644 --- a/src/api/service/content-types/service/schema.json +++ b/src/api/service/content-types/service/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "service", "pluralName": "services", - "displayName": "service" + "displayName": "service", + "description": "" }, "options": { "draftAndPublish": true @@ -19,6 +20,12 @@ "relation": "manyToMany", "target": "api::order.order", "mappedBy": "services" + }, + "master": { + "type": "relation", + "relation": "manyToOne", + "target": "api::customer.customer", + "inversedBy": "services" } } } diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index fd2fe62..4605967 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -440,6 +440,7 @@ export interface ApiCustomerCustomer extends Struct.CollectionTypeSchema { publishedAt: Schema.Attribute.DateTime; role: Schema.Attribute.Enumeration<['client', 'master']> & Schema.Attribute.Required; + services: Schema.Attribute.Relation<'oneToMany', 'api::service.service'>; slots: Schema.Attribute.Relation<'oneToMany', 'api::slot.slot'>; telegramId: Schema.Attribute.BigInteger & Schema.Attribute.Unique; updatedAt: Schema.Attribute.DateTime; @@ -465,6 +466,7 @@ export interface ApiOrderOrder extends Struct.CollectionTypeSchema { createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & Schema.Attribute.Private; + date: Schema.Attribute.Date; locale: Schema.Attribute.String & Schema.Attribute.Private; localizations: Schema.Attribute.Relation<'oneToMany', 'api::order.order'> & Schema.Attribute.Private; @@ -489,6 +491,7 @@ export interface ApiOrderOrder extends Struct.CollectionTypeSchema { export interface ApiServiceService extends Struct.CollectionTypeSchema { collectionName: 'services'; info: { + description: ''; displayName: 'service'; pluralName: 'services'; singularName: 'service'; @@ -506,6 +509,7 @@ export interface ApiServiceService extends Struct.CollectionTypeSchema { 'api::service.service' > & Schema.Attribute.Private; + master: Schema.Attribute.Relation<'manyToOne', 'api::customer.customer'>; name: Schema.Attribute.String; orders: Schema.Attribute.Relation<'manyToMany', 'api::order.order'>; publishedAt: Schema.Attribute.DateTime;