Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -1012,3 +1012,24 @@ soroban contract deploy \
## Versioning

This API documentation corresponds to the current `main` branch. The Soroban contract does not use semantic versioning on-chain; breaking changes require redeployment to a new contract ID. Client-side services follow the app version in `package.json`.

---

## Trial Optimization & Conversion Tracking API

The `TrialOptimizationService` provides conversion tracking, trial-to-paid automated triggers, trial extension rules, notification templates, and analytics.

### Methods

#### `processTrials(subscriptions)` & `getAnalyticsSummary(subscriptions)`
Calculates trial conversion rate, active/converted/extended trial counts, and generated conversion revenue.

#### `applyExtension(trialId, ruleId)`
Applies trial extension rules (e.g. high engagement bonus days).

#### `convertTrialToPaid(trialId, trigger)`
Triggers automated or manual trial-to-paid conversion with designated trigger type.

#### `generateReport(format)`
Exports full trial conversion logs and analytics in `json` or `csv`.

3 changes: 3 additions & 0 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ components:
tags:
- name: Initialization
description: One-time contract setup
- name: Trial Optimization
description: Trial conversion tracking, trial-to-paid automation, extension rules, and notifications

- name: Plan Management
description: Create and manage subscription plans
- name: Subscription Management
Expand Down
12 changes: 12 additions & 0 deletions src/navigation/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
}))
);
const AnalyticsDashboard = lazyScreen(() => import('../../app/screens/AnalyticsDashboard'));
const PaymentReconciliationDashboard = lazyScreen(() => import('../screens/PaymentReconciliationDashboard'));

Check failure on line 99 in src/navigation/AppNavigator.tsx

View workflow job for this annotation

GitHub Actions / Type Check

Cannot find module '../screens/PaymentReconciliationDashboard' or its corresponding type declarations.
const TrialOptimizationDashboard = lazyScreen(() => import('../screens/TrialOptimizationDashboard'));
const TrialDetailsScreen = lazyScreen(() => import('../screens/TrialDetailsScreen'));

// Issue #547: GDPR
Expand Down Expand Up @@ -609,6 +611,16 @@
component={BillingAlignmentScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="PaymentReconciliation"
component={PaymentReconciliationDashboard}
options={{ title: 'Payment Reconciliation', headerShown: true }}
/>
<Stack.Screen
name="TrialOptimization"
component={TrialOptimizationDashboard}
options={{ title: 'Trial Optimization', headerShown: true }}
/>
<Stack.Screen
name="PaymentMethods"
component={PaymentMethodsScreen}
Expand Down
6 changes: 6 additions & 0 deletions src/navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export type RootStackParamList = {
PauseSubscription: { subscriptionId: string };
RoleManagement: undefined;
RevenueReport: undefined;
AutomatedCompliance: undefined;
PaymentReconciliation: undefined;
TrialOptimization: undefined;
};

export type TabParamList = {
Expand All @@ -98,6 +101,9 @@ export type TabParamList = {
WalletTab: undefined;
AnalyticsTab: undefined;
RevenueTab: undefined;
ComplianceTab: undefined;
ReconciliationTab: undefined;
TrialOptimizationTab: undefined;
SettingsTab: NavigatorScreenParams<RootStackParamList> | undefined;
};

Expand Down
Loading
Loading