# Class MasterListController

Namespace
  adas_core.Controllers

Assembly
  adas-core.dll

    [Route("master-lists")]
    [ApiController]
    public class MasterListController : ControllerBase

Inheritance
  object
  ControllerBase
  MasterListController

Inherited Members
  ControllerBase.StatusCode(int)
  ControllerBase.StatusCode(int, object)
  ControllerBase.Content(string)
  ControllerBase.Content(string, string)
  ControllerBase.Content(string, string, Encoding)
  ControllerBase.Content(string, MediaTypeHeaderValue)
  ControllerBase.NoContent()
  ControllerBase.Ok()
  ControllerBase.Ok(object)
  ControllerBase.Redirect(string)
  ControllerBase.RedirectPermanent(string)
  ControllerBase.RedirectPreserveMethod(string)
  ControllerBase.RedirectPermanentPreserveMethod(string)
  ControllerBase.LocalRedirect(string)
  ControllerBase.LocalRedirectPermanent(string)
  ControllerBase.LocalRedirectPreserveMethod(string)
  ControllerBase.LocalRedirectPermanentPreserveMethod(string)
  ControllerBase.RedirectToAction()
  ControllerBase.RedirectToAction(string)
  ControllerBase.RedirectToAction(string, object)
  ControllerBase.RedirectToAction(string, string)
  ControllerBase.RedirectToAction(string, string, object)
  ControllerBase.RedirectToAction(string, string, string)
  ControllerBase.RedirectToAction(string, string, object, string)
  ControllerBase.RedirectToActionPreserveMethod(string, string, object, string)
  ControllerBase.RedirectToActionPermanent(string)
  ControllerBase.RedirectToActionPermanent(string, object)
  ControllerBase.RedirectToActionPermanent(string, string)
  ControllerBase.RedirectToActionPermanent(string, string, string)
  ControllerBase.RedirectToActionPermanent(string, string, object)
  ControllerBase.RedirectToActionPermanent(string, string, object, string)
  ControllerBase.RedirectToActionPermanentPreserveMethod(string, string, object, string)
  ControllerBase.RedirectToRoute(string)
  ControllerBase.RedirectToRoute(object)
  ControllerBase.RedirectToRoute(string, object)
  ControllerBase.RedirectToRoute(string, string)
  ControllerBase.RedirectToRoute(string, object, string)
  ControllerBase.RedirectToRoutePreserveMethod(string, object, string)
  ControllerBase.RedirectToRoutePermanent(string)
  ControllerBase.RedirectToRoutePermanent(object)
  ControllerBase.RedirectToRoutePermanent(string, object)
  ControllerBase.RedirectToRoutePermanent(string, string)
  ControllerBase.RedirectToRoutePermanent(string, object, string)
  ControllerBase.RedirectToRoutePermanentPreserveMethod(string, object, string)
  ControllerBase.RedirectToPage(string)
  ControllerBase.RedirectToPage(string, object)
  ControllerBase.RedirectToPage(string, string)
  ControllerBase.RedirectToPage(string, string, object)
  ControllerBase.RedirectToPage(string, string, string)
  ControllerBase.RedirectToPage(string, string, object, string)
  ControllerBase.RedirectToPagePermanent(string)
  ControllerBase.RedirectToPagePermanent(string, object)
  ControllerBase.RedirectToPagePermanent(string, string)
  ControllerBase.RedirectToPagePermanent(string, string, string)
  ControllerBase.RedirectToPagePermanent(string, string, object, string)
  ControllerBase.RedirectToPagePreserveMethod(string, string, object, string)
  ControllerBase.RedirectToPagePermanentPreserveMethod(string, string, object, string)
  ControllerBase.File(byte[], string)
  ControllerBase.File(byte[], string, bool)
  ControllerBase.File(byte[], string, string)
  ControllerBase.File(byte[], string, string, bool)
  ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(Stream, string)
  ControllerBase.File(Stream, string, bool)
  ControllerBase.File(Stream, string, string)
  ControllerBase.File(Stream, string, string, bool)
  ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(string, string)
  ControllerBase.File(string, string, bool)
  ControllerBase.File(string, string, string)
  ControllerBase.File(string, string, string, bool)
  ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.PhysicalFile(string, string)
  ControllerBase.PhysicalFile(string, string, bool)
  ControllerBase.PhysicalFile(string, string, string)
  ControllerBase.PhysicalFile(string, string, string, bool)
  ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.Unauthorized()
  ControllerBase.Unauthorized(object)
  ControllerBase.NotFound()
  ControllerBase.NotFound(object)
  ControllerBase.BadRequest()
  ControllerBase.BadRequest(object)
  ControllerBase.BadRequest(ModelStateDictionary)
  ControllerBase.UnprocessableEntity()
  ControllerBase.UnprocessableEntity(object)
  ControllerBase.UnprocessableEntity(ModelStateDictionary)
  ControllerBase.Conflict()
  ControllerBase.Conflict(object)
  ControllerBase.Conflict(ModelStateDictionary)
  ControllerBase.Problem(string, string, int?, string, string)
  ControllerBase.ValidationProblem(ValidationProblemDetails)
  ControllerBase.ValidationProblem(ModelStateDictionary)
  ControllerBase.ValidationProblem()
  ControllerBase.ValidationProblem(string, string, int?, string, string, ModelStateDictionary)
  ControllerBase.Created()
  ControllerBase.Created(string, object)
  ControllerBase.Created(Uri, object)
  ControllerBase.CreatedAtAction(string, object)
  ControllerBase.CreatedAtAction(string, object, object)
  ControllerBase.CreatedAtAction(string, string, object, object)
  ControllerBase.CreatedAtRoute(string, object)
  ControllerBase.CreatedAtRoute(object, object)
  ControllerBase.CreatedAtRoute(string, object, object)
  ControllerBase.Accepted()
  ControllerBase.Accepted(object)
  ControllerBase.Accepted(Uri)
  ControllerBase.Accepted(string)
  ControllerBase.Accepted(string, object)
  ControllerBase.Accepted(Uri, object)
  ControllerBase.AcceptedAtAction(string)
  ControllerBase.AcceptedAtAction(string, string)
  ControllerBase.AcceptedAtAction(string, object)
  ControllerBase.AcceptedAtAction(string, string, object)
  ControllerBase.AcceptedAtAction(string, object, object)
  ControllerBase.AcceptedAtAction(string, string, object, object)
  ControllerBase.AcceptedAtRoute(object)
  ControllerBase.AcceptedAtRoute(string)
  ControllerBase.AcceptedAtRoute(string, object)
  ControllerBase.AcceptedAtRoute(object, object)
  ControllerBase.AcceptedAtRoute(string, object, object)
  ControllerBase.Challenge()
  ControllerBase.Challenge(params string[])
  ControllerBase.Challenge(AuthenticationProperties)
  ControllerBase.Challenge(AuthenticationProperties, params string[])
  ControllerBase.Forbid()
  ControllerBase.Forbid(params string[])
  ControllerBase.Forbid(AuthenticationProperties)
  ControllerBase.Forbid(AuthenticationProperties, params string[])
  ControllerBase.SignIn(ClaimsPrincipal)
  ControllerBase.SignIn(ClaimsPrincipal, string)
  ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties)
  ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties, string)
  ControllerBase.SignOut()
  ControllerBase.SignOut(AuthenticationProperties)
  ControllerBase.SignOut(params string[])
  ControllerBase.SignOut(AuthenticationProperties, params string[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, params Expression<Func<TModel, object>>[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, Func<ModelMetadata, bool>)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, params Expression<Func<TModel, object>>[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, Func<ModelMetadata, bool>)
  ControllerBase.TryUpdateModelAsync(object, Type, string)
  ControllerBase.TryUpdateModelAsync(object, Type, string, IValueProvider, Func<ModelMetadata, bool>)
  ControllerBase.TryValidateModel(object)
  ControllerBase.TryValidateModel(object, string)
  ControllerBase.HttpContext
  ControllerBase.Request
  ControllerBase.Response
  ControllerBase.RouteData
  ControllerBase.ModelState
  ControllerBase.ControllerContext
  ControllerBase.MetadataProvider
  ControllerBase.ModelBinderFactory
  ControllerBase.Url
  ControllerBase.ObjectValidator
  ControllerBase.ProblemDetailsFactory
  ControllerBase.User
  ControllerBase.Empty
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Constructors

### MasterListController(IMasterListServiceFactory, ILogger<MasterListController>, IOptions<ListSettings>)

    public MasterListController(IMasterListServiceFactory serviceFactory, ILogger<MasterListController> logger, IOptions<ListSettings> listSettings)

#### Parameters

`serviceFactory` IMasterListServiceFactory
`logger` ILogger<MasterListController>
`listSettings` IOptions<ListSettings>

## Methods

### AddOptionToMasterList(string, string, FilterOptionListElement)

Adds a filter option to a master list identified by its type name and id. Validates that the type name maps to a known master list type and that the id has a valid format before delegating the operation to the service resolved through the service factory.

    [HttpPost("{typeName}/{id}/item")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> AddOptionToMasterList(string typeName, string id, FilterOptionListElement opt)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the appropriate service.

`id` string

  The string representation of the master list identifier.

`opt` FilterOptionListElement

  The filter option element to add to the master list, supplied in the request body.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the add operation.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed into a valid `MasterListType` value.

BadRequestException

  Thrown when `id` is not a valid `ObjectId` format.

### DeleteMasterList(string, string)

Deletes a master list item identified by its type name and identifier. Validates that the supplied type name maps to a known MasterListType and that the identifier is a valid ObjectId before delegating the deletion to the corresponding service.

    [HttpDelete("{typeName}/{id}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> DeleteMasterList(string typeName, string id)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the appropriate service.

`id` string

  The string representation of the master list item's ObjectId to delete.

#### Returns

Task<IActionResult>

  An IActionResult that returns `Ok` when the master list item is successfully deleted.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed as a MasterListType value.

BadRequestException

  Thrown when `id` is not a valid ObjectId format.

### DeleteOptionFromMasterList(string, string, string)

Deletes a specific option from a master list, identified by its type, master list ID, and item ID. Validates that the type is a known master list type and that both the master list and item identifiers are valid ObjectId values. If the deletion produces no result, a conflict exception is thrown.

    [HttpDelete("{typeName}/{id}/item/{itemId}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> DeleteOptionFromMasterList(string typeName, string id, string itemId)

#### Parameters

`typeName` string

  The name of the master list type, used to resolve the appropriate service and parse to MasterListType.

`id` string

  The ObjectId of the master list containing the option to delete.

`itemId` string

  The ObjectId of the master list option to remove.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the deletion operation.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not match a known master list type.

BadRequestException

  Thrown when `id` or `itemId` are not valid ObjectId values.

ConflictException

  Thrown when the deletion operation returns no result.

### GetAllMasterListCounts()

Retrieves the record count for every MasterListType by resolving the corresponding service through the service factory and aggregating the results into a single dictionary. Requires the "AuthSome" role and the "DisplayId" permission on the "Source" resource.

    [HttpGet("count")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetAllMasterListCounts()

#### Returns

Task<IActionResult>

  An IActionResult containing a Dictionary<TKey, TValue> that maps each MasterListType to its total record count, returned with HTTP 200 OK.

### GetAllMasterListWithoutOptions()

Retrieves all master list entries (without their associated options) for every MasterListType value, aggregating the results from each type's dedicated service resolved through the service factory.

    [HttpGet("no-options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetAllMasterListWithoutOptions()

#### Returns

Task<IActionResult>

  An IActionResult containing an HTTP 200 response with the combined collection of MasterListDto items gathered from all master list services.

### GetMasterList(string)

Retrieves a master list for the specified type by resolving the appropriate service through the service factory and returning its full collection of records.

    [HttpGet("{typeName}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterList(string typeName)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the corresponding service.

#### Returns

Task<IActionResult>

  An IActionResult containing the master list data when the specified type is valid.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not correspond to a valid `MasterListType` value.

### GetMasterListById(string, string)

Retrieves a master list entry of the specified type by its unique identifier, delegating the lookup to the appropriate service resolved by the master list type.

    [HttpGet("{typeName}/{id}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListById(string typeName, string id)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the corresponding service.

`id` string

  The unique identifier of the master list entry to retrieve.

#### Returns

Task<IActionResult>

  An IActionResult containing the requested master list entry.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed as a valid `MasterListType`.

BadRequestException

  Thrown when `id` is not in a valid `ObjectId` format.

### GetMasterListByIdAndSearchOptions(string, string, FilterOptionListElement)

Busca las opciones que contengan un texto de una lista determinada

    [HttpPost("{typeName}/{id}/options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListByIdAndSearchOptions(string typeName, string id, FilterOptionListElement searchOptions)

#### Parameters

`typeName` string

  Tipo de Lista

`id` string

  id de la lista

`searchOptions` FilterOptionListElement

#### Returns

Task<IActionResult>

### GetMasterListByIdWithPaginatedOptions(string, string, PaginationFilter)

Retrieves paginated options for a master list entry by its type and identifier. Validates the type name against the supported MasterListType values and ensures the identifier is a valid ObjectId, delegating the actual retrieval to the appropriate service resolved through the service factory.

    [HttpPost("{typeName}/{id}/master-list-paginated-options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListByIdWithPaginatedOptions(string typeName, string id, PaginationFilter request)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the corresponding service.

`id` string

  The string representation of the master list identifier, which must be a valid ObjectId.

`request` PaginationFilter

  The pagination filter applied to the master list options query.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated master list options returned by the resolved service.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not correspond to a valid MasterListType value.

BadRequestException

  Thrown when `id` is not a valid ObjectId format.

### GetMasterListByName(string, string)

Retrieves a master list entry by its name, resolving the appropriate service based on the provided type. Validates that the type name maps to a known MasterListType; otherwise returns a bad request.

    [HttpGet("{typeName}/{name}/name")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListByName(string typeName, string name)

#### Parameters

`typeName` string

  The string representation of the MasterListType used to resolve the backing service.

`name` string

  The name of the master list entry to look up.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the master list lookup.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed into a valid MasterListType.

### GetMasterListByTextSearch(string, string?)

Retrieves a master list filtered by a text search term, selecting the appropriate service implementation based on the specified master list type. Validates that the type name corresponds to a known MasterListType and that the search text meets the minimum length requirement.

    [HttpGet("{typeName}/{textSearch}/text")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListByTextSearch(string typeName, string? textSearch)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the corresponding service via the service factory.

`textSearch` string

  The text used to filter the master list entries. Must be at least 3 characters long.

#### Returns

Task<IActionResult>

  An IActionResult containing the filtered master list results returned by the resolved service.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed to a valid MasterListType value.

BadRequestException

  Thrown when `textSearch` is provided but is shorter than 3 characters.

### GetMasterListCount(string)

Retrieves the total count of master list items for a specified master list type.

    [HttpGet("{typeName}/count")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListCount(string typeName)

#### Parameters

`typeName` string

  The name of the master list type to count, parsed into the MasterListType enum.

#### Returns

Task<IActionResult>

  An IActionResult containing the count of master list items.

#### Exceptions

BadRequestException

  Thrown when the provided `typeName` cannot be parsed into a valid MasterListType.

### GetMasterListOptionsNamesById(string, string)

Retrieves the master list options names for a specific master list entry, identified by its type and ID. Validates that the provided type name corresponds to a known MasterListType and that the ID is a valid MongoDB.Bson.ObjectId, delegating the lookup to the service resolved for the matching master list type.

    [HttpGet("{typeName}/{id}/master-list-options-names")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListOptionsNamesById(string typeName, string id)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the appropriate service.

`id` string

  The identifier of the master list entry whose options names should be retrieved.

#### Returns

Task<IActionResult>

  An IActionResult containing the master list options names returned by the resolved service.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed as a MasterListType value.

BadRequestException

  Thrown when `id` is not a valid MongoDB.Bson.ObjectId format.

### GetMasterListSettings()

Retrieves the master list settings for the authenticated user with the required permission.

    [HttpGet("list-settings")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    public IActionResult GetMasterListSettings()

#### Returns

IActionResult

  An IActionResult containing the master list settings on success.

### GetMasterListWithPaginatedOptions(string, PaginationFilter)

Retrieves a paginated master list of items for the specified master list type. Validates the `typeName` against the MasterListType enumeration and resolves the appropriate service via the service factory to fetch the results.

    [HttpPost("{typeName}/paginated-options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetMasterListWithPaginatedOptions(string typeName, PaginationFilter request)

#### Parameters

`typeName` string

  The name of the master list type to query, matched against the MasterListType enumeration.

`request` PaginationFilter

  The pagination filter containing paging criteria applied to the master list query.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated master list result wrapped in an HTTP 200 OK response.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed into a valid MasterListType value.

### GetOptionTypeList(string, string, string)

Retrieves the related options master list associated with a given source list. Validates that the provided type names map to valid MasterListType values and that the list identifier is a valid ObjectId; resolves the related list id through the source list service and returns the corresponding master list for the default locale.

    [HttpGet("{typeName}/{listId}/related-options/{targetCategory}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetOptionTypeList(string typeName, string listId, string targetCategory)

#### Parameters

`typeName` string

  The name of the source MasterListType used to resolve the originating service.

`listId` string

  The identifier of the source master list from which the related list is resolved.

`targetCategory` string

  The name of the target MasterListType used to resolve the related options service.

#### Returns

Task<IActionResult>

  The MasterList containing the related options for the requested category.

#### Exceptions

BadRequestException

  Thrown when `typeName` or `targetCategory` cannot be parsed as a valid MasterListType, or when `listId` is not a valid ObjectId.

### GetPaginatedMasterList(PaginationFilter, string)

Retrieves a paginated master list of the specified type. Validates the `typeName` against the MasterListType enumeration and dispatches the request to the corresponding service resolved through the service factory.

    [HttpPost("{typeName}/paginated")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetPaginatedMasterList(PaginationFilter request, string typeName)

#### Parameters

`request` PaginationFilter

  The pagination filter containing paging criteria applied to the master list query.

`typeName` string

  The string identifier of the master list type, which is parsed into the MasterListType enum to resolve the appropriate service.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated master list result.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed into a valid MasterListType value.

### GetPaginatedMasterListWithPaginatedOptions(PaginationPairDto, string)

Retrieves a paginated master list along with its associated paginated options for the specified master list type, applying both list and option filters.

    [HttpPost("{typeName}/paginated-master-list-paginated-options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetPaginatedMasterListWithPaginatedOptions(PaginationPairDto filters, string typeName)

#### Parameters

`filters` PaginationPairDto

  The pagination pair DTO containing the list filter and option filter used to narrow the results.

`typeName` string

  The name of the master list type used to resolve the corresponding service through the service factory.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated master list result with its options.

#### Exceptions

BadRequestException

  Thrown when the provided `typeName` cannot be parsed as a valid `MasterListType`.

### GetPaginatedOptions(string, string, PaginationFilter)

Retrieves paginated options for a specified master list type and identifier, supporting role-based access and permission authorization.

    [HttpPost("{typeName}/{id}/paginated-options")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetPaginatedOptions(string typeName, string id, PaginationFilter request)

#### Parameters

`typeName` string

  The name of the master list type to resolve from MasterListType.

`id` string

  The identifier of the master list used to scope the paginated options.

`request` PaginationFilter

  The pagination filter applied to the requested options.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated options payload.

#### Exceptions

BadRequestException

  Thrown when `typeName` cannot be parsed as a valid MasterListType value.

BadRequestException

  Thrown when `id` is not a valid MongoDB.Bson.ObjectId format.

### InsertMasterListFromPanel(string, MasterList)

Inserts a master list from the panel based on the specified master list type. Validates that the request body is provided and that the type name corresponds to a valid MasterListType.

    [HttpPost("{typeName}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> InsertMasterListFromPanel(string typeName, MasterList master)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the target MasterListType.

`master` MasterList

  The master list payload received from the request body.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the insert operation.

#### Exceptions

BadRequestException

  Thrown when `master` is null.

BadRequestException

  Thrown when `typeName` cannot be parsed into a valid MasterListType.

### UpdateMasterList(string, string, MasterList)

Updates an existing master list entry identified by its type and identifier, replacing its contents with the supplied payload.

    [HttpPut("{typeName}/{id}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateMasterList(string typeName, string id, MasterList master)

#### Parameters

`typeName` string

  The name of the master list type; must correspond to a value of MasterListType.

`id` string

  The identifier of the master list entry; must be a valid MongoDB.Bson.ObjectId.

`master` MasterList

  The master list payload containing the new values to persist.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the update operation.

#### Exceptions

BadRequestException

  Thrown when `master` is null; when `typeName` cannot be parsed into a MasterListType; or when `id` is not a valid MongoDB.Bson.ObjectId.

### UpdateMasterListDescription(string, string, UpdateListNameAndDescriptionDto)

Updates the description of a master list entry identified by its type and id. Validates that the type name maps to a known master list type, the id is a valid identifier, and the description is not null, then delegates the update to the appropriate service; returns a conflict response if the update fails.

    [HttpPut("{typeName}/{id}/description")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateMasterListDescription(string typeName, string id, UpdateListNameAndDescriptionDto udpateListNameAndDescriptionDto)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the appropriate service.

`id` string

  The identifier of the master list entry to update.

`udpateListNameAndDescriptionDto` UpdateListNameAndDescriptionDto

  The DTO containing the new description to apply to the master list entry.

#### Returns

Task<IActionResult>

  An IActionResult that returns OK on success, BadRequest when the description is null, or Conflict when the update does not succeed.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not correspond to a valid master list type.

BadRequestException

  Thrown when `id` is not in a valid identifier format.

### UpdateMasterListName(string, string, UpdateListNameAndDescriptionDto)

Updates the name of a master list of the specified type and identifier, enforcing role-based and "Source"/"DisplayId" permissions. Validates the master list type, the object id format, and the presence of a new name; returns 409 Conflict when the underlying update fails.

    [HttpPut("{typeName}/{id}/name")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateMasterListName(string typeName, string id, UpdateListNameAndDescriptionDto udpateListNameAndDescriptionDto)

#### Parameters

`typeName` string

  The name of the master list type to update; must map to a MasterListType value.

`id` string

  The identifier of the master list to rename; must be a valid ObjectId.

`udpateListNameAndDescriptionDto` UpdateListNameAndDescriptionDto

  The payload containing the new name to apply to the master list.

#### Returns

Task<IActionResult>

  An IActionResult with the result of the update, BadRequestResult when the name is missing, or ConflictObjectResult when the update fails.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not correspond to a known master list type, or when `id` is not a valid ObjectId.

### UpdateOptionDetailsFromMasterList(string, string, UpdateMasterListDetailsDto)

Updates the details of a master list option of the specified type, after validating the type and identifier. Returns a conflict response if the service cannot update the details, otherwise returns the updated result.

    [HttpPut("{typeName}/{id}/details")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateOptionDetailsFromMasterList(string typeName, string id, UpdateMasterListDetailsDto opt)

#### Parameters

`typeName` string

  The name of the master list type to update; must parse to a valid MasterListType.

`id` string

  The identifier of the master list entry to update; must be a valid ObjectId format.

`opt` UpdateMasterListDetailsDto

  The payload containing the new details to apply to the master list entry.

#### Returns

Task<IActionResult>

  The updated master list result wrapped in an IActionResult, or a conflict response when the update fails.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not correspond to a valid master list type, or when `id` is not a valid ObjectId.

### UpdateOptionFromMasterList(string, string, string, OptionList)

Updates an option within the specified master list, supporting multiple master list types and locales.

    [HttpPut("{locale}/{typeName}/{id}/item")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateOptionFromMasterList(string locale, string typeName, string id, OptionList opt)

#### Parameters

`locale` string

  The locale identifier used to resolve the target language context.

`typeName` string

  The name of the master list type whose option should be updated.

`id` string

  The identifier of the master list entry to update.

`opt` OptionList

  The option payload containing the updated values.

#### Returns

Task<IActionResult>

  The updated master list result on success; otherwise, a 409 Conflict when the update fails.

#### Exceptions

BadRequestException

  Thrown when `typeName` is not a valid MasterListType, when `locale` is not a valid LocaleEnum, or when `id` is not a valid ObjectId.

### UpdateOptionMasterListFromAdmPanel(string, string, OptionList)

Updates an option within a master list identified by its type and identifier from the administrative panel.

    [HttpPut("{typeName}/{id}/item")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdateOptionMasterListFromAdmPanel(string typeName, string id, OptionList opt)

#### Parameters

`typeName` string

  The name of the master list type used to resolve the target service and operation.

`id` string

  The unique identifier of the master list entry to update.

`opt` OptionList

  The option payload containing the values to apply to the master list entry.

#### Returns

Task<IActionResult>

  An IActionResult that returns the updated result on success or a `Conflict` response when the update fails.

#### Exceptions

BadRequestException

  Thrown when `typeName` does not match a valid MasterListType value.

BadRequestException

  Thrown when `id` is not a valid MongoDB.Bson.ObjectId format.