apps/recallassess/recallassess-api/src/api/client/course/dto/course.dto.ts
Client-facing published course payload (landing + marketing sites).
Includes DB fields plus enriched display fields (level_color, CDN image URL, outline helpers).
Properties |
|
| category |
Type : string
|
Decorators :
@Expose()
|
| Optional course_code |
Type : string
|
Decorators :
@Expose()
|
| Optional course_detail_url |
Type : string | null
|
Decorators :
@Expose()
|
| Optional course_enrolled_override_text |
Type : string | null
|
Decorators :
@Expose()
|
| description |
Type : string
|
Decorators :
@Expose()
|
| duration |
Type : string | null
|
Decorators :
@Expose()
|
| enrolled |
Type : number
|
Decorators :
@Expose()
|
| id |
Type : number
|
Decorators :
@Expose()
|
| image |
Type : string
|
Decorators :
@Expose()
|
| image_alt |
Type : string
|
Decorators :
@Expose()
|
| Optional is_featured |
Type : boolean
|
Decorators :
@Expose()
|
| Optional is_published |
Type : boolean
|
Decorators :
@Expose()
|
| level |
Type : string
|
Decorators :
@Expose()
|
| level_color |
Type : string
|
Decorators :
@Expose()
|
| modules |
Type : number
|
Decorators :
@Expose()
|
| short_description |
Type : string
|
Decorators :
@Expose()
|
| sort_order |
Type : number
|
Decorators :
@Expose()
|
| Optional testimonials_url |
Type : string | null
|
Decorators :
@Expose()
|
| title |
Type : string
|
Decorators :
@Expose()
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { Exclude, Expose } from "class-transformer";
/**
* Client-facing published course payload (landing + marketing sites).
*
* Includes DB fields plus enriched display fields (`level_color`, CDN image URL, outline helpers).
*/
@Exclude()
export class CLCourseDto {
@Expose()
@ApiProperty({ description: "Course ID", example: 1 })
id!: number;
@Expose()
@ApiProperty({ description: "Course title", example: "Developing Negotiation Power" })
title!: string;
@Expose()
@ApiProperty({
description: "Course suite / category shown on marketing (e.g. Executive Negotiation Business Suite)",
example: "Executive Negotiation Business Suite",
})
category!: string;
@Expose()
@ApiProperty({ description: "Course level enum value", example: "ADVANCED" })
level!: string;
@Expose()
@ApiProperty({ description: "UI color key derived from level", example: "green" })
level_color!: string;
@Expose()
@ApiProperty({ description: "Full course description (HTML or text)", example: "" })
description!: string;
@Expose()
@ApiProperty({
description: "Marketing outline paragraph (admin Short description)",
example:
"Built on Harvard negotiation theory, corporate psychology, and 35 years of negotiation experience…",
})
short_description!: string;
@Expose()
@ApiProperty({ description: "Count of published modules", example: 12 })
modules!: number;
@Expose()
@ApiPropertyOptional({ description: "Display duration string", example: "4-6 weeks", nullable: true })
duration!: string | null;
@Expose()
@ApiProperty({ description: "Enrollment count", example: 42 })
enrolled!: number;
@Expose()
@ApiProperty({ description: "Course hero image URL (CDN)", example: "https://media…/public/marketing/courses/dnp.jpg" })
image!: string;
@Expose()
@ApiProperty({ description: "Alt text for course image", example: "Developing Negotiation Power course illustration" })
image_alt!: string;
@Expose()
@ApiPropertyOptional({ description: "Unique course code", example: "DNP" })
course_code?: string;
@Expose()
@ApiPropertyOptional({ description: "Whether the course is published", example: true })
is_published?: boolean;
@Expose()
@ApiPropertyOptional({ description: "Whether the course is featured", example: false })
is_featured?: boolean;
@Expose()
@ApiProperty({ description: "Display sort order (ascending on marketing and landing)", example: 10 })
sort_order!: number;
@Expose()
@ApiPropertyOptional({ description: "Course detail PDF URL", nullable: true })
course_detail_url?: string | null;
@Expose()
@ApiPropertyOptional({ description: "Testimonials PDF URL", nullable: true })
testimonials_url?: string | null;
@Expose()
@ApiPropertyOptional({
description: "Override text instead of enrollment count on landing cards",
nullable: true,
})
course_enrolled_override_text?: string | null;
/**
* Published module titles in sort order (marketing “Course content” list).
*/
@Expose()
@ApiProperty({
description: "Published module titles in sort order (marketing course outline content list)",
type: [String],
example: ["The 5 Negotiation Formats", "Negotiation Preparation: The Expansive Approach"],
})
module_titles!: string[];
/**
* Marketing learning objectives from `course.learning_objectives` (admin-editable).
* One string per bullet on the marketing courses page.
*/
@Expose()
@ApiProperty({
description:
"Learning objectives for the marketing course outline (from course.learning_objectives; admin-editable, one bullet per entry)",
type: [String],
example: [
"12 strategies for developing negotiation power, whatever hand you're dealt",
"Core concepts: BATNA, RV, and ZOPA, applied to any scenario",
],
})
learning_objectives!: string[];
}