@umituz/react-native-subscription 2.37.39 → 2.37.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/package.json +1 -1
  2. package/src/domains/credits/application/CreditLimitCalculator.ts +1 -9
  3. package/src/domains/credits/application/DeductCreditsCommand.ts +13 -6
  4. package/src/domains/credits/application/RefundCreditsCommand.ts +1 -5
  5. package/src/domains/credits/application/credit-strategies/TrialCreditStrategy.ts +1 -5
  6. package/src/domains/credits/application/creditDocumentHelpers.ts +2 -9
  7. package/src/domains/credits/core/Credits.ts +0 -23
  8. package/src/domains/credits/core/CreditsMapper.ts +0 -6
  9. package/src/domains/credits/core/UserCreditsDocument.ts +0 -12
  10. package/src/domains/credits/infrastructure/CreditsRepositoryManager.ts +0 -21
  11. package/src/domains/credits/infrastructure/operations/CreditsWriter.ts +2 -1
  12. package/src/domains/credits/presentation/deduct-credit/useDeductCredit.ts +2 -2
  13. package/src/domains/credits/presentation/useCredits.ts +10 -9
  14. package/src/domains/paywall/components/PaywallContainer.types.ts +0 -28
  15. package/src/domains/paywall/components/PaywallModal.styles.ts +0 -4
  16. package/src/domains/paywall/entities/types.ts +0 -5
  17. package/src/domains/paywall/hooks/usePaywallActions.ts +1 -15
  18. package/src/domains/revenuecat/core/errors/RevenueCatError.ts +0 -6
  19. package/src/domains/revenuecat/core/errors/RevenueCatErrorHandler.ts +0 -24
  20. package/src/domains/revenuecat/core/errors/RevenueCatErrorMessages.ts +0 -18
  21. package/src/domains/revenuecat/core/errors/index.ts +0 -4
  22. package/src/domains/revenuecat/core/types/RevenueCatConfig.ts +3 -7
  23. package/src/domains/revenuecat/core/types/RevenueCatData.ts +4 -9
  24. package/src/domains/revenuecat/core/types/RevenueCatTypes.ts +5 -65
  25. package/src/domains/revenuecat/core/types/index.ts +0 -4
  26. package/src/domains/revenuecat/infrastructure/services/UserSwitchMutex.ts +1 -24
  27. package/src/domains/subscription/application/SubscriptionAuthListener.ts +5 -21
  28. package/src/domains/subscription/application/SubscriptionInitializerTypes.ts +1 -5
  29. package/src/domains/subscription/application/SubscriptionSyncService.ts +11 -2
  30. package/src/domains/subscription/application/SubscriptionSyncUtils.ts +1 -1
  31. package/src/domains/subscription/application/initializer/BackgroundInitializer.ts +15 -2
  32. package/src/domains/subscription/application/initializer/ServiceConfigurator.ts +9 -2
  33. package/src/domains/subscription/constants/thresholds.ts +0 -9
  34. package/src/domains/subscription/core/SubscriptionConstants.ts +0 -4
  35. package/src/domains/subscription/core/SubscriptionStatus.ts +11 -21
  36. package/src/domains/subscription/core/SubscriptionStatusHandlers.ts +4 -7
  37. package/src/domains/subscription/infrastructure/handlers/PurchaseStatusResolver.ts +1 -1
  38. package/src/domains/subscription/infrastructure/hooks/subscriptionQueryKeys.ts +0 -13
  39. package/src/domains/subscription/infrastructure/hooks/usePurchasePackage.ts +0 -18
  40. package/src/domains/subscription/infrastructure/hooks/useRestorePurchase.ts +3 -17
  41. package/src/domains/subscription/infrastructure/hooks/useRevenueCatTrialEligibility.ts +0 -17
  42. package/src/domains/subscription/infrastructure/hooks/useSubscriptionPackages.ts +0 -19
  43. package/src/domains/subscription/infrastructure/hooks/useSubscriptionQueries.ts +0 -6
  44. package/src/domains/subscription/infrastructure/managers/subscriptionManagerUtils.ts +0 -17
  45. package/src/domains/subscription/infrastructure/state/initializationState.ts +0 -25
  46. package/src/domains/subscription/infrastructure/utils/InitializationCache.ts +0 -21
  47. package/src/domains/subscription/infrastructure/utils/PremiumStatusSyncer.ts +2 -7
  48. package/src/domains/subscription/infrastructure/utils/authPurchaseState.ts +0 -5
  49. package/src/domains/subscription/infrastructure/utils/renewal/PackageTierComparator.ts +1 -0
  50. package/src/domains/subscription/infrastructure/utils/trialEligibilityUtils.ts +0 -18
  51. package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.styles.ts +0 -5
  52. package/src/domains/subscription/presentation/components/details/PremiumDetailsCardTypes.ts +0 -5
  53. package/src/domains/subscription/presentation/components/feedback/paywallFeedbackStyles.ts +0 -5
  54. package/src/domains/subscription/presentation/stores/index.ts +0 -4
  55. package/src/domains/subscription/presentation/stores/purchaseLoadingStore.ts +0 -13
  56. package/src/domains/subscription/presentation/useAuthAwarePurchase.ts +30 -21
  57. package/src/domains/subscription/presentation/usePaywallVisibility.ts +0 -9
  58. package/src/domains/subscription/presentation/useSubscriptionStatus.ts +8 -11
  59. package/src/domains/subscription/utils/authGuards.ts +3 -0
  60. package/src/domains/trial/application/TrialService.ts +0 -9
  61. package/src/domains/trial/core/TrialTypes.ts +0 -8
  62. package/src/domains/wallet/domain/mappers/TransactionMapper.ts +0 -5
  63. package/src/domains/wallet/domain/types/transaction.types.ts +0 -7
  64. package/src/domains/wallet/index.ts +0 -7
  65. package/src/domains/wallet/infrastructure/config/walletConfig.ts +0 -11
  66. package/src/domains/wallet/presentation/hooks/useTransactionHistory.ts +6 -3
  67. package/src/domains/wallet/presentation/hooks/useWallet.ts +0 -7
  68. package/src/domains/wallet/utils/transactionIconMap.ts +0 -10
  69. package/src/global.d.ts +0 -6
  70. package/src/index.ts +1 -4
  71. package/src/init/createSubscriptionInitModule.ts +12 -2
  72. package/src/init/index.ts +1 -5
  73. package/src/presentation/hooks/feedback/useFeedbackSubmit.ts +0 -11
  74. package/src/shared/application/FeedbackService.ts +3 -21
  75. package/src/shared/application/ports/ISubscriptionRepository.ts +0 -4
  76. package/src/shared/infrastructure/SubscriptionEventBus.ts +0 -13
  77. package/src/shared/infrastructure/firestore/collectionUtils.ts +1 -17
  78. package/src/shared/infrastructure/firestore/index.ts +0 -4
  79. package/src/shared/infrastructure/firestore/resultUtils.ts +0 -12
  80. package/src/shared/infrastructure/react-query/hooks/usePreviousUserCleanup.ts +0 -17
  81. package/src/shared/infrastructure/react-query/queryConfig.ts +0 -15
  82. package/src/shared/utils/BaseError.ts +0 -5
  83. package/src/shared/utils/Result.ts +0 -20
  84. package/src/shared/utils/dateConverter.ts +6 -46
  85. package/src/utils/appUtils.ts +0 -16
  86. package/src/utils/creditMapper.ts +0 -7
  87. package/src/utils/dateUtils.compare.ts +0 -24
  88. package/src/utils/dateUtils.core.ts +0 -39
  89. package/src/utils/dateUtils.format.ts +0 -41
  90. package/src/utils/dateUtils.math.ts +0 -41
  91. package/src/utils/dateUtils.ts +0 -5
  92. package/src/utils/packagePeriodUtils.ts +0 -20
  93. package/src/utils/packageTypeDetector.ts +1 -21
  94. package/src/utils/premiumStatusUtils.ts +1 -14
  95. package/src/utils/priceUtils.ts +0 -35
  96. package/src/utils/tierUtils.ts +1 -8
  97. package/src/utils/types.ts +1 -25
  98. package/src/utils/validation.ts +1 -7
  99. package/src/domains/README.md +0 -52
  100. package/src/domains/config/domain/README.md +0 -37
  101. package/src/domains/config/domain/entities/README.md +0 -41
  102. package/src/domains/paywall/README.md +0 -101
  103. package/src/domains/paywall/entities/README.md +0 -40
  104. package/src/domains/paywall/hooks/README.md +0 -41
  105. package/src/domains/subscription/application/syncConstants.ts +0 -1
  106. package/src/domains/subscription/infrastructure/README.md +0 -41
  107. package/src/domains/subscription/infrastructure/config/README.md +0 -49
  108. package/src/domains/subscription/infrastructure/handlers/README.md +0 -41
  109. package/src/domains/subscription/infrastructure/hooks/README.md +0 -50
  110. package/src/domains/subscription/infrastructure/managers/README.md +0 -41
  111. package/src/domains/subscription/infrastructure/services/README.md +0 -42
  112. package/src/domains/subscription/infrastructure/utils/README.md +0 -41
  113. package/src/domains/subscription/presentation/components/README.md +0 -155
  114. package/src/domains/subscription/presentation/components/details/CreditRow.md +0 -92
  115. package/src/domains/subscription/presentation/components/details/DetailRow.md +0 -91
  116. package/src/domains/subscription/presentation/components/details/PremiumDetailsCard.md +0 -93
  117. package/src/domains/subscription/presentation/components/details/PremiumStatusBadge.md +0 -91
  118. package/src/domains/subscription/presentation/components/details/README.md +0 -99
  119. package/src/domains/subscription/presentation/components/feedback/PaywallFeedbackModal.md +0 -90
  120. package/src/domains/subscription/presentation/components/feedback/README.md +0 -99
  121. package/src/domains/subscription/presentation/components/paywall/PaywallModal.md +0 -94
  122. package/src/domains/subscription/presentation/components/paywall/README.md +0 -54
  123. package/src/domains/subscription/presentation/components/sections/README.md +0 -99
  124. package/src/domains/subscription/presentation/components/sections/SubscriptionSection.md +0 -94
  125. package/src/domains/subscription/presentation/utils/README.md +0 -31
  126. package/src/domains/wallet/README.md +0 -51
  127. package/src/domains/wallet/domain/README.md +0 -41
  128. package/src/domains/wallet/infrastructure/README.md +0 -41
  129. package/src/domains/wallet/presentation/components/README.md +0 -41
  130. package/src/domains/wallet/presentation/hooks/README.md +0 -41
  131. package/src/shared/application/ports/README.md +0 -48
@@ -1,50 +0,0 @@
1
- # RevenueCat Presentation Hooks
2
-
3
- React hooks for accessing RevenueCat data and operations.
4
-
5
- ## Location
6
-
7
- `src/revenuecat/presentation/hooks/`
8
-
9
- ## Strategy
10
-
11
- React hooks that expose RevenueCat functionality to the presentation layer, providing access to customer info, subscription packages, and offerings.
12
-
13
- ## Restrictions
14
-
15
- ### REQUIRED
16
-
17
- - MUST handle loading states appropriately
18
- - MUST handle error states gracefully
19
- - MUST cache responses when appropriate
20
- - MUST subscribe to real-time updates when needed
21
- - MUST validate all data before use
22
-
23
- ### PROHIBITED
24
-
25
- - MUST NOT expose RevenueCat implementation details to components
26
- - MUST NOT bypass error handling
27
- - MUST NOT create infinite loops with subscriptions
28
- - MUST NOT assume data is always available
29
-
30
- ### CRITICAL
31
-
32
- - Always handle loading and error states
33
- - Unsubscribe from all listeners on unmount
34
- - Validate all data before using it in components
35
- - Handle null/undefined states properly
36
-
37
- ## AI Agent Guidelines
38
-
39
- When working with RevenueCat hooks:
40
- 1. Always handle loading and error states
41
- 2. Unsubscribe from listeners on unmount
42
- 3. Validate all data before use
43
- 4. Cache responses appropriately
44
- 5. Handle null/undefined states gracefully
45
-
46
- ## Related Documentation
47
-
48
- - [Main Hooks](../../../presentation/hooks/README.md)
49
- - [Domain](../../domain/README.md)
50
- - [Services](../infrastructure/services/README.md)
@@ -1,41 +0,0 @@
1
- # RevenueCat Infrastructure Managers
2
-
3
- ## Location
4
- Manager classes for coordinating RevenueCat operations.
5
-
6
- ## Strategy
7
- This directory contains high-level manager classes that coordinate between different RevenueCat services and handle complex operations like SDK configuration and entitlement access.
8
-
9
- ## Restrictions
10
-
11
- ### REQUIRED
12
- - Must coordinate between services properly
13
- - Must manage SDK configuration correctly
14
- - Must provide access to entitlement IDs
15
- - Must handle complex operations safely
16
-
17
- ### PROHIBITED
18
- - DO NOT bypass service coordination
19
- - DO NOT misconfigure SDK
20
- - DO NOT expose invalid entitlement IDs
21
- - DO NOT oversimplify complex operations
22
-
23
- ### CRITICAL SAFETY
24
- - Service coordination MUST be correct
25
- - SDK configuration MUST be valid
26
- - Entitlement access MUST be safe
27
- - Complex operations MUST be handled properly
28
-
29
- ## AI Agent Guidelines
30
- 1. Coordinate properly between RevenueCat services
31
- 2. Manage SDK configuration with correct parameters
32
- 3. Provide safe access to entitlement IDs
33
- 4. Handle complex operations with proper error handling
34
- 5. Test coordination logic thoroughly
35
- 6. Document manager responsibilities clearly
36
- 7. Maintain separation of concerns
37
-
38
- ## Related Documentation
39
- - [Services](../services/README.md)
40
- - [Config](../config/README.md)
41
- - [Domain](../../domain/README.md)
@@ -1,42 +0,0 @@
1
- # RevenueCat Infrastructure Services
2
-
3
- ## Location
4
- Service implementations for RevenueCat operations.
5
-
6
- ## Strategy
7
- This directory contains concrete implementations of RevenueCat interfaces, providing the actual integration with the RevenueCat SDK using singleton pattern with proper error handling and caching.
8
-
9
- ## Restrictions
10
-
11
- ### REQUIRED
12
- - Must use singleton pattern for service instance
13
- - Must wrap all service calls in try-catch
14
- - Must use TypeScript types for all operations
15
- - Must log all RevenueCat operations
16
-
17
- ### PROHIBITED
18
- - DO NOT create multiple service instances
19
- - DO NOT skip error handling
20
- - DO NOT bypass type safety
21
- - DO NOT skip logging operations
22
-
23
- ### CRITICAL SAFETY
24
- - Service MUST be configured only once
25
- - All calls MUST be wrapped in error handling
26
- - All operations MUST be type-safe
27
- - All operations MUST be logged
28
-
29
- ## AI Agent Guidelines
30
- 1. Use singleton pattern for service instance
31
- 2. Wrap all service calls in try-catch blocks
32
- 3. Use TypeScript types for all operations
33
- 4. Log all RevenueCat operations for debugging
34
- 5. Cache customer info and offerings appropriately
35
- 6. Validate parameters before calling SDK
36
- 7. Configure service only once at startup
37
- 8. Use mock implementations for testing
38
-
39
- ## Related Documentation
40
- - [RevenueCat Infrastructure](../README.md)
41
- - [RevenueCat Handlers](../handlers/README.md)
42
- - [RevenueCat Application Ports](../../application/ports/README.md)
@@ -1,41 +0,0 @@
1
- # RevenueCat Infrastructure Utils
2
-
3
- ## Location
4
- Utility functions for RevenueCat operations.
5
-
6
- ## Strategy
7
- This directory contains utility functions for common RevenueCat operations including error mapping, data transformation, validation, and formatting with proper type safety.
8
-
9
- ## Restrictions
10
-
11
- ### REQUIRED
12
- - Must use error mapping for user-facing messages
13
- - Must ensure types are validated before use
14
- - Must respect user locale for formatting
15
- - Must check for null/undefined values
16
-
17
- ### PROHIBITED
18
- - DO NOT show SDK errors directly to users
19
- - DO NOT use data without type validation
20
- - DO NOT ignore locale settings
21
- - DO NOT skip null checks
22
-
23
- ### CRITICAL SAFETY
24
- - All errors MUST be mapped to domain errors
25
- - All types MUST be validated before use
26
- - Locale MUST be respected for formatting
27
- - Null checks MUST be performed consistently
28
-
29
- ## AI Agent Guidelines
30
- 1. Always map SDK errors to domain errors for user-facing messages
31
- 2. Ensure type safety by validating types before use
32
- 3. Respect user locale when formatting prices and periods
33
- 4. Always check for null/undefined values before processing
34
- 5. Use debug helpers in development for troubleshooting
35
- 6. Validate all data before processing
36
- 7. Test utility functions with edge cases
37
-
38
- ## Related Documentation
39
- - [RevenueCat Infrastructure](../README.md)
40
- - [RevenueCat Domain Types](../../domain/types/README.md)
41
- - [RevenueCat Errors](../../domain/errors/README.md)
@@ -1,155 +0,0 @@
1
- # Presentation Components
2
-
3
- React Native UI components for subscription and paywall features.
4
-
5
- ## Location
6
-
7
- **Directory**: `src/presentation/components/`
8
-
9
- **Type**: Component Library
10
-
11
- ## Strategy
12
-
13
- ### Component Categories
14
-
15
- Components are organized by functionality:
16
-
17
- 1. **Details Components**
18
- - CreditRow: Display credit balance and info
19
- - DetailRow: Generic detail display row
20
- - PremiumStatusBadge: Visual premium indicator
21
- - PremiumDetailsCard: Premium subscription details
22
-
23
- 2. **Feedback Components**
24
- - PaywallFeedbackModal: User feedback collection
25
- - Alert components: Warning and info displays
26
-
27
- 3. **Section Components**
28
- - SubscriptionSection: Subscription info section
29
- - CreditsSection: Credits balance section
30
-
31
- 4. **Paywall Components**
32
- - PaywallModal: Upgrade/purchase modal
33
- - Purchase options: Subscription and credit packages
34
-
35
- ### Design Principles
36
-
37
- All components follow these principles:
38
- - **Reusable**: Composable and configurable
39
- - **Typed**: Full TypeScript support
40
- - **Accessible**: WCAG compliant where possible
41
- - **Testable**: Easy to test in isolation
42
- - **Themeable**: Support custom styling
43
-
44
- ### Integration Points
45
-
46
- - **React Native**: Core UI framework
47
- - **Design System**: Shared UI components
48
- - **Localization**: i18n string support
49
- - **Theme**: Custom styling support
50
-
51
- ## Restrictions
52
-
53
- ### REQUIRED
54
-
55
- - **Props Typing**: All components MUST have TypeScript interfaces
56
- - **Default Props**: MUST provide sensible defaults
57
- - **Accessibility**: MUST implement accessibility labels
58
- - **Responsive**: MUST handle different screen sizes
59
-
60
- ### PROHIBITED
61
-
62
- - **NEVER** hardcode colors or sizes (use theme)
63
- - **NEVER** include business logic in components
64
- - **DO NOT** make direct API calls
65
- - **NEVER** hardcode strings (use localization)
66
-
67
- ### CRITICAL SAFETY
68
-
69
- - **ALWAYS** validate props before rendering
70
- - **ALWAYS** handle loading and error states
71
- - **NEVER** trust user input for security decisions
72
- - **MUST** implement proper error boundaries
73
- - **ALWAYS** sanitize user-provided content
74
-
75
- ## AI Agent Guidelines
76
-
77
- ### When Building Components
78
-
79
- 1. **Always** define TypeScript interfaces for props
80
- 2. **Always** use theme for styling (no hardcoded values)
81
- 3. **Always** implement accessibility labels
82
- 4. **Always** handle loading and error states
83
- 5. **Never** include business logic in components
84
-
85
- ### Integration Checklist
86
-
87
- - [ ] Define TypeScript interface for props
88
- - [ ] Use theme for all styling
89
- - [ ] Implement accessibility labels
90
- - [ ] Handle loading state
91
- - [ ] Handle error state
92
- - [ ] Provide sensible defaults
93
- - [ ] Test with different screen sizes
94
- - [ ] Test accessibility
95
- - [ ] Test with various prop combinations
96
- - [ ] Document component usage
97
-
98
- ### Common Patterns
99
-
100
- 1. **Compound Components**: Build complex UIs from simple parts
101
- 2. **Render Props**: Share stateful logic
102
- 3. **Slot Pattern**: Allow content injection
103
- 4. **Control Props**: Make components controlled or uncontrolled
104
- 5. **Asynchronous States**: Handle loading, error, success states
105
- 6. **Responsive Design**: Adapt to different screen sizes
106
- 7. **Theme Integration**: Use design system tokens
107
- 8. **Accessibility First**: Include a11y from the start
108
-
109
- ## Related Documentation
110
-
111
- - **Details Components**: `details/README.md`
112
- - **Feedback Components**: `feedback/README.md`
113
- - **Section Components**: `sections/README.md`
114
- - **Paywall Components**: `paywall/README.md`
115
- - **Design System**: External design system documentation
116
- - **Hooks**: `../hooks/README.md`
117
-
118
- ## Component Examples
119
-
120
- ### CreditRow
121
-
122
- Display user's credit balance with optional actions.
123
-
124
- Usage:
125
- - Set amount prop to number of credits
126
- - Set isLoading to true during data fetch
127
- - Provide onPress callback for navigation
128
- - Component displays credit count and handles tap
129
-
130
- ### PremiumStatusBadge
131
-
132
- Visual indicator for premium subscription status.
133
-
134
- Usage:
135
- - Set isPremium to boolean status
136
- - Set tier to subscription level (gold, silver, etc.)
137
- - Component renders styled badge
138
-
139
- ### PaywallModal
140
-
141
- Modal for subscription and credit purchase.
142
-
143
- Usage:
144
- - Set isVisible to boolean for show/hide
145
- - Provide onClose callback
146
- - Pass features array for premium features list
147
- - Modal handles purchase flow
148
-
149
- ## Directory Structure
150
-
151
- The components directory contains:
152
- - **details/** - Detail display components (CreditRow, DetailRow, PremiumStatusBadge, PremiumDetailsCard)
153
- - **feedback/** - Feedback and alert components (PaywallFeedbackModal)
154
- - **sections/** - Section components (SubscriptionSection)
155
- - **paywall/** - Paywall components (PaywallModal)
@@ -1,92 +0,0 @@
1
- # CreditRow Component
2
-
3
- Row component displaying credit information with amount and label.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/details/CreditRow.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Credit Information Display
16
-
17
- 1. **Amount Display**: Show credit amount with icon
18
- 2. **Label Display**: Show credit type or source label
19
- 3. **Visual Hierarchy**: Clear separation between amount and label
20
- 4. **Icon Integration**: Display appropriate icon for credit type
21
- 5. **Styling Options**: Support custom styling override
22
- 6. **Compact Layout**: Efficient use of space for list items
23
-
24
- ### Integration Points
25
-
26
- - **useCredits**: For credit balance and transaction data
27
- - **Icon System**: For credit type icons
28
- - **List Components**: For credit transaction lists
29
- - **Settings UI**: For credits section in settings
30
-
31
- ## Restrictions
32
-
33
- ### REQUIRED
34
-
35
- - **Amount Prop**: MUST provide valid credit amount
36
- - **Label Prop**: MUST provide descriptive label
37
- - **Icon Display**: SHOULD display appropriate icon
38
- - **Null Handling**: MUST handle null or zero values
39
-
40
- ### PROHIBITED
41
-
42
- - **NEVER** display without amount
43
- - **NEVER** hardcode icon types
44
- - **DO NOT** use for non-credit data
45
- - **DO NOT** display negative amounts without clear indication
46
-
47
- ### CRITICAL SAFETY
48
-
49
- - **ALWAYS** validate amount prop
50
- - **MUST** handle zero or null amounts
51
- - **ALWAYS** provide clear labels
52
- - **NEVER** expose raw transaction data
53
-
54
- ## AI Agent Guidelines
55
-
56
- ### When Implementing Credit Rows
57
-
58
- 1. **Always** provide valid amount
59
- 2. **Always** provide clear label
60
- 3. **Always** display appropriate icon
61
- 4. **Always** handle zero amounts
62
- 5. **Never** use for non-credit display
63
-
64
- ### Integration Checklist
65
-
66
- - [ ] Import from correct path: `@umituz/react-native-subscription`
67
- - [ ] Provide valid amount prop
68
- - [ ] Provide clear label prop
69
- - [ ] Display appropriate icon
70
- - [ ] Handle zero amounts
71
- - [ ] Handle null amounts
72
- - [ ] Apply custom styling if needed
73
- - [ ] Test with positive amount
74
- - [ ] Test with zero amount
75
- - [ ] Test in list context
76
- - [ ] Test standalone display
77
-
78
- ### Common Patterns
79
-
80
- 1. **Transaction List**: Show credit transactions
81
- 2. **Balance Display**: Show current balance
82
- 3. **Allocation Breakdown**: Show credit sources
83
- 4. **History View**: Display transaction history
84
- 5. **Settings Section**: Credits section in settings
85
-
86
- ## Related Documentation
87
-
88
- - **DetailRow**: Generic detail row component
89
- - **PremiumDetailsCard**: Premium details card
90
- - **useCredits**: Credits hook
91
- - **Credits README**: `../../../../domains/wallet/README.md`
92
- - **Details README**: `./README.md`
@@ -1,91 +0,0 @@
1
- # DetailRow Component
2
-
3
- Simple row component displaying a label-value pair for subscription details.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/details/DetailRow.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Label-Value Display
16
-
17
- 1. **Label Positioning**: Display label on left side
18
- 2. **Value Positioning**: Display value on right side
19
- 3. **Space Distribution**: Even spacing between label and value
20
- 4. **Highlight Option**: Support highlighting values (e.g., expiration warnings)
21
- 5. **Custom Styling**: Allow style overrides for flexibility
22
- 6. **Consistent Layout**: Maintain consistent vertical spacing
23
-
24
- ### Integration Points
25
-
26
- - **PremiumDetailsCard**: Uses this component internally
27
- - **SubscriptionSection**: For subscription detail display
28
- - **Settings Screens**: For settings detail items
29
- - **List Components**: For detail lists
30
-
31
- ## Restrictions
32
-
33
- ### REQUIRED
34
-
35
- - **Label Prop**: MUST provide valid label string
36
- - **Value Prop**: MUST provide valid value string
37
- - **Spacing**: MUST maintain consistent spacing
38
- - **Null Handling**: MUST handle null or undefined values
39
-
40
- ### PROHIBITED
41
-
42
- - **NEVER** display without label and value
43
- - **NEVER** use highlight for non-warning cases
44
- - **DO NOT** use excessively long labels (affects layout)
45
- - **DO NOT** mix different data types in same list
46
-
47
- ### CRITICAL SAFETY
48
-
49
- - **ALWAYS** validate label and value props
50
- - **MUST** handle empty strings
51
- - **ALWAYS** use highlight sparingly (for warnings only)
52
- - **NEVER** expose sensitive raw data
53
-
54
- ## AI Agent Guidelines
55
-
56
- ### When Implementing Detail Rows
57
-
58
- 1. **Always** provide clear, concise labels
59
- 2. **Always** format values appropriately
60
- 3. **Always** use highlight only for warnings
61
- 4. **Always** keep labels short and consistent
62
- 5. **Never** display implementation details
63
-
64
- ### Integration Checklist
65
-
66
- - [ ] Import from correct path: `@umituz/react-native-subscription`
67
- - [ ] Provide valid label prop
68
- - [ ] Provide valid value prop
69
- - [ ] Format values appropriately
70
- - [ ] Use highlight for warnings only
71
- - [ ] Apply custom styling if needed
72
- - [ ] Test with short values
73
- - [ ] Test with long values
74
- - [ ] Test with highlight enabled
75
- - [ ] Test in list context
76
- - [ ] Test standalone display
77
-
78
- ### Common Patterns
79
-
80
- 1. **Subscription Details**: Show subscription info
81
- 2. **Settings Items**: Display settings values
82
- 3. **Status Information**: Show various status types
83
- 4. **Date Display**: Format and show dates
84
- 5. **Compact Lists**: Display multiple details
85
-
86
- ## Related Documentation
87
-
88
- - **PremiumDetailsCard**: Uses this component
89
- - **CreditRow**: Similar component for credits
90
- - **SubscriptionSection**: Section containing detail rows
91
- - **Details README**: `./README.md`
@@ -1,93 +0,0 @@
1
- # PremiumDetailsCard Component
2
-
3
- Premium subscription details card component.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/details/PremiumDetailsCard.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Premium Status Card Display
16
-
17
- 1. **Status Display**: Show premium status with badge
18
- 2. **Detail Rendering**: Display subscription details (expiration, renewal, etc.)
19
- 3. **Action Buttons**: Show manage or upgrade button based on status
20
- 4. **Translation Support**: Support custom translations
21
- 5. **Visual Hierarchy**: Clear structure with header, details, and actions
22
- 6. **Responsive Design**: Adapt to different screen sizes
23
-
24
- ### Integration Points
25
-
26
- - **useSubscriptionStatus**: For subscription status data
27
- - **DetailRow**: For displaying individual details
28
- - **PremiumStatusBadge**: For status badge
29
- - **usePremium**: For premium status check
30
- - **Navigation**: For button actions
31
-
32
- ## Restrictions
33
-
34
- ### REQUIRED
35
-
36
- - **Status Prop**: MUST provide valid subscription status object
37
- - **Callback Handling**: MUST implement button callbacks
38
- - **Loading State**: MUST handle loading state
39
- - **Null Handling**: MUST handle null status values
40
-
41
- ### PROHIBITED
42
-
43
- - **NEVER** display without status data
44
- - **NEVER** hardcode status text (use translations)
45
- - **DO NOT** show both manage and upgrade buttons
46
- - **DO NOT** expose sensitive implementation details
47
-
48
- ### CRITICAL SAFETY
49
-
50
- - **ALWAYS** validate status object
51
- - **MUST** handle loading state
52
- - **ALWAYS** provide clear button labels
53
- - **NEVER** trust client-side status for security
54
-
55
- ## AI Agent Guidelines
56
-
57
- ### When Implementing Premium Cards
58
-
59
- 1. **Always** provide valid subscription status
60
- 2. **Always** handle loading state
61
- 3. **Always** implement button callbacks
62
- 4. **Always** use translations for localization
63
- 5. **Never** hardcode status strings
64
-
65
- ### Integration Checklist
66
-
67
- - [ ] Import from correct path: `@umituz/react-native-subscription`
68
- - [ ] Provide valid subscription status
69
- - [ ] Implement onManagePress callback
70
- - [ ] Implement onUpgradePress callback
71
- - [ ] Handle loading state
72
- - [ ] Handle null dates
73
- - [ ] Provide translations
74
- - [ ] Test with active premium
75
- - [ ] Test with expired subscription
76
- - [ ] Test with free user
77
- - [ ] Test with lifetime subscription
78
-
79
- ### Common Patterns
80
-
81
- 1. **Profile Display**: Show in user profile
82
- 2. **Settings Card**: Display in settings screen
83
- 3. **Status Overview**: Show premium status overview
84
- 4. **With Navigation**: Navigate to management
85
- 5. **Localized Display**: Use with i18n
86
-
87
- ## Related Documentation
88
-
89
- - **PremiumStatusBadge**: Status badge component
90
- - **DetailRow**: Detail item component
91
- - **SubscriptionSection**: Subscription section
92
- - **usePremium**: Premium status hook
93
- - **Details README**: `./README.md`
@@ -1,91 +0,0 @@
1
- # PremiumStatusBadge Component
2
-
3
- Compact badge component displaying premium status.
4
-
5
- ## Location
6
-
7
- **Import Path**: `@umituz/react-native-subscription`
8
-
9
- **File**: `src/presentation/components/details/PremiumStatusBadge.tsx`
10
-
11
- **Type**: Component
12
-
13
- ## Strategy
14
-
15
- ### Status Badge Display
16
-
17
- 1. **Status Detection**: Display appropriate status (premium/free)
18
- 2. **Visual Indication**: Use color and icon to indicate status
19
- 3. **Compact Design**: Small footprint for various use cases
20
- 4. **Styling Options**: Support different sizes and styles
21
- 5. **Accessibility**: Include accessibility labels
22
- 6. **Color Coding**: Use consistent colors for status types
23
-
24
- ### Integration Points
25
-
26
- - **usePremium**: For premium status check
27
- - **Headers**: Display in screen headers
28
- - **Cards**: Add to cards as status indicator
29
- - **Lists**: Use in list items as badge
30
- - **Buttons**: Add to buttons for premium features
31
-
32
- ## Restrictions
33
-
34
- ### REQUIRED
35
-
36
- - **Status Prop**: MUST provide valid status boolean
37
- - **Accessibility**: MUST include accessibility label
38
- - **Color Consistency**: MUST use consistent colors
39
- - **Size Constraint**: SHOULD maintain compact size
40
-
41
- ### PROHIBITED
42
-
43
- - **NEVER** display without status prop
44
- - **NEVER** use inconsistent colors
45
- - **DO NOT** make badge too large
46
- - **DO NOT** use for non-premium status
47
-
48
- ### CRITICAL SAFETY
49
-
50
- - **ALWAYS** validate status prop
51
- - **MUST** include accessibility support
52
- - **ALWAYS** use approved color schemes
53
- - **NEVER** expose implementation logic
54
-
55
- ## AI Agent Guidelines
56
-
57
- ### When Implementing Status Badges
58
-
59
- 1. **Always** provide valid status boolean
60
- 2. **Always** include accessibility label
61
- 3. **Always** use consistent colors
62
- 4. **Always** maintain compact size
63
- 5. **Never** use for non-status indicators
64
-
65
- ### Integration Checklist
66
-
67
- - [ ] Import from correct path: `@umituz/react-native-subscription`
68
- - [ ] Provide valid status prop
69
- - [ ] Include accessibility label
70
- - [ ] Apply appropriate styling
71
- - [ ] Test with premium status
72
- - [ ] Test with free status
73
- - [ ] Test in different contexts
74
- - [ ] Verify color consistency
75
- - [ ] Check accessibility support
76
- - [ ] Test size constraints
77
-
78
- ### Common Patterns
79
-
80
- 1. **Header Badge**: Display in screen headers
81
- 2. **Card Badge**: Add to premium cards
82
- 3. **List Indicator**: Use in list items
83
- 4. **Button Badge**: Add to premium feature buttons
84
- 5. **Profile Badge**: Show in user profile
85
-
86
- ## Related Documentation
87
-
88
- - **PremiumDetailsCard**: Premium status card
89
- - **DetailRow**: Detail row component
90
- - **usePremium**: Premium status hook
91
- - **Details README**: `./README.md`