erp-platform/ui/src/proxy/reports/models.ts

119 lines
2.5 KiB
TypeScript
Raw Normal View History

2025-08-15 11:26:03 +00:00
// reports.models.ts
/** Enum, backend ile birebir (0..4) */
export enum ReportParameterType {
Text = 0,
Number = 1,
Date = 2,
Email = 3,
Url = 4,
2025-08-15 08:07:51 +00:00
}
2025-08-15 11:26:03 +00:00
/** ---- API MODELLERİ (Raw JSON) ---- */
/** Not: Tarihler APIden ISO string olarak gelir (Date değil) */
2025-08-15 08:07:51 +00:00
export interface ReportParameterDto {
2025-08-15 11:26:03 +00:00
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
2025-08-15 08:07:51 +00:00
}
export interface GeneratedReportDto {
2025-08-15 11:26:03 +00:00
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
2025-08-15 08:07:51 +00:00
}