Project

General

Profile

Edit Copy Actions

Feature #4155

open

Feature #4154: Inventory Actuals Capture

User Story: Enter Actual Inventory

Added by Yalavarthi Thriveni 2 months ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/29/2025
Due date:
09/30/2025 (about 2 months late)
% Done:

42%

Estimated time:
8:00 h (Total: 22:00 h)

Description

User Story: Enter Actual Inventory
Epic: Actuals Capture
As a Field Staff
I want to enter actual quantities for inventory, equipment, and labour
So that accurate resource usage is recorded against the job.

Acceptance Criteria Recap
Field Staff can enter actuals (inventory, equipment, labour).
Validation rules (no negative qty, mandatory reason code if > planned).
Draft save possible; Submit notifies Admin.
Admin can view entered actuals in preview mode.
Audit log created for every save/submit.

Developer Test Cases
Field Staff
Inventory entry
Ensure API POST /jobs/{id}/actuals accepts payload with inventory lines.
Validate actualQty >= 0. Reject negatives with 400 Bad Request.
If actualQty > plannedQty and reasonCode missing → return error.
Ensure remarks are optional.
Ensure DB snapshot persists with correct schema.
Equipment entry
Test planned equipment updates correctly (plannedUsed vs actualUsed).
Ensure new equipment can be added dynamically with reason/remarks.
Labour entry
Ensure actual hours are integers/decimals.
If actual > planned and remarks missing → reject with error.
Ensure multiple roles can be recorded.
Attachments
Verify file upload API supports .jpg, .png, .pdf only.
Reject files > 10MB.
Ensure presigned S3 URL is generated.
Save as Draft
Test DB stores draft with status = draft.
Ensure multiple saves overwrite draft but create new audit revision.
Submit for Review
Ensure status changes to submitted.
Notification event ActualsSubmitted emitted.
Audit log stored with correct metadata (userId, timestamp, version).
Admin
Preview Actuals
Ensure API GET /jobs/{id}/actuals/preview returns planned vs actual.
Ensure variances highlighted if actual ≠ planned.
Ensure attachments appear in preview payload.
Read-only Access
Admin cannot edit field staff draft directly (must use revise flow later).
Audit Logs
Verify audit endpoint GET /jobs/{id}/actuals/history shows correct actions (saveDraft, submit).

Tester QA Test Cases
Field Staff
Basic Input Validation
Try entering negative qty → expect error popup.
Enter actual > planned without reason → expect error.
Enter actual > planned with reason → expect success.
Labour Hours
Enter planned = 8, actual = 9 without remarks → expect error.
Enter planned = 8, actual = 9 with remarks → expect success.
Draft Save
Enter partial data, save draft, log out → log back in, confirm draft loads.
Attachment Handling
Upload .jpg < 10MB → success.
Upload .exe → expect rejection.
Upload .pdf > 10MB → expect rejection.
Submit Flow
After submit, verify notification appears in Admin’s inbox.
Confirm draft moves to submitted status.
Admin
Preview Screen
Open submitted job → verify planned vs actual table displayed.
Confirm variances highlighted (e.g., +2 red, -1 green).
Confirm attachments are visible/downloadable.
Access Control
Attempt to edit field staff draft → ensure UI prevents editing.
Confirm only revise flow later allows edits.
Audit History
Open history tab → confirm actions “Under Review” and “Submitted” appear with correct user info.


Add

Subtasks 4 (2 open2 closed)

Feature #4157: Create UI for User Story: Enter Actual InventoryNewSai Teja Popuri09/29/202509/29/2025

Delete link to subtaskActions
Feature #4158: create api for User Story: Enter Actual InventoryNewAjit A09/29/202509/29/2025

Delete link to subtaskActions
Feature #4159: Test this User Story: Enter Actual InventoryClosedSai Mahananda09/30/202509/30/2025

Delete link to subtaskActions
Feature #4164: Review Frontend & Backend code ClosedYalavarthi Thriveni09/29/202509/29/2025

Delete link to subtaskActions

Add

Related issues

Edit Copy Actions

Also available in: Atom PDF