add type 'service'

This commit is contained in:
vchikalkin 2025-02-12 11:16:44 +03:00
parent b30e9e46fb
commit 554fa6adc0
6 changed files with 84 additions and 2 deletions

View File

@ -26,7 +26,7 @@
"price": {
"type": "integer"
},
"service": {
"service_description": {
"type": "text"
},
"client": {
@ -55,6 +55,12 @@
},
"time_end": {
"type": "time"
},
"services": {
"type": "relation",
"relation": "manyToMany",
"target": "api::service.service",
"inversedBy": "orders"
}
}
}

View File

@ -0,0 +1,24 @@
{
"kind": "collectionType",
"collectionName": "services",
"info": {
"singularName": "service",
"pluralName": "services",
"displayName": "service"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string"
},
"orders": {
"type": "relation",
"relation": "manyToMany",
"target": "api::order.order",
"mappedBy": "services"
}
}
}

View File

@ -0,0 +1,7 @@
/**
* service controller
*/
import { factories } from '@strapi/strapi'
export default factories.createCoreController('api::service.service');

View File

@ -0,0 +1,7 @@
/**
* service router
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreRouter('api::service.service');

View File

@ -0,0 +1,7 @@
/**
* service service
*/
import { factories } from '@strapi/strapi';
export default factories.createCoreService('api::service.service');

View File

@ -471,7 +471,8 @@ export interface ApiOrderOrder extends Struct.CollectionTypeSchema {
order_number: Schema.Attribute.Integer;
price: Schema.Attribute.Integer;
publishedAt: Schema.Attribute.DateTime;
service: Schema.Attribute.Text;
service_description: Schema.Attribute.Text;
services: Schema.Attribute.Relation<'manyToMany', 'api::service.service'>;
slot: Schema.Attribute.Relation<'manyToOne', 'api::slot.slot'>;
state: Schema.Attribute.Enumeration<
['created', 'scheduled', 'approved', 'completed', 'cancelled']
@ -485,6 +486,35 @@ export interface ApiOrderOrder extends Struct.CollectionTypeSchema {
};
}
export interface ApiServiceService extends Struct.CollectionTypeSchema {
collectionName: 'services';
info: {
displayName: 'service';
pluralName: 'services';
singularName: 'service';
};
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::service.service'
> &
Schema.Attribute.Private;
name: Schema.Attribute.String;
orders: Schema.Attribute.Relation<'manyToMany', 'api::order.order'>;
publishedAt: Schema.Attribute.DateTime;
updatedAt: Schema.Attribute.DateTime;
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
Schema.Attribute.Private;
};
}
export interface ApiSettingSetting extends Struct.CollectionTypeSchema {
collectionName: 'settings';
info: {
@ -1058,6 +1088,7 @@ declare module '@strapi/strapi' {
'api::block.block': ApiBlockBlock;
'api::customer.customer': ApiCustomerCustomer;
'api::order.order': ApiOrderOrder;
'api::service.service': ApiServiceService;
'api::setting.setting': ApiSettingSetting;
'api::slot.slot': ApiSlotSlot;
'plugin::content-releases.release': PluginContentReleasesRelease;