371 lines
10 KiB
TypeScript
371 lines
10 KiB
TypeScript
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
|
||
/** Üst menü zinciri (kökten), menülerin dil anahtarları. */
|
||
menuPath: string[]
|
||
/** Doğrudan bağlı diğer wizard dosyaları: alt formlar / component bağımlılıkları. */
|
||
dependencies: string[]
|
||
}
|
||
|
||
export enum WizardRecordTypeEnum {
|
||
SeedFile = 0,
|
||
ListForm = 1,
|
||
ListFormField = 2,
|
||
Workflow = 3,
|
||
PermissionGrant = 4,
|
||
Permission = 5,
|
||
PermissionGroup = 6,
|
||
Menu = 7,
|
||
Module = 8,
|
||
DataSource = 9,
|
||
LanguageKey = 10,
|
||
CustomEndpoint = 20,
|
||
BackgroundWorker = 21,
|
||
IntranetWidget = 22,
|
||
Tenant = 23,
|
||
}
|
||
|
||
export enum WizardDeleteStatusEnum {
|
||
Deleted = 0,
|
||
Kept = 1,
|
||
NotFound = 2,
|
||
}
|
||
|
||
export enum WizardDeleteReasonEnum {
|
||
None = 0,
|
||
InUse = 1,
|
||
Redeploy = 2,
|
||
}
|
||
|
||
export interface WizardRecordRefDto {
|
||
recordType: WizardRecordTypeEnum
|
||
name: string
|
||
}
|
||
|
||
export interface WizardDeleteLogItemDto {
|
||
recordType: WizardRecordTypeEnum
|
||
name: string
|
||
status: WizardDeleteStatusEnum
|
||
reason: WizardDeleteReasonEnum
|
||
usedBy: WizardRecordRefDto[]
|
||
}
|
||
|
||
/** Silinen, korunan ve bulunamayan her kayıt tek tek listelenir. */
|
||
export interface WizardDeleteResultDto {
|
||
fileName: string
|
||
wizardName: string
|
||
items: WizardDeleteLogItemDto[]
|
||
}
|
||
|
||
export interface WizardInsertedRecordsDto {
|
||
languageKeys: string[]
|
||
permissionGroupNames: string[]
|
||
permissionNames: string[]
|
||
menuCodes: string[]
|
||
dataSourceCodes: string[]
|
||
moduleIds: 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<ListFormWizardDto, 'groups'> {
|
||
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[]
|
||
/** Zip icerigi ile hedef ortam karsilastirildiginda bulunan tutarsizliklar. */
|
||
issues: WizardImportIssueDto[]
|
||
/** Engelleyici bulgu varsa import baslatilamaz; sunucu da yazma ucunu reddeder. */
|
||
hasBlockingIssues: boolean
|
||
/** Sema islerinin (script, kolon ekleme, tablo tasarimcisi) hedef aldigi veri kaynagi. */
|
||
dataSourceCode: string
|
||
}
|
||
|
||
/** Import analizinde bulunan bir tutarsizligin agirligi; backend enum'u ile birebir. */
|
||
export enum WizardImportIssueSeverityEnum {
|
||
Error = 0,
|
||
Warning = 1,
|
||
}
|
||
|
||
/** Import analizinde bulunan tek bir tutarsizlik. */
|
||
export interface WizardImportIssueDto {
|
||
severity: WizardImportIssueSeverityEnum
|
||
/** Bulgunun ilgili oldugu kapsam-goreli yol; genel bir bulguda bostur. */
|
||
path?: string
|
||
message: string
|
||
/**
|
||
* Bulgunun karsiligi olan SQL cumlesi. Eksik kolon uyarilarinda kapanista calistirilacak
|
||
* cumledir; engelleyici bulgularda kullanicinin elle uygulayacagi cumledir.
|
||
*/
|
||
statement?: string
|
||
/** Bulgu bir tablo semasiyla ilgiliyse tablonun adi; tablo tasarimcisi bununla acilir. */
|
||
tableName?: string
|
||
/** Tablo semasi; script'te sema oneki yoksa bostur. */
|
||
schemaName?: string
|
||
/** Tablo hedefte hic yoksa true; tasarimci olusturma modunda acilir. */
|
||
tableMissing?: boolean
|
||
/**
|
||
* Bulgu arsivin kendi eksikliginden/bozulmasindan kaynaklaniyorsa true. Hedef ortamda
|
||
* giderilemez; tek cozum kaynak ortamda export'u tekrarlamaktir.
|
||
*/
|
||
requiresReexport?: boolean
|
||
}
|
||
|
||
/**
|
||
* Import kapanisinin sonucu. Yazilan dosyalar bagimlilik sirasiyla veritabanina uygulanir:
|
||
* once SQL nesneleri, sonra CRUD tanimlari, en son veri satirlari.
|
||
*/
|
||
export interface WizardImportCompleteResultDto {
|
||
/** Calistirilan SQL nesne scriptleri; veri satirlarindan once uygulanir. */
|
||
appliedSql: WizardImportStepResultDto[]
|
||
/**
|
||
* Hedefte eksik olup eklenen kolonlar. Script'in CREATE blogu var olan bir tabloda calismadigi
|
||
* icin yeni kolonlar buradan gelir; var olan bir kolon degistirilmez, hicbir kolon dusurulmez.
|
||
*/
|
||
appliedSchema: WizardImportStepResultDto[]
|
||
/** Veritabanina uygulanan CRUD endpoint dosyalari. */
|
||
appliedCrud: WizardImportStepResultDto[]
|
||
appliedData: WizardImportSeedApplyResultDto[]
|
||
/** Kurulan ekran tanimlari; import bitince ekran calisir, migrate beklemez. */
|
||
appliedWizards: WizardImportStepResultDto[]
|
||
}
|
||
|
||
/** Import kapanisindaki tek bir adimin sonucu (SQL scripti ya da CRUD dosyasi). */
|
||
export interface WizardImportStepResultDto {
|
||
path: string
|
||
/** Adim basariliysa yapilan isi ozetleyen kisa metin. */
|
||
detail?: string
|
||
/** Adim basarisizsa nedeni. */
|
||
error?: string
|
||
}
|
||
|
||
/** 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
|
||
}
|
||
|
||
/** Export zip'ine girecek tek bir seed dosyasi. */
|
||
export interface WizardExportEntryDto {
|
||
/** Kapsam klasorune goreli yol, ornegin `sql/object/Prj_T_Task.sql`. */
|
||
path: string
|
||
/** Dosyanin arsive neden girdigi (wizard'in kendisi, alt form, lookup, veri...). */
|
||
reason: string
|
||
}
|
||
|
||
/** Indirmeden once gosterilen export onizlemesi. */
|
||
export interface WizardExportAnalysisDto {
|
||
fileName: string
|
||
archiveName: string
|
||
scopeFolder: string
|
||
entries: WizardExportEntryDto[]
|
||
/** Bagimlilik olarak bulunan ama diskte karsiligi olmayan dosyalar. */
|
||
warnings: string[]
|
||
}
|