System Options Service
Overview
System Options represent configurable settings that affect system behavior.
They provide a consistent reference for:
- feature toggles
- tenant-specific configuration values
- controlling system behaviors dynamically
System options are tenant-scoped and are referenced by multiple modules.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/SystemOptions/GetAllSystemOptions
Returns all system options for the current tenant.
Behavior:
- Returns a list of system options
- Returns
404if no system options exist
Authorization:
- Requires Bearer Token
GET
/api/v1/SystemOptions/GetSystemOptionsById/{id}
Returns a single system option by its numeric identifier.
Behavior:
- Looks up a system option by ID
- Returns
404if the system option does not exist
Authorization:
- Requires Bearer Token
POST
/api/v1/SystemOptions/AddNewSystemOptions
Creates a new system option.
Request body:
SystemOptionTypeId(int, required)Value(string, required)IsActive(bool, optional)CreatedAt(DateTime, optional)
Behavior:
- Validation is handled in the service layer via
IsReadyToAdd() - Successful creation writes an audit log entry
Errors:
- Returns
400if validation -
Authorization:
- Requires Bearer Token
PUT
/api/v1/SystemOptions/UpdateSystemOptionsByProductId/{id}
Updates an existing system option.
Request body:
- Same fields as POST
Behavior:
- ID is taken from the route
- Partial updates are not supported
- Successful update writes an audit log entry
Errors:
- Returns
400if validation - or system option does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/SystemOptions/DeleteSystemOptionsById/{id}
Deletes a system option by its ID.
Behavior:
- Performs a hard delete
- Record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if system option does not exist or deletion -
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer
- Deleting a system option does not cascade changes
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients