diff --git a/server/planning/assignments/delivery_service.py b/server/planning/assignments/delivery_service.py index eb88389b8..9c11f061e 100644 --- a/server/planning/assignments/delivery_service.py +++ b/server/planning/assignments/delivery_service.py @@ -1,6 +1,6 @@ -from planning.core.service import BasePlanningAsyncService from planning.types import DeliveryResourceModel +from superdesk.core.resources import AsyncResourceService -class DeliveryAsyncService(BasePlanningAsyncService[DeliveryResourceModel]): +class DeliveryAsyncService(AsyncResourceService[DeliveryResourceModel]): pass diff --git a/server/planning/assignments/module.py b/server/planning/assignments/module.py index 5d882a3f9..5964c6650 100644 --- a/server/planning/assignments/module.py +++ b/server/planning/assignments/module.py @@ -46,23 +46,26 @@ name="planning_id_1", keys=[("planning_id", 1)], background=True, + unique=False, ), MongoIndexOptions( name="assignment_id_1", keys=[("assignment_id", 1)], background=True, + unique=False, ), MongoIndexOptions( name="coverage_id_1", keys=[("coverage_id", 1)], background=True, + unique=False, ), MongoIndexOptions( name="item_id_1", keys=[("item_id", 1)], background=True, + unique=False, ), ], ), - elastic=ElasticResourceConfig(), ) diff --git a/server/planning/types/delivery.py b/server/planning/types/delivery.py index a8e3dd2d4..7ce8bde87 100644 --- a/server/planning/types/delivery.py +++ b/server/planning/types/delivery.py @@ -2,12 +2,11 @@ from typing import Annotated from datetime import datetime -from superdesk.core.resources import fields +from superdesk.core.resources import ResourceModelWithObjectId, fields from superdesk.core.resources.validators import validate_data_relation_async -from .base import BasePlanningModel -class DeliveryResourceModel(BasePlanningModel): +class DeliveryResourceModel(ResourceModelWithObjectId): planning_id: Annotated[fields.Keyword, validate_data_relation_async("planning")] coverage_id: str | None = None assignment_id: Annotated[fields.ObjectId, validate_data_relation_async("assignments")]