Creating Unauthenticated Users
NOTE
This item has been deferred to a later release, due to scope and complexity constraints.
Overview
This requirement covers the creation of unauthenticated users (Workers, Visitors, and plant operators) who exist in the Digital Lock On platform but do not primarily use the platform interface. These users utilise QR codes for lock-on processes with Site Protectors.
User Story
As an administrator, I want to create unauthenticated users so that Workers, Visitors, and plant operators can be recognised in the Digital Lock On platform and participate in lock-on processes via QR codes.
Business Rules
- Unauthenticated users are created only in the Digital Lock On platform (no Clerk account)
- User types "Worker", "Visitor", and "Admin" can be created as unauthenticated users
- Each unauthenticated user must have a unique QR code for identification
- Mobile numbers must be unique across all users in the system
- Users can be created without email addresses
- Admin platform access is required to create unauthenticated users
Acceptance Criteria
Successful User Creation
- [ ] Admin can create a new Worker user without authentication credentials
- [ ] Admin can create a new Visitor user without authentication credentials
- [ ] Admin can create a new Admin user without authentication credentials
- [ ] Digital Lock On user record is created with all required fields from User interface
- [ ] Unique QR code is generated for the user
- [ ] User appears in Digital Lock On platform user listings
- [ ] QR code can be successfully scanned by Site Protectors for lock-on processes
Required User Data
- [ ] Name (required) - full name of the user
- [ ] Mobile number (required) - contact number for the user
- [ ] Company (required) - organisation or company affiliation
- [ ] User type (required) - must be "Worker", "Visitor", or "Admin"
- [ ] Email address (optional) - contact email if available
QR Code Requirements
- [ ] QR code is automatically generated upon user creation
- [ ] QR code contains unique user identification information
- [ ] QR code is linked to the user record in the Digital Lock On platform
- [ ] QR code can be printed or displayed for physical distribution
- [ ] QR code remains valid for the lifetime of the user record
Validation Requirements
- [ ] Mobile number format is validated
- [ ] Mobile number uniqueness is enforced across all users
- [ ] Email address format is validated (if provided)
- [ ] User type is restricted to "Worker", "Visitor", or "Admin"
- [ ] All required fields are provided before creation
Error Handling
- [ ] Clear error message when mobile number already exists
- [ ] Clear error message when email already exists (if provided)
- [ ] Clear error message for invalid mobile number format
- [ ] Clear error message for invalid email format (if provided)
- [ ] Clear error message for invalid user type
- [ ] Clear error message if QR code generation fails
Dependencies
- Digital Lock On platform user management API must be available
- QR code generation service must be available
- User type definitions must be consistent between admin platform and Digital Lock On platform
Implementation Notes
- User ID should be automatically generated (UUID or similar)
- QR code should encode the user ID for quick lookup during lock-on processes
- Email field should remain optional to accommodate users without email addresses
- LastLoginAt field will remain empty for unauthenticated users
- Consider QR code format that works well with mobile scanning apps
Notes
- These users will not have login credentials or access to the Digital Lock On platform interface
- Users participate in the system primarily through QR code scanning by Site Protectors
- Contractors may be created on-the-fly (not an admin requirement) in the main platform
- User updates and deletion are covered in separate requirements
- Audit trail for user creation will be addressed in a future decision