File

apps/recallassess/recallassess-api/src/api/admin/dashboard/dto/admin-dashboard-response.dto.ts

Index

Properties

Properties

categories
Type : string[]
Decorators :
@Expose()
@ApiProperty({type: undefined})
series
Type : AdminDashboardNamedDataSeriesDto[]
Decorators :
@Expose()
@Type(undefined)
@ApiProperty({type: undefined})
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { Exclude, Expose, Transform, Type } from "class-transformer";

@Exclude()
export class AdminDashboardWeekTaskCountsDto {
  @Expose()
  @ApiProperty()
  new!: number;

  @Expose()
  @ApiProperty()
  completed!: number;
}

@Exclude()
export class AdminDashboardTaskOverviewDto {
  @Expose()
  @Type(() => AdminDashboardWeekTaskCountsDto)
  @ApiProperty({ name: "this-week" })
  "this-week"!: AdminDashboardWeekTaskCountsDto;

  @Expose()
  @Type(() => AdminDashboardWeekTaskCountsDto)
  @ApiProperty({ name: "last-week" })
  "last-week"!: AdminDashboardWeekTaskCountsDto;
}

@Exclude()
export class AdminDashboardTaskSeriesDto {
  @Expose()
  @ApiProperty({ name: "this-week", type: [Number] })
  "this-week"!: number[];

  @Expose()
  @ApiProperty({ name: "last-week", type: [Number] })
  "last-week"!: number[];
}

@Exclude()
export class AdminDashboardTaskDistributionDto {
  @Expose()
  @Type(() => AdminDashboardTaskOverviewDto)
  @ApiProperty()
  overview!: AdminDashboardTaskOverviewDto;

  @Expose()
  @ApiProperty({ type: [String] })
  labels!: string[];

  @Expose()
  @Type(() => AdminDashboardTaskSeriesDto)
  @ApiProperty()
  series!: AdminDashboardTaskSeriesDto;
}

@Exclude()
export class AdminDashboardNamedDataSeriesDto {
  @Expose()
  @ApiProperty()
  name!: string;

  @Expose()
  @ApiProperty({ type: [Number] })
  data!: number[];
}

@Exclude()
export class AdminDashboardBudgetDistributionDto {
  @Expose()
  @ApiProperty({ type: [String] })
  categories!: string[];

  @Expose()
  @Type(() => AdminDashboardNamedDataSeriesDto)
  @ApiProperty({ type: [AdminDashboardNamedDataSeriesDto] })
  series!: AdminDashboardNamedDataSeriesDto[];
}

@Exclude()
export class AdminDashboardExpensesBlockDto {
  @Expose()
  @ApiProperty()
  amount!: number;

  @Expose()
  @ApiProperty({ type: [String] })
  labels!: string[];

  @Expose()
  @Type(() => AdminDashboardNamedDataSeriesDto)
  @ApiProperty({ type: [AdminDashboardNamedDataSeriesDto] })
  series!: AdminDashboardNamedDataSeriesDto[];
}

@Exclude()
export class AdminDashboardBudgetDetailRowDto {
  @Expose()
  @ApiProperty()
  id!: number;

  @Expose()
  @ApiProperty()
  type!: string;

  @Expose()
  @ApiProperty()
  total!: number;

  @Expose()
  @ApiProperty()
  expensesAmount!: number;

  @Expose()
  @ApiProperty()
  expensesPercentage!: number;

  @Expose()
  @ApiProperty()
  remainingAmount!: number;

  @Expose()
  @ApiProperty()
  remainingPercentage!: number;
}

@Exclude()
export class AdminDashboardBudgetDetailsDto {
  @Expose()
  @ApiProperty({ type: [String] })
  columns!: string[];

  @Expose()
  @Type(() => AdminDashboardBudgetDetailRowDto)
  @ApiProperty({ type: [AdminDashboardBudgetDetailRowDto] })
  rows!: AdminDashboardBudgetDetailRowDto[];
}

@Exclude()
export class AdminDashboardTeamMemberDto {
  @Expose()
  @ApiProperty()
  id!: string;

  @Expose()
  @ApiProperty()
  avatar!: string;

  @Expose()
  @ApiProperty()
  name!: string;

  @Expose()
  @ApiProperty()
  email!: string;

  @Expose()
  @ApiProperty()
  phone!: string;

  @Expose()
  @ApiProperty()
  title!: string;
}

/**
 * Serialized admin dashboard payload (template/demo data). Only @Expose() fields are returned;
 * placeholder nulls are omitted from JSON via @Transform.
 */
@Exclude()
export class AdminDashboardResponseDto {
  @Expose()
  @Type(() => AdminDashboardTaskDistributionDto)
  @ApiProperty()
  taskDistribution!: AdminDashboardTaskDistributionDto;

  @Expose()
  @Type(() => AdminDashboardBudgetDistributionDto)
  @ApiProperty()
  budgetDistribution!: AdminDashboardBudgetDistributionDto;

  @Expose()
  @Type(() => AdminDashboardExpensesBlockDto)
  @ApiProperty()
  weeklyExpenses!: AdminDashboardExpensesBlockDto;

  @Expose()
  @Type(() => AdminDashboardExpensesBlockDto)
  @ApiProperty()
  monthlyExpenses!: AdminDashboardExpensesBlockDto;

  @Expose()
  @Type(() => AdminDashboardExpensesBlockDto)
  @ApiProperty()
  yearlyExpenses!: AdminDashboardExpensesBlockDto;

  @Expose()
  @Type(() => AdminDashboardBudgetDetailsDto)
  @ApiProperty()
  budgetDetails!: AdminDashboardBudgetDetailsDto;

  @Expose()
  @Type(() => AdminDashboardTeamMemberDto)
  @ApiProperty({ type: [AdminDashboardTeamMemberDto] })
  teamMembers!: AdminDashboardTeamMemberDto[];

  @Expose()
  @Transform(({ value }) => (value == null ? undefined : value))
  @ApiPropertyOptional({ description: "Reserved; omitted when null" })
  summary?: unknown;

  @Expose()
  @Transform(({ value }) => (value == null ? undefined : value))
  @ApiPropertyOptional({ description: "Reserved; omitted when null" })
  topCustomersAndSuppliers?: unknown;

  @Expose()
  @Transform(({ value }) => (value == null ? undefined : value))
  @ApiPropertyOptional({ description: "Reserved; omitted when null" })
  stockAging?: unknown;

  @Expose()
  @Transform(({ value }) => (value == null ? undefined : value))
  @ApiPropertyOptional({ description: "Reserved; omitted when null" })
  salesProfitAnalysis?: unknown;

  @Expose()
  @Transform(({ value }) => (value == null ? undefined : value))
  @ApiPropertyOptional({ description: "Reserved; omitted when null" })
  salesPurchaseAnalysis?: unknown;
}

results matching ""

    No results matching ""