Maintenance Fault

This commit is contained in:
Sedat ÖZTÜRK 2025-11-21 11:31:59 +03:00
parent 540668b1c0
commit 1745707691
18 changed files with 1740 additions and 38 deletions

View file

@ -9452,7 +9452,19 @@
},
{
"resourceName": "Platform",
"key": "App.Maintenance.Faults",
"key": "App.Maintenance.FaultType",
"tr": "Arıza Türleri",
"en": "Fault Types"
},
{
"resourceName": "Platform",
"key": "App.Maintenance.FaultStatus",
"tr": "Arıza Durumları",
"en": "Fault Statuses"
},
{
"resourceName": "Platform",
"key": "App.Maintenance.Fault",
"tr": "Arıza Bildirimleri",
"en": "Fault Reports"
},

View file

@ -1313,6 +1313,532 @@ public class ListFormSeeder_Maintenance : IDataSeedContributor, ITransientDepend
}
})
);
#region Fault
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Fault))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.Fault,
Name = AppCodes.Maintenance.Fault,
Title = AppCodes.Maintenance.Fault,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Maintenance.Fault,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Fault)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Maintenance.Fault),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Fault)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Maintenance.Fault, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 1, DataField = "Code", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Title", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 3, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 4, DataField = "WorkCenterId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 5, DataField = "Location", ColSpan = 1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 6, DataField = "FaultTypeId", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 7, DataField = "Priority", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 8, DataField = "Severity", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 9, DataField = "AssignedTo", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox },
new EditingFormItemDto { Order = 10, DataField = "EstimatedRepairTime", ColSpan = 1, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 11, DataField = "FollowUpRequired", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 12, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
new EditingFormItemDto { Order = 13, DataField = "FaultStatusId", ColSpan = 1, EditorType2=EditorTypes.dxSelectBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
);
#region Fault Type Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Code",
Width = 100,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Title",
Width = 180,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "WorkCenterId",
Width = 150,
ListOrderNo = 5,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Workcenter), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Location",
Width = 150,
ListOrderNo = 6,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "FaultTypeId",
Width = 100,
ListOrderNo = 7,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.FaultType), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Priority",
Width = 100,
ListOrderNo = 7,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = JsonSerializer.Serialize(new LookupDto
{
DataSourceType = UiLookupDataSourceTypeEnum.StaticData,
ValueExpr = "key",
DisplayExpr = "name",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key = "Low", Name = "Low" },
new () { Key = "Medium", Name = "Medium" },
new () { Key = "High", Name = "High" },
new () { Key = "Urgent", Name = "Urgent" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Severity",
Width = 100,
ListOrderNo = 8,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = JsonSerializer.Serialize(new LookupDto
{
DataSourceType = UiLookupDataSourceTypeEnum.StaticData,
ValueExpr = "key",
DisplayExpr = "name",
LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] {
new () { Key = "Low", Name = "Low" },
new () { Key = "Medium", Name = "Medium" },
new () { Key = "High", Name = "High" },
new () { Key = "Critical", Name = "Critical" },
}),
}),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Int32,
FieldName = "EstimatedRepairTime",
Width = 100,
ListOrderNo = 9,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "FollowUpRequired",
Width = 100,
ListOrderNo = 10,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "FaultStatusId",
Width = 100,
ListOrderNo = 11,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.FaultStatus), "Id", "Name"),
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
]);
#endregion
}
#endregion
#region Fault Type
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.FaultType))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.FaultType,
Name = AppCodes.Maintenance.FaultType,
Title = AppCodes.Maintenance.FaultType,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Maintenance.FaultType,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultType)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Maintenance.FaultType),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.FaultType)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Maintenance.FaultType, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 3, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
);
#region Fault Type Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
]);
#endregion
}
#endregion
#region Fault Status
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.FaultStatus))
{
var listForm = await _listFormRepository.InsertAsync(
new ListForm()
{
ListFormType = ListFormTypeEnum.List,
IsSubForm = false,
ShowNote = true,
LayoutJson = DefaultLayoutJson,
CultureName = LanguageCodes.En,
ListFormCode = ListFormCodes.Lists.FaultStatus,
Name = AppCodes.Maintenance.FaultStatus,
Title = AppCodes.Maintenance.FaultStatus,
DataSourceCode = SeedConsts.DataSources.DefaultCode,
IsTenant = true,
IsBranch = false,
IsOrganizationUnit = false,
Description = AppCodes.Maintenance.FaultStatus,
SelectCommandType = SelectCommandTypeEnum.Table,
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultStatus)),
KeyFieldName = "Id",
KeyFieldDbSourceType = DbType.Guid,
DefaultFilter = DefaultFilterJson,
SortMode = GridOptions.SortModeSingle,
FilterRowJson = DefaultFilterRowJson,
HeaderFilterJson = DefaultHeaderFilterJson,
SearchPanelJson = DefaultSearchPanelJson,
GroupPanelJson = DefaultGroupPanelJson,
SelectionJson = DefaultSelectionSingleJson,
ColumnOptionJson = DefaultColumnOptionJson,
PermissionJson = DefaultPermissionJson(AppCodes.Maintenance.FaultStatus),
DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.FaultStatus)),
DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson,
PagerOptionJson = DefaultPagerOptionJson,
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson,
EditingOptionJson = DefaultEditingOptionJson(AppCodes.Maintenance.FaultStatus, 500, 250, true, true, true, true, false),
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>() {
new() {
Order=1, ColCount=1, ColSpan=1, ItemType="group", Items= [
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 2, DataField = "Description", ColSpan = 1, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order = 3, DataField = "IsActive", ColSpan = 1, EditorType2=EditorTypes.dxCheckBox },
]}
}),
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
new() { FieldName = "IsActive", FieldDbType = DbType.Boolean, Value = "true", CustomValueType = FieldCustomValueTypeEnum.Value }
}),
}
);
#region Fault Status Fields
await _listFormFieldRepository.InsertManyAsync([
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Guid,
FieldName = "Id",
Width = 100,
ListOrderNo = 1,
Visible = false,
IsActive = true,
IsDeleted = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Name",
Width = 350,
ListOrderNo = 2,
Visible = true,
IsActive = true,
IsDeleted = false,
SortIndex = 1,
SortDirection = GridColumnOptions.SortOrderAsc,
AllowSearch = true,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Description",
Width = 500,
ListOrderNo = 3,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
},
new() {
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.Boolean,
FieldName = "IsActive",
Width = 100,
ListOrderNo = 4,
Visible = true,
IsActive = true,
IsDeleted = false,
AllowSearch = true,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
}
]);
#endregion
}
#endregion
}
}

View file

@ -2447,19 +2447,39 @@
},
{
"ParentCode": "App.Maintenance",
"Code": "App.Maintenance.Faults",
"DisplayName": "App.Maintenance.Faults",
"Code": "App.Maintenance.FaultType",
"DisplayName": "App.Maintenance.FaultType",
"Order": 7,
"Url": "/admin/list/list-faulttype",
"Icon": "FcInspection",
"RequiredPermissionName": "App.Maintenance.FaultType",
"IsDisabled": false
},
{
"ParentCode": "App.Maintenance",
"Code": "App.Maintenance.FaultStatus",
"DisplayName": "App.Maintenance.FaultStatus",
"Order": 8,
"Url": "/admin/maintenance/faults",
"Url": "/admin/list/list-faultstatus",
"Icon": "FcMediumPriority",
"RequiredPermissionName": "App.Maintenance.FaultStatus",
"IsDisabled": false
},
{
"ParentCode": "App.Maintenance",
"Code": "App.Maintenance.Fault",
"DisplayName": "App.Maintenance.Fault",
"Order": 9,
"Url": "/admin/list/list-fault",
"Icon": "FcHighPriority",
"RequiredPermissionName": "App.Maintenance.Faults",
"RequiredPermissionName": "App.Maintenance.Fault",
"IsDisabled": false
},
{
"ParentCode": "App.Maintenance",
"Code": "App.Maintenance.Workorders",
"DisplayName": "App.Maintenance.Workorders",
"Order": 9,
"Order": 10,
"Url": "/admin/maintenance/workorders",
"Icon": "FcList",
"RequiredPermissionName": "App.Maintenance.Workorders",

View file

@ -6819,17 +6819,17 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault",
"ParentName": null,
"DisplayName": "App.Maintenance.Faults",
"DisplayName": "App.Maintenance.Fault",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Create",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Create",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
@ -6837,8 +6837,8 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Update",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Update",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
@ -6846,8 +6846,8 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Delete",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Delete",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
@ -6855,8 +6855,8 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Export",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Export",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
@ -6864,8 +6864,8 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Import",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Import",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
@ -6873,13 +6873,142 @@
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Faults.Note",
"ParentName": "App.Maintenance.Faults",
"Name": "App.Maintenance.Fault.Note",
"ParentName": "App.Maintenance.Fault",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType",
"ParentName": null,
"DisplayName": "App.Maintenance.FaultType",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Create",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Update",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Delete",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Export",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Import",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultType.Note",
"ParentName": "App.Maintenance.FaultType",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus",
"ParentName": null,
"DisplayName": "App.Maintenance.FaultStatus",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Create",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Create",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Update",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Update",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Delete",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Delete",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Export",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Export",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Import",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Import",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.FaultStatus.Note",
"ParentName": "App.Maintenance.FaultStatus",
"DisplayName": "Note",
"IsEnabled": true,
"MultiTenancySide": 3,
"MenuGroup": "Erp"
},
{
"GroupName": "App.Maintenance",
"Name": "App.Maintenance.Workorders",

View file

@ -164,5 +164,8 @@ public enum TableNameEnum
WorkcenterSpecification,
Plan,
PlanMaterial,
PlanEmployee
PlanEmployee,
Fault,
FaultStatus,
FaultType,
}

View file

@ -539,6 +539,9 @@ public static class PlatformConsts
public const string Plan = "list-maintenanceplan";
public const string PlanMaterial = "list-maintenanceplanmaterial";
public const string PlanEmployee = "list-maintenanceplanemployee";
public const string Fault = "list-fault";
public const string FaultType = "list-faulttype";
public const string FaultStatus = "list-faultstatus";
}
}

View file

@ -193,6 +193,9 @@ public static class TableNameResolver
{ nameof(TableNameEnum.Plan), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
{ nameof(TableNameEnum.PlanMaterial), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
{ nameof(TableNameEnum.PlanEmployee), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
{ nameof(TableNameEnum.Fault), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
{ nameof(TableNameEnum.FaultStatus), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
{ nameof(TableNameEnum.FaultType), (TablePrefix.TenantByName, MenuPrefix.Maintenance) },
// 🔹 ACCOUNTING

View file

@ -529,6 +529,9 @@ public static class SeedConsts
public const string Plan = Default + ".Plan";
public const string PlanMaterial = Default + ".PlanMaterial";
public const string PlanEmployee = Default + ".PlanEmployee";
public const string Fault = Default + ".Fault";
public const string FaultType = Default + ".FaultType";
public const string FaultStatus = Default + ".FaultStatus";
}
public static class Accounting

View file

@ -0,0 +1,33 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class Fault : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Code { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public Guid? WorkCenterId { get; set; }
public Workcenter? WorkCenter { get; set; }
public string Location { get; set; }
public Guid? FaultTypeId { get; set; }
public FaultType? FaultType { get; set; }
public string Priority { get; set; }
public string Severity { get; set; }
public int? EstimatedRepairTime { get; set; }
public bool FollowUpRequired { get; set; }
public Guid? FaultStatusId { get; set; }
public FaultStatus? FaultStatus { get; set; }
public bool IsActive { get; set; }
public string AssignedTo { get; set; }
public int? ActualRepairTime { get; set; }
public Guid WorkOrderId { get; set; }
public string ResolutionNotes { get; set; }
public string ClosedBy { get; set; }
public DateTime? ClosedAt { get; set; }
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class FaultStatus : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Fault> Faults { get; set; }
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace Erp.Platform.Entities;
public class FaultType : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public ICollection<Fault> Faults { get; set; }
}

View file

@ -26,7 +26,6 @@ using System.Text.Json;
using static Erp.Platform.PlatformConsts;
using static Erp.Settings.SettingsConsts;
using Erp.Platform.Enums;
using Erp.Platform.Domain.DeveloperKit;
namespace Erp.Platform.EntityFrameworkCore;
@ -237,6 +236,9 @@ public class PlatformDbContext :
public DbSet<Workcenter> Workcenters { get; set; }
public DbSet<WorkcenterSpecification> WorkcenterSpecifications { get; set; }
public DbSet<MaintenancePlan> MaintenancePlans { get; set; }
public DbSet<Fault> Faults { get; set; }
public DbSet<FaultStatus> FaultStatuses { get; set; }
public DbSet<FaultType> FaultTypes { get; set; }
#endregion
public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
@ -2798,5 +2800,45 @@ public class PlatformDbContext :
.HasForeignKey(x => x.MaintenancePlanId)
.OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<Fault>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Fault)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(100);
b.Property(x => x.WorkCenterId).IsRequired().HasMaxLength(50);
b.Property(x => x.Location).HasMaxLength(250);
b.Property(x => x.FaultTypeId).IsRequired();
b.Property(x => x.Priority).HasMaxLength(50);
b.Property(x => x.Severity).HasMaxLength(50);
b.Property(x => x.Title).HasMaxLength(200);
b.Property(x => x.Description);
b.Property(x => x.AssignedTo).HasMaxLength(150);
b.Property(x => x.FaultStatusId).IsRequired();
b.Property(x => x.ResolutionNotes);
b.Property(x => x.ClosedBy).HasMaxLength(150);
b.Property(x => x.WorkOrderId).HasMaxLength(100);
});
builder.Entity<FaultStatus>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultStatus)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
builder.Entity<FaultType>(b =>
{
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.FaultType)), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(50);
b.Property(x => x.Description).HasMaxLength(500);
b.Property(x => x.IsActive).HasDefaultValue(true);
});
}
}

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Erp.Platform.Migrations
{
[DbContext(typeof(PlatformDbContext))]
[Migration("20251120201509_Initial")]
[Migration("20251121074401_Initial")]
partial class Initial
{
/// <inheritdoc />
@ -4540,6 +4540,236 @@ namespace Erp.Platform.Migrations
b.ToTable("Hr_T_Expense", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.Fault", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<int?>("ActualRepairTime")
.HasColumnType("int");
b.Property<string>("AssignedTo")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<DateTime?>("ClosedAt")
.HasColumnType("datetime2");
b.Property<string>("ClosedBy")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<int?>("EstimatedRepairTime")
.HasColumnType("int");
b.Property<Guid>("FaultStatusId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("FaultTypeId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("FollowUpRequired")
.HasColumnType("bit");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Location")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Priority")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ResolutionNotes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Severity")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<Guid>("WorkCenterId")
.HasMaxLength(50)
.HasColumnType("uniqueidentifier");
b.Property<Guid>("WorkOrderId")
.HasMaxLength(100)
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("FaultStatusId");
b.HasIndex("FaultTypeId");
b.HasIndex("WorkCenterId");
b.ToTable("Mnt_T_Fault", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.FaultStatus", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<bool>("IsActive")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("Mnt_T_FaultStatus", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.FaultType", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<bool>("IsActive")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("Mnt_T_FaultType", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.GlobalSearch", b =>
{
b.Property<int>("Id")
@ -14283,6 +14513,33 @@ namespace Erp.Platform.Migrations
b.Navigation("Employee");
});
modelBuilder.Entity("Erp.Platform.Entities.Fault", b =>
{
b.HasOne("Erp.Platform.Entities.FaultStatus", "FaultStatus")
.WithMany("Faults")
.HasForeignKey("FaultStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Erp.Platform.Entities.FaultType", "FaultType")
.WithMany("Faults")
.HasForeignKey("FaultTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Erp.Platform.Entities.Workcenter", "WorkCenter")
.WithMany()
.HasForeignKey("WorkCenterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FaultStatus");
b.Navigation("FaultType");
b.Navigation("WorkCenter");
});
modelBuilder.Entity("Erp.Platform.Entities.JobPosition", b =>
{
b.HasOne("Erp.Platform.Entities.Department", "Department")
@ -15374,6 +15631,16 @@ namespace Erp.Platform.Migrations
b.Navigation("Events");
});
modelBuilder.Entity("Erp.Platform.Entities.FaultStatus", b =>
{
b.Navigation("Faults");
});
modelBuilder.Entity("Erp.Platform.Entities.FaultType", b =>
{
b.Navigation("Faults");
});
modelBuilder.Entity("Erp.Platform.Entities.LossReason", b =>
{
b.Navigation("Opportunities");

View file

@ -1276,6 +1276,50 @@ namespace Erp.Platform.Migrations
table.PrimaryKey("PK_Hr_T_Template360", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Mnt_T_FaultStatus",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Mnt_T_FaultStatus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Mnt_T_FaultType",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
IsActive = table.Column<bool>(type: "bit", nullable: false, defaultValue: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Mnt_T_FaultType", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Mnt_T_WorkcenterStatus",
columns: table => new
@ -4936,6 +4980,61 @@ namespace Erp.Platform.Migrations
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Mnt_T_Fault",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
Code = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
WorkCenterId = table.Column<Guid>(type: "uniqueidentifier", maxLength: 50, nullable: false),
Location = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
FaultTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Priority = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
Severity = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
EstimatedRepairTime = table.Column<int>(type: "int", nullable: true),
FollowUpRequired = table.Column<bool>(type: "bit", nullable: false),
FaultStatusId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
AssignedTo = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
ActualRepairTime = table.Column<int>(type: "int", nullable: true),
WorkOrderId = table.Column<Guid>(type: "uniqueidentifier", maxLength: 100, nullable: false),
ResolutionNotes = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClosedBy = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: true),
ClosedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Mnt_T_Fault", x => x.Id);
table.ForeignKey(
name: "FK_Mnt_T_Fault_Mnt_T_FaultStatus_FaultStatusId",
column: x => x.FaultStatusId,
principalTable: "Mnt_T_FaultStatus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Mnt_T_Fault_Mnt_T_FaultType_FaultTypeId",
column: x => x.FaultTypeId,
principalTable: "Mnt_T_FaultType",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Mnt_T_Fault_Mnt_T_Workcenter_WorkCenterId",
column: x => x.WorkCenterId,
principalTable: "Mnt_T_Workcenter",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Mnt_T_Plan",
columns: table => new
@ -6440,6 +6539,21 @@ namespace Erp.Platform.Migrations
table: "Hr_T_SurveyResponse",
column: "SurveyId");
migrationBuilder.CreateIndex(
name: "IX_Mnt_T_Fault_FaultStatusId",
table: "Mnt_T_Fault",
column: "FaultStatusId");
migrationBuilder.CreateIndex(
name: "IX_Mnt_T_Fault_FaultTypeId",
table: "Mnt_T_Fault",
column: "FaultTypeId");
migrationBuilder.CreateIndex(
name: "IX_Mnt_T_Fault_WorkCenterId",
table: "Mnt_T_Fault",
column: "WorkCenterId");
migrationBuilder.CreateIndex(
name: "IX_Mnt_T_Plan_WorkCenterId",
table: "Mnt_T_Plan",
@ -7163,6 +7277,9 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "Hr_T_SurveyQuestionOption");
migrationBuilder.DropTable(
name: "Mnt_T_Fault");
migrationBuilder.DropTable(
name: "Mnt_T_PlanEmployee");
@ -7379,6 +7496,12 @@ namespace Erp.Platform.Migrations
migrationBuilder.DropTable(
name: "Hr_T_SurveyQuestion");
migrationBuilder.DropTable(
name: "Mnt_T_FaultStatus");
migrationBuilder.DropTable(
name: "Mnt_T_FaultType");
migrationBuilder.DropTable(
name: "Mnt_T_Plan");

View file

@ -4537,6 +4537,236 @@ namespace Erp.Platform.Migrations
b.ToTable("Hr_T_Expense", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.Fault", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<int?>("ActualRepairTime")
.HasColumnType("int");
b.Property<string>("AssignedTo")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<DateTime?>("ClosedAt")
.HasColumnType("datetime2");
b.Property<string>("ClosedBy")
.HasMaxLength(150)
.HasColumnType("nvarchar(150)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<int?>("EstimatedRepairTime")
.HasColumnType("int");
b.Property<Guid>("FaultStatusId")
.HasColumnType("uniqueidentifier");
b.Property<Guid>("FaultTypeId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("FollowUpRequired")
.HasColumnType("bit");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Location")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Priority")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ResolutionNotes")
.HasColumnType("nvarchar(max)");
b.Property<string>("Severity")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.Property<string>("Title")
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<Guid>("WorkCenterId")
.HasMaxLength(50)
.HasColumnType("uniqueidentifier");
b.Property<Guid>("WorkOrderId")
.HasMaxLength(100)
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("FaultStatusId");
b.HasIndex("FaultTypeId");
b.HasIndex("WorkCenterId");
b.ToTable("Mnt_T_Fault", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.FaultStatus", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<bool>("IsActive")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("Mnt_T_FaultStatus", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.FaultType", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<bool>("IsActive")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(true);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("Mnt_T_FaultType", (string)null);
});
modelBuilder.Entity("Erp.Platform.Entities.GlobalSearch", b =>
{
b.Property<int>("Id")
@ -14280,6 +14510,33 @@ namespace Erp.Platform.Migrations
b.Navigation("Employee");
});
modelBuilder.Entity("Erp.Platform.Entities.Fault", b =>
{
b.HasOne("Erp.Platform.Entities.FaultStatus", "FaultStatus")
.WithMany("Faults")
.HasForeignKey("FaultStatusId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Erp.Platform.Entities.FaultType", "FaultType")
.WithMany("Faults")
.HasForeignKey("FaultTypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Erp.Platform.Entities.Workcenter", "WorkCenter")
.WithMany()
.HasForeignKey("WorkCenterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FaultStatus");
b.Navigation("FaultType");
b.Navigation("WorkCenter");
});
modelBuilder.Entity("Erp.Platform.Entities.JobPosition", b =>
{
b.HasOne("Erp.Platform.Entities.Department", "Department")
@ -15371,6 +15628,16 @@ namespace Erp.Platform.Migrations
b.Navigation("Events");
});
modelBuilder.Entity("Erp.Platform.Entities.FaultStatus", b =>
{
b.Navigation("Faults");
});
modelBuilder.Entity("Erp.Platform.Entities.FaultType", b =>
{
b.Navigation("Faults");
});
modelBuilder.Entity("Erp.Platform.Entities.LossReason", b =>
{
b.Navigation("Opportunities");

View file

@ -100,9 +100,7 @@
"props": null,
"description": null,
"isActive": true,
"dependencies": [
"DynamicEntityComponent"
]
"dependencies": ["DynamicEntityComponent"]
}
],
"ReportCategories": [
@ -2431,12 +2429,7 @@
"minSalary": 80000,
"maxSalary": 120000,
"currencyCode": "USD",
"requiredSkills": [
"JavaScript",
"TypeScript",
"React",
"Node.js"
],
"requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"],
"responsibilities": [
"Develop frontend and backend applications",
"Write clean and maintainable code",
@ -4131,9 +4124,7 @@
{
"postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪",
"type": "video",
"urls": [
"https://www.w3schools.com/html/mov_bbb.mp4"
]
"urls": ["https://www.w3schools.com/html/mov_bbb.mp4"]
}
],
"SocialPollOptions": [
@ -5009,5 +5000,148 @@
"isActive": true,
"lastExecuted": "2023-08-15T00:00:00.000Z"
}
],
"Faults": [
{
"code": "ARZ-2024-001",
"workCenterCode": "CNC-001",
"location": "Atölye A - Hat 1",
"faultTypeName": "Mekanik",
"priority": "High",
"severity": "High",
"title": "Motor Aşırı Titreşim",
"description": "CNC torna tezgahında motor aşırı titreşim yapıyor. Ses seviyesi normalden yüksek ve hassas işlemlerde problem yaşanıyor.",
"assignedTo": "Mehmet Kaya - Mekanik Ekibi",
"status": "Açık",
"estimatedRepairTime": 180,
"followUpRequired": true,
"isActive": true
},
{
"code": "ARZ-2024-002",
"workCenterCode": "COMP-001",
"location": "Kompresör Odası",
"faultTypeName": "Elektrik",
"priority": "Urgent",
"severity": "Critical",
"title": "Elektrik Panosu Arızası",
"description": "Kompresör elektrik panosunda kısa devre meydana geldi. Sistem tamamen durdu.",
"assignedTo": "Ahmet Yılmaz - Elektrik Ekibi",
"status": "Kapandı",
"estimatedRepairTime": 240,
"actualRepairTime": 195,
"resolutionNotes": "Yanık sigorta değiştirildi ve pano kontrolleri yapıldı. Sistem normal çalışıyor.",
"followUpRequired": false,
"isActive": true
},
{
"code": "ARZ-2024-003",
"workCenterCode": "CONV-001",
"location": "Ana Üretim Hattı",
"faultTypeName": "Performans",
"priority": "Normal",
"severity": "Medium",
"title": "Kayış Gerilimi Azaldı",
"description": "Konveyör kayışında gevşeme tespit edildi. Hız düşüklüğü gözlemleniyor.",
"status": "Onarımda",
"estimatedRepairTime": 60,
"followUpRequired": false,
"isActive": true
},
{
"code": "ARZ-2024-004",
"workCenterCode": "CONV-001",
"location": "Kaynak Atölyesi",
"faultTypeName": "Yazılım",
"priority": "High",
"severity": "High",
"title": "Program Kalibrasyon Hatası",
"description": "Robot kaynak pozisyonlarında sapma var. Kalibrasyon gerekiyor.",
"assignedTo": "Sema Korkmaz - Robot Teknisyeni",
"status": "İnceleniyor",
"estimatedRepairTime": 120,
"followUpRequired": true,
"isActive": true
},
{
"code": "ARZ-2024-005",
"workCenterCode": "CONV-001",
"location": "Pres Atölyesi",
"faultTypeName": "Hidrolik",
"priority": "Low",
"severity": "Low",
"title": "Yağ Sızıntısı",
"description": "Hidrolik sistem borularında hafif yağ sızıntısı tespit edildi.",
"status": "Açık",
"estimatedRepairTime": 45,
"actualRepairTime": 30,
"resolutionNotes": "Boru bağlantıları sıkılaştırıldı. Sızıntı durduruldu.",
"followUpRequired": true,
"isActive": true
}
],
"FaultTypes": [
{
"name": "Mekanik",
"description": "Mekanik bileşenlerde meydana gelen arızalar",
"isActive": true
},
{
"name": "Elektrik",
"description": "Elektrik sistemlerinde meydana gelen arızalar",
"isActive": true
},
{
"name": "Hidrolik",
"description": "Hidrolik sistemlerde meydana gelen arızalar",
"isActive": true
},
{
"name": "Pnömatik",
"description": "Pnömatik sistemlerde meydana gelen arızalar",
"isActive": true
},
{
"name": "Yazılım",
"description": "Yazılım ve programlama hatalarından kaynaklanan arızalar",
"isActive": true
},
{
"name": "Güvenlik",
"description": "Güvenlik sistemlerinde meydana gelen arızalar",
"isActive": true
},
{
"name": "Performans",
"description": "Performans ile ilgili arızalar",
"isActive": true
},
{
"name": "Diğer",
"description": "Diğer arızalar",
"isActive": true
}
],
"FaultStatuses": [
{
"name": "Açık",
"description": "Arıza kaydı yeni oluşturuldu ve henüz müdahale edilmedi",
"isActive": true
},
{
"name": "İnceleniyor",
"description": "Arıza üzerinde inceleme ve teşhis çalışmaları devam ediyor",
"isActive": true
},
{
"name": "Onarımda",
"description": "Arıza giderme ve onarım işlemleri sürüyor",
"isActive": true
},
{
"name": "Kapandı",
"description": "Arıza giderildi ve kayıt kapatıldı",
"isActive": true
}
]
}

View file

@ -110,6 +110,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
private readonly IRepository<WorkcenterStatus, Guid> _workcenterStatusRepository;
private readonly IRepository<Workcenter, Guid> _workcenterRepository;
private readonly IRepository<MaintenancePlan, Guid> _maintenancePlanRepository;
private readonly IRepository<Fault, Guid> _faultRepository;
private readonly IRepository<FaultStatus, Guid> _faultStatusRepository;
private readonly IRepository<FaultType, Guid> _faultTypeRepository;
public TenantDataSeeder(
IClock clock,
@ -202,7 +205,10 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
IRepository<WorkcenterType, Guid> workcenterTypeRepository,
IRepository<WorkcenterStatus, Guid> workcenterStatusRepository,
IRepository<Workcenter, Guid> workcenterRepository,
IRepository<MaintenancePlan, Guid> maintenancePlanRepository
IRepository<MaintenancePlan, Guid> maintenancePlanRepository,
IRepository<Fault, Guid> faultRepository,
IRepository<FaultStatus, Guid> faultStatusRepository,
IRepository<FaultType, Guid> faultTypeRepository
)
{
_clock = clock;
@ -297,6 +303,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
_workcenterStatusRepository = workcenterStatusRepository;
_workcenterRepository = workcenterRepository;
_maintenancePlanRepository = maintenancePlanRepository;
_faultRepository = faultRepository;
_faultStatusRepository = faultStatusRepository;
_faultTypeRepository = faultTypeRepository;
}
private static IConfigurationRoot BuildConfiguration()
@ -2011,6 +2020,63 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
LastExecuted = item.LastExecuted
}, autoSave: true);
}
foreach (var item in items.FaultTypes)
{
var exists = await _faultTypeRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _faultTypeRepository.InsertAsync(new FaultType
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.FaultStatuses)
{
var exists = await _faultStatusRepository.AnyAsync(x => x.Name == item.Name);
if (exists)
continue;
await _faultStatusRepository.InsertAsync(new FaultStatus
{
Name = item.Name,
Description = item.Description,
IsActive = item.IsActive
}, autoSave: true);
}
foreach (var item in items.Faults)
{
var exists = await _faultRepository.AnyAsync(x => x.Code == item.Code);
if (exists)
continue;
var workcenter = await _workcenterRepository.FirstOrDefaultAsync(x => x.Code == item.WorkCenterCode);
var faultType = await _faultTypeRepository.FirstOrDefaultAsync(x => x.Name == item.FaultTypeName);
var faultStatus = await _faultStatusRepository.FirstOrDefaultAsync(x => x.Name == item.Status);
await _faultRepository.InsertAsync(new Fault
{
Code = item.Code,
WorkCenterId = workcenter?.Id,
Location = item.Location,
FaultTypeId = faultType?.Id,
Priority = item.Priority,
Severity = item.Severity,
Title = item.Title,
Description = item.Description,
FaultStatusId = faultStatus?.Id,
EstimatedRepairTime = item.EstimatedRepairTime,
ActualRepairTime = item.ActualRepairTime,
ResolutionNotes = item.ResolutionNotes,
FollowUpRequired = item.FollowUpRequired,
IsActive = item.IsActive,
}, autoSave: true);
}
}
}

View file

@ -102,6 +102,41 @@ public class TenantSeederDto
public List<WorkcenterStatusSeedDto> WorkcenterStatuses { get; set; }
public List<WorkcenterSeedDto> Workcenters { get; set; }
public List<MaintenancePlanSeedDto> MaintenancePlans { get; set; }
public List<FaultSeedDto> Faults { get; set; }
public List<FaultStatusSeedDto> FaultStatuses { get; set; }
public List<FaultTypeSeedDto> FaultTypes { get; set; }
}
public class FaultSeedDto
{
public string Code { get; set; }
public string WorkCenterCode { get; set; }
public string Location { get; set; }
public string FaultTypeName { get; set; }
public string Priority { get; set; }
public string Severity { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Status { get; set; }
public int? EstimatedRepairTime { get; set; }
public int? ActualRepairTime { get; set; }
public string ResolutionNotes { get; set; }
public bool FollowUpRequired { get; set; }
public bool IsActive { get; set; }
}
public class FaultStatusSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class FaultTypeSeedDto
{
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
}
public class MaintenancePlanSeedDto