Skip to main content

Advertising Entities

Entities for the advertising platform system allowing companies to create and manage ad campaigns.

Overview

The advertising platform system is similar to Facebook Ads Manager, allowing advertisers to:

  1. Create advertiser accounts
  2. Create ad campaigns with budgets and targeting
  3. Upload ad creatives (images, videos, text)
  4. Track performance (impressions, clicks, conversions)
  5. Manage billing and payments

Core Entities

AdvertiserAccount

Represents a company/brand that can advertise (e.g., Rapala, Shimano).

Key Fields:

  • Id (int): Unique identifier
  • UserId: Account owner user
  • CompanyName: Company name
  • IsVerified: Whether account is verified by admin
  • SubscriptionTier: Basic, Professional, Enterprise
  • AccountBalance: Account balance for ad spending
  • StripeCustomerId: Stripe customer ID
  • IsActive: Whether account is active

Relationships:

  • Many-to-one: User
  • One-to-many: AdCampaign, AdvertiserTeamMember, AdvertiserPayment, AdvertiserInvoice

AdCampaign

A collection of ads with shared budget and targeting.

Key Fields:

  • Id (int): Unique identifier
  • AdvertiserAccountId: Associated advertiser
  • CampaignName: Campaign name
  • BudgetType: Daily, Lifetime
  • BudgetAmount: Budget amount
  • Targeting: Targeting criteria (JSON)
  • StartDate, EndDate: Campaign dates
  • Status: Draft, Active, Paused, Completed
  • FrequencyCap: Max impressions per user

Relationships:

  • Many-to-one: AdvertiserAccount
  • One-to-many: AdCreative, AdImpression, AdClick

AdCreative

The actual ad content (image, video, text, etc.).

Key Fields:

  • Id (int): Unique identifier
  • AdCampaignId: Associated campaign
  • CreativeType: Image, Video, Text, Carousel
  • Headline: Ad headline
  • BodyText: Ad body text
  • ImageUrl, VideoUrl: Media URLs
  • CallToAction: CTA button text
  • LandingPageUrl: Landing page URL
  • Status: Active, Paused, Rejected

Relationships:

  • Many-to-one: AdCampaign
  • One-to-many: AdImpression, AdClick

AdImpression

Tracks ad impressions (views).

Key Fields:

  • Id (int): Unique identifier
  • AdCreativeId: Associated creative
  • UserId: User who viewed ad (if logged in)
  • ImpressionDate: Impression timestamp
  • DeviceType: Desktop, Mobile, Tablet
  • Location: User location

Relationships:

  • Many-to-one: AdCreative, User (optional)

AdClick

Tracks ad clicks.

Key Fields:

  • Id (int): Unique identifier
  • AdCreativeId: Associated creative
  • UserId: User who clicked (if logged in)
  • ClickDate: Click timestamp
  • DeviceType: Device type
  • Location: User location

Relationships:

  • Many-to-one: AdCreative, User (optional)

AdvertiserPayment

Tracks advertiser payments and account top-ups.

Key Fields:

  • Id (int): Unique identifier
  • AdvertiserAccountId: Associated account
  • Amount: Payment amount
  • PaymentType: TopUp, Subscription
  • StripePaymentIntentId: Stripe payment intent
  • Status: Pending, Completed, Failed
  • PaymentDate: Payment timestamp

Relationships:

  • Many-to-one: AdvertiserAccount

AdvertiserInvoice

Tracks advertiser invoices for ad spending.

Key Fields:

  • Id (int): Unique identifier
  • AdvertiserAccountId: Associated account
  • InvoiceNumber: Invoice number
  • Amount: Invoice amount
  • PeriodStart, PeriodEnd: Billing period
  • Status: Pending, Paid, Overdue
  • DueDate: Due date

Relationships:

  • Many-to-one: AdvertiserAccount

AdvertiserTeamMember

Team members who can manage advertiser accounts.

Key Fields:

  • Id (int): Unique identifier
  • AdvertiserAccountId: Associated account
  • UserId: Team member user
  • Role: Admin, Manager, Viewer
  • Permissions: Permissions (JSON)

Relationships:

  • Many-to-one: AdvertiserAccount, User