Sales Order Time Entry Service
Overview
Sales order time entries record blocks of time logged by users against a specific sales order. Each entry captures who did the work, what type of work it was, when it was done, and how long it took.
Relates to:
- Sales Order Time Task Types — work category definitions
- Sales Orders — parent order
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/SalesOrderTimeEntries/{id}
Returns a single time entry by its numeric identifier.
Behavior:
- Looks up entry by
Id - Returns
404if not found
Authorization:
- Requires Bearer Token
GET ALL
/api/v1/SalesOrderTimeEntries/order/{salesOrderId}
Returns all time entries for a given sales order.
Behavior:
- Returns all time entries for the order ordered by
WorkDateascending - Returns
404if no entries exist for the order
Authorization:
- Requires Bearer Token
POST
/api/v1/SalesOrderTimeEntries
Creates a new time entry against a sales order.
Request body:
SalesOrderTimeEntryModel(required)
Behavior:
- Validates
SalesOrderId > 0,UserId > 0,TaskTypeId > 0,TotalMinutes > 0,WorkDateis provided - If
WorkDateis not provided, defaults to today (UTC) - Records
CreatedByUserIdandCreatedAt - Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Authorization:
- Requires Bearer Token
PUT
/api/v1/SalesOrderTimeEntries/{id}
Updates an existing time entry.
Request:
- Route parameter:
id(numeric) - Body:
SalesOrderTimeEntryModel(with updated fields)
Behavior:
- Updates editable fields:
TaskTypeId,WorkDate,TotalMinutes,Notes - Successful update writes an audit log entry
Errors:
- Returns
400if validation fails or entry does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/SalesOrderTimeEntries/{id}
Deletes a time entry by its identifier.
Behavior:
- Performs a hard delete
- Successful deletion writes an audit log entry
Errors:
- Returns
400if entry does not exist or deletion fails
Authorization:
- Requires Bearer Token
Notes
TotalMinutesis stored as an integer — convert hours to minutes before submittingWorkDateusesDateOnly— time component is not storedCreatedAtis set server-side and is not writable by the client- Validation is enforced in the service layer
- All state-changing operations are audited