Copy an optimisation configuration
Create a new optimisation configuration in the current organisation or location from a visible source configuration. In Harbor Soho, an operator can copy a template such as `Sistema - OFF`, review the prefilled form, make one change, and create a location-level copy without changing the source.
In this article
Use Copy when an existing optimisation configuration is a good starting point but should not be edited directly. Antylogic opens a new configuration form with the source name, description, and settings prefilled, while Default starts off for the copy.
The copy is saved in the context where the action starts. From Harbor Soho it creates a location configuration; from the organisation route it creates an organisation configuration.
Before you start
- The operator is signed in with Harbor Demo Group selected, and Harbor Soho selected for the location example.
- For the location flow, start from `location/optimization-configs?tab=optimizer`.
- The source configuration is visible from the current context: system, organisation, or the current location.
- The operator has `optimization:manage` in the destination scope. `optimization:view` alone can read configurations but cannot use Copy or create the copy.
- The source detail can be loaded with `optimization:view` or `optimization:manage` before the form is prefilled.
Instructions
- 1.
Open the Optimizer tab
In Harbor Soho, open Reservations and choose Optimizer. The list can include system templates, organisation configurations, and location configurations visible in the current context.
- 2.
Use Copy on a visible source
Find the configuration to reuse, such as `Sistema - OFF`, and choose Copy from its row action. The source is only used to prefill the new form; it is not edited.
- 3.
Review the prefilled form
The app opens a new configuration form with `copyFromId` set and no existing item ID. The copied name, description, and settings are loaded from the source, and Default is forced off.
- 4.
Make the copy distinct
Change at least one field before saving, such as the name or a settings value. The form preserves unknown settings keys so values not modelled by the UI are not dropped.
- 5.
Decide on Default deliberately
Leave Default off unless this copied configuration should become the default for the current scope. The form does not include a destination selector; the route and API scope decide where it is created.
- 6.
Create and confirm the result
Press Create. The app sends only `name`, `description`, `is_default`, and `settings`; it does not send the source ID or technical metadata. On success, the list is refreshed and the new configuration appears in the current scope.
Validations and limits
- Copy is not rendered for users with only `optimization:view`.
- The copied form starts with no changes, so Create stays disabled until the operator edits at least one field.
- The name is trimmed in the frontend and backend; a blank name is rejected.
- The detail query only runs when there is a source ID, a valid scope context, and effective read permission.
- `POST /optimization-configs` requires `optimization:manage` in the destination scope.
- The copy does not inherit `is_default`, `is_system`, source identity, ownership fields, timestamps, or `copyFromId`.
- If the source cannot be loaded, no copy is created. If saving fails, the form shows the resolved API error.
- The original source configuration remains unchanged after the copy is created.
Expected result
A new `optimization_config` is created in the current organisation or Harbor Soho location, based on the visible source configuration. The source remains unchanged and the refreshed list can show the new copy.