Add SKIP_GPS_VALIDATION feature for attendance and visit services
- Introduced SKIP_GPS_VALIDATION environment variable to control GPS validation during check-ins and check-outs. - Updated loadEnv function to parse SKIP_GPS_VALIDATION and enforce its rules based on NODE_ENV. - Enhanced attendance and visit services to utilize the new configuration, allowing GPS validation to be skipped in development environments. - Added unit tests to verify the behavior of SKIP_GPS_VALIDATION in various scenarios, ensuring proper handling in both production and development contexts. - Updated check-in verification logic to respect the SKIP_GPS_VALIDATION option, improving flexibility in location checks.
This commit is contained in:
@@ -23,3 +23,7 @@ BCRYPT_SALT_ROUNDS=10
|
||||
# OpenAPI UI at /docs (default: on unless NODE_ENV=production)
|
||||
# SWAGGER_ENABLED=true
|
||||
# SWAGGER_ENABLED=false
|
||||
|
||||
# Debug only. Skip GPS radius/location checks on check-in and check-out.
|
||||
# Rejected when NODE_ENV=production.
|
||||
# SKIP_GPS_VALIDATION=true
|
||||
|
||||
Reference in New Issue
Block a user