Add NFC chore submission feature and enhance family settings

- Introduced NFC support for chore submissions, allowing specific person credit after Head of Household approval.
- Updated family settings to include NFC base URL, scan cooldown, and confirmation page options.
- Enhanced chore management with options for anyone to complete chores and NFC link generation.
- Improved API endpoints for handling NFC tokens and chore submissions.
- Updated readme to reflect new NFC features and settings.
This commit is contained in:
2026-03-31 10:28:27 -05:00
parent 9a78c4564e
commit f14de0b7e1
21 changed files with 779 additions and 21 deletions
+17
View File
@@ -50,6 +50,23 @@ if (isset($body['week_starts_on'])) {
}
$merged['week_starts_on'] = $w;
}
if (array_key_exists('nfc_base_url', $body)) {
$baseUrl = trim((string) $body['nfc_base_url']);
if ($baseUrl !== '' && !preg_match('#^https?://#i', $baseUrl)) {
sendJson(['success' => false, 'error' => 'nfc_base_url must start with http:// or https://'], 400);
}
$merged['nfc_base_url'] = rtrim($baseUrl, '/');
}
if (array_key_exists('nfc_show_confirmation', $body)) {
$merged['nfc_show_confirmation'] = !empty($body['nfc_show_confirmation']);
}
if (array_key_exists('nfc_scan_cooldown_seconds', $body)) {
$cooldown = (int) $body['nfc_scan_cooldown_seconds'];
if ($cooldown < 0 || $cooldown > 600) {
sendJson(['success' => false, 'error' => 'nfc_scan_cooldown_seconds must be 0-600'], 400);
}
$merged['nfc_scan_cooldown_seconds'] = $cooldown;
}
$merged = normalizeLoadedFamilySettings($merged);