File

apps/recallassess/recallassess-api/src/api/client/course/dto/course.dto.ts

Description

Client-facing published course payload (landing + marketing sites).

Includes DB fields plus enriched display fields (level_color, CDN image URL, outline helpers).

Index

Properties

Properties

category
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Course suite / category shown on marketing (e.g. Executive Negotiation Business Suite)', example: 'Executive Negotiation Business Suite'})
Optional course_code
Type : string
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Unique course code', example: 'DNP'})
Optional course_detail_url
Type : string | null
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Course detail PDF URL', nullable: true})
Optional course_enrolled_override_text
Type : string | null
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Override text instead of enrollment count on landing cards', nullable: true})
description
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Full course description (HTML or text)', example: ''})
duration
Type : string | null
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Display duration string', example: '4-6 weeks', nullable: true})
enrolled
Type : number
Decorators :
@Expose()
@ApiProperty({description: 'Enrollment count', example: 42})
id
Type : number
Decorators :
@Expose()
@ApiProperty({description: 'Course ID', example: 1})
image
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Course hero image URL (CDN)', example: 'https://media…/public/marketing/courses/dnp.jpg'})
image_alt
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Alt text for course image', example: 'Developing Negotiation Power course illustration'})
Optional is_featured
Type : boolean
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Whether the course is featured', example: false})
Optional is_published
Type : boolean
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Whether the course is published', example: true})
learning_objectives
Type : string[]
Decorators :
@Expose()
@ApiProperty({description: 'Learning objectives for the marketing course outline (from course.learning_objectives; admin-editable, one bullet per entry)', type: undefined, example: undefined})

Marketing learning objectives from course.learning_objectives (admin-editable). One string per bullet on the marketing courses page.

level
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Course level enum value', example: 'ADVANCED'})
level_color
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'UI color key derived from level', example: 'green'})
module_titles
Type : string[]
Decorators :
@Expose()
@ApiProperty({description: 'Published module titles in sort order (marketing course outline content list)', type: undefined, example: undefined})

Published module titles in sort order (marketing “Course content” list).

modules
Type : number
Decorators :
@Expose()
@ApiProperty({description: 'Count of published modules', example: 12})
short_description
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Marketing outline paragraph (admin Short description)', example: 'Built on Harvard negotiation theory, corporate psychology, and 35 years of negotiation experience…'})
sort_order
Type : number
Decorators :
@Expose()
@ApiProperty({description: 'Display sort order (ascending on marketing and landing)', example: 10})
Optional testimonials_url
Type : string | null
Decorators :
@Expose()
@ApiPropertyOptional({description: 'Testimonials PDF URL', nullable: true})
title
Type : string
Decorators :
@Expose()
@ApiProperty({description: 'Course title', example: 'Developing Negotiation Power'})
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[];
}

results matching ""

    No results matching ""