import { ColumnFormatEditDto } from '@/proxy/admin/list-form-field/models' import { GanttOptionDto, GridOptionsEditDto, SchedulerOptionDto, SubFormDto, TodoOptionDto, TreeOptionDto, WidgetEditDto, WorkflowDto, SelectCommandTypeEnum, } from '@/proxy/form/models' import { ListViewLayoutType } from '@/views/admin/listForm/edit/types' export interface ListFormWizardColumnItemDto { fieldName: string editorType: string editorOptions: string editorScript: string colSpan: number isRequired: boolean includeInEditingForm: boolean dbSourceType: number } export interface ListFormWizardColumnGroupDto { caption: string colCount: number items: ListFormWizardColumnItemDto[] } /** Wizard'ın yol ayrımı; backend `WizardComponentKindEnum` ile birebir eşleşir. */ export enum WizardComponentKindEnum { List = 0, Custom = 1, } export interface ListFormWizardDto { componentKind: WizardComponentKindEnum /** * Düzenleme modunda, yerine geçilecek seed dosyasının adı. Doluysa sunucu önce bu dosyayı * ve ürettiği kayıtları siler, sonra yenisini üretir; istek güncelleme yetkisiyle çalışır. */ editFileName?: string wizardName: string /** * Wizard'ın ilk deploy edildiği an. Dosya adı tarih taşımadığı için seeder dosyaları bu * damgaya göre sıralar; sunucu üretir, istemci göndermez. */ seededAt?: string listFormCode: string menuCode: string menuOrder: number /** * Wizard menüye eklensin mi. False ise menü kaydı hiç üretilmez; ListForm, permission ve * dil anahtarları yine üretilir (SubGrid gibi başka bir ekranın parçası olarak kullanılır). */ createMenu: boolean customComponentName: string /** Menünün açtığı adres; Custom yolunda seçilen bileşenin rota yolu. */ menuUrl: string isTenant: boolean isBranch: boolean isOrganizationUnit: boolean allowAdding: boolean allowUpdating: boolean allowDeleting: boolean confirmDelete: boolean allowDetail: boolean defaultLayout: ListViewLayoutType grid: boolean card: boolean pivot: boolean tree: boolean chart: boolean gantt: boolean scheduler: boolean todo: boolean menuEn: string menuTr: string titleEn: string titleTr: string descEn: string descTr: string menuParentEn: string menuParentTr: string permissionGroupName: string /** Izin grubunun Ingilizce gorunen adi; grup adiyla ayni olan dil anahtarina yazilir. */ permissionGroupEn: string /** Izin grubunun Turkce gorunen adi. */ permissionGroupTr: string menuParentCode: string menuParentModuleId?: string menuParentIcon?: string menuIcon: string dataSourceCode: string dataSourceConnectionString: string selectCommandType: SelectCommandTypeEnum selectCommand: string keyFieldName: string keyFieldDbSourceType: number treeOptionDto: TreeOptionDto ganttOptionDto: GanttOptionDto schedulerOptionDto: SchedulerOptionDto todoOptionDto: TodoOptionDto workflowDto: WorkflowDto groups?: ListFormWizardColumnGroupDto[] subForms?: SubFormDto[] widgets?: WidgetEditDto[] } /** Izin grubu secim listesi ogesi; gorunen adlar grup adiyla ayni olan dil anahtarindan gelir. */ export interface WizardPermissionGroupDto { name: string displayNameEn: string displayNameTr: string } export interface WizardFileInfoDto { fileName: string wizardName: string listFormCode: string defaultLayout: string menuIcon: string createdAt: string hasInsertedRecords: boolean componentKind: WizardComponentKindEnum customComponentName: string menuUrl: string } export interface WizardInsertedRecordsDto { languageKeys: string[] permissionGroupNames: string[] permissionNames: string[] menuCodes: string[] dataSourceCodes: string[] } export interface WizardSeedFileItemDto { fieldName: string editorType: string editorOptions: string editorScript: string colSpan: number isRequired: boolean includeInEditingForm?: boolean dbSourceType: number turkishCaption?: string englishCaption?: string captionName?: string lookupDataSourceType?: number valueExpr?: string displayExpr?: string lookupQuery?: string } export interface WizardSeedFileGroupDto { caption: string colCount: number items: WizardSeedFileItemDto[] } export interface WizardSeedFileWizardDto extends Omit { groups?: WizardSeedFileGroupDto[] } export interface WizardSeedFileDto { wizard: WizardSeedFileWizardDto /** Wizard'ın ürettiği ekranın ListForm sözleşmesi; tasarımcıdaki değişiklikler buraya yazılır. */ listForm?: GridOptionsEditDto /** Ekranın alanları; ListForm detayındaki alan tanımlarıyla aynı sözleşme. */ fields?: ColumnFormatEditDto[] isDeletedField: boolean isCreatedField: boolean insertedRecords: WizardInsertedRecordsDto } /** Import edilen dosyanin hedefteki karsiligiyla karsilastirma sonucu; backend enum'u ile birebir. */ export enum WizardImportEntryStatusEnum { New = 0, Identical = 1, Conflict = 2, } export interface WizardImportEntryDto { /** Kapsam klasorune goreli yol, ornegin `crud/Orders.json`. */ path: string folder: string fileName: string status: WizardImportEntryStatusEnum incomingSize: number existingSize: number /** Yalnizca Conflict durumunda doludur. */ incomingContent?: string /** Yalnizca Conflict durumunda doludur. */ existingContent?: string } export interface WizardImportAnalysisDto { importId: string /** Dosyalarin yazilacagi kapsam klasoru (`host` ya da `tenants/{tenantId}`). */ scopeFolder: string entries: WizardImportEntryDto[] warnings: string[] } /** * Import kapanisinin sonucu. Yazilan `data/*.json` dosyalari ayni islemde veritabanina da * uygulanir; her dosyanin sonucu burada raporlanir. */ export interface WizardImportCompleteResultDto { appliedData: WizardImportSeedApplyResultDto[] } /** Tek bir veri seed dosyasinin veritabanina uygulanma sonucu. */ export interface WizardImportSeedApplyResultDto { /** Kapsam klasorune goreli yol. */ path: string /** Veritabanina eklenen satir sayisi. */ insertedRowCount: number /** Zaten var oldugu icin dosyadaki degerlerle guncellenen satir sayisi. */ updatedRowCount: number /** Anahtari olmadigi icin guncellenemeyen, dokunulmayan satir sayisi. */ skippedRowCount: number /** Dosya uygulanamadiysa nedeni; basarili durumda bostur. */ error?: string } export interface WizardImportApplyResultDto { path: string overwritten: boolean size: number }