mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
feat: support meal photo URIs and improve UI events
- Add `photoUris` field to `MealEntry` and update Firestore rules. - Implement `UiEvent` handling in `MainActivity` for navigation/links. - Remove sensitive email data from error logs and clean up manifest.
This commit is contained in:
1 parent
f0487453c9
commit
87bbb448c2
34 files changed
+2026
-1170
No files matched your search
+3
-2
@@ -36,6 +36,7 @@ service cloud.firestore {
|
||||
data.satietyAfter is int && data.satietyAfter >= 1 && data.satietyAfter <= 10 &&
|
||||
(!('note' in data) || data.note == null || (data.note is string && data.note.size() <= 1000)) &&
|
||||
(!('foodItemsSerialized' in data) || data.foodItemsSerialized == null || (data.foodItemsSerialized is list && data.foodItemsSerialized.size() <= 30 && (data.foodItemsSerialized.size() == 0 || data.foodItemsSerialized[0] is string))) &&
|
||||
(!('photoUris' in data) || data.photoUris == null || (data.photoUris is list && data.photoUris.size() <= 6 && (data.photoUris.size() == 0 || data.photoUris[0] is string))) &&
|
||||
(!('photosBase64' in data) || data.photosBase64 == null || (data.photosBase64 is list && data.photosBase64.size() <= 6 && (data.photosBase64.size() == 0 || data.photosBase64[0] is string))) &&
|
||||
(!('updatedAt' in data) || data.updatedAt == null || (data.updatedAt is timestamp && data.updatedAt <= request.time));
|
||||
}
|
||||
@@ -57,7 +58,7 @@ service cloud.firestore {
|
||||
allow create: if isOwner(userId) &&
|
||||
isValidId(mealId) &&
|
||||
incoming().keys().hasAll(['userId', 'mealType', 'mealTimestamp', 'hungerBefore', 'satietyAfter', 'createdAt']) &&
|
||||
incoming().keys().hasOnly(['userId', 'mealType', 'mealTimestamp', 'hungerBefore', 'satietyAfter', 'note', 'foodItemsSerialized', 'photosBase64', 'createdAt', 'updatedAt']) &&
|
||||
incoming().keys().hasOnly(['userId', 'mealType', 'mealTimestamp', 'hungerBefore', 'satietyAfter', 'note', 'foodItemsSerialized', 'photoUris', 'photosBase64', 'createdAt', 'updatedAt']) &&
|
||||
incoming().createdAt is timestamp &&
|
||||
incoming().createdAt <= request.time &&
|
||||
isValidMealEntry(incoming());
|
||||
@@ -67,7 +68,7 @@ service cloud.firestore {
|
||||
incoming().userId == existing().userId &&
|
||||
incoming().createdAt == existing().createdAt &&
|
||||
isValidMealEntry(incoming()) &&
|
||||
incoming().diff(existing()).affectedKeys().hasOnly(['mealType', 'mealTimestamp', 'hungerBefore', 'satietyAfter', 'note', 'foodItemsSerialized', 'photosBase64', 'updatedAt']);
|
||||
incoming().diff(existing()).affectedKeys().hasOnly(['mealType', 'mealTimestamp', 'hungerBefore', 'satietyAfter', 'note', 'foodItemsSerialized', 'photoUris', 'photosBase64', 'updatedAt']);
|
||||
|
||||
allow delete: if isOwner(userId) && isValidId(mealId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user