Actions Service
Overview
Actions represent tasks or activities assigned to entities (customers or suppliers). They support scheduling, tracking, and completion management.
Actions are used for:
- follow-up calls and reminders
- scheduled meetings
- task management
- activity tracking
All action operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/Actions/{id}
Returns a single action by its numeric identifier.
Route parameters:
id(long, required) - action identifier
Behavior:
- Looks up action by ID
- Returns
404if the action does not exist
Authorization:
- Requires Bearer Token
GET
/api/v1/Actions/entity/{entityId}
Returns all actions for a specific entity.
Route parameters:
entityId(long, required) - entity identifier
Behavior:
- Returns all actions linked to the entity
- Returns
404if no actions exist for the entity
Authorization:
- Requires Bearer Token
GET
/api/v1/Actions/due
Returns all due actions (past due date and not completed).
Behavior:
- Returns actions where
DueAtis in the past andCompletedAtis null - Returns
404if no due actions exist
Authorization:
- Requires Bearer Token
POST
/api/v1/Actions
Creates a new action.
Request body:
EntityId(long, required) - associated entitySubject(string, required) - action titleActionType(long, required) - action type identifierDescription(string, optional) - detailed descriptionDueAt(DateTime, optional) - due dateAction(string, optional) - action notes
Behavior:
- Validation is handled in the service layer
CreatedAtis set automatically- Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Authorization:
- Requires Bearer Token
PUT
/api/v1/Actions/{id}
Updates an existing action.
Request:
- Action ID is taken from the route
- Body must include:
Subject(string, required)
- Optional:
Description(string)DueAt(DateTime)Action(string)CompletedAt(DateTime)ActionType(long)
Behavior:
UpdatedAtis set automatically- Successful update writes an audit log entry
Errors:
- Returns
400if validation fails or action does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/Actions/{id}
Deletes an action by its identifier.
Behavior:
- Performs a hard delete
- Record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if action does not exist
Authorization:
- Requires Bearer Token
Notes
- Actions are linked to entities via
EntityId - Due actions can be queried for task management workflows
- Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients