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:
+4
-1
@@ -7,7 +7,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
sendJson(['success' => false, 'error' => 'Method not allowed'], 405);
|
||||
}
|
||||
|
||||
$people = normalizePeopleList(readJsonFile('people.json'));
|
||||
$people = migrateAllPeople(normalizePeopleList(readJsonFile('people.json')));
|
||||
$actor = requireActivePerson($people);
|
||||
|
||||
$body = readJsonBody();
|
||||
@@ -37,6 +37,8 @@ if ($id !== '') {
|
||||
'author_id' => (string) ($actor['id'] ?? ''),
|
||||
'pending_submission' => null,
|
||||
'status' => 'active',
|
||||
'anyone_can_complete' => false,
|
||||
'nfc' => normalizeChoreNfcMeta(null),
|
||||
];
|
||||
$idx = null;
|
||||
}
|
||||
@@ -68,6 +70,7 @@ $row['description'] = isset($body['description']) ? trim((string) $body['descrip
|
||||
$row['image'] = isset($body['image']) ? trim((string) $body['image']) : '';
|
||||
$row['lists'] = normalizeChoreLists($body['lists'] ?? []);
|
||||
$row['assignee_ids'] = $assigneeIdsClean;
|
||||
$row['anyone_can_complete'] = !empty($body['anyone_can_complete']);
|
||||
|
||||
$val = isset($body['value']) ? $body['value'] : 0;
|
||||
$row['value'] = is_numeric($val) ? max(0.0, (float) $val) : 0.0;
|
||||
|
||||
Reference in New Issue
Block a user