using adas_core.Domain.Enums; using adas_core.Domain.Models.DTO.Display; using adas_core.Domain.Models.Filter; using adas_core.Domain.Models.GroupedObservations; using adas_core.Domain.Models.MongoModels; using adas_core.Domain.Models.Responses; using MongoDB.Bson; namespace adas_core.Application.Services.Interfaces; public interface IDisplayConfigService { /// /// Retrieves all display configurations asynchronously. /// /// A task that represents the asynchronous operation. The task result contains a list of all entries. Task> GetAll(); /// /// Retrieves a paginated list of display configurations in a compact (minimal) representation. /// /// The pagination filter that controls page size, page number, and sorting criteria. /// A task that represents the asynchronous operation, containing a with the compact display configuration entries. Task> GetAllCompactPaginated(PaginationFilter request); /// /// Retrieves a list of display configurations filtered by the specified display type. /// /// The display type used to filter the configurations. /// A task that represents the asynchronous operation, containing a list of objects matching the specified type. Task> GetByType(DisplayConfigEnums.DisplayType type); /// /// Asynchronously retrieves a by its identifier. /// /// The unique identifier of the display configuration to retrieve. /// A task that represents the asynchronous operation, containing the matching the specified identifier. Task GetById(ObjectId id); /// /// Asynchronously retrieves a identified by the specified configuration identifier, unit identifier, and display type. /// /// The optional identifier of the display configuration to look up; may be null when searching without a specific configuration. /// The identifier of the unit the display configuration belongs to. /// The display type used to filter or scope the lookup. /// A that resolves to the matching , or null if no configuration is found. Task GetById(ObjectId? configId, ObjectId unitId, DisplayConfigEnums.DisplayType displayType); /// /// Inserts a single display configuration asynchronously and returns the resulting configuration, or null when no record is produced. /// /// The display configuration to insert. /// A task that represents the asynchronous insert operation, containing the inserted or null. Task InsertOne(DisplayConfig config); /// /// Inserts a new display configuration in a minimal fashion and returns the created , or null when no configuration could be produced. /// /// The data transfer object containing the values used to create the new display configuration. /// A that yields the created when successful, or null when no result is available. Task InsertOneMinimal(CreateDisplayConfigDto config); /// /// Performs a test insertion operation that returns a instance, used to validate insertion behavior. /// /// A representing the asynchronous test insertion result. Task InsertOneTest(); /// /// Updates the display configuration identified by the specified identifier with the provided new configuration data. /// /// The unique identifier of the display configuration to update. /// The new display configuration data to apply to the existing configuration. /// The updated , or null if no display configuration with the specified identifier is found. Task UpdateConfig(ObjectId displayConfigId, object newDisplayConfig); /// /// Updates the list of fields associated with the specified configuration display. /// /// The identifier of the configuration display whose field list will be updated. /// The list of fields to be applied to the configuration display. /// A task that represents the asynchronous operation. The task result contains a value indicating whether the update was successful. Task UpdateFieldList(ObjectId objectIdConfigDisplay, List fields); /// /// Updates the color configuration for the specified config display. /// /// The identifier of the config display whose color configuration will be updated. /// The color configuration data to apply to the config display. /// A task that represents the asynchronous operation. The task result contains true if the update was successful; otherwise, false. Task UpdateConfigColor(ObjectId objectIdConfigDisplay, ColorConfig colorConfigDto); /// /// Asynchronously updates the header configuration associated with the specified config display identifier. /// /// The identifier of the config display whose header configuration will be updated. /// The new header configuration to apply. /// A task that represents the asynchronous operation. The task result contains true if the update was successful; otherwise, false. Task UpdateHeaderConfig(ObjectId objectIdConfigDisplay, HeaderConfig headerConfig); /// /// Updates the home banner configuration for the specified config display with the provided list of banner items. /// /// The identifier of the config display whose home banner will be updated. /// The list of banner items to set as the home banner configuration. /// A task that represents the asynchronous operation. The task result contains true if the home banner was updated successfully; otherwise, false. Task UpdateSetHomeBanner(ObjectId objectIdConfigDisplay, List bannerItems); /// /// Updates the base display configuration with the specified settings. /// /// The display configuration to apply as the new base configuration. /// A task that represents the asynchronous update operation. The task result contains a boolean value indicating whether the update was successful. Task UpdateBaseConfig(DisplayConfig baseConfig); /// /// Asynchronously updates the hospital name associated with the specified display configuration. /// /// The identifier of the display configuration whose hospital name will be updated. /// The new hospital name to apply to the display configuration. /// A task that resolves to true if the update was applied successfully; otherwise, false. Task UpdateDisplayConfigHospitalName(ObjectId objectIdConfigDisplay, string name); /// /// Deletes a display configuration identified by the specified object identifier. /// /// The unique identifier of the display configuration to delete. /// A task that represents the asynchronous delete operation. The task result contains a boolean value indicating whether the display configuration was successfully deleted. Task DeleteDisplayConfig(ObjectId objectIdConfigDisplay); /// /// Asynchronously retrieves the default display configuration for the specified display type. /// /// The display type used to look up the default configuration. /// A task that represents the asynchronous operation, containing the default for the given display type, or null if no default configuration is available. Task GetDefaultConfig(DisplayConfigEnums.DisplayType type); /// /// Retrieves the list of display configuration locations associated with the specified configuration display identifier. /// /// The ObjectId of the configuration display whose locations are to be retrieved. /// A task that represents the asynchronous operation, containing a list of DisplayConfigLocationDto objects for the specified configuration display. Task> GetDisplayConfigLocations(ObjectId objectIdConfigDisplay); /// /// Asynchronously retrieves all display configurations in a compact (minimal) representation. /// /// A task that represents the asynchronous operation. The task result contains a list of objects representing the compact display configurations. Task> GetAllCompact(); /// /// Inserts a new display configuration record using a predefined template, optionally scoped to a specific hospital context. /// /// The identifier of the object the display configuration is associated with. /// The type of display configuration template to use for the insertion. /// The optional hospital identifier used to scope the configuration; may be null when the configuration is not hospital-specific. /// A task that represents the asynchronous operation, containing the inserted , or null if the configuration could not be created. Task InsertOneWithTemplate(string objectId, DisplayConfigEnums.DisplayType configType, string? configHospital); /// /// Updates the card configuration based on the provided settings. /// /// The card configuration to be updated. /// A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the update was successful. Task UpdateCardConfig(CardConfig baseConfig); /// /// Inserts a new card configuration using the supplied data and returns the resulting , or null if no card config is created. /// /// The DTO containing the data used to create the display config card. /// A task that resolves to the inserted , or null if the insert did not produce a card config. Task InsertCardConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto); /// /// Asynchronously retrieves all card configurations. /// /// A task that represents the asynchronous operation. The task result contains a list of all items. Task> GetCardConfigAll(); /// /// Retrieves the card configuration associated with the specified identifier. /// Returns null when no matching card configuration is found. /// /// The unique identifier of the card configuration to retrieve. /// A task that represents the asynchronous operation. The task result contains the if found; otherwise, null. Task GetCardConfigById(ObjectId id); /// /// Asynchronously updates the card details configuration based on the provided base configuration. /// /// The base card details configuration to apply during the update. /// A task that represents the asynchronous operation, containing a boolean value indicating whether the update was successful. Task UpdateDetailConfig(CardDetailsConfig baseConfig); /// /// Inserts a new card detail configuration based on the provided display config data. /// /// The DTO containing the data required to create the card detail configuration. /// A task that resolves to the created , or null if the configuration could not be inserted. Task InsertCardDetailConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto); /// /// Inserts a new chart configuration based on the provided display config card data. /// /// The data transfer object containing the details of the chart configuration to create. /// A task that represents the asynchronous operation, containing the newly inserted , or null if the insertion was not successful. Task InsertChartConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto); /// /// Asynchronously updates the chart configuration based on the provided base configuration and returns a value indicating whether the update was successful. /// /// The base chart configuration to apply during the update. /// A task that represents the asynchronous operation. The result is true if the chart configuration was updated successfully; otherwise, false. Task UpdateChartConfig(ChartConfig baseConfig); /// /// Asynchronously deletes a chart configuration identified by the specified configuration display identifier. /// /// The of the chart configuration display to delete. /// A task that represents the asynchronous delete operation, containing a value indicating whether the deletion was successful. Task DeleteChartConfig(ObjectId objectIdConfigDisplay); /// /// Asynchronously retrieves the chart configuration associated with the specified chart identifier. /// /// The unique identifier of the chart whose configuration should be fetched. /// A task that represents the asynchronous operation. The task result contains the associated with the provided identifier, or null if no configuration is found. Task GetChartConfig(ObjectId objectIdConfigChart); }