-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/app review required data #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
aa9ce5f
docs(app_review_config): enhance documentation for clarity and comple…
fulleni 93a0ef7
feat(enums): add InitialAppReviewAnswer enum
fulleni 1e58fd1
feat(core): add NegativeFeedback model for tracking user's negative s…
fulleni 7b35980
chore: barrels
fulleni 82443a7
style: format
fulleni 9e39540
fix(app-review): add fixture data for testing and demonstration
fulleni b06085d
refactor(enums): rename InitialAppReviewAnswer to InitialAppReviewFee…
fulleni cd7bf9d
test(core): add unit tests for InitialAppReviewFeedback enum
fulleni a9b9e5b
style: format
fulleni c62aa08
refactor(ugc): rename InitialAppReviewAnswer to InitialAppReviewFeedback
fulleni c8023a9
test(user_generated_content): add comprehensive tests for AppReview m…
fulleni 0be17e7
test(user_generated_content): add NegativeFeedback model tests
fulleni 142937f
docs(app_review): enhance architectural documentation for two-layer r…
fulleni 3f3256a
refactor(user_generated_content): replace DateTime with bool for stor…
fulleni c4a363f
docs(app_review_config): update documentation for positive feedback
fulleni b280039
refactor(fixtures): update app review model field
fulleni dae5a14
test: update app review tests to check store review request status
fulleni 1880471
build(serialization): sync
fulleni a1db254
refactor: update import path for utils
fulleni 2ede413
feat(config): enhance app review configuration options
fulleni cb9bab6
feat(ReportingConfig): add master switch for enabling/disabling repor…
fulleni 756be6a
feat(config): add master switch for community features
fulleni 04543a9
fix(remote-config): update initial prompt cooldown days to 3
fulleni 3163c40
test(config): add CommunityConfig tests
fulleni 27181c8
test(config): improve ReportingConfig tests
fulleni 5493229
build(serialization): sync
fulleni 0608c51
build(serialization): sync
fulleni cc0d5e7
fix(fixtures): rotate negative feedback reasons in app reviews
fulleni d7d1b03
refactor(app_review): use helper functions for date time serialization
fulleni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| /// {@template initial_app_review_feedback} | ||
| /// Represents the user's response to the initial, private app review prompt | ||
| /// (e.g., "Are you enjoying the app?"). | ||
| /// {@endtemplate} | ||
| @JsonEnum() | ||
| enum InitialAppReviewFeedback { | ||
| /// The user indicated a positive experience. | ||
| @JsonValue('positive') | ||
| positive, | ||
|
|
||
| /// The user indicated a negative experience. | ||
| @JsonValue('negative') | ||
| negative, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| import 'package:core/core.dart'; | ||
|
|
||
| /// Generates a list of predefined app reviews for fixture data. | ||
| List<AppReview> getAppReviewsFixturesData({ | ||
| String languageCode = 'en', | ||
| DateTime? now, | ||
| }) { | ||
| final appReviews = <AppReview>[]; | ||
| final users = usersFixturesData; | ||
| final referenceTime = now ?? DateTime.now(); | ||
|
|
||
| final reasonsByLang = <String, List<String>>{ | ||
| 'en': [ | ||
| 'The app is a bit slow when loading the main feed.', | ||
| 'I did not like the old layout.', | ||
| 'Still experiencing some lag on the search page.', | ||
| 'Crashes sometimes when I open a notification.', | ||
| ], | ||
| 'ar': [ | ||
| 'التطبيق بطيء بعض الشيء عند تحميل الواجهة الرئيسية.', | ||
| 'لم يعجبني التصميم القديم.', | ||
| 'لا أزال أواجه بعض البطء في صفحة البحث.', | ||
| 'يتوقف أحيانًا عند فتح إشعار.', | ||
| ], | ||
| }; | ||
|
|
||
| final resolvedLanguageCode = ['en', 'ar'].contains(languageCode) | ||
| ? languageCode | ||
| : 'en'; | ||
| final reasons = reasonsByLang[resolvedLanguageCode]!; | ||
|
|
||
| for (var i = 0; i < users.length; i++) { | ||
| final user = users[i]; | ||
| final createdAt = referenceTime.subtract(Duration(days: 30 - i)); | ||
|
|
||
| // Every 3rd user gives a positive review and is sent to the store. | ||
| if (i % 3 == 0) { | ||
| appReviews.add( | ||
| AppReview( | ||
| id: 'ar-pos-$i', | ||
| userId: user.id, | ||
| initialFeedback: InitialAppReviewFeedback.positive, | ||
| createdAt: createdAt, | ||
| updatedAt: createdAt.add(const Duration(minutes: 1)), | ||
| wasStoreReviewRequested: true, | ||
| ), | ||
| ); | ||
| } | ||
| // Every 5th user gives a negative review with a reason. | ||
| else if (i % 5 == 0) { | ||
| appReviews.add( | ||
| AppReview( | ||
| id: 'ar-neg-reason-$i', | ||
| userId: user.id, | ||
| initialFeedback: InitialAppReviewFeedback.negative, | ||
| createdAt: createdAt, | ||
| updatedAt: createdAt, | ||
| negativeFeedbackHistory: [ | ||
| NegativeFeedback(providedAt: createdAt, reason: reasons[0]), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
| // Other users give a negative review without a reason. | ||
| else { | ||
| appReviews.add( | ||
| AppReview( | ||
| id: 'ar-neg-$i', | ||
| userId: user.id, | ||
| initialFeedback: InitialAppReviewFeedback.negative, | ||
| createdAt: createdAt, | ||
| updatedAt: createdAt, | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| // Add a case where a user gave negative feedback, then was prompted again | ||
| // later and gave positive feedback. | ||
| final multiStageUser = users[1]; | ||
| final firstReviewTime = referenceTime.subtract(const Duration(days: 45)); | ||
| final secondReviewTime = referenceTime.subtract(const Duration(days: 5)); | ||
|
|
||
| // This would be an update to an existing record, but for fixtures we can | ||
| // just show the final state. | ||
| appReviews.add( | ||
| AppReview( | ||
| id: 'ar-multistage-final', | ||
| userId: multiStageUser.id, | ||
| initialFeedback: InitialAppReviewFeedback.positive, | ||
| // createdAt would be from the first interaction | ||
| createdAt: firstReviewTime, | ||
| // updatedAt is from the most recent interaction | ||
| updatedAt: secondReviewTime, | ||
| // The reason from the first negative review might be cleared or kept, | ||
| // depending on business logic. Here we assume it's cleared on positive. | ||
| wasStoreReviewRequested: true, | ||
| // The history might be kept for analytics, even after a positive review. | ||
| negativeFeedbackHistory: [ | ||
| NegativeFeedback(providedAt: firstReviewTime, reason: reasons[1]), | ||
| ], | ||
| ), | ||
| ); | ||
|
|
||
| // Add a case for a user who gave negative feedback multiple times. | ||
| final persistentNegativeUser = users[2]; | ||
| final firstNegativeTime = referenceTime.subtract(const Duration(days: 60)); | ||
| final secondNegativeTime = referenceTime.subtract(const Duration(days: 20)); | ||
| appReviews.add( | ||
| AppReview( | ||
| id: 'ar-multi-neg', | ||
| userId: persistentNegativeUser.id, | ||
| initialFeedback: InitialAppReviewFeedback.negative, | ||
| createdAt: firstNegativeTime, | ||
| updatedAt: secondNegativeTime, | ||
| negativeFeedbackHistory: [ | ||
| NegativeFeedback(providedAt: firstNegativeTime, reason: reasons[2]), | ||
| NegativeFeedback(providedAt: secondNegativeTime, reason: reasons[3]), | ||
| ], | ||
| ), | ||
| ); | ||
|
|
||
| return appReviews; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.