-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add public-samples/podcast-marketing-saas-it6tbi/src/web/src/types/ma…
…rketing.ts
- Loading branch information
1 parent
1fec7e1
commit c072f54
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,71 @@ | ||
/** | ||
* @fileoverview Marketing-related TypeScript type definitions for the web application | ||
* | ||
* Requirements addressed: | ||
* - Type Safety (9.1 Programming Languages/Frontend): | ||
* Ensures type safety in marketing-related data structures by defining reusable | ||
* types and interfaces. | ||
* - API Design (8.3 API Design/8.3.2 Interface Specifications): | ||
* Provides structured types for marketing-related API responses and requests, | ||
* ensuring consistency and type safety. | ||
*/ | ||
|
||
import { ApiResponse } from './api'; | ||
import { CommonError } from './common'; | ||
import { Episode } from './episode'; | ||
|
||
/** | ||
* Represents a marketing campaign with its essential metadata and content information | ||
*/ | ||
export interface MarketingCampaign { | ||
/** Unique identifier for the campaign */ | ||
id: string; | ||
|
||
/** Title or name of the marketing campaign */ | ||
title: string; | ||
|
||
/** List of social media or marketing platforms where the campaign will be distributed */ | ||
platforms: string[]; | ||
|
||
/** The actual content or message of the marketing campaign */ | ||
content: string; | ||
|
||
/** Scheduled date for the campaign to be published */ | ||
scheduleDate: Date; | ||
|
||
/** Current status of the marketing campaign */ | ||
status: 'draft' | 'scheduled' | 'published'; | ||
} | ||
|
||
/** | ||
* API response structure for a single marketing campaign request | ||
* Extends the standard ApiResponse with MarketingCampaign as the data type | ||
*/ | ||
export interface MarketingResponse extends ApiResponse<MarketingCampaign> { | ||
/** Marketing campaign data */ | ||
data: MarketingCampaign; | ||
|
||
/** HTTP status code */ | ||
status: number; | ||
|
||
/** Human-readable response message */ | ||
message: string; | ||
} | ||
|
||
/** | ||
* API response structure for paginated marketing campaign list requests | ||
* Contains pagination metadata along with the marketing campaign data | ||
*/ | ||
export interface MarketingListResponse { | ||
/** Array of marketing campaigns */ | ||
data: MarketingCampaign[]; | ||
|
||
/** Total number of campaigns available */ | ||
total: number; | ||
|
||
/** Current page number (1-based) */ | ||
page: number; | ||
|
||
/** Number of campaigns per page */ | ||
pageSize: number; | ||
} |