🤝 Affiliates
Every account is an affiliate, however there are default affiliates and opped-in affiliates, this document will explain how it works and what the difrences are.
| Design | Prototype | Dev Mode | Task | Alpha Branch | Chat | Alpha | Beta | Production
- Details
- Design
- Development
- Launch
Description
Everyone is an affiliate however, by default users get points for any activities including affiliate activities (see the Points document for details), opped-in affiliates are accounts that have signedup to the affiliate program or partner program, that means they earn a comission on any business they bring to hudi.
Primaraly we track affiliates within our database, however, to avode busilding a tracker we should look for an open cource project or use an API.
Status
These details are only updated with each release, for more acurate updates and keeping track of progress, see the task in GitHub.
| Owner | Lead | Doc Status | Product Status | Last Update | Version | Release | Phase |
|---|---|---|---|---|---|---|---|
| Ben | Samuel | In Progress | Backlog | - | - | - | - |
User Stories
Persona One
As [Persona One] I want to invite a firend and earn point for my activitie.
Persona Two
As [Persona Two] I want share a podcast or product and get rewarded for it.
Persona Three
As [Persona Three] I want to invite my clients to create ads for thier business and earn a comission on what they spend (for the next year).
Reminders
- #191
- #205
- Ensure Deep Link is setup
- Ensure theme is properly linked
- Be sure to follow the release guidelines
- Update Documentation
Links & Resources
Coming Soon
- Biz Docs
- Research
- Design
- Prototype
- Dev Mode
- Task
- Alpha Branch
- Chat
- Alpha
- Beta
- Production
- Firebase Auth Docs
Before you start developing you will need to setup your environment, if you have not done that yet visit Development Envietment.
- Data Structure
- Data Model (Draft)
- Backend
- Frontend
Affiliates This part of the data is related to the affiliate and partner programs, we need to keep track of who is inviting who, any invite that happens within the app should be very stright forward to track however, to allow users to share links and so on, we should consider using an affiliate software API. We might also be able to seperate all the affiliate data in another collection or remove it all together and relly only on a third party API. We might also want to use the HubSpot API or another CRM.
- affiliates
-
- affiliate #1
-
-
- account (id)
-
-
-
- profile (id)
-
-
-
- type (general, agency, partner)
-
-
-
- status (reqest, pendding, active, inactive, dismissed)
-
-
-
-
link (r65rh)
-
iniciate
-
- iniciate 1
-
-
- account/contact (id)
-
-
-
- type (invite, share, general, etc.)
-
-
-
- item (general, product, podcast, etc.)
-
-
-
- via (link, qr, etc.)
-
-
-
- link ()
-
-
-
- date
-
-
-
- clicks (0)
-
-
-
- conversions (0)
-
-
-
- conversion value ($0.00)
-
-
-
- reward (points, money, bonus, etc.)
-
-
Click
-
- click 1 (int)
-
-
- iniciate (id)
-
-
-
- timestamp (datetime)
-
-
-
- ip_address (string)
-
-
services
-
- service 1
-
-
- title
-
-
-
- type
-
-
-
- category
-
-
-
- provider (profile ID)
-
-
clients
-
- client 1
-
-
- account (ID)
-
-
-
- conversion (ID)
-
-
-
- timestamp (datetime)
-
-
Conversion
-
- conversion #1 (id)
-
-
- click (id)
-
-
-
- timestamp (datetime)
-
-
-
- order (id)
-
-
-
- amount (float)
-
-
-
- reward (points, money, bonus, etc.)
-
-
-
- reward_amount
-
-
Report
-
- id (int)
-
-
- affiliate_id (int)
-
-
-
- start_date (datetime)
-
-
-
- end_date (datetime)
-
-
-
- clicks (int)
-
-
-
- conversions (int)
-
-
-
- revenue (float)
-
-
log
-
-
I'll help you create a Dart data model based on your affiliate and partner program requirements. I'll use Dart classes with proper typing and structure the relationships between entities. Here's a comprehensive Dart data model:
// Enum definitions
enum AffiliateType { general, agency, partner }
enum AffiliateStatus { request, pending, active, inactive, dismissed }
enum InitiateType { invite, share, general }
enum InitiateItem { general, product, podcast }
enum InitiateVia { link, qr }
enum RewardType { points, money, bonus }
// Affiliate entity
class Affiliate {
final String id;
final String accountId;
final String profileId;
final AffiliateType type;
final AffiliateStatus status;
final String link;
final List<Initiate> initiates;
Affiliate({
required this.id,
required this.accountId,
required this.profileId,
required this.type,
required this.status,
required this.link,
this.initiates = const [],
});
}
// Initiate entity (tracking invitations/shares)
class Initiate {
final String id;
final String accountId; // or contactId
final InitiateType type;
final InitiateItem item;
final InitiateVia via;
final String? link;
final DateTime date;
final int clicks;
final int conversions;
final double conversionValue;
final RewardType reward;
final List<Click> clickDetails;
Initiate({
required this.id,
required this.accountId,
required this.type,
required this.item,
required this.via,
this.link,
required this.date,
this.clicks = 0,
this.conversions = 0,
this.conversionValue = 0.0,
required this.reward,
this.clickDetails = const [],
});
}
// Click tracking entity
class Click {
final String id;
final String initiateId;
final DateTime timestamp;
final String? ipAddress;
Click({
required this.id,
required this.initiateId,
required this.timestamp,
this.ipAddress,
});
}
// Service entity
class Service {
final String id;
final String title;
final String type;
final String category;
final String providerProfileId;
Service({
required this.id,
required this.title,
required this.type,
required this.category,
required this.providerProfileId,
});
}
// Client entity
class Client {
final String id;
final String accountId;
final String conversionId;
final DateTime timestamp;
Client({
required this.id,
required this.accountId,
required this.conversionId,
required this.timestamp,
});
}
// Conversion entity
class Conversion {
final String id;
final String clickId;
final DateTime timestamp;
final String? orderId;
final double amount;
final RewardType reward;
final double rewardAmount;
Conversion({
required this.id,
required this.clickId,
required this.timestamp,
this.orderId,
required this.amount,
required this.reward,
required this.rewardAmount,
});
}
// Report entity
class Report {
final String id;
final String affiliateId;
final DateTime startDate;
final DateTime endDate;
final int clicks;
final int conversions;
final double revenue;
Report({
required this.id,
required this.affiliateId,
required this.startDate,
required this.endDate,
required this.clicks,
required this.conversions,
required this.revenue,
});
}
// Optional: Log entity (basic structure, can be expanded)
class Log {
final String id;
final DateTime timestamp;
final String eventType;
final String description;
final Map<String, dynamic> details;
Log({
required this.id,
required this.timestamp,
required this.eventType,
required this.description,
this.details = const {},
});
}
// Example usage:
void main() {
final affiliate = Affiliate(
id: "aff1",
accountId: "acc1",
profileId: "prof1",
type: AffiliateType.general,
status: AffiliateStatus.active,
link: "r65rh",
);
final initiate = Initiate(
id: "init1",
accountId: "acc2",
type: InitiateType.invite,
item: InitiateItem.product,
via: InitiateVia.link,
link: "https://example.com/ref=r65rh",
date: DateTime.now(),
reward: RewardType.money,
);
}
This Dart data model includes:
- Enums: Type-safe enumerations for various status and type fields
- Classes: Well-structured classes for each entity with appropriate data types
- Relationships: Proper linking between entities using IDs
- Required Fields: Marked as
requiredwhere essential - Optional Fields: Nullable types (with
?) or default values where appropriate - Collections: Lists to maintain relationships (like initiates in Affiliate)
Key features:
- Immutable classes (using final fields)
- Type safety with Dart's strong typing
- Flexible structure that can work with either local storage or third-party APIs
- Scalable design that can be extended with additional fields/methods
For integration with third-party APIs (like HubSpot or affiliate software):
- You could add serialization methods (toJson/fromJson) to each class
- Create API service classes to handle the communication
- Add factory constructors for creating instances from API responses
Would you like me to add any specific features like:
- JSON serialization methods
- API integration examples
- Database storage considerations
- Additional fields or methods
- Validation logic
Tasks
Functions
Utilized Functions
- Access controle reqesire either auth or access permissions
Dependicies
These are not final, only ideas of apis we could use
- Everflow
- Referral Hero
- Open Source
Tasks
Parent Widgets
- Coming Soon
Child Widgets Tasks
- Coming Soon
Compatibility
- Android Phones
- Android Tablets
- Android Watch
- Android TV
- iOS
- iPad
- iWatch
- Apple TV
- Chrome OS
- Mac OS
- Google Cast
Dependencies
Widgets
Views
These are the views that make up the user experience of a complete and independent product, while many of these views are shared across multiple products, they are customized to serve a Uniquely "podcast" experience to the user.
-
Splash
Just as with any splash views, we want to establish the podcast brand and give the overview views and it's content time to check for updates and load.
- User Story
- User Flow
- Design
-
Intro
again, we want this to be a user experience independent of the rest of the husi app, therefore, should this e the first time the user is accessing the podcast product, the user is greated with a slide of benefits and feature available in the podcast app.
-
[Onboarding]
In order to make the posdcast experience optimal, we will check for missing account data or data that is required by the podcast app and ask the user to fill them, we will also have a views asking the user what topics they like and another on what shows they are alredy listing to.
-
[Overview]
Overview is where the user can get a quick glance at trending, playing and other podcasts, just as with all apps in hudi, overview is the default views.
-
Header
-
Filter (Months)
-
Annoucments
-
Tasks
-
Resources
-
Promotions
Offers that can help sell
- Leads
filter all, top, new, etc.
- Recommended/For You
- Promoted
- Top Performers
filetr by emplyee, campaign, etc
- Banner
- New features
add a "share with your clients" button
- revenue
filter per (month), employee, region, etc.
- Filter
- NavBar
-
-
All Clients
-
All Invites
-
Revenue
-
Materials
Features
Below is a list of features that will be utilized in order to deliver a great podcast experiance. The details bellow are not comprehensive feature details but rather, describe how the features will be utilized withon the podcast product, for further details, please see the individual feature documentation.