erp-platform/ui/src/proxy/reports/models.ts
2025-08-15 14:26:03 +03:00

118 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// reports.models.ts
/** Enum, backend ile birebir (0..4) */
export enum ReportParameterType {
Text = 0,
Number = 1,
Date = 2,
Email = 3,
Url = 4,
}
/** ---- API MODELLERİ (Raw JSON) ---- */
/** Not: Tarihler APIden ISO string olarak gelir (Date değil) */
export interface ReportParameterDto {
id: string
reportTemplateId: string
name: string
placeholder?: string
type: ReportParameterType // enum (0..4)
defaultValue?: string
required: boolean
description?: string
}
export interface ReportTemplateDto {
id: string
name: string
description?: string
htmlContent: string
category?: string
tags: string[]
parameters: ReportParameterDto[]
// FullAuditedEntityDto alanları
creationTime: string // ISO
lastModificationTime?: string // ISO | undefined
creatorId?: string
lastModifierId?: string
}
export interface GeneratedReportDto {
id: string
templateId?: string | null
templateName: string
generatedContent: string
parameters: Record<string, string>
generatedAt: string // ISO
// FullAuditedEntityDto alanları
creationTime: string // ISO
lastModificationTime?: string // ISO | undefined
creatorId?: string
lastModifierId?: string
template?: ReportTemplateDto // dolu gelebilir
}
/** Create / Update inputları */
export interface CreateReportParameterDto {
name: string
placeholder?: string
type: ReportParameterType
defaultValue?: string
required: boolean
description?: string
}
export interface UpdateReportParameterDto extends CreateReportParameterDto {
id?: string // opsiyonel
}
export interface CreateReportTemplateDto {
name: string
description?: string
htmlContent: string
category?: string
tags?: string[]
parameters: CreateReportParameterDto[]
}
export interface UpdateReportTemplateDto {
name: string
description?: string
htmlContent: string
category?: string
tags?: string[]
parameters: UpdateReportParameterDto[]
}
/** Generate inputu */
export interface GenerateReportDto {
templateId: string
parameters: Record<string, string>
}
/** List inputları (query string) */
export interface GetReportTemplatesInput {
skipCount?: number
maxResultCount?: number
sorting?: string
filter?: string
category?: string
}
export interface GetGeneratedReportsInput {
skipCount?: number
maxResultCount?: number
sorting?: string
filter?: string
templateId?: string
}
/** (Opsiyonel) Paged wrapper — projende zaten varsa bunu kullanmana gerek yok */
export interface PagedResultDto<T> {
items: T[]
totalCount: number
}