Skip to content

Adds and manages operation source in the OrderReferencePool - #1441

Open
1nf0rmagician wants to merge 6 commits into
feature/material-management-implementation-v001from
feature/order-reference-source
Open

Adds and manages operation source in the OrderReferencePool#1441
1nf0rmagician wants to merge 6 commits into
feature/material-management-implementation-v001from
feature/order-reference-source

Conversation

@1nf0rmagician

Copy link
Copy Markdown
Member

This PR is stacked on #1440

Having the information where an operation was created from is relevant for (notifications about) later state transitions of the container properly mapping linked containers to sources of their respective operations.

- Adds an Id based facade method to delete containers
- Handles error cases for unknown Ids
- Add a controller action to deregister containers
Adds extension methods to retireve custom attributes for enum values, especially for display name and description. This works similar to the extensions on `ICustomAttributeProvider` that already exist.
- Adds the controller action seperated on a dedicated region
- Adds a controller action allowing to check whether an order integration is available in the system
- Adds a facade to the order integration module to retrieve the information
- Adds required setup in the module controller and components
[HttpGet("integrations/orders/available")]
[ProducesResponseType(typeof(bool), StatusCodes.Status200OK)]
[Authorize(Policy = MaterialPermissions.CanRead)]
public ActionResult<bool> HasOrderIntegration() => Ok(_orderIntegration is null);

@MathoMathiasCamara MathoMathiasCamara Aug 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this is not correct. It's supposed to be not null

[ProducesResponseType(StatusCodes.Status500InternalServerError)]
[Authorize(Policy = MaterialPermissions.CanUpdate)]
public async Task<ActionResult<MaterialContainerModel>> PreAdviceAsync(PreAdvideModel preAdvice)
public async Task<ActionResult<MaterialContainerModel>> PreAdviceAsync(PreAdvideModel preAdvice, CancellationToken cancellationToken)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Model name PreAdvideModel has a typo

var deregistration = new DeregisteredStateInformation();
cancellationToken.ThrowIfCancellationRequested();
container.TransitionTo(deregistration);
var isDeleted = await ResourceManagement.DeleteAsync(container.Id, CancellationToken.None);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not pass the token here?

/// <summary>
/// Extensions for the <see cref="Enum"/>
/// </summary>
public static class EnumExtensions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion there should the a different PR just for this extension, because if i am not wrong the EntryConvert already does something similar in the background for flag enums and enums. @dbeuchler what do you think ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sounds good and also some extensions are duplicated (see CustomAttributeProviderExtensions). Every MORYX-Framework changes not related to material management should be a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants