161 Commits
Author SHA1 Message Date
ivanszabo 7f3562fb73 MemoryStreamos a fotó ... 2025-07-02 18:30:10 +02:00
ivanszabo bc977af15c Alap BUGFIX javításhoz 2025-07-02 13:32:33 +02:00
ivanszabo 6be6bc533c Hogy az "élesre" menjen .. 2025-07-01 17:13:34 +02:00
ivanszabo 864c76f827 BUGFIX Scroll javítása 1.1.035 2025-07-01 10:47:47 +02:00
ivanszabo 8208b31d08 1.1.033 Fényképek beküldése javítása 2025-07-01 08:30:34 +02:00
ivanszabo 4f149f4eef 1.1.030 2025-06-30 07:24:55 +02:00
ivanszabo 8ce7268338 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-06-29 13:30:38 +02:00
ivanszabo d42900e8f6 MOBILE BugFix 2025-06-29 13:30:34 +02:00
ivanszabo 25cd092a08 Backend BUGFIX 2025-06-29 13:30:08 +02:00
ivanszabo e5dd9aad27 A PDF generálásának javítása 2025-06-17 11:35:36 +02:00
ivanszabo d1ad7e76c3 Na most van jól beállítva a dolog. 2025-06-10 17:26:14 +02:00
ivanszabo 5e94586a75 Jóváhagyási BUGFIX 2025-06-10 12:14:52 +02:00
ivanszabo d775ae82a0 GIT 2025-06-10 12:14:41 +02:00
ivanszabo e6b53d193c ok 2025-06-06 08:47:53 +02:00
ivanszabo 400a459479 Itt maradt 2025-06-06 08:46:12 +02:00
Iván Szabó ac74ef9cfc v1.1.030 2025-06-05 08:56:22 +02:00
Iván Szabó 4c7d71a404 Blokkolás és frissítés is 2025-06-05 08:47:17 +02:00
ivanszabo 75d8119880 Ellenőrző lap mdosíthatósága 2025-06-05 08:12:27 +02:00
ivanszabo ff9d6ae361 Fontos kezelési javítások 2025-06-04 12:25:04 +02:00
ivanszabo 6839fc0b78 Hibajavítás hegyek 2025-06-04 11:05:29 +02:00
ivanszabo 11aea1eb5d git change 2025-06-04 09:13:52 +02:00
ivanszabo fb58bfcde0 PDF javítása 2025-05-23 21:20:05 +02:00
ivanszabo 7be3a5c58a console.log kivétele 2025-05-23 20:42:42 +02:00
ivanszabo d3e63404a2 Jóváhagyás utáni automatikus mail + CheckListHeader ShortName és Description javítása 2025-05-23 20:41:44 +02:00
ivanszabo cd0b1da85b v1.1.025 release kiadása 2025-05-23 10:51:44 +02:00
ivanszabo dc12fe8709 v1.1.025 MOBILE 2025-05-23 10:51:31 +02:00
ivanszabo 92dcb645db Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-05-23 10:50:22 +02:00
ivanszabo 0d83e30cd2 Lezárás javítása 2025-05-23 10:50:13 +02:00
ivanszabo 2318269f99 Manuális lezárás indokkal 2025-05-23 10:49:02 +02:00
ivanszabo 84f161585a Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-05-22 21:02:14 +02:00
ivanszabo 05259a09ee CheckListInfoPage implementálása 2025-05-22 21:02:09 +02:00
ivanszabo 98442dfe90 PDF javítása + %-os készültség javítása 2025-05-22 21:01:27 +02:00
ivanszabo e745f313a8 Megfelelő hang lejátszása is javítva 2025-05-16 08:40:51 +02:00
ivanszabo 254ab86d03 Egy pici javítás 2025-05-16 08:40:33 +02:00
ivanszabo 4c25dd2105 FCM kifejlesztése 2025-05-16 07:45:58 +02:00
ivanszabo da92dc45b6 Firebase FCM kliens működik 2025-05-16 07:27:02 +02:00
ivanszabo e8f7ee7e36 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-05-15 14:45:51 +02:00
ivanszabo 1f4fce1e42 X 2025-05-15 14:45:00 +02:00
ivanszabo b6ffcca996 Firebird Cloud Message API előkészítése 2025-05-15 14:41:34 +02:00
ivanszabo 73a4b9a445 Na most kaptam TOKENT!!! 2025-05-15 09:39:33 +02:00
ivanszabo 9df2854a3c Firebase teszthez 2025-05-15 09:28:08 +02:00
ivanszabo 7efd090b86 Forebird.CloudMessages implementálása 2025-05-14 21:56:33 +02:00
ivanszabo 0a36544dce Klónozás javítása 2025-05-08 11:01:55 +02:00
ivanszabo 699110af10 Privacy kialakítása 2025-05-07 13:25:27 +02:00
ivanszabo 272bd1a3fd CheckListTemplateHeader klónozása 2025-05-07 13:05:28 +02:00
ivanszabo 9ffbcd87f2 Business és Audit log hozzáadva, WEB-en letölthető 2025-04-28 11:35:30 +02:00
ivanszabo 2fae17fed4 CheckListTemplateHeader törlése WEB-ről 2025-04-25 11:38:09 +02:00
ivanszabo 4025224821 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-25 10:32:08 +02:00
ivanszabo 89c330aa0d CheckListHeader-be új infók 2025-04-25 10:31:43 +02:00
ivanszabo c028b78f1c CheckListHeader-be új infók 2025-04-25 10:31:42 +02:00
ivanszabo a324f5f852 1.1.019 verzió kiadása 2025-04-25 10:31:42 +02:00
ivanszabo 62419a2c28 MOBILE BUGFIX-ek 2025-04-25 10:29:14 +02:00
ivanszabo 1294a00219 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-22 18:38:42 +02:00
ivanszabo 0de851f7d9 Version MOBILE 2025-04-22 18:38:33 +02:00
ivanszabo f80029bd07 API URL beállítása 2025-04-22 18:12:57 +02:00
ivanszabo a8b4aa7b22 ProgramVersion - Backend 2025-04-22 18:05:31 +02:00
ivanszabo 4b674d67ab v1.1.018 Backend 2025-04-22 14:40:02 +02:00
ivanszabo f6e21418b6 v1.1.018 MOBILE 2025-04-22 14:38:43 +02:00
ivanszabo bb8d866778 Javítás a Blokkolt tételekre is. 2025-04-22 14:18:06 +02:00
ivanszabo 3c394f632d Most működik egy tesztelhető verzió. 2025-04-22 14:17:11 +02:00
ivanszabo cba9181a2d Kis kerek gombok + Egyéb nyalánkságok 2025-04-21 19:16:58 +02:00
ivanszabo dbc2f30a27 Jóváhagyás gomb MOBIL-on 2025-04-17 14:39:50 +02:00
ivanszabo 2798aeaf0d Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-17 13:30:33 +02:00
ivanszabo bce3c9e401 Feloldás mobilról 2025-04-17 08:41:56 +02:00
ivanszabo 5acf9ff954 PDF könyvtár letöltése 2025-04-16 13:29:07 +02:00
ivanszabo a1d683b955 Fényképek letöltése programból 2025-04-16 12:34:00 +02:00
ivanszabo 335f00367d DeviceMessages-hez backend fejlesztése 2025-04-16 08:42:14 +02:00
ivanszabo 8815df06b3 Figyelmeztető üzenet javítása + hangjelzés 2025-04-16 08:41:30 +02:00
ivanszabo ab86c845ab Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-15 19:42:56 +02:00
ivanszabo e151590860 Userhez is lehet már NFC kódot rendelni 2025-04-15 19:42:48 +02:00
ivanszabo 4dbda1aac3 User NFCCode is rögzítésre kerüljön 2025-04-15 19:42:39 +02:00
ivanszabo c51ee750f9 MobileUserDTO javítása 2025-04-15 18:38:16 +02:00
ivanszabo 50dcf3aff6 MobilUser lekérdezése 2025-04-15 15:13:08 +02:00
ivanszabo ae7257a3ff Auditok rendes implementálása 2025-04-15 10:17:19 +02:00
ivanszabo 9c179feeca Teljes log most jó 2025-04-15 08:50:13 +02:00
ivanszabo 380b6ac030 Különböző logok, különböző file-ba 2025-04-14 20:15:00 +02:00
ivanszabo ca71bd2194 Lezárt nem szerkeszthető már 2025-04-14 14:31:35 +02:00
ivanszabo b0a4da67d0 Lezáró az adatbázisba 2025-04-14 14:15:09 +02:00
ivanszabo 8dc902d2fb Lezárás oka a logba 2025-04-14 14:14:18 +02:00
ivanszabo 0811111865 Ellenőrzés lezárása 2025-04-14 14:11:57 +02:00
ivanszabo 29200ae418 Jelszó módosítása 2025-04-14 12:31:50 +02:00
ivanszabo 44e6719c3d Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-11 16:19:05 +02:00
ivanszabo 5c5a852ead Release +Version Backend 2025-04-11 16:18:58 +02:00
ivanszabo 70dd745889 Release + version 2025-04-11 16:18:23 +02:00
ivanszabo fad1398668 Csak a Web beállított léphet be 2025-04-11 10:56:51 +02:00
ivanszabo 7a757e84b2 Login továbbfejlesztése 2025-04-11 10:56:51 +02:00
ivanszabo 6d276e73b8 UI rendberakása 2025-04-11 10:55:40 +02:00
ivanszabo 9d107e8c0b Na most van kész a 2 faktoros authentikáció ! :) 2025-04-10 23:32:36 +02:00
ivanszabo aca0a86a6a Két faktor másik lába is kész. 2025-04-10 21:20:55 +02:00
ivanszabo d5a7895efa Kétfaktoros első része ok 2025-04-10 20:49:01 +02:00
ivanszabo 623a3c49b1 MailKit-tel
email küldése
2025-04-10 19:04:59 +02:00
ivanszabo 5356ef7424 Na most már jó lesz. 2025-04-10 16:29:36 +02:00
ivanszabo 1ea8e4fbe7 Verzió a láblécbe 2025-04-10 16:20:07 +02:00
ivanszabo 13b9d943b9 Na most menti a képet is a PDF-be 2025-04-10 16:18:33 +02:00
ivanszabo 06f5a5dd62 UserService Delete metódusai + controller 2025-04-10 14:07:20 +02:00
ivanszabo cd57fc46bc Felhasználó és szabály törlésének befejezése 2025-04-10 13:37:39 +02:00
ivanszabo 7109da0d95 Logger imolemetálása 2025-04-10 10:58:47 +02:00
ivanszabo 6137baff72 publishoz MOBILE 2025-04-10 08:51:04 +02:00
ivanszabo 621d61e08e Publishoz 2025-04-10 08:46:41 +02:00
ivanszabo 02cef1bf23 BUGFIX 2025-04-09 15:38:53 +02:00
ivanszabo e3ee93c74c UI BUGFIX 2025-04-09 15:37:30 +02:00
ivanszabo d383ccccbd Photo beküldésekor 2025-04-09 13:56:36 +02:00
ivanszabo 4eaffbcc4f DeviceMessage 2025-04-08 21:06:03 +02:00
ivanszabo a201e2028e JsonSerialize javítása 2025-04-08 21:05:12 +02:00
ivanszabo 7720f4944a Beküldés javítása 2025-04-08 17:50:47 +02:00
ivanszabo a394c643a2 Javítás 2025-04-08 17:46:22 +02:00
ivanszabo ac48e676df Na most jó a blokkolós cucc 2025-04-08 15:14:19 +02:00
ivanszabo d21ff69cc8 UI blokkolás, feloldás 2025-04-08 15:04:21 +02:00
ivanszabo b5d4a163fd Blokkolás, feloldás 2025-04-08 14:59:35 +02:00
ivanszabo cdaceb1961 Blokkolás, jóváhagyás, ilyesmi. 2025-04-08 14:59:05 +02:00
ivanszabo 2dbcbd1ed8 Mentés fölé csík 2025-04-08 07:42:25 +02:00
ivanszabo c8b8f6ae92 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-07 17:05:44 +02:00
ivanszabo b02fb58f2e Üzenetküldés frontenden 2025-04-07 17:05:40 +02:00
ivanszabo 85976547f6 Most működik az üzenetküldés Backenden 2025-04-07 17:05:27 +02:00
ivanszabo a3be387ee1 Még egy kis UI rendezés 2025-04-07 08:24:04 +02:00
ivanszabo e306139aec Egy kis UI rendezés 2025-04-07 07:57:10 +02:00
ivanszabo 2513765e51 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-06 19:34:29 +02:00
ivanszabo 3366884965 Program letöltés backend zsír!!! 2025-04-06 19:34:12 +02:00
ivanszabo a64304a05f Megy a program letöltése is... 2025-04-06 19:33:47 +02:00
ivanszabo 66744e0526 NFC azonosítás is kész 2025-04-06 14:42:34 +02:00
ivanszabo dc3e6e2f7b NFC azonosítás is beállítva 2025-04-06 14:41:36 +02:00
ivanszabo 71a5850d65 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-05 18:11:57 +02:00
ivanszabo 33232bae75 FÉLKÉSZ 2025-04-05 18:11:42 +02:00
ivanszabo 8dc13c702c DeviceMessages endpoint 2025-04-05 14:53:14 +02:00
ivanszabo 4951fc0c7a Kis tisztogatás, de fordul. 2025-04-05 12:50:57 +02:00
ivanszabo 429ccd2d70 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-05 11:31:16 +02:00
ivanszabo abc90dcec1 com.nuvolar.wfcapp beállítása 2025-04-05 11:31:09 +02:00
ivanszabo 476c9ead4c DisplayNameHelper kifejlesztése 2025-04-04 13:38:07 +02:00
ivanszabo 5b1f7fb642 Továbbfejlesztés 2025-04-04 12:42:47 +02:00
ivanszabo de8b95eda1 Alap töréls Web Locations működik. 2025-04-04 11:30:06 +02:00
ivanszabo fa48365d98 Egy kis lapozás ... 2025-04-03 17:07:12 +02:00
ivanszabo d5e11bc2e4 BaseService BL projektbe 2025-04-03 12:06:40 +02:00
ivanszabo a97c944f12 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-04-02 16:52:30 +02:00
ivanszabo 92c15072b8 Beküldés és mentés javítása 2025-04-02 16:52:25 +02:00
ivanszabo 001c59a669 LibreOffice-val dokumentum konvertálása PDF-re most jó 2025-04-02 16:51:11 +02:00
ivanszabo 90637b3848 PDF készítés DevExpressel. 2025-04-02 13:01:49 +02:00
ivanszabo 12bf69aadd Photo rendberakása + EF migráció 2025-04-02 10:32:27 +02:00
ivanszabo fe7b52efde Photo rendberakása 2025-04-02 10:32:27 +02:00
ivanszabo c7a3a608ba UI javítás + beküldés, képméretezés 2025-04-02 09:04:28 +02:00
ivanszabo c3fda85182 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-03-31 22:13:33 +02:00
ivanszabo ea305ebbf4 BUGFIXEK UI oldalon 2025-03-31 22:13:28 +02:00
ivanszabo 5207f32712 BUGFIX-ek 2025-03-31 22:13:17 +02:00
ivanszabo 61dd5bc9a1 Jó kis javítás, fejlesztés TESZT-hez 2025-03-31 19:31:22 +02:00
ivanszabo a7e913b3ee CheckStatus + UI fejlesztése 2025-03-31 15:20:16 +02:00
ivanszabo 7996f887ba IsEnabled a CheckPoint-hoz 2025-03-31 13:39:02 +02:00
ivanszabo 56f17681be RoleCheckPoint 2025-03-31 11:55:24 +02:00
ivanszabo d7c198acfa UI fejlesztés 2025-03-30 22:48:57 +02:00
ivanszabo 8566889cf9 swagger javítása 2025-03-29 09:12:55 +01:00
ivanszabo ce432e1ab0 Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck 2025-03-28 20:51:04 +01:00
ivanszabo 146402a96a Snackbar meg ilyesmik 2025-03-28 20:51:00 +01:00
ivanszabo 66cf378556 SyncControl 2025-03-28 20:47:13 +01:00
ivanszabo d3bfeadc50 CheckListService extending 2025-03-28 19:25:35 +01:00
ivanszabo 77796f3247 CheckListRow edit 2025-03-28 17:35:29 +01:00
ivanszabo 728b6a8a9e Merge branch 'NFCTEST' 2025-03-28 15:37:49 +01:00
ivanszabo 148ea094ce UserRole javítása 2025-03-28 13:56:56 +01:00
ivanszabo ddc898cc2e RoleCheckListHeaderTemplate befejezése új/módosítás 2025-03-28 12:55:10 +01:00
ivanszabo f119b196ea RoleCheckListTemplateHeader lista nézet 2025-03-27 12:11:34 +01:00
ivanszabo 04cca012f4 WORD -> PDF 2025-03-27 11:13:42 +01:00
ivanszabo cb38e869a1 CheckListHeader TAB-osítva ... 2025-03-26 10:23:39 +01:00
ivanszabo 83980667d7 CheckListRow megjelenítése 2025-03-26 09:14:27 +01:00
ivanszabo ace4130f31 Entity javítás 2025-03-24 23:29:29 +01:00
276 changed files with 26321 additions and 1422 deletions
+5
View File
@@ -339,3 +339,8 @@ ASALocalRun/
# BeatPulse healthcheck temp database
healthchecksdb
/src/WorkFlowCheck.API/Images
*.pdf
/src/WorkFlowCheck.API/Pdf/c86f3a6a-c646-4627-823c-7e24134b7725.docx
/src/WorkFlowCheck.API/Downloads/APK/com.nuvolar.wfcapp-Signed.apk
/src/WorkFlowCheck.API/Pdf/3b9fd83a-dce8-4427-813b-9475726700be.docx
@@ -39,6 +39,30 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("CreatePDF/{id}")]
public async Task<ApiResponseDTO<byte[]>> CreatePDF(int id)
{
var retVal = new ApiResponseDTO<byte[]>()
{
IsSuccess = true,
};
var checkListHeader = await _checkListService.GetCheckListHeaderAsync(id);
var response = await _checkListService.CreateCheckListHeaderPDFAsync(id);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllCheckListHeaders")]
public async Task<ApiResponseDTO<List<CheckListHeaderDTO>>> GetAllCheckListHeadersAsync()
{
@@ -106,6 +130,86 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
[HttpPost("CloseCheckListHeader")]
public async Task<ApiResponseDTO<bool>> CloseCheckListHeader([FromBody] CheckListHeaderCloseDTO checkListHeaderCloseDTO)
{
var retVal = new ApiResponseDTO<bool>() { IsSuccess = false };
try
{
var result = await _checkListService.CloseCheckListHeader(checkListHeaderCloseDTO);
retVal.Data = result;
retVal.IsSuccess = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("AcceptCheckListHeader/{id}/{userId}")]
public async Task<ApiResponseDTO<bool>> AcceptCheckListHeader(int id, int userId)
{
var retVal = new ApiResponseDTO<bool> { IsSuccess = false };
var response = await _checkListService.AcceptCheckListHeaderAsync(id, userId);
if (response)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("BlockCheckListHeader/{id}/{userId}")]
public async Task<ApiResponseDTO<bool>> BlockCheckListHeader(int id, int userId)
{
var retVal = new ApiResponseDTO<bool> { IsSuccess = false };
var response = await _checkListService.BlockCheckListHeaderAsync(id, userId);
if (response)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("UnBlockCheckListHeader/{id}/{userId}")]
public async Task<ApiResponseDTO<bool>> UnBlockCheckListHeader(int id, int userId)
{
var retVal = new ApiResponseDTO<bool> { IsSuccess = false };
var response = await _checkListService.UnBlockCheckListHeaderAsync(id, userId);
if (response)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetCheckListTemplateHeader/{id}")]
@@ -175,7 +279,51 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
[HttpGet("DeleteCheckListTemplateHeader/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteCheckListTemplateHeader(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _checkListService.DeleteCheckListTemplateHeaderAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("CloneCheckListTemplateHeader/{id}")]
public async Task<ApiResponseDTO<bool>> CloneCheckListTemplateHeader(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _checkListService.CloneCheckListTemplateHeaderAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetCheckListTemplateRow/{id}")]
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> GetCheckListTemplateRow(int id)
@@ -200,6 +348,28 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteCheckListTemplateRow/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteCheckListTemplateRow(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _checkListService.DeleteCheckListTemplateRowAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateCheckListTemplateRow")]
public async Task<ApiResponseDTO<CheckListTemplateRowDTO>> UpdateCheckListTemplateRow([FromBody] CheckListTemplateRowDTO CheckListTemplateRowDTO)
{
@@ -221,5 +391,50 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
[HttpGet("GetCheckListRow/{id}")]
public async Task<ApiResponseDTO<CheckListRowDTO>> GetCheckListRow(int id)
{
var retVal = new ApiResponseDTO<CheckListRowDTO>()
{
IsSuccess = true,
};
var checkListRowDTO = await _checkListService.GetCheckListRowAsync(id);
if (checkListRowDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListRowDTO;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateCheckListRow")]
public async Task<ApiResponseDTO<CheckListRowDTO>> UpdateCheckListRow([FromBody] CheckListRowDTO CheckListRowDTO)
{
var retVal = new ApiResponseDTO<CheckListRowDTO>()
{
IsSuccess = true
};
try
{
var result = await _checkListService.UpdateCheckListRowAsync(CheckListRowDTO);
retVal.Data = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -0,0 +1,83 @@
using Google.Apis.Auth.OAuth2;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Serilog;
using System.Net.Http.Headers;
using System.Text;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class FCMController : ControllerBase
{
private readonly IMessageService _messageService;
public FCMController(IMessageService messageService)
{
_messageService = messageService;
}
[HttpPost("SendFCMMessage")]
public async Task<ApiResponseDTO<bool>> SendFCMMessage([FromBody] FCMMessageDTO fCMMessageDTO)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true
};
try
{
retVal.IsSuccess = await _messageService.SendFCMMessage(fCMMessageDTO);
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
[HttpPost("SendFCMMessageToLastToken")]
public async Task<ApiResponseDTO<bool>> SendFCMMessageToLastToken([FromBody] FCMMessageDTO fCMMessageDTO)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true
};
try
{
retVal.IsSuccess = await _messageService.SendFCMMessageToLastToken(fCMMessageDTO);
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
[HttpPost("SendFCMToken")]
public async Task<ApiResponseDTO<bool>> SendFCMToken([FromBody] FCMMessageDTO fCMMessageDTO)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true
};
try
{
await _messageService.SendFCMTokenAsync(fCMMessageDTO.Token);
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.IdentityModel.Tokens;
using Serilog;
using System.Text;
using WorkFlowCheck.BL.Services;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
@@ -12,13 +14,23 @@ namespace WorkFlowCheck.API.Controllers
public class SyncController : ControllerBase
{
private ISyncService _syncService;
public SyncController(ISyncService syncService)
private INumberGeneratorService _numberGeneratorService;
private IMessageService _messageService;
private IUserService _userService;
public SyncController(ISyncService syncService,
INumberGeneratorService numberGeneratorService,
IUserService userService,
IMessageService messageService)
{
_syncService = syncService;
_numberGeneratorService = numberGeneratorService;
_messageService = messageService;
_userService = userService;
}
[HttpGet("GetCheckPoint/{id}")]
public async Task<ApiResponseDTO<CheckPointDTO>> GetCheckpointAsync(int id)
{
@@ -26,13 +38,35 @@ namespace WorkFlowCheck.API.Controllers
{
IsSuccess = true,
};
var checkPointListDTO = await _syncService.GetCheckPointAsync(id);
var checkPointDTO = await _syncService.GetCheckPointAsync(id);
if (checkPointListDTO != null)
if (checkPointDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = checkPointDTO;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DeleteCheckPoint/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteCheckpointAsync(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var response = await _syncService.DeleteCheckPointAsync(id);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = checkPointListDTO;
retVal.Data = response;
}
else
{
@@ -131,6 +165,29 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteEquipment/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteEquipmentAsync(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var response = await _syncService.DeleteEquipmentAsync(id);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllEquipments")]
public async Task<ApiResponseDTO<List<EquipmentDTO>>> GetAllEquipmentsAsync()
{
@@ -200,6 +257,29 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteLocation/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteLocationAsync(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var response = await _syncService.DeleteLocationAsync(id);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllLocations")]
public async Task<ApiResponseDTO<List<LocationDTO>>> GetAllLocationsAsync()
{
@@ -293,10 +373,238 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpPost("SendCheckListHeader")]
public async Task<ApiResponseDTO<string>> SendCheckListHeader([FromBody] CheckListHeaderDTO checkListHeaderDTO)
{
var retVal = new ApiResponseDTO<string>()
{
IsSuccess = true
};
try
{
var result = await _syncService.SendCheckListHeaderAsync(checkListHeaderDTO);
retVal.Data = "Sikeres beküldés!";
}
catch (Exception ex)
{
retVal.IsSuccess = false;
retVal.Errors.Add(ex.Message);
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetAllNumbergenerators")]
public async Task<ApiResponseDTO<List<NumberGeneratorTemplateDTO>>> GetAllNumbergeneratorsAsync()
{
var retVal = new ApiResponseDTO<List<NumberGeneratorTemplateDTO>>()
{
IsSuccess = true,
};
var locationListDTO = await _numberGeneratorService.GetAllNumbergeneratorsAsync();
if (locationListDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = locationListDTO;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("DeviceMessageSend")]
public async Task<ApiResponseDTO<bool>> DeviceMessageSend([FromBody] DeviceMessageDTO deviceMessageDTO)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true
};
try
{
var result = await _syncService.DeviceMessageSend(deviceMessageDTO);
retVal.Data = true;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
retVal.Errors.Add(ex.Message);
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("DeviceMessageReadUnreaded/{deviceIdBase64}")]
public async Task<ApiResponseDTO<List<DeviceMessageDTO>>> DeviceMessageReadUnreaded(string deviceIdBase64)
{
var retVal = new ApiResponseDTO<List<DeviceMessageDTO>>()
{
IsSuccess = true,
};
byte[] byteArray = Base64UrlEncoder.DecodeBytes(deviceIdBase64);
string deviceId = Encoding.UTF8.GetString(byteArray);
var response = await _syncService.DeviceMessageReadUnreaded(deviceId);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DeviceMessageReadUnreadedRole/{roleId}")]
public async Task<ApiResponseDTO<List<DeviceMessageDTO>>> DeviceMessageReadUnreadedRole(int roleId)
{
var retVal = new ApiResponseDTO<List<DeviceMessageDTO>>()
{
IsSuccess = true,
};
var response = await _syncService.DeviceMessageReadUnreadedRole(roleId);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("Download")]
public async Task<IActionResult> DownloadAPKFileAsync()
{
try
{
string fileName = "com.nuvolar.wfcapp-Signed.apk";
string downloadFolder = Path.Combine(Directory.GetCurrentDirectory(), "Downloads", "APK");
string filePath = Path.Combine(downloadFolder, fileName);
if (!System.IO.File.Exists(filePath))
{
return NotFound("File not found.");
}
var fileBytes = await System.IO.File.ReadAllBytesAsync(filePath);
var fileType = "application/octet-stream";
Response.Headers.Add("Content-Length", fileBytes.Length.ToString());
return File(fileBytes, fileType, fileName);
}
catch (Exception ex)
{
return StatusCode(500, $"Error: {ex.Message}");
}
}
[HttpGet("SendTestMail")]
public async Task<ApiResponseDTO<bool>> SendTestMail()
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true
};
try
{
var result = await _messageService.SendMailAsync(
new List<string>()
{
"ivan.szabo.sis@gmail.com",
}, "Teszt", "Ok");
retVal.Data = true;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
retVal.Errors.Add(ex.Message);
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetAllMobileUsers")]
public async Task<ApiResponseDTO<List<MobileUserDTO>>> GetAllMobileUsers()
{
var retVal = new ApiResponseDTO<List<MobileUserDTO>>()
{
IsSuccess = true,
Data = new List<MobileUserDTO>()
};
var usersListDTO = await _userService.GetAllUserAsync();
retVal.Data.AddRange(usersListDTO
.Where(user => user.RoleDTO.Any(role => role.CanUseMobilApp))
.Select(user => new MobileUserDTO
{
Id = user.Id,
Email = user.Email,
FirstName = user.FirstName,
LastName = user.LastName,
NFCActive = user.NFCActive,
NFCCode = user.NFCCode,
UserName = user.UserName
})
);
if (retVal.Data == null || retVal.Data.Count <= 0) { retVal.IsSuccess = false; retVal.Errors.Add("No data!"); }
return retVal;
}
[HttpPost("UpdateAllMobileUser")]
public async Task<ApiResponseDTO<List<MobileUserDTO>>> UpdateAllMobileUser([FromBody] List<MobileUserDTO> mobileUserListDTO)
{
var retVal = new ApiResponseDTO<List<MobileUserDTO>>()
{
IsSuccess = true
};
try
{
foreach (var mobileUserDTO in mobileUserListDTO)
{
var userDTO = await _userService.GetUserAsync(mobileUserDTO.Id);
if (userDTO != null && userDTO.Id == mobileUserDTO.Id)
{
userDTO.NFCCode = mobileUserDTO.NFCCode;
var result = await _userService.UpdateUserAsync(userDTO);
}
}
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -0,0 +1,399 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Serilog;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class SystemController : ControllerBase
{
private readonly ISystemService _systemService;
public SystemController(ISystemService systemService)
{
_systemService = systemService;
}
[HttpGet("GetDatabaseAndVersionInfo")]
public async Task<ApiResponseDTO<string>> GetDatabaseAndVersionInfo()
{
var retVal = new ApiResponseDTO<string>()
{
IsSuccess = true,
};
var result = await _systemService.GetDatabaseAndVersionInfoAsync();
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllImageFiles")]
public async Task<ApiResponseDTO<List<ImageFileDTO>>> GetAllImageFilesAsync()
{
var retVal = new ApiResponseDTO<List<ImageFileDTO>>()
{
IsSuccess = true,
};
try
{
var allowedExtensions = new[] { ".png", ".jpg", ".jpeg", ".bmp", ".gif", ".webp", ".tiff" };
var imageFolder = Path.Combine(Directory.GetCurrentDirectory(), "Images");
var files = Directory.GetFiles(imageFolder)
.Where(f => allowedExtensions.Contains(Path.GetExtension(f).ToLower()))
.Select(f =>
{
var fileInfo = new FileInfo(f);
return new
{
FileName = fileInfo.Name,
FileSize = FormatFileSize(fileInfo.Length),
CreatedDate = fileInfo.CreationTime.ToString("yyyy.MM.dd HH:mm"),
};
});
var checkListFileInfos = new List<ImageFileDTO>();
foreach (var file in files.OrderBy(o => o.FileName).ToList())
{
var checkListFileInfoDTO = new ImageFileDTO()
{
FileName = file.FileName,
FileSize = file.FileSize,
CreateDate = file.CreatedDate,
};
checkListFileInfos.Add(checkListFileInfoDTO);
}
if (checkListFileInfos != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListFileInfos;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetAllPDFFiles")]
public async Task<ApiResponseDTO<List<ImageFileDTO>>> GetAllPDFilesAsync()
{
var retVal = new ApiResponseDTO<List<ImageFileDTO>>()
{
IsSuccess = true,
};
try
{
var pdfFolder = Path.Combine(Directory.GetCurrentDirectory(), "PDF");
var files = Directory.GetFiles(pdfFolder, "*.pdf")
.Select(f =>
{
var fileInfo = new FileInfo(f);
return new
{
FileName = fileInfo.Name,
FileSize = FormatFileSize(fileInfo.Length),
CreatedDate = fileInfo.CreationTime.ToString("yyyy.MM.dd HH:mm"),
};
});
var checkListFileInfos = new List<ImageFileDTO>();
foreach (var file in files.OrderBy(o => o.FileName).ToList())
{
var checkListFileInfoDTO = new ImageFileDTO()
{
FileName = file.FileName,
FileSize = file.FileSize,
CreateDate = file.CreatedDate,
};
checkListFileInfos.Add(checkListFileInfoDTO);
}
if (checkListFileInfos != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListFileInfos;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetAllLogAuditFiles")]
public async Task<ApiResponseDTO<List<LogFileDTO>>> GetAllLogAuditFilesAsync()
{
var retVal = new ApiResponseDTO<List<LogFileDTO>>()
{
IsSuccess = true,
};
try
{
var logAuditFiles = Path.Combine(Directory.GetCurrentDirectory(), "Logs\\AuditFlow");
var files = Directory.GetFiles(logAuditFiles, "*.log")
.Select(f =>
{
var fileInfo = new FileInfo(f);
return new
{
FileName = fileInfo.Name,
FileSize = FormatFileSize(fileInfo.Length),
CreatedDate = fileInfo.CreationTime.ToString("yyyy.MM.dd HH:mm"),
};
});
var checkListFileInfos = new List<LogFileDTO>();
foreach (var file in files.OrderBy(o => o.FileName).ToList())
{
var checkListFileInfoDTO = new LogFileDTO()
{
FileName = file.FileName,
FileSize = file.FileSize,
CreateDate = file.CreatedDate,
};
checkListFileInfos.Add(checkListFileInfoDTO);
}
if (checkListFileInfos != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListFileInfos;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetAllLogBusinessFiles")]
public async Task<ApiResponseDTO<List<LogFileDTO>>> GetAllLogBusinessFilesAsync()
{
var retVal = new ApiResponseDTO<List<LogFileDTO>>()
{
IsSuccess = true,
};
try
{
var logBusinessFiles = Path.Combine(Directory.GetCurrentDirectory(), "Logs\\BusinessFlow");
var files = Directory.GetFiles(logBusinessFiles, "*.log")
.Select(f =>
{
var fileInfo = new FileInfo(f);
return new
{
FileName = fileInfo.Name,
FileSize = FormatFileSize(fileInfo.Length),
CreatedDate = fileInfo.CreationTime.ToString("yyyy.MM.dd HH:mm"),
};
});
var checkListFileInfos = new List<LogFileDTO>();
foreach (var file in files.OrderBy(o => o.FileName).ToList())
{
var checkListFileInfoDTO = new LogFileDTO()
{
FileName = file.FileName,
FileSize = file.FileSize,
CreateDate = file.CreatedDate,
};
checkListFileInfos.Add(checkListFileInfoDTO);
}
if (checkListFileInfos != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListFileInfos;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("DownloadFile/{filename}")]
public async Task<ApiResponseDTO<byte[]>> DownloadFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>()
{
IsSuccess = false,
};
var imageFile = Path.Combine(Directory.GetCurrentDirectory(), "Images", filename);
if (!System.IO.File.Exists(imageFile))
{
retVal.Errors.Add($"{filename} does not exist");
return retVal;
}
byte[] response = System.IO.File.ReadAllBytes(imageFile);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DownloadPDFFile/{filename}")]
public async Task<ApiResponseDTO<byte[]>> DownloadPDFFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>()
{
IsSuccess = false,
};
var imageFile = Path.Combine(Directory.GetCurrentDirectory(), "PDF", filename);
if (!System.IO.File.Exists(imageFile))
{
retVal.Errors.Add($"{filename} does not exist");
return retVal;
}
byte[] response = System.IO.File.ReadAllBytes(imageFile);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DownloadAuditLogFile/{filename}")]
public async Task<ApiResponseDTO<byte[]>> DownloadAuditLogFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>()
{
IsSuccess = false,
};
var imageFile = Path.Combine(Directory.GetCurrentDirectory(), "Logs\\AuditFlow", filename);
if (!System.IO.File.Exists(imageFile))
{
retVal.Errors.Add($"{filename} does not exist");
return retVal;
}
byte[] response = System.IO.File.ReadAllBytes(imageFile);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DownloadBusinessLogFile/{filename}")]
public async Task<ApiResponseDTO<byte[]>> DownloadBusinessLogFile(string filename)
{
var retVal = new ApiResponseDTO<byte[]>()
{
IsSuccess = false,
};
var imageFile = Path.Combine(Directory.GetCurrentDirectory(), "Logs\\BusinessFlow", filename);
if (!System.IO.File.Exists(imageFile))
{
retVal.Errors.Add($"{filename} does not exist");
return retVal;
}
byte[] response = System.IO.File.ReadAllBytes(imageFile);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
private string FormatFileSize(long bytes)
{
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
double len = bytes;
int order = 0;
while (len >= 1024 && order < sizes.Length - 1)
{
order++;
len /= 1024;
}
return $"{len:0.##} {sizes[order]}";
}
}
}
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.BL.Services.Interfaces;
@@ -71,6 +71,28 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteUser/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteUser(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _userService.DeleteUserAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateUser")]
public async Task<ApiResponseDTO<UserDTO>> UpdateUser([FromBody] UserDTO userDTO)
{
@@ -92,6 +114,7 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
[HttpPost("Authenticate")]
public async Task<ApiResponseDTO<UserDTO>> Authenticate([FromBody] UserSimpleDTO userSimpleDTO)
{
@@ -102,7 +125,7 @@ namespace WorkFlowCheck.API.Controllers
if (string.IsNullOrEmpty(userSimpleDTO.UserName) || string.IsNullOrEmpty(userSimpleDTO.Password))
{
retVal.IsSuccess = false;
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
return retVal;
}
try
@@ -114,11 +137,11 @@ namespace WorkFlowCheck.API.Controllers
{
retVal.IsSuccess = true;
retVal.Data = userDTO_Response;
Log.Information($"Sikeres azonosítás! {userSimpleDTO.UserName}");
Log.Information($"Sikeres azonosítás! {userSimpleDTO.UserName}");
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
@@ -126,7 +149,7 @@ namespace WorkFlowCheck.API.Controllers
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
@@ -139,6 +162,205 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
/// <summary>
/// Ez a 2 faktoros első lépése.
/// </summary>
/// <param name="userSimpleDTO"></param>
/// <returns></returns>
[HttpPost("Authenticate2F1")]
public async Task<ApiResponseDTO<string>> Authenticate2F1([FromBody] UserSimpleDTO userSimpleDTO)
{
var retVal = new ApiResponseDTO<string>()
{
IsSuccess = true
};
if (string.IsNullOrEmpty(userSimpleDTO.UserName) || string.IsNullOrEmpty(userSimpleDTO.Password))
{
retVal.IsSuccess = false;
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
return retVal;
}
try
{
var response = await _userService.Authenticate2F1(userSimpleDTO.UserName, userSimpleDTO.Password);
if (!string.IsNullOrEmpty(response))
{
retVal.IsSuccess = true;
retVal.Data = response;
Log.Information($"Sikeres azonosítás! {userSimpleDTO.UserName}");
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpPost("Authenticate2F2")]
public async Task<ApiResponseDTO<UserDTO>> Authenticate2F2([FromBody] User2FADTO user2FADTO)
{
var retVal = new ApiResponseDTO<UserDTO>()
{
IsSuccess = true
};
if (string.IsNullOrEmpty(user2FADTO.UserName) ||
string.IsNullOrEmpty(user2FADTO.Password) ||
string.IsNullOrEmpty(user2FADTO.Code) ||
string.IsNullOrEmpty(user2FADTO.Token2FA))
{
retVal.IsSuccess = false;
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
return retVal;
}
try
{
var userDTO_Response = await _userService.Authenticate2F2(user2FADTO.UserName,
user2FADTO.Password,
user2FADTO.Code,
user2FADTO.Token2FA);
if (userDTO_Response != null)
{
if (string.IsNullOrEmpty(userDTO_Response.UserName) == false)
{
retVal.IsSuccess = true;
retVal.Data = userDTO_Response;
Log.Information($"Sikeres azonosítás! {user2FADTO.UserName}");
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {user2FADTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {user2FADTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpPost("Authenticate2F2ChangePassword")]
public async Task<ApiResponseDTO<UserDTO>> Authenticate2F2ChangePassword([FromBody] UserChangePassword2FADTO userChangePassword2FADTO)
{
var retVal = new ApiResponseDTO<UserDTO>()
{
IsSuccess = true
};
if (string.IsNullOrEmpty(userChangePassword2FADTO.UserName) ||
string.IsNullOrEmpty(userChangePassword2FADTO.OldPassword) ||
string.IsNullOrEmpty(userChangePassword2FADTO.NewPassword1) ||
string.IsNullOrEmpty(userChangePassword2FADTO.NewPassword2) ||
string.IsNullOrEmpty(userChangePassword2FADTO.Code) ||
string.IsNullOrEmpty(userChangePassword2FADTO.Token2FA))
{
retVal.IsSuccess = false;
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
return retVal;
}
try
{
var userDTO_Response = await _userService.Authenticate2F2ChangePassword(userChangePassword2FADTO.UserName,
userChangePassword2FADTO.OldPassword,
userChangePassword2FADTO.NewPassword1,
userChangePassword2FADTO.Code,
userChangePassword2FADTO.Token2FA);
if (userDTO_Response != null)
{
if (string.IsNullOrEmpty(userDTO_Response.UserName) == false)
{
retVal.IsSuccess = true;
retVal.Data = userDTO_Response;
Log.Information($"Sikeres azonosítás! {userChangePassword2FADTO.UserName}");
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userChangePassword2FADTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userChangePassword2FADTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpPost("AuthenticateNFC")]
public async Task<ApiResponseDTO<UserDTO>> AuthenticateNFC([FromBody] UserSimpleDTO userSimpleDTO)
{
var retVal = new ApiResponseDTO<UserDTO>()
{
IsSuccess = true
};
if (string.IsNullOrEmpty(userSimpleDTO.UserName) || string.IsNullOrEmpty(userSimpleDTO.Password))
{
retVal.IsSuccess = false;
retVal.Errors.Add("Nem megfelelo felhasználói név vagy jelszó");
return retVal;
}
try
{
var userDTO_Response = await _userService.AuthenticateNFC(userSimpleDTO.UserName);
if (userDTO_Response != null)
{
if (string.IsNullOrEmpty(userDTO_Response.UserName) == false && userDTO_Response.NFCActive)
{
retVal.IsSuccess = true;
retVal.Data = userDTO_Response;
Log.Information($"Sikeres azonosítás! {userSimpleDTO.UserName}");
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
else
{
var error = $"Nem megfelelo felhasználó vagy jelszó! {userSimpleDTO.UserName}";
retVal.IsSuccess = false;
retVal.Errors.Add(error);
Log.Information(error);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetRole/{id}")]
public async Task<ApiResponseDTO<RoleDTO>> GetRole(int id)
@@ -193,6 +415,28 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteRole/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteRole(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _userService.DeleteRoleAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateRole")]
public async Task<ApiResponseDTO<RoleDTO>> UpdateRole([FromBody] RoleDTO roleDTO)
{
@@ -269,6 +513,28 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
[HttpGet("DeleteUserRole/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteUserRole(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _userService.DeleteUserRoleAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateUserRole")]
public async Task<ApiResponseDTO<UserRoleDTO>> UpdateUserRole([FromBody] UserRoleDTO userRoleDTO)
{
@@ -292,5 +558,199 @@ namespace WorkFlowCheck.API.Controllers
}
[HttpGet("GetRoleCheckListTemplateHeader/{id}")]
public async Task<ApiResponseDTO<RoleCheckListTemplateHeaderDTO>> GetRoleCheckListTemplateHeader(int id)
{
var retVal = new ApiResponseDTO<RoleCheckListTemplateHeaderDTO>()
{
IsSuccess = true,
};
var roleCheckListTemplateHeaderDTO = await _userService.GetRoleCheckListTemplateHeaderAsync(id);
if (roleCheckListTemplateHeaderDTO != null)
{
if (roleCheckListTemplateHeaderDTO.Id == 0)
{
retVal.IsSuccess = false;
retVal.Errors.Add("No match!");
retVal.Data = roleCheckListTemplateHeaderDTO;
}
else
{
retVal.IsSuccess = true;
retVal.Data = roleCheckListTemplateHeaderDTO;
}
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllRoleCheckListTemplateHeaders")]
public async Task<ApiResponseDTO<List<RoleCheckListTemplateHeaderDTO>>> GetAllRoleCheckListTemplateHeaders()
{
var retVal = new ApiResponseDTO<List<RoleCheckListTemplateHeaderDTO>>()
{
IsSuccess = true,
};
var results = await _userService.GetAllRoleCheckListTemplateHeadersAsync();
if (results != null)
{
retVal.IsSuccess = true;
retVal.Data = results;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DeleteRoleCheckListTemplateHeader/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteRoleCheckListTemplateHeader(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _userService.DeleteRoleCheckListTemplateHeaderAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateRoleCheckListTemplateHeader")]
public async Task<ApiResponseDTO<RoleCheckListTemplateHeaderDTO>> UpdateRoleCheckListTemplateHeader([FromBody] RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO)
{
var retVal = new ApiResponseDTO<RoleCheckListTemplateHeaderDTO>()
{
IsSuccess = true
};
try
{
var result = await _userService.UpdateRoleCheckListTemplateHeaderAsync(roleCheckListTemplateHeaderDTO);
retVal.Data = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
[HttpGet("GetRoleCheckPoint/{id}")]
public async Task<ApiResponseDTO<RoleCheckPointDTO>> GetRoleCheckPoint(int id)
{
var retVal = new ApiResponseDTO<RoleCheckPointDTO>()
{
IsSuccess = true,
};
var roleCheckPointDTO = await _userService.GetRoleCheckPointAsync(id);
if (roleCheckPointDTO != null)
{
if (roleCheckPointDTO.Id == 0)
{
retVal.IsSuccess = false;
retVal.Errors.Add("No match!");
retVal.Data = roleCheckPointDTO;
}
else
{
retVal.IsSuccess = true;
retVal.Data = roleCheckPointDTO;
}
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllRoleCheckPoints")]
public async Task<ApiResponseDTO<List<RoleCheckPointDTO>>> GetAllRoleCheckPoints()
{
var retVal = new ApiResponseDTO<List<RoleCheckPointDTO>>()
{
IsSuccess = true,
};
var results = await _userService.GetAllRoleCheckPointsAsync();
if (results != null)
{
retVal.IsSuccess = true;
retVal.Data = results;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("DeleteRoleCheckPoint/{id}")]
public async Task<ApiResponseDTO<bool>> DeleteRoleCheckPoint(int id)
{
var retVal = new ApiResponseDTO<bool>()
{
IsSuccess = true,
};
var result = await _userService.DeleteRoleCheckPointAsync(id);
if (result != null)
{
retVal.IsSuccess = true;
retVal.Data = result;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpPost("UpdateRoleCheckPoint")]
public async Task<ApiResponseDTO<RoleCheckPointDTO>> UpdateRoleCheckPoint([FromBody] RoleCheckPointDTO roleCheckPointDTO)
{
var retVal = new ApiResponseDTO<RoleCheckPointDTO>()
{
IsSuccess = true
};
try
{
var result = await _userService.UpdateRoleCheckPointAsync(roleCheckPointDTO);
retVal.Data = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}
Binary file not shown.
+61 -1
View File
@@ -11,13 +11,43 @@ using WorkFlowCheck.DL.Seed;
using WorkFlowCheck.Common.RequestContext;
using WorkFlowCheck.API.RequestContext;
using WorkFlowCheck.API.Middleware;
using Serilog.Filters;
var builder = WebApplication.CreateBuilder(args);
//------------------------------------------------------------------------------------------------------------------
string baseLogPath = Path.Combine(Directory.GetCurrentDirectory(), "Logs");
if (!Directory.Exists(baseLogPath))
Directory.CreateDirectory(baseLogPath);
string auditLogPath = Path.Combine(Directory.GetCurrentDirectory(), "Logs", "AuditFlow");
if (!Directory.Exists(auditLogPath))
Directory.CreateDirectory(auditLogPath);
string businessLogPath = Path.Combine(Directory.GetCurrentDirectory(), "Logs", "BusinessFlow");
if (!Directory.Exists(businessLogPath))
Directory.CreateDirectory(businessLogPath);
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
.ReadFrom.Configuration(builder.Configuration) // Konfiguráció betöltése
.WriteTo.Console()
.WriteTo.File("logs/log-.log", rollingInterval: RollingInterval.Day)
.WriteTo.Logger(lc => lc
.Filter.ByIncludingOnly(Matching.WithProperty("TAG", "AuditFlow"))
.WriteTo.File("Logs/AuditFlow/au-.log", rollingInterval: RollingInterval.Day)
)
.WriteTo.Logger(lc => lc
.Filter.ByIncludingOnly(Matching.WithProperty("TAG", "BusinessFlow"))
.WriteTo.File("Logs/BusinessFlow/bs-.log", rollingInterval: RollingInterval.Day)
)
.CreateLogger();
//------------------------------------------------------------------------------------------------------------------
Log.ForContext("TAG", "BusinessFlow").Information("API indítása...");
builder.Services.AddAutoMapper(typeof(MapperProfile));
builder.Services.AddMemoryCache();
builder.Services.AddHttpContextAccessor();
@@ -83,8 +113,36 @@ builder.Services.AddCors(options =>
});
});
builder.WebHost.ConfigureKestrel(options =>
{
var kestrelConfig = builder.Configuration.GetSection("Kestrel");
options.Configure(kestrelConfig);
});
var app = builder.Build();
//----------------- Munkakönyvtárak létrehozása -----------------------------
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
if (!Directory.Exists(imageDirectory))
{
Directory.CreateDirectory(imageDirectory);
}
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
// Ensure the Images directory exists
if (!Directory.Exists(pdfDirectory))
{
Directory.CreateDirectory(pdfDirectory);
}
string downloadDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Downloads");
if (!Directory.Exists(downloadDirectory))
{
Directory.CreateDirectory(downloadDirectory);
}
string downloadAPKDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Downloads","APK");
if (!Directory.Exists(downloadAPKDirectory))
{
Directory.CreateDirectory(downloadAPKDirectory);
}
//---------------------------------------------------------------------------
using (var scope = app.Services.CreateScope())
@@ -113,5 +171,7 @@ app.UseMiddleware<JwtMiddleware>();
app.MapControllers();
app.UseAuthorization();
app.UseCors();
Log.ForContext("TAG", "BusinessFlow").Information("API fut.");
app.Run();
@@ -17,6 +17,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.Auth" Version="1.69.0" />
<PackageReference Include="MailKit" Version="4.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
<PrivateAssets>all</PrivateAssets>
@@ -24,8 +26,11 @@
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>
@@ -33,6 +38,19 @@
<None Update="Certs\SwaggerCert.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Pdf\CheckList_Template_V1.docx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.Development.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Logs\" />
</ItemGroup>
</Project>
@@ -1,4 +1,9 @@
{
"ConnectionStrings": {
//"DefaultConnection": "Data Source=NSINB-37\\WFC;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
//"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFC;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False",
"DefaultConnection": "Data Source=WS2016DC\\SQLEXPRESS;Initial Catalog=WFCUAT;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False"
},
"Logging": {
"LogLevel": {
"Default": "Information",
+45 -5
View File
@@ -7,7 +7,7 @@
"SecretKey": "9aLxV2t7RpM8BfKqZwXy3GehYJDUNTCrHkVZ",
"Issuer": "https://wfcapi.nuvolar.hu/",
"Audience": "wfc-application",
"TokenLifetimeMinutes": 30
"TokenLifetimeMinutes": 1440
},
"Logging": {
"LogLevel": {
@@ -21,14 +21,54 @@
{
"Name": "Console"
},
{
"Name": "Logger",
"Args": {
"filter": "Equals(TAG, 'AuditFlow')",
"writeTo": [
{
"Name": "File",
"Args": {
"path": "logs/log-.log",
"rollingInterval": "Day"
"path": "Logs/AuditFlow/log-.txt",
"rollingInterval": "Day",
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
]
},
"AllowedHosts": "*"
}
},
{
"Name": "Logger",
"Args": {
"filter": "Equals(TAG, 'BusinessFlow')",
"writeTo": [
{
"Name": "File",
"Args": {
"path": "Logs/BusinessFlow/log-.txt",
"rollingInterval": "Day",
"outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"
}
}
]
}
}
],
"Enrich": [ "FromLogContext" ]
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://localhost:8660"
}
}
},
"EmailSettings": {
"SmtpServer": "smtp.gmail.com",
"SmtpPort": 587,
"Username": "nuvolarsetup@gmail.com",
"Password": "reiq pgfr nxub pvrb",
"SenderName": "Nuvolar System"
}
}
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "com-nuvolar-wfcapp",
"private_key_id": "37642626e4a61fea715f3ef02a35d53fa9227666",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCVQKzCOgEhaQFo\nxtOYCpOc6XQNOVfNm8Z1xu1uoQtSZZIH3ivJy1IBqlyP/+sQ+7FO3Af5v90ae3rf\nvzd42QC4hrbBPyLGbVJWDHNPOzwg7bbez3waaU4i/7m4YJ61hlOObo888mjAxG8t\nz0cDEQzWPPUlLBCvtzY8Zv3jWdYaBxGUUzHxfemjTVLG7YCUjyt057HJVSH7AJpV\ndhnBi+3xlogsnK227ou/rLWoNyZVDOUaSiMor+LNiQx82eXc+UUaJgjpbI5AMk9z\n7CgAM8CSMOw7BHhCImVXaxH9rLZCsw0xpZnCJuOJKRyIMhrfcWKcHjrgkEW+xErj\nWN9lSkHRAgMBAAECggEAAwH5FUcrVom13b9bfF3ysnPdKwbNvVrLN5yDFIKV7oK1\n3Bca42u3rulIqR15doe275GVLtASL+ZfABcrslGPr1hGIqvvusdRVGL2+CjXveti\nbvgoDmVyvddwzf2S9zIiOQ2i8PHK4P8YZTg/DGmVnFPhRg7utWbMFtClw0UQQKkd\nzRwRDsw0jx9wDpP4EaO+czNvVZnnj+miL8QICN4gjbTdyQiVw2D1KzabwmozfEkM\nqTP+yH9mSC4gAEkG+X3i48QxiXZXvLflfnhF58+mT4yjIBIQbRTi0w9yLWRkcs8n\nmCq/89PZMncpNdCSJqdNOsYXgVaW8OMePxPNER2g4QKBgQDHl47N9AGyukpqEJJK\nR/8u3IwcCjLBb0wk5UxtZyz2JpoyqXoaKw7teqCqhg6lVd8MdIcVITKe0nZ+P29z\nyL+RVC+hGm/OQj6mAVyFEZptMgtQZGA2ThLY4ozZgzTW7uNyChhnUcqTiMCJ0g5g\n05imd6nQFKxI1ZfCsE7qlq6yYQKBgQC/bxKYno/6OT+9TTS+OCYVx9WJ8JCzOqFh\n/S+7qV14Bmml/JmYoSo/umxNOlKu3c7QtjU6caD/r4q/r6RHvvBxMlBu4K+vTEXh\nhFeqYORwTcEkcTDpjAGDekeJsRSxv5bg6QtsW30mtreBBC1/fOAvHD03Tz8GmFsp\nHry7b1WlcQKBgQCrnb51iix3oETh5DPVWQirI4n5hi9UMb24L81CeKepU1Hc4+qQ\nW5uvSHSjizdGpIpwLDYGThA3jeHC9gp/9Qn7DPcTQCcIo984YA1MgfFVmOUvj89G\ngmUkRdA0KuQhNzEsWk/XbvWPW9Op7YrdaLNl15iUyWHGEpo2FeEVRtEZoQKBgF5Z\nM+UcYQGGLa/y2UfXDI43izsM4YQ0JU3SJzBqbLK3FmLEeD8NT3FRRAdb81xT3ZZn\n9xvy3NKnhc6rll/17zMbBSFgg7X19YsMWtiSIIRpDgQT9XNlmWlfXtqx9+0S7B21\nPfgNr0ThUNe5Y2Mt/J+7X0BfQkTR2jwN9h665I9BAoGADx/oQLMXgKGdes4adF1Z\np9miGNsmUgXHdT+CdWkRx5uRd1a5s1Di6sOEUBPyFJ9hYc5ObRuC5q1A24ApASak\n0YCbUV1lqzFI4loXyM5ABqRTRCVGH94PXDAvsRUTTLvRIOliOeOBa8bNGGPlXtFw\nXzrkDjsz71JdNxgvT2Zz7nA=\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-fbsvc@com-nuvolar-wfcapp.iam.gserviceaccount.com",
"client_id": "109975038898567298706",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-fbsvc%40com-nuvolar-wfcapp.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
@@ -0,0 +1,225 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System.Diagnostics;
namespace WorkFlowCheck.BL.DocumentGenerator
{
public class DokumentumGenerator
{
public static byte[] DocxToPdfL(byte[] wordBytes, List<string> imagePaths = null)
{
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
string fileName = Guid.NewGuid().ToString();
string tempWordPath = Path.Combine(pdfDirectory, fileName + ".docx");
string tempPdfPath = Path.Combine(pdfDirectory, fileName + ".pdf");
try
{
// Word fájl mentése ideiglenes fájlba
File.WriteAllBytes(tempWordPath, wordBytes);
if (imagePaths != null && imagePaths.Count > 0)
{
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(tempWordPath, true))
{
MainDocumentPart mainPart = wordDoc.MainDocumentPart;
foreach (string imagePath in imagePaths)
{
if (File.Exists(imagePath))
{
InsertImageAsNewPage(mainPart, imagePath);
}
}
wordDoc.MainDocumentPart.Document.Save();
}
}
// LibreOffice parancssori konverzió
ProcessStartInfo startInfo = new ProcessStartInfo
{
#if !DEBUG
FileName = "e:\\LibreOffice\\program\\soffice", // LibreOffice parancs
#else
//FileName = "c:\\Program Files\\LibreOffice\\program\\soffice", // LibreOffice parancs
FileName = "e:\\LibreOffice\\program\\soffice", // LibreOffice parancs
#endif
Arguments = $"--headless --convert-to pdf \"{tempWordPath}\" --outdir \"{pdfDirectory}",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
using (Process process = Process.Start(startInfo))
{
process.WaitForExit();
}
// Ellenőrzés, hogy létrejött-e a PDF
if (File.Exists(tempPdfPath))
{
byte[] pdfBytes = File.ReadAllBytes(tempPdfPath);
// Ideiglenes fájlok törlése
File.Delete(tempWordPath);
File.Delete(tempPdfPath);
return pdfBytes;
}
else
{
throw new Exception("PDF konverzió sikertelen.");
}
}
catch (Exception ex)
{
Console.WriteLine("Hiba a PDF konverzió során: " + ex.Message);
return null;
}
}
private static void InsertImageAsNewPage(MainDocumentPart mainPart, string imagePath)
{
string fileName = Path.GetFileName(imagePath);
// Kép méretezés max szélesség/magasság A4 hasznos területhez igazítva
using var image = SixLabors.ImageSharp.Image.Load(imagePath);
int pixelWidth = image.Width;
int pixelHeight = image.Height;
long maxWidth = 5760000L; // kb. 16 cm
long maxHeight = 7200000L; // kb. 20 cm
double aspectRatio = (double)pixelHeight / pixelWidth;
long finalWidth = maxWidth;
long finalHeight = (long)(maxWidth * aspectRatio);
if (finalHeight > maxHeight)
{
finalHeight = maxHeight;
finalWidth = (long)(maxHeight / aspectRatio);
}
// Kép hozzáadása Word dokumentumhoz
ImagePart imagePart = mainPart.AddImagePart(ImagePartType.Jpeg);
using (FileStream stream = new FileStream(imagePath, FileMode.Open))
{
imagePart.FeedData(stream);
}
string imagePartId = mainPart.GetIdOfPart(imagePart);
Drawing drawing = CreateImageDrawing(imagePartId, finalWidth, finalHeight);
// Kép beillesztése középre igazítva
Paragraph imageParagraph = new Paragraph(new Run(drawing))
{
ParagraphProperties = new ParagraphProperties(
new Justification() { Val = JustificationValues.Center }
)
};
TableCell imageCell = new TableCell(imageParagraph,
new TableCellProperties(
new TableCellVerticalAlignment { Val = TableVerticalAlignmentValues.Center },
new TableCellWidth() { Type = TableWidthUnitValues.Pct, Width = "10000" }
));
// Képes sor (magas, kitölti az oldalt)
TableRow imageRow = new TableRow(imageCell);
imageRow.AppendChild(new TableRowProperties(
new TableRowHeight() { Val = 9000, HeightType = HeightRuleValues.Exact }
));
// Fájlnév beillesztése középre
Paragraph fileNamePara = new Paragraph(new Run(new Text(fileName)))
{
ParagraphProperties = new ParagraphProperties(
new Justification() { Val = JustificationValues.Center }
)
};
TableCell fileNameCell = new TableCell(fileNamePara,
new TableCellProperties(
new TableCellVerticalAlignment { Val = TableVerticalAlignmentValues.Center },
new TableCellWidth() { Type = TableWidthUnitValues.Pct, Width = "10000" }
));
// Fájlnév sor (normál magasság)
TableRow fileNameRow = new TableRow(fileNameCell);
fileNameRow.AppendChild(new TableRowProperties(
new TableRowHeight() { Val = 400, HeightType = HeightRuleValues.Auto }
));
// Táblázat szegély nélkül, teljes oldalszélességben
Table table = new Table(
new TableProperties(
new TableWidth { Width = "10000", Type = TableWidthUnitValues.Pct },
new TableBorders(
new TopBorder { Val = BorderValues.None },
new BottomBorder { Val = BorderValues.None },
new LeftBorder { Val = BorderValues.None },
new RightBorder { Val = BorderValues.None },
new InsideHorizontalBorder { Val = BorderValues.None },
new InsideVerticalBorder { Val = BorderValues.None }
)
),
imageRow,
fileNameRow
);
// Új oldal és a táblázat beszúrása a dokumentum végére
Body body = mainPart.Document.Body;
body.Append(new Paragraph(new Run(new Break() { Type = BreakValues.Page })));
body.Append(table);
}
private static Drawing CreateImageDrawing(string relationshipId, long width, long height)
{
return new Drawing(
new DocumentFormat.OpenXml.Drawing.Wordprocessing.Inline(
new DocumentFormat.OpenXml.Drawing.Wordprocessing.Extent() { Cx = width, Cy = height },
new DocumentFormat.OpenXml.Drawing.Wordprocessing.EffectExtent()
{
LeftEdge = 0L,
TopEdge = 0L,
RightEdge = 0L,
BottomEdge = 0L
},
new DocumentFormat.OpenXml.Drawing.Wordprocessing.DocProperties()
{
Id = (UInt32Value)1U,
Name = "Inserted Image"
},
new DocumentFormat.OpenXml.Drawing.Graphic(
new DocumentFormat.OpenXml.Drawing.GraphicData(
new DocumentFormat.OpenXml.Drawing.Pictures.Picture(
new DocumentFormat.OpenXml.Drawing.Pictures.NonVisualPictureProperties(
new DocumentFormat.OpenXml.Drawing.Pictures.NonVisualDrawingProperties()
{
Id = (UInt32Value)0U,
Name = "Picture"
},
new DocumentFormat.OpenXml.Drawing.Pictures.NonVisualPictureDrawingProperties()),
new DocumentFormat.OpenXml.Drawing.Pictures.BlipFill(
new DocumentFormat.OpenXml.Drawing.Blip()
{
Embed = relationshipId
},
new DocumentFormat.OpenXml.Drawing.Stretch(
new DocumentFormat.OpenXml.Drawing.FillRectangle())),
new DocumentFormat.OpenXml.Drawing.Pictures.ShapeProperties(
new DocumentFormat.OpenXml.Drawing.Transform2D(
new DocumentFormat.OpenXml.Drawing.Offset() { X = 0L, Y = 0L },
new DocumentFormat.OpenXml.Drawing.Extents() { Cx = width, Cy = height }),
new DocumentFormat.OpenXml.Drawing.PresetGeometry(
new DocumentFormat.OpenXml.Drawing.AdjustValueList())
{ Preset = DocumentFormat.OpenXml.Drawing.ShapeTypeValues.Rectangle }))
)
{ Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" })
)
{ DistanceFromTop = 0U, DistanceFromBottom = 0U, DistanceFromLeft = 0U, DistanceFromRight = 0U });
}
}
}
@@ -0,0 +1,576 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System.Text.RegularExpressions;
namespace WorkFlowCheck.BL.DocumentGenerator
{
public class SablonGenerator : IDisposable
{
private readonly List<OpenXmlElement> _currentRoot;
private MemoryStream Mem { get; }
private WordprocessingDocument Doc { get; set; }
private List<OpenXmlElement> CurrentRoot => Repeater?.SablonRoot ?? _currentRoot;
private SubSablon Repeater { get; set; }
protected class SubSablon : IDisposable
{
private List<OpenXmlElement> SablonRootBase { get; set; }
protected internal List<OpenXmlElement> SablonRoot { get; private set; }
public BookmarkStart BookmarkStart { get; }
public BookmarkEnd BookmarkEnd { get; }
protected internal SubSablon(WordprocessingDocument doc, string key)
{
var bookmark = doc.MainDocumentPart.RootElement.Descendants<BookmarkStart>()
.FirstOrDefault(x => x.Name == key);
//var parentBookmark = false;
if (bookmark != null)
{
SablonRoot = new List<OpenXmlElement>();
var nextSibling = bookmark.NextSibling();
if (nextSibling == null)
nextSibling = bookmark.Parent;
while (nextSibling != null)
{
var endBookmark = (nextSibling is BookmarkEnd end && end.Id == bookmark.Id.Value) ? end : null;
if (endBookmark == null)
{
endBookmark = nextSibling.Descendants<BookmarkEnd>().FirstOrDefault(x => x.Id == bookmark.Id.Value);
if (endBookmark != null)
SablonRoot.Add(nextSibling);
}
if (endBookmark != null)
{
bookmark.Remove();
endBookmark.Remove();
break;
}
SablonRoot.Add(nextSibling);
var tmpNextSibling = nextSibling.NextSibling();
if (tmpNextSibling == null)
{
tmpNextSibling = nextSibling.Parent;
if (tmpNextSibling != null && !(tmpNextSibling is Body) && !(tmpNextSibling is Document))
SablonRoot.Clear();
else
break;
}
nextSibling = tmpNextSibling;
}
}
if (SablonRoot != null && SablonRoot.Count > 0)
{
SablonRootBase = new List<OpenXmlElement>();
foreach (var item in SablonRoot)
{
SablonRootBase.Add(item.CloneNode(true));
}
BookmarkStart = new BookmarkStart() { Name = "repeater", Id = "1000" };
BookmarkEnd = new BookmarkEnd() { Id = "1000" };
if (SablonRoot.First().Parent != null)
{
SablonRoot.First().InsertBeforeSelf(BookmarkStart);
SablonRoot.First().InsertBeforeSelf(BookmarkEnd);
foreach (var rootItem in SablonRoot)
rootItem.Remove();
}
else
{
foreach (var rootItem in SablonRoot)
foreach (var rootItemChildElement in rootItem.ChildElements)
rootItemChildElement.Remove();
SablonRoot.First().AppendChild(BookmarkStart);
SablonRoot.First().AppendChild(BookmarkEnd);
}
Reset();
}
}
private void Insert()
{
var root = SablonRoot;
if (root.Count == 1 && root.First() is Document)
{
root = root.First().ChildElements.ToList();
}
for (var i = 0; i < root.Count; i++)
{
if (i == 0)
BookmarkStart.InsertBeforeSelf(root[i]);
else
root[i - 1].InsertAfterSelf(root[i]);
}
}
private void Reset()
{
SablonRoot.Clear();
foreach (var item in SablonRootBase)
{
SablonRoot.Add(item.CloneNode(true));
}
}
protected internal void InsertAndReset()
{
Insert();
Reset();
}
public void Dispose()
{
BookmarkStart?.Remove();
BookmarkEnd?.Remove();
SablonRootBase = null;
SablonRoot = null;
}
}
public IDisposable Repeat(string key)
{
Repeater = new SubSablon(Doc, key);
return Repeater;
}
public SablonGenerator(byte[] content)
{
Mem = new MemoryStream();
Mem.Write(content, 0, content.Length);
try
{
Doc = WordprocessingDocument.Open(Mem, true, new OpenSettings()
{
MarkupCompatibilityProcessSettings =
new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.ProcessAllParts,
FileFormatVersions.Office2010)
});
}
catch (Exception)
{
//if (!string.IsNullOrEmpty(Config.TryGetStringValue("SablonGeneratorErrorPath")))
//{
// File.WriteAllBytes(Path.Combine(Config.GetStringValue("SablonGeneratorErrorPath"), DateTime.Now.ToString("yyyyMMddHHHmmss.content")), content);
//}
throw;
}
_currentRoot = new List<OpenXmlElement>();
CurrentRoot.AddRange(Doc.MainDocumentPart.HeaderParts.Select(x => x.RootElement));
CurrentRoot.Add(Doc.MainDocumentPart.RootElement);
CurrentRoot.AddRange(Doc.MainDocumentPart.FooterParts.Select(x => x.RootElement));
}
public static void CheckOpenXmlDocument(byte[] content)
{
WordprocessingDocument doc = null;
var mem = new MemoryStream();
mem.Write(content, 0, content.Length);
try
{
doc = WordprocessingDocument.Open(mem, true, new OpenSettings()
{
MarkupCompatibilityProcessSettings =
new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.ProcessAllParts,
FileFormatVersions.Office2010)
});
}
catch (Exception ex)
{
#if DEBUG
//LoggerHelper.DiagnosticAudit.Information(DateTime.Now,
//Common.Enums.Area.BaseSystem,
//0,
//string.Format(ex.ToString()),
//new Guid().ToString());
//LoggerHelper.DiagnosticAudit.Log.Information(ex.ToString());
#else
//LoggerHelper.DiagnosticAudit.Information(DateTime.Now,
//Common.Enums.Area.BaseSystem,
//0,
//string.Format(ex.Message),
//Guid.Empty.ToString());
#endif
//throw new BusinessException("Hibás vagy nem megfelelő OpenXML állomány.");
}
finally
{
mem?.Dispose();
doc?.Dispose();
}
}
public void Generate(Dictionary<string, string> propertyDictionary)
{
ReplaceBookmarks(propertyDictionary);
if (Repeater?.SablonRoot != null) Repeater.InsertAndReset();
}
public void SimpleReplace(string key, string value)
{
value = value == null ? "" : value;
foreach (var headerPart in Doc.MainDocumentPart.HeaderParts)
SimpleReplace2(headerPart.Header, key, value);
SimpleReplace2(Doc.MainDocumentPart.Document.Body, key, value);
foreach (var footerPart in Doc.MainDocumentPart.FooterParts)
SimpleReplace2(footerPart.Footer, key, value);
}
protected void SimpleReplace(OpenXmlCompositeElement target, string key, string value)
{
var keyValue = key.Replace("#", "");
var texts = target.Descendants<Text>();
Text start = null;
Text keyValueText = null;
foreach (var text in texts)
if (text.Text == "#" && start == null)
start = text;
else if (text.Text == "#" && start != null && keyValueText != null)
{
var end = text;
keyValueText.Text = value;
start.Remove();
end.Remove();
start = null;
keyValueText = null;
}
else if (start != null && text.Text.ToUpper().Contains(keyValue.ToUpper()))
keyValueText = text;
else if (text.Text.ToUpper().Contains(key.ToUpper()))
{
start = null;
keyValueText = null;
text.Text = Regex.Replace(text.Text, key, value, RegexOptions.IgnoreCase);
}
else
{
start = null;
keyValueText = null;
}
}
protected void SimpleReplace2(OpenXmlCompositeElement target, string key, string value)
{
var texts = target.Descendants<Text>();
Text start = null;
var tokens = new List<Text>();
string tokenText = "";
foreach (var text in texts)
{
if (text.Text == "#" && start == null)
{
start = text;
tokenText += text.Text;
}
else if (text.Text == "#" && start != null)
{
var end = text;
tokenText += text.Text;
if (tokenText.ToUpper() == key.ToUpper())
{
start.Text = value;
foreach (var token in tokens)
{
token.Remove();
}
tokens.Clear();
end.Remove();
start = null;
tokenText = "";
}
else
{
start = null;
tokens.Clear();
tokenText = "";
end = null;
}
}
else if (text.Text.Contains('#') && text.Text.ToUpper() == key.ToUpper())
{
text.Text = value;
}
else if (text.Text.Contains('#'))
{
}
else if (start != null)
{
tokens.Add(text);
tokenText += text.Text;
}
}
}
public void SimpleReplaceForCV(string key, string value)
{
value = value == null ? "" : value;
SimpleReplaceForCV(Doc.MainDocumentPart.Document.Body, key, value);
}
protected void SimpleReplaceForCV(OpenXmlCompositeElement target, string key, string value)
{
var keyValue = key.Replace("#", "");
var texts = target.Descendants<Text>();
Text start = null;
Text keyValueText = null;
var keyindox = "";
foreach (var text in texts)
{
if (text.Text.Contains(key))
{
text.Text = text.Text.Replace(key, value);
break;
}
if (text.Text.Contains(keyValue + "#") && start != null)
{
start.Text = "";
text.Text = text.Text.Replace(keyValue + "#", value);
break;
}
if ((text.Text == "#" || (text.Text.Contains("#") && text.Text.Count(x => x == '#') == 1)) && start == null)
{
start = text;
keyindox = start.Text;
}
else if (start != null && (text.Text == "#" || text.Text.Contains("#")))
{
for (int i = texts.ToList().IndexOf(start) + 1; i < texts.ToList().IndexOf(text) + 1; i++)
{
if (texts.ToList()[i].Text.Contains(key))
{
texts.ToList()[i].Text = texts.ToList()[i].Text.Replace(key, value);
break;
}
keyindox = keyindox + texts.ToList()[i].Text;
}
keyindox = keyindox.Replace("#", "");
if (keyindox == keyValue || keyindox.Replace(" ", "") == keyValue)
{
for (int i = texts.ToList().IndexOf(start) + 1; i < texts.ToList().IndexOf(text); i++)
{
texts.ToList()[i].Text = "";
}
start.Text = "";
text.Text = value;
}
if (keyindox.Contains(keyValue))
{
for (int i = texts.ToList().IndexOf(start) + 1; i < texts.ToList().IndexOf(text); i++)
{
texts.ToList()[i].Text = "";
}
start.Text = "";
text.Text = keyindox.Replace(keyValue, value);
}
start = null;
keyindox = "";
}
}
}
private void ReplaceBookmarks(Dictionary<string, string> propertyDictionary)
{
var bookmarkEndList = new List<BookmarkEnd>();
foreach (var item in CurrentRoot)
{
var bookmarkEnds = item.Descendants<BookmarkEnd>();
bookmarkEndList.AddRange(bookmarkEnds.ToList());
}
foreach (var docContent in CurrentRoot)
{
var bookmarkStarts = docContent.Descendants<BookmarkStart>();
var bookmarkStartList = bookmarkStarts.ToList();
if (docContent is BookmarkStart)
bookmarkStartList.Add(docContent as BookmarkStart);
for (int k = 0; k < bookmarkStartList.Count; k++)
{
Run bookmarkRun = bookmarkStartList[k].NextSibling<Run>();
if (bookmarkRun != null)
{
var bookmarkText = bookmarkRun.GetFirstChild<Text>().InnerText;
if (propertyDictionary.ContainsKey(bookmarkText))
{
var itemValue = propertyDictionary[bookmarkText];
bookmarkRun.GetFirstChild<Text>().Text = itemValue ?? string.Empty;
var id = bookmarkStartList[k].Id.Value;
bookmarkStartList[k].Remove();
var end = bookmarkEndList.Find(x => x.Id == id);
end.Remove();
}
}
}
}
}
/// <summary>
/// Táblázat generálás (a keyinrow paramétert keresi a táblázat első sorában (nem fejléc), ezt a sort kitörli, és helyére szúrja be az új sorokat
/// amit az első paraméterben kap meg
/// </summary>
/// <param name="rowsAndCells">sorok és benne az egyes cellák tartalma</param>
/// <param name="keyInRow">első (nem fejléc) sorában lévő kulcs, ez alapján azonosítjuk be a táblázatot</param>
/// <param name="deleteEmptyRow">ha igaz, a táblázat összes meglévő sorát törli</param>
public void SetTable_Old(List<List<string>> rowsAndCells, string keyInRow, bool deleteEmptyRow = false)
{
Body bod = Doc.MainDocumentPart.Document.Body;
var table = bod.Descendants<Table>().Where(tbl => tbl.InnerText.Contains(keyInRow)).FirstOrDefault();
if (table != null)
{
if (deleteEmptyRow)
{
var firstRow = table.ChildElements.Where(x => x is TableRow).FirstOrDefault();
var deletedRows = table.ChildElements.Where(x => x is TableRow).ToList();
deletedRows.Remove(firstRow);
foreach (var item in deletedRows)
table.RemoveChild(item);
}
else
{
var deletedRow = table.ChildElements.Where(x => x is TableRow).LastOrDefault();
table.RemoveChild<TableRow>(deletedRow as TableRow);
}
foreach (var row in rowsAndCells)
{
List<OpenXmlElement> cells = new List<OpenXmlElement>();
foreach (var cell in row)
{
var tableCell = new TableCell(new Paragraph(new Run(new Text(cell))));
cells.Add(tableCell);
}
table.Append(new TableRow(cells));
}
}
}
public void SetTable(List<List<string>> rowsAndCells, string keyInRow, bool deleteEmptyRow = false)
{
Body bod = Doc.MainDocumentPart.Document.Body;
var table = bod.Descendants<Table>().Where(tbl => tbl.InnerText.Contains(keyInRow)).FirstOrDefault();
if (table != null)
{
TableRow formatRow = null;
// Megkeressük az első sort és elmentjük a formázást
if (deleteEmptyRow)
{
var firstRow = table.ChildElements.OfType<TableRow>().FirstOrDefault();
if (firstRow != null)
{
formatRow = (TableRow)firstRow.CloneNode(true); // Az első sor másolása formázással
var deletedRows = table.ChildElements.OfType<TableRow>().ToList();
foreach (var item in deletedRows)
table.RemoveChild(item);
}
}
else
{
var deletedRow = table.ChildElements.OfType<TableRow>().LastOrDefault();
if (deletedRow != null)
{
formatRow = (TableRow)deletedRow.CloneNode(true); // Az utolsó sor másolása formázással
table.RemoveChild(deletedRow);
}
}
// Új sorok beszúrása a mentett formázással
foreach (var row in rowsAndCells)
{
List<OpenXmlElement> cells = new List<OpenXmlElement>();
for (int i = 0; i < row.Count; i++)
{
var cellText = row[i].Replace("#", "");
// Ha van formázási minta, alkalmazzuk
TableCell newCell;
if (formatRow != null && i < formatRow.Elements<TableCell>().Count())
{
var formatCell = formatRow.Elements<TableCell>().ElementAt(i);
var clonedCell = (TableCell)formatCell.CloneNode(true);
var para = clonedCell.Descendants<Paragraph>().FirstOrDefault();
// Ha van beágyazott szöveg, frissítjük a tartalmát
if (para != null)
{
var run = para.Descendants<Run>().FirstOrDefault();
if (run != null)
{
run.RemoveAllChildren<Text>();
run.AppendChild(new Text(cellText));
}
}
newCell = clonedCell;
}
else
{
// Alapértelmezett cella, ha nincs formázási minta
newCell = new TableCell(new Paragraph(new Run(new Text(cellText))));
}
cells.Add(newCell);
}
table.Append(new TableRow(cells));
}
}
}
public byte[] CloseAndGetDocument()
{
Doc.Dispose();
Doc = null;
return Mem.ToArray();
}
public void Dispose()
{
Doc?.Dispose();
Mem.Dispose();
}
/// <summary>
/// Hozzáfűzi a már megnyitott fájlhoz a paraméterként kapott dokumentum tartalmát.
/// </summary>
/// <param name="document"></param>
/// <param name="addPageBreak"></param>
public void AppendDocument(byte[] document, bool addPageBreak = true)
{
var mainPart = Doc.MainDocumentPart;
string altChunkId = "AltChunk_" + Guid.NewGuid().ToString().Replace("-", "");
var chunk = mainPart.AddAlternativeFormatImportPart(AlternativeFormatImportPartType.WordprocessingML, altChunkId);
chunk.FeedData(new MemoryStream(document));
// oldaltörés, ha kell
if (addPageBreak)
{
mainPart.Document.Body.AppendChild(new Paragraph(new Run(new Break() { Type = BreakValues.Page })));
}
mainPart.Document.Body.AppendChild(new AltChunk() { Id = altChunkId });
mainPart.Document.Save();
}
}
}
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<title>Értesítés jóváhagyásról</title>
</head>
<body style="font-family: Arial, sans-serif; background-color: #f9f9f9; padding: 20px;">
<p style="font-size: 18px;">
A következő munkafolyamat jóvá lett hagyva:
</p>
<p style="font-size: 28px; font-weight: bold; color: #333; margin-top: 10px;">
#DocumentNumber#
</p>
</body>
</html>
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<title>Megerősítő kód</title>
</head>
<body style="font-family: Arial, sans-serif; background-color: #f9f9f9; padding: 20px;">
<p style="font-size: 18px;">
<strong>Workflow Check Application Web</strong> megerősítő kódja:
</p>
<p style="font-size: 28px; font-weight: bold; color: #333; margin-top: 10px;">
#token2F#
</p>
</body>
</html>
+2
View File
@@ -17,6 +17,8 @@ namespace WorkFlowCheck.BL.Infra
service.AddScoped<ISyncService, SyncService>();
service.AddScoped<ICheckListService, CheckListService>();
service.AddScoped<INumberGeneratorService, NumberGeneratorService>();
service.AddScoped<IMessageService, MessageService>();
service.AddScoped<ISystemService, SystemService>();
}
}
}
+40 -3
View File
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using AutoMapper.Configuration.Conventions;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.DL.Entities;
@@ -16,7 +17,9 @@ namespace WorkFlowCheck.BL.Mappings
{
CreateMap<User, UserDTO>().ForMember(dest => dest.RoleDTO, opt => opt.MapFrom(src => src.UserRoles.Select(ur => ur.Role)));
CreateMap<Role, RoleDTO>();
CreateMap<Role, RoleDTO>()
.ForMember(dest => dest.ParentId, opt => opt.MapFrom(src => src.ParentId))
.ForMember(dest => dest.ParentRoleName, opt => opt.MapFrom(src => src.Parent != null ? src.Parent.RoleName : null));
CreateMap<UserRole, UserRoleDTO>()
.ForMember(dest => dest.RoleDTO, opt => opt.MapFrom(src => src.Role))
@@ -33,7 +36,14 @@ namespace WorkFlowCheck.BL.Mappings
.ForMember(dest => dest.EquipmentDTO, opt => opt.MapFrom(src => src.Equipment))
.ForMember(dest => dest.CheckPointDTO, opt => opt.MapFrom(src => src.CheckPoint));
CreateMap<CheckPoint, CheckPointDTO>().ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckPoint, CheckPointDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckPoint, CheckPointDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRows));
CreateMap<CheckPointDTO, CheckPoint>();
@@ -43,12 +53,39 @@ namespace WorkFlowCheck.BL.Mappings
CreateMap<Equipment, EquipmentDTO>();
CreateMap<EquipmentDTO, Equipment>();
CreateMap<DeviceMessage, DeviceMessageDTO>();
CreateMap<DeviceMessageDTO, DeviceMessage>();
CreateMap<CheckListHeader, CheckListHeaderDTO>()
.ForMember(dest => dest.UserDTO, opt => opt.MapFrom(src => src.User))
.ForMember(dest => dest.AcceptUserId, opt => opt.MapFrom(src => src.AcceptUser != null ? src.AcceptUser.Id : (int?)null))
.ForMember(dest => dest.AcceptUserDTO, opt => opt.MapFrom(src => src.AcceptUser))
.ForMember(dest => dest.CheckListRowDTO, opt => opt.MapFrom(src => src.CheckListRows));
CreateMap<CheckListRow, CheckListRowDTO>()
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRow));
.ForMember(dest => dest.CheckListTemplateRowDTO, opt => opt.MapFrom(src => src.CheckListTemplateRow))
.ForMember(dest => dest.Photo, opt => opt.MapFrom(src => GetImageBytes(src.PhotoFileName)));
CreateMap<RoleCheckListTemplateHeader, RoleCheckListTemplateHeaderDTO>()
.ForMember(dest => dest.RoleDTO, opt => opt.MapFrom(src => src.Role))
.ForMember(dest => dest.CheckListTemplateHeaderDTO, opt => opt.MapFrom(src => src.CheckListTemplateHeader));
}
private byte[] GetImageBytes(string fileName)
{
try
{
var filePath = Path.Combine(Directory.GetCurrentDirectory(), "Images", fileName);
if (File.Exists(filePath))
{
return File.ReadAllBytes(filePath);
}
return Array.Empty<byte>(); // Visszaad egy üres byte[]-ot, ha a fájl nem található
}
catch (Exception)
{
return Array.Empty<byte>(); // Hiba esetén is üres byte[]-ot ad vissza
}
}
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.BL.Models
{
public class EmailSettings
{
public string SmtpServer { get; set; } = string.Empty;
public int SmtpPort { get; set; }
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string SenderName { get; set; } = string.Empty;
}
}
@@ -0,0 +1,149 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.DL;
namespace WorkFlowCheck.BL.Services
{
public class BaseService
{
public readonly AppDbContext _dbContext;
public readonly IMapper _mapper;
private readonly ILogger _logger;
public BaseService(AppDbContext db_dbContext, IMapper mapper)
{
_dbContext = db_dbContext;
_mapper = mapper;
_logger = Log.ForContext("Tag", "PROGSEC");
}
public async Task<bool> DeleteEntityByIdAsync<T>(int id) where T : class
{
try
{
var entity = await _dbContext.Set<T>().FindAsync(id);
if (entity == null)
return false;
_dbContext.Set<T>().Remove(entity);
await _dbContext.SaveChangesAsync();
return true;
}
catch (Exception ex)
{
Log.Error($"Hiba történt a törlés során: {ex.Message}");
return false;
}
}
public async Task<T?> GetEntityByIdAsync<T>(int id) where T : class
{
try
{
var entity = await _dbContext.Set<T>().FindAsync(id);
return entity;
}
catch (Exception ex)
{
Log.Error($"Hiba történt a lekérdezés során: {ex.Message}");
return null;
}
}
public async Task<List<TEntity>> GetEntityByFilterAsync<TEntity, TFilter>(TFilter filter) where TEntity : class where TFilter : class
{
try
{
IQueryable<TEntity> query = _dbContext.Set<TEntity>();
foreach (var property in typeof(TFilter).GetProperties())
{
var value = property.GetValue(filter);
if (value != null)
{
var parameter = Expression.Parameter(typeof(TEntity), "x");
var member = Expression.Property(parameter, property.Name);
var constant = Expression.Constant(value);
var equal = Expression.Equal(member, constant);
var lambda = Expression.Lambda<Func<TEntity, bool>>(equal, parameter);
query = query.Where(lambda);
}
}
// Adatok lekérdezése
return await query.ToListAsync();
}
catch (Exception ex)
{
Log.Error($"Hiba történt a lekérdezés során: {ex.Message}");
return new List<TEntity>();
}
}
public async Task<PagedResult<TEntity>> GetPagedEntityByFilterAsync<TEntity, TFilter>(TFilter filter, int pageNumber, int pageSize) where TEntity : class where TFilter : class
{
try
{
// Az IQueryable típusú lista létrehozása
IQueryable<TEntity> query = _dbContext.Set<TEntity>();
// Dinamikus szűrés a filter tulajdonságai alapján
foreach (var property in typeof(TFilter).GetProperties())
{
var value = property.GetValue(filter);
if (value != null)
{
var parameter = Expression.Parameter(typeof(TEntity), "x");
var member = Expression.Property(parameter, property.Name);
var constant = Expression.Constant(value);
var equal = Expression.Equal(member, constant);
var lambda = Expression.Lambda<Func<TEntity, bool>>(equal, parameter);
query = query.Where(lambda);
}
}
// Teljes rekordok száma a szűrő után
int totalCount = await query.CountAsync();
// Lapozás alkalmazása
var items = await query
.Skip((pageNumber - 1) * pageSize)
.Take(pageSize)
.ToListAsync();
// Lapozási eredmény összerakása
return new PagedResult<TEntity>
{
Items = items,
TotalCount = totalCount,
PageNumber = pageNumber,
PageSize = pageSize
};
}
catch (Exception ex)
{
Console.WriteLine($"Hiba történt a lekérdezés során: {ex.Message}");
return new PagedResult<TEntity>();
}
}
}
public class PagedResult<TEntity>
{
public List<TEntity> Items { get; set; } = new List<TEntity>();
public int TotalCount { get; set; }
public int PageNumber { get; set; }
public int PageSize { get; set; }
}
}
+394 -13
View File
@@ -1,29 +1,41 @@
using AutoMapper;
using DocumentFormat.OpenXml.Office.CustomUI;
using DocumentFormat.OpenXml.Office2010.Excel;
using DocumentFormat.OpenXml.Spreadsheet;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using Serilog;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.BL.DocumentGenerator;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Common.Enums;
using WorkFlowCheck.DL;
using WorkFlowCheck.DL.Entities;
namespace WorkFlowCheck.BL.Services
{
public class CheckListService : ICheckListService
public class CheckListService : BaseService, ICheckListService
{
private AppDbContext _dbContext;
private IMapper _mapper;
private readonly INumberGeneratorService _numberGeneratorService;
public CheckListService(AppDbContext dbContext, IMapper mapper, INumberGeneratorService numberGeneratorService)
private readonly INumberGeneratorService _numberGeneratorService;
private readonly IMessageService _messageService;
public CheckListService(AppDbContext dbContext,
IMapper mapper,
INumberGeneratorService numberGeneratorService,
IMessageService messageService,
IUserService userService) : base(dbContext, mapper)
{
_dbContext = dbContext;
_mapper = mapper;
_numberGeneratorService = numberGeneratorService;
_messageService = messageService;
}
public async Task<CheckListHeaderDTO> GetCheckListHeaderAsync(int Id)
@@ -37,10 +49,25 @@ namespace WorkFlowCheck.BL.Services
{
var res = await _dbContext.CheckListHeaders
.Where(w => w.Id == Id)
.Include(i => i.User)
.Include(i => i.AcceptUser)
.Include(i => i.CheckListRows)
.ThenInclude(r => r.CheckListTemplateRow)
.ThenInclude(r => r.CheckPoint)
.Include(i => i.CheckListRows)
.ThenInclude(r => r.CheckListTemplateRow)
.ThenInclude(r => r.Equipment)
.AsNoTracking()
.FirstOrDefaultAsync();
if (res != null)
{
res.CheckListRows = res.CheckListRows
.OrderBy(r => r.CheckListTemplateRow.CheckPoint?.ShortName ?? string.Empty)
.ThenBy(r => r.CheckListTemplateRow.RowIndex)
.ToList();
}
if (res != null)
{
retVal = _mapper.Map<CheckListHeaderDTO>(res);
@@ -59,14 +86,15 @@ namespace WorkFlowCheck.BL.Services
var retVal = new List<CheckListHeaderDTO>();
try
{
var roles = await _dbContext.CheckListHeaders
var checkListHeaders = await _dbContext.CheckListHeaders
.Include(i => i.CheckListRows)
.Include(i => i.User)
.Include(i => i.AcceptUser)
.AsNoTracking()
.ToListAsync();
if (roles != null)
if (checkListHeaders != null)
{
retVal = _mapper.Map<List<CheckListHeaderDTO>>(roles);
retVal = _mapper.Map<List<CheckListHeaderDTO>>(checkListHeaders);
}
}
catch (Exception ex)
@@ -86,6 +114,7 @@ namespace WorkFlowCheck.BL.Services
{
CheckListTemplateHeaderId = checkListHeaderDTO.CheckListTemplateHeaderDTO.Id,
Description = checkListHeaderDTO.Description,
ShortName = checkListHeaderDTO.ShortName,
GuidNumber = Guid.NewGuid(),
};
_dbContext.CheckListHeaders.Add(checkListHeader);
@@ -101,7 +130,7 @@ namespace WorkFlowCheck.BL.Services
if (checkListHeader != null)
{
checkListHeader.Description = checkListHeaderDTO.Description;
checkListHeader.ShortName = checkListHeaderDTO.ShortName;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<CheckListHeaderDTO>(checkListHeader);
@@ -136,11 +165,12 @@ namespace WorkFlowCheck.BL.Services
CheckListHeader checkListHeader = new CheckListHeader()
{
CheckListTemplateHeaderId = checkListHeaderNewDTO.CheckListTemplateHeaderId,
CheckStatus = CheckStatus.Open,
DateExecution = currentDate,
IsEditable = true,
UserId = checkListHeaderNewDTO.UserId,
ShortName = "",
Description = "",
Description = checkListTemplateHeader.Description ?? "",
DocumentNumber = documentNumber,
GuidNumber = Guid.NewGuid(),
IsDeleted = false,
@@ -165,7 +195,7 @@ namespace WorkFlowCheck.BL.Services
CheckListTemplateRowId = item.Id,
GuidNumber = Guid.NewGuid(),
IsDeleted = false,
Photo = new byte[0],
PhotoFileName = "",
};
_dbContext.CheckListRows.Add(checkListRow);
}
@@ -182,6 +212,245 @@ namespace WorkFlowCheck.BL.Services
}
return retVal;
}
public async Task<bool> AcceptCheckListHeaderAsync(int id, int userid)
{
var retVal = false;
try
{
var user = await _dbContext.Users
.Where(w => w.Id == userid)
.FirstOrDefaultAsync();
if (user == null) return false;
var checkListHeader = await _dbContext.CheckListHeaders
.Where(w => w.Id == id && w.CheckStatus == CheckStatus.Sent)
.FirstOrDefaultAsync();
if (checkListHeader != null)
{
checkListHeader.CheckStatus = CheckStatus.Signed;
checkListHeader.IsEditable = false;
checkListHeader.AcceptUserId = userid;
checkListHeader.DateExecution = DateTime.Now;
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása, jóváhagyás: Ellenőrzés:{checkListHeader.DocumentNumber}, Felhasználó: {user.LastName} {user.FirstName}");
await _dbContext.SaveChangesAsync();
var pdf = await CreateCheckListHeaderPDFAsync(id);
if (pdf != null && pdf.Length > 0)
{
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
var fileName = $"CD_{timestamp}_{checkListHeader.GuidNumber.ToString().ToUpper()}.pdf";
var filePath = Path.Combine(pdfDirectory, fileName);
await File.WriteAllBytesAsync(filePath, pdf);
await SendMailToAcceptedUser(filePath, checkListHeader, userid);
retVal = true;
}
}
}
catch (Exception ex)
{
retVal = false;
Log.Error(ex.Message);
}
return retVal;
}
private async Task SendMailToAcceptedUser(string filePath, CheckListHeader checkListHeader, int userId)
{
try
{
var user = _dbContext.Users.Where(W => W.Id == userId).FirstOrDefault();
if (user != null)
{
if (!string.IsNullOrEmpty(user.Email))
{
var recepients = new List<string>()
{
user.Email,
};
await _messageService.SendMailAsync(recepients,
$"Értesítés folyamat jóváhagyásáról {checkListHeader.DocumentNumber}",
GetAcceptCheckListHeaderMessageBody(checkListHeader),
filePath);
}
}
}
catch (Exception ex)
{
}
}
private string GetAcceptCheckListHeaderMessageBody(CheckListHeader checkListHeader)
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "WorkFlowCheck.BL.HtmlTemplates.AcceptCheckListHeaderBody.html";
using var stream = assembly.GetManifestResourceStream(resourceName);
if (stream == null)
throw new FileNotFoundException($"Nem található a beágyazott erőforrás: {resourceName}");
using var reader = new StreamReader(stream);
var html = reader.ReadToEnd();
return html.Replace("#DocumentNumber#", checkListHeader.DocumentNumber);
}
public async Task<byte[]> CreateCheckListHeaderPDFAsync(int checkListHeaderId)
{
try
{
var checkListHeader = await this.GetCheckListHeaderAsync(checkListHeaderId);
string pdfDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Pdf");
byte[] byteArray = File.ReadAllBytes(Path.Combine(pdfDirectory, "CheckList_Template_V1.docx"));
SablonGenerator gen = new SablonGenerator(byteArray);
gen.SimpleReplace("#description#", checkListHeader.Description);
gen.SimpleReplace("#DocumentNumber#", checkListHeader.DocumentNumber);
gen.SimpleReplace("#DateExecution#", checkListHeader.DateExecution.ToString("yyyy.MM.dd HH:mm"));
gen.SimpleReplace("#WorkUser#", $"{checkListHeader.UserDTO?.LastName} {checkListHeader.UserDTO?.FirstName}");
gen.SimpleReplace("#AcceptUser#", $"{checkListHeader.AcceptUserDTO?.LastName} {checkListHeader.AcceptUserDTO?.FirstName}");
gen.SimpleReplace("#Guid#", checkListHeader.GuidNumber.ToString());
if (checkListHeader.CheckListRowDTO != null && checkListHeader.CheckListRowDTO.Count > 0)
{
var elements = new List<List<string>>();
foreach (var item in checkListHeader.CheckListRowDTO)
{
if (item.CheckListTemplateRowDTO != null)
{
var cells = new List<string>
{
$"{item.CheckListTemplateRowDTO.RowIndex.ToString()}.",
item.CheckListTemplateRowDTO.OperationDescription,
item.Answer
};
elements.Add(cells);
}
}
gen.SetTable(elements, "#rowindex");
}
byte[] content = gen.CloseAndGetDocument();
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
var images = checkListHeader.CheckListRowDTO.Where(w => (w.CheckListTemplateRowDTO.AnswerType == "P" || w.CheckListTemplateRowDTO.AnswerType == "PN") &&
string.IsNullOrEmpty(w.Answer) != true)
.Select(s => Path.Combine(imageDirectory, s.Answer))
.ToList();
return DokumentumGenerator.DocxToPdfL(content, images);
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return new byte[0];
}
public async Task<bool> BlockCheckListHeaderAsync(int id, int userid)
{
var retVal = false;
try
{
var checkListHeader = await _dbContext.CheckListHeaders
.Where(w => w.Id == id && w.CheckStatus == CheckStatus.InProgress)
.FirstOrDefaultAsync();
if (checkListHeader != null && checkListHeader.CheckStatus == CheckStatus.InProgress)
{
checkListHeader.CheckStatus = CheckStatus.Blocked;
checkListHeader.IsEditable = false;
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap blokkolva: Ellenőrzés:{id}, Felhasználó:{userid}");
await _dbContext.SaveChangesAsync();
retVal = true;
}
}
catch (Exception ex)
{
retVal = false;
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> UnBlockCheckListHeaderAsync(int id, int userid)
{
var retVal = false;
try
{
var checkListHeader = await _dbContext.CheckListHeaders
.Where(w => w.Id == id && w.CheckStatus == CheckStatus.Blocked)
.FirstOrDefaultAsync();
if (checkListHeader != null && checkListHeader.CheckStatus == CheckStatus.Blocked)
{
checkListHeader.CheckStatus = CheckStatus.InProgress;
checkListHeader.IsEditable = true;
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap feloldva: Ellenőrzés:{id}, Felhasználó:{userid}");
await _dbContext.SaveChangesAsync();
retVal = true;
}
}
catch (Exception ex)
{
retVal = false;
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO closeCheckListHeaderCloseDTO)
{
var retVal = false;
try
{
var checkListHeader = await _dbContext.CheckListHeaders
.Where(w => w.Id == closeCheckListHeaderCloseDTO.Id &&
(w.CheckStatus == CheckStatus.Blocked ||
w.CheckStatus == CheckStatus.InProgress ||
w.CheckStatus == CheckStatus.Open
))
.FirstOrDefaultAsync();
if (checkListHeader != null)
{
checkListHeader.CheckStatus = CheckStatus.Closed;
checkListHeader.IsEditable = false;
checkListHeader.AcceptUserId = closeCheckListHeaderCloseDTO.UserId;
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap lezárva: Ellenőrzés:{closeCheckListHeaderCloseDTO.Id}, " +
$"Felhasználó:{closeCheckListHeaderCloseDTO.UserId}, " +
$"Lezárás oka: {closeCheckListHeaderCloseDTO.CloseReason}");
await _dbContext.SaveChangesAsync();
retVal = true;
}
}
catch (Exception ex)
{
retVal = false;
Log.Error(ex.Message);
}
return retVal;
}
public async Task<CheckListTemplateHeaderDTO> GetCheckListTemplateHeaderAsync(int Id)
{
@@ -246,6 +515,8 @@ namespace WorkFlowCheck.BL.Services
Description = checkListTemplateHeaderDTO.Description,
ShortName = checkListTemplateHeaderDTO.ShortName,
IsDeleted = false,
NumberGenerator1Id = checkListTemplateHeaderDTO.NumberGenerator1Id,
NumberGenerator2Id = checkListTemplateHeaderDTO.NumberGenerator2Id,
};
_dbContext.CheckListTemplateHeaders.Add(checkListTemplateHeader);
@@ -275,7 +546,57 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<bool> DeleteCheckListTemplateHeaderAsync(int id)
{
return await DeleteEntityByIdAsync<CheckListTemplateHeader>(id);
}
public async Task<bool> CloneCheckListTemplateHeaderAsync(int id)
{
var retVal = false;
try
{
var checkListTemplateHeader = await _dbContext.CheckListTemplateHeaders
.AsNoTracking()
.Include(i => i.CheckListTemplateRows)
.Where(w => w.Id == id).FirstOrDefaultAsync();
if (checkListTemplateHeader != null)
{
var newCheckListTemplateHeader = new CheckListTemplateHeader()
{
CheckListTemplateRows = new List<CheckListTemplateRow>(),
Description = checkListTemplateHeader.Description,
IsDeleted = false,
NumberGenerator1Id = checkListTemplateHeader.NumberGenerator1Id,
NumberGenerator2Id = checkListTemplateHeader.NumberGenerator2Id,
ShortName = $"{checkListTemplateHeader.ShortName} (másolat)",
};
foreach (var checkListTemplateRow in checkListTemplateHeader.CheckListTemplateRows)
{
var newCheckListTemplateRow = new CheckListTemplateRow()
{
AnswerType = checkListTemplateRow.AnswerType,
CheckListTemplateHeader = newCheckListTemplateHeader,
CheckPointId = checkListTemplateRow.CheckPointId,
EquipmentId = checkListTemplateRow.EquipmentId,
IsDeleted = false,
OperationDescription = checkListTemplateRow.OperationDescription,
RowIndex = checkListTemplateRow.RowIndex,
};
newCheckListTemplateHeader.CheckListTemplateRows.Add(newCheckListTemplateRow);
}
_dbContext.CheckListTemplateHeaders.Add(newCheckListTemplateHeader);
await _dbContext.SaveChangesAsync();
}
}
catch (Exception ex)
{
retVal = false;
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
}
return retVal;
}
public async Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id)
{
var retVal = new CheckListTemplateRowDTO();
@@ -301,6 +622,10 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<bool> DeleteCheckListTemplateRowAsync(int id)
{
return await DeleteEntityByIdAsync<CheckListTemplateRow>(id);
}
public async Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO)
{
var retVal = new CheckListTemplateRowDTO() { };
@@ -348,5 +673,61 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<CheckListRowDTO> GetCheckListRowAsync(int id)
{
var retVal = new CheckListRowDTO();
try
{
var res = await _dbContext.CheckListRows
.Include(i => i.CheckListTemplateRow)
.Where(w => w.Id == id)
.AsNoTracking()
.FirstOrDefaultAsync();
if (res != null)
{
retVal = _mapper.Map<CheckListRowDTO>(res);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<CheckListRowDTO> UpdateCheckListRowAsync(CheckListRowDTO checkListRowDTO)
{
var retVal = new CheckListRowDTO() { };
try
{
if (checkListRowDTO.Id == 0)
{
}
else
{
var checkListRow = await _dbContext.CheckListRows
.Where(w => w.Id == checkListRowDTO.Id)
.FirstOrDefaultAsync();
if (checkListRow != null)
{
checkListRow.Answer = checkListRowDTO.Answer;
//checkListRow.Photo = checkListRowDTO.Photo;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<CheckListRowDTO>(checkListRow);
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Rendering;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.BL.Services.Interfaces
@@ -12,16 +8,28 @@ namespace WorkFlowCheck.BL.Services.Interfaces
Task<CheckListHeaderDTO> GetCheckListHeaderAsync(int Id);
Task<List<CheckListHeaderDTO>> GetAllCheckListHeaderAsync();
Task<CheckListHeaderDTO> UpdateCheckListHeaderAsync(CheckListHeaderDTO checkListHeaderDTO);
Task<bool> AcceptCheckListHeaderAsync(int id, int userid);
Task<bool> BlockCheckListHeaderAsync(int id, int userid);
Task<bool> UnBlockCheckListHeaderAsync(int id, int userid);
Task<bool> CloseCheckListHeader(CheckListHeaderCloseDTO closeCheckListHeaderCloseDTO);
Task<byte[]> CreateCheckListHeaderPDFAsync(int checkListHeaderId);
Task<CheckListHeaderDTO> StartNewCheckListAsync(CheckListHeaderNewDTO checkListHeaderNewDTO);
Task<CheckListTemplateHeaderDTO> GetCheckListTemplateHeaderAsync(int Id);
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateHeaderAsync();
Task<CheckListTemplateHeaderDTO> UpdateCheckListTemplateHeaderAsync(CheckListTemplateHeaderDTO checkListTemplateHeaderDTO);
Task<bool> DeleteCheckListTemplateHeaderAsync(int id);
Task<bool> CloneCheckListTemplateHeaderAsync(int id);
Task<CheckListTemplateRowDTO> GetCheckListTemplateRowAsync(int id);
Task<bool> DeleteCheckListTemplateRowAsync(int id);
Task<CheckListTemplateRowDTO> UpdateCheckListTemplateRowAsync(CheckListTemplateRowDTO checkListTemplateRowDTO);
Task<CheckListRowDTO> GetCheckListRowAsync(int id);
Task<CheckListRowDTO> UpdateCheckListRowAsync(CheckListRowDTO checkListRowDTO);
}
}
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.BL.Services.Interfaces
{
public interface IMessageService
{
Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody, string? attachmentFilePath = null);
Task<bool> SendFCMTokenAsync(string token);
Task<string> GetLastFCMTokensAsync();
Task<bool> SendFCMMessage(FCMMessageDTO fCMMessageDTO);
Task<bool> SendFCMMessageToLastToken(FCMMessageDTO fCMMessageDTO);
}
}
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.BL.Services.Interfaces
{
@@ -11,5 +12,6 @@ namespace WorkFlowCheck.BL.Services.Interfaces
{
Task<string> GenerateNextNumberAsync(int templateId, IDbContextTransaction transaction, DateTime? baseDate = null);
Task<string> GetSampleAsync(int templateId, DateTime? baseDate = null);
Task<List<NumberGeneratorTemplateDTO>> GetAllNumbergeneratorsAsync();
}
}
@@ -1,4 +1,5 @@
using WorkFlowCheck.Common.DTO;
using Microsoft.AspNetCore.Mvc;
using WorkFlowCheck.Common.DTO;
namespace WorkFlowCheck.BL.Services.Interfaces
@@ -7,21 +8,32 @@ namespace WorkFlowCheck.BL.Services.Interfaces
{
Task<List<CheckPointDTO>> GetAllCheckPointAsync();
Task<CheckPointDTO> GetCheckPointAsync(int id);
Task<bool> DeleteCheckPointAsync(int id);
Task<CheckPointDTO> UpdateCheckPointAsync(CheckPointDTO checkPointDTO);
Task<List<CheckPointDTO>> UpdateAllCheckPointAsync(List<CheckPointDTO> checkPointListDTO);
Task<List<LocationDTO>> GetAllLocationAsync();
Task<LocationDTO> GetLocationAsync(int id);
Task<bool> DeleteLocationAsync(int id);
Task<LocationDTO> UpdateLocationAsync(LocationDTO LocationDTO);
Task<List<EquipmentDTO>> GetAllEquipmentAsync();
Task<EquipmentDTO> GetEquipmentAsync(int id);
Task<bool> DeleteEquipmentAsync(int id);
Task<EquipmentDTO> UpdateEquipmentAsync(EquipmentDTO EquipmentDTO);
Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync(int userId);
Task<List<CheckListHeaderDTO>> GetAllCheckListAsync(int userId);
Task<CheckListHeaderDTO> SendCheckListHeaderAsync(CheckListHeaderDTO checkListHeaderDTO);
Task<bool> DeviceMessageSend(DeviceMessageDTO deviceMessageDTO);
Task<List<DeviceMessageDTO>> DeviceMessageReadUnreaded(string deviceId);
Task<List<DeviceMessageDTO>> DeviceMessageReadUnreadedRole(int roleId);
}
}
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.BL.Services.Interfaces
{
public interface ISystemService
{
Task<string> GetDatabaseAndVersionInfoAsync();
}
}
@@ -11,18 +11,34 @@ namespace WorkFlowCheck.BL.Services.Interfaces
{
Task<UserDTO> GetUserAsync(int Id);
Task<List<UserDTO>> GetAllUserAsync();
Task<bool> DeleteUserAsync(int Id);
Task<UserDTO> UpdateUserAsync(UserDTO userDTO);
Task<UserDTO> Authenticate(string UserName, string Password);
Task<string> Authenticate2F1(string UserName, string Password);
Task<UserDTO> Authenticate2F2(string UserName, string Password, string Code, string token2FA);
Task<UserDTO> Authenticate2F2ChangePassword(string UserName, string OldPassword, string NewPassword, string Code, string token2FA);
Task<UserDTO> AuthenticateNFC(string NFCCode);
Task<RoleDTO> GetRoleAsync(int Id);
Task<List<RoleDTO>> GetAllRoleAsync();
Task<bool> DeleteRoleAsync(int Id);
Task<RoleDTO> UpdateRoleAsync(RoleDTO roleDTO);
Task<UserRoleDTO> GetUserRoleAsync(int Id);
Task<List<UserRoleDTO>> GetAllUserRoleAsync();
Task<bool> DeleteUserRoleAsync(int Id);
Task<UserRoleDTO> UpdateUserRoleAsync(UserRoleDTO userRoleDTO);
Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeaderAsync(int Id);
Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplateHeadersAsync();
Task<bool> DeleteRoleCheckListTemplateHeaderAsync(int Id);
Task<RoleCheckListTemplateHeaderDTO> UpdateRoleCheckListTemplateHeaderAsync(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO);
Task<RoleCheckPointDTO> GetRoleCheckPointAsync(int Id);
Task<List<RoleCheckPointDTO>> GetAllRoleCheckPointsAsync();
Task<bool> DeleteRoleCheckPointAsync(int Id);
Task<RoleCheckPointDTO> UpdateRoleCheckPointAsync(RoleCheckPointDTO roleCheckPointDTO);
string GenerateJwtToken(UserDTO userDTO);
}
@@ -0,0 +1,184 @@
using MailKit.Net.Smtp;
using MailKit.Security;
using MimeKit;
using Microsoft.Extensions.Configuration;
using WorkFlowCheck.BL.Models;
using WorkFlowCheck.BL.Services.Interfaces;
using Serilog;
using WorkFlowCheck.DL.Entities;
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using WorkFlowCheck.DL;
using WorkFlowCheck.Common.DTO;
using System.Net.Http.Headers;
using System.Text;
using Google.Apis.Auth.OAuth2;
using Newtonsoft.Json;
namespace WorkFlowCheck.BL.Services
{
public class MessageService : BaseService, IMessageService
{
private readonly EmailSettings _settings;
public MessageService(AppDbContext dbContext,
IMapper mapper,
IConfiguration configuration) : base(dbContext, mapper)
{
_settings = configuration.GetSection("EmailSettings").Get<EmailSettings>()!;
}
public async Task<bool> SendMailAsync(List<string> recipients, string subject, string htmlBody, string? attachmentFilePath = null)
{
var message = new MimeMessage();
message.From.Add(new MailboxAddress(_settings.SenderName, _settings.Username));
foreach (var recipient in recipients)
{
message.To.Add(MailboxAddress.Parse(recipient));
}
message.Subject = subject;
var builder = new BodyBuilder
{
HtmlBody = htmlBody
};
if (!string.IsNullOrEmpty(attachmentFilePath) && File.Exists(attachmentFilePath))
{
builder.Attachments.Add(attachmentFilePath);
}
message.Body = builder.ToMessageBody();
using var smtp = new SmtpClient();
await smtp.ConnectAsync(_settings.SmtpServer, _settings.SmtpPort, SecureSocketOptions.StartTls);
await smtp.AuthenticateAsync(_settings.Username, _settings.Password);
await smtp.SendAsync(message);
await smtp.DisconnectAsync(true);
return true;
}
public async Task<bool> SendFCMTokenAsync(string token)
{
var retVal = true;
try
{
if (!string.IsNullOrEmpty(token))
{
var FCMToken = await _dbContext.FCMTokens.Where(w => w.Token == token).FirstOrDefaultAsync();
if (FCMToken == null)
{
FCMToken = new FCMToken();
FCMToken.Token = token;
await _dbContext.FCMTokens.AddAsync(FCMToken);
}
else
{
FCMToken.LastModAt = DateTime.UtcNow;
}
await _dbContext.SaveChangesAsync();
}
}
catch (Exception ex)
{
retVal = false;
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
}
return retVal;
}
public async Task<string> GetLastFCMTokensAsync()
{
var retVal = "";
try
{
var FCMToken = await _dbContext.FCMTokens
.AsNoTracking()
.OrderByDescending(x => x.LastModAt)
.Take(1)
.FirstOrDefaultAsync();
if (FCMToken != null && !string.IsNullOrEmpty(FCMToken.Token))
{
retVal += FCMToken.Token;
}
}
catch (Exception ex)
{
retVal = "";
Log.ForContext("TAG", "BusinessFlow").Error(ex.Message);
}
return retVal;
}
public async Task<bool> SendFCMMessage(FCMMessageDTO fCMMessageDTO)
{
var retVal = true;
try
{
var pathToJsonKey = "com-nuvolar-wfcapp-firebase-adminsdk-fbsvc-37642626e4.json";
var projectId = "com-nuvolar-wfcapp";
var credential = GoogleCredential
.FromFile(pathToJsonKey)
.CreateScoped("https://www.googleapis.com/auth/firebase.messaging");
var accessToken = await credential.UnderlyingCredential.GetAccessTokenForRequestAsync();
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
var message = new
{
message = new
{
token = fCMMessageDTO.Token,
notification = new
{
title = fCMMessageDTO.Title,
body = fCMMessageDTO.Body,
},
android = new
{
notification = new
{
channel_id = "com.nuvolar.wfcapp.general"
}
}
}
};
var json = JsonConvert.SerializeObject(message);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync($"https://fcm.googleapis.com/v1/projects/{projectId}/messages:send", content);
var result = await response.Content.ReadAsStringAsync();
}
catch (Exception ex)
{
retVal = false;
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> SendFCMMessageToLastToken(FCMMessageDTO fCMMessageDTO)
{
var retVal = true;
try
{
fCMMessageDTO.Token = await GetLastFCMTokensAsync();
retVal = await SendFCMMessage(fCMMessageDTO);
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -1,11 +1,13 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.DL;
using WorkFlowCheck.DL.Entities;
@@ -13,7 +15,7 @@ namespace WorkFlowCheck.BL.Services
{
public class NumberGeneratorService : INumberGeneratorService
{
private readonly DbContext _dbContext;
private readonly AppDbContext _dbContext;
private static readonly Dictionary<int, SemaphoreSlim> _templateLocks = new();
public NumberGeneratorService(AppDbContext dbContext)
@@ -71,7 +73,6 @@ namespace WorkFlowCheck.BL.Services
semaphore.Release();
}
}
public async Task<string> GetSampleAsync(int templateId, DateTime? baseDate = null)
{
var template = await _dbContext.Set<NumberGeneratorTemplate>()
@@ -87,6 +88,28 @@ namespace WorkFlowCheck.BL.Services
return BuildFormattedNumber(template, formatted, dynamicSuffix);
}
public async Task<List<NumberGeneratorTemplateDTO>> GetAllNumbergeneratorsAsync()
{
var retVal = new List<NumberGeneratorTemplateDTO>();
try
{
var numbergenerators = await _dbContext.NumberGeneratorTemplates.ToListAsync();
foreach (var numbergenerator in numbergenerators)
{
var numbergeneratortemplateDTO = new NumberGeneratorTemplateDTO();
numbergeneratortemplateDTO.Id = numbergenerator.Id;
numbergeneratortemplateDTO.ShortName = numbergenerator.ShortName;
numbergeneratortemplateDTO.Sample = await this.GetSampleAsync(numbergenerator.Id, DateTime.Now);
retVal.Add(numbergeneratortemplateDTO);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
private SemaphoreSlim GetOrCreateSemaphore(int templateId)
{
@@ -98,14 +121,12 @@ namespace WorkFlowCheck.BL.Services
return _templateLocks[templateId];
}
}
private static (int year, int? month) GetKeyDateParts(NumberGeneratorTemplate template, DateTime date)
{
int year = date.Year;
int? month = template.GenerateType == GenerateType.YearAndMonth ? date.Month : null;
return (year, month);
}
private static string BuildDynamicSuffix(NumberGeneratorTemplate template, DateTime date)
{
return template.GenerateType switch
@@ -115,7 +136,6 @@ namespace WorkFlowCheck.BL.Services
_ => template.Suffix
};
}
private static string BuildFormattedNumber(NumberGeneratorTemplate template, string formattedNumber, string dynamicSuffix)
{
var sb = new StringBuilder();
+269 -13
View File
@@ -1,24 +1,35 @@
using AutoMapper;
using DocumentFormat.OpenXml.InkML;
using DocumentFormat.OpenXml.Office2010.Excel;
using DocumentFormat.OpenXml.Spreadsheet;
using Microsoft.EntityFrameworkCore;
using Serilog;
using System.Collections.Generic;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Common.Enums;
using WorkFlowCheck.Common.RequestContext;
using WorkFlowCheck.DL;
using WorkFlowCheck.DL.Entities;
namespace WorkFlowCheck.BL.Services
{
public class SyncService : ISyncService
public class SyncService : BaseService, ISyncService
{
private AppDbContext _dbContext;
private IMapper _mapper;
private readonly IRequestContext _requestContext;
private readonly IUserService _userService;
private readonly IMessageService _messageService;
public SyncService(AppDbContext dbContext, IMapper mapper)
public SyncService(AppDbContext dbContext,
IMapper mapper,
IRequestContext requestContext,
IMessageService messageService,
IUserService userService) : base(dbContext, mapper)
{
_dbContext = dbContext;
_mapper = mapper;
_requestContext = requestContext;
_userService = userService;
_messageService = messageService;
}
public async Task<List<CheckPointDTO>> GetAllCheckPointAsync()
@@ -49,14 +60,17 @@ namespace WorkFlowCheck.BL.Services
try
{
var res = await _dbContext.CheckPoints
var checkpoint = await _dbContext.CheckPoints
.Include(i => i.CheckListTemplateRows)
.Where(w => w.Id == id)
.AsNoTracking()
.FirstOrDefaultAsync();
if (res != null)
if (checkpoint != null)
{
retVal = _mapper.Map<CheckPointDTO>(res);
retVal = _mapper.Map<CheckPointDTO>(checkpoint);
var role = await _dbContext.Roles.Where(w => w.Id == retVal.RoleId).FirstOrDefaultAsync();
}
}
catch (Exception ex)
@@ -66,6 +80,10 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<bool> DeleteCheckPointAsync(int id)
{
return await DeleteEntityByIdAsync<CheckPoint>(id);
}
public async Task<CheckPointDTO> UpdateCheckPointAsync(CheckPointDTO checkPointDTO)
{
var retVal = new CheckPointDTO();
@@ -87,6 +105,7 @@ namespace WorkFlowCheck.BL.Services
{
res.ShortName = checkPointDTO.ShortName;
res.Code = checkPointDTO.Code;
res.IsEnabled = checkPointDTO.IsEnabled;
await _dbContext.SaveChangesAsync();
@@ -170,6 +189,10 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<bool> DeleteLocationAsync(int id)
{
return await DeleteEntityByIdAsync<DL.Entities.Location>(id);
}
public async Task<LocationDTO> UpdateLocationAsync(LocationDTO LocationDTO)
{
var retVal = new LocationDTO();
@@ -178,7 +201,7 @@ namespace WorkFlowCheck.BL.Services
{
if (LocationDTO.Id == 0) //Hozzáadás, ha Id == 0
{
var Location = _mapper.Map<Location>(LocationDTO);
var Location = _mapper.Map<DL.Entities.Location>(LocationDTO);
_dbContext.Locations.Add(Location);
await _dbContext.SaveChangesAsync();
@@ -189,8 +212,7 @@ namespace WorkFlowCheck.BL.Services
var res = await _dbContext.Locations.Where(w => w.Id == LocationDTO.Id).FirstOrDefaultAsync();
if (res != null)
{
res = _mapper.Map<Location>(LocationDTO);
res.FullName = LocationDTO.FullName;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<LocationDTO>(res);
@@ -246,6 +268,10 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<bool> DeleteEquipmentAsync(int id)
{
return await DeleteEntityByIdAsync<Equipment>(id);
}
public async Task<EquipmentDTO> UpdateEquipmentAsync(EquipmentDTO EquipmentDTO)
{
var retVal = new EquipmentDTO();
@@ -281,6 +307,7 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<List<CheckListTemplateHeaderDTO>> GetAllCheckListTemplateAsync(int userId)
{
var retVal = new List<CheckListTemplateHeaderDTO>();
@@ -321,8 +348,12 @@ namespace WorkFlowCheck.BL.Services
try
{
var res = await _dbContext.CheckListHeaders
.Where(w => w.IsEditable && w.UserId == userId)
.Where(w => w.CheckStatus == CheckStatus.Open ||
w.CheckStatus == CheckStatus.InProgress ||
w.CheckStatus == CheckStatus.Blocked ||
w.CheckStatus == CheckStatus.Sent)
.Include(i => i.CheckListRows)
//.ThenInclude(i => i.CheckListTemplateRow)
.AsNoTracking()
.ToListAsync();
@@ -339,5 +370,230 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<CheckListHeaderDTO> SendCheckListHeaderAsync(CheckListHeaderDTO checkListHeaderDTO)
{
var retVal = new CheckListHeaderDTO();
try
{
if (checkListHeaderDTO.Id > 0)
{
var res = await _dbContext.CheckListHeaders
.Include(i => i.CheckListRows)
.Where(w => w.Id == checkListHeaderDTO.Id)
.FirstOrDefaultAsync();
if (res != null && (res.CheckStatus == CheckStatus.Open ||
res.CheckStatus == CheckStatus.InProgress))
{
var ids = checkListHeaderDTO.CheckListRowDTO?.Select(r => r.Id).ToList();
if (ids != null && ids.Count > 0)
{
var rowsToUpdate = await _dbContext.CheckListRows
.Where(r => ids.Contains(r.Id))
.ToListAsync();
foreach (var row in rowsToUpdate)
{
var dtoRow = checkListHeaderDTO.CheckListRowDTO?.FirstOrDefault(r => r.Id == row.Id);
if (dtoRow != null)
{
row.Answer = dtoRow.Answer;
if (dtoRow.Photo != null && dtoRow.Photo.Length > 0)
{
string imageDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Images");
var timestamp = DateTime.Now.ToString("yyyyMMdd_HHmmss");
var fileName = $"PH_{timestamp}_{row.CheckListHeaderId}_{row.Id}.jpeg";
row.PhotoFileName = fileName;
var filePath = Path.Combine(imageDirectory, fileName);
await File.WriteAllBytesAsync(filePath, dtoRow.Photo);
row.Answer = fileName;
}
}
}
}
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<CheckListHeaderDTO>(res);
string Answer = "";
if (NeedBlocking(checkListHeaderDTO, out Answer))
{
/// TODO: blokkolás miatt
res.CheckStatus = CheckStatus.Blocked;
await _dbContext.SaveChangesAsync();
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap blokkolva: Ellenőrzés:{checkListHeaderDTO.Id}, Felhasználó:{_requestContext.CurrentUsername}");
var user = await _userService.GetUserAsync(_requestContext.CurrentUserId ?? 1);
foreach (var item in user.RoleDTO)
{
var deviceMessageDTO = new DeviceMessageDTO()
{
IsReaded = false,
Message = $"Ellenőrző lap blokkolva! [{checkListHeaderDTO.DocumentNumber}]\n({Answer})",
SendDate = DateTime.UtcNow,
ExtraDataJSON = "",
RoleId = item.ParentId,
DeviceIdFrom = "",
DeviceIdTo = "",
};
await this.DeviceMessageSend(deviceMessageDTO);
var fCMMessageDTO = new FCMMessageDTO
{
Body = deviceMessageDTO.Message,
Title = "Blokkolási értesítés",
UserId = user.Id,
};
await _messageService.SendFCMMessageToLastToken(fCMMessageDTO);
}
return retVal;
}
res.CheckStatus = CheckStatus.InProgress;
if (CheckIfLastReached(checkListHeaderDTO))
{
/// TODO: most kell a CheckStatust állítani és menjen üzenet !
res.CheckStatus = CheckStatus.Sent;
Log.ForContext("TAG", "BusinessFlow").Warning($"Ellenőrzési lap státuszváltozása: Ellenőrzés:{checkListHeaderDTO.Id}, Felhasználó:{_requestContext.CurrentUsername}");
}
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<CheckListHeaderDTO>(res);
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
private bool NeedBlocking(CheckListHeaderDTO checkListHeaderDTO, out string Answer)
{
var retVal = false;
Answer = "";
if (checkListHeaderDTO.CheckListRowDTO != null && checkListHeaderDTO.CheckListRowDTO.Count > 0)
{
var checkListRows = checkListHeaderDTO.CheckListRowDTO;
foreach (var row in checkListRows)
{
if (!string.IsNullOrEmpty(row.Answer))
{
if (row.CheckListTemplateRowDTO != null)
{
Answer = row.CheckListTemplateRowDTO.OperationDescription;
if (row.CheckListTemplateRowDTO.AnswerType == "PI-N" && row.Answer == "Igen")
{
retVal = true;
break;
}
if (row.CheckListTemplateRowDTO.AnswerType == "I-PN" && row.Answer == "Nem")
{
retVal = true;
break;
}
}
}
}
}
return retVal;
}
private bool CheckIfLastReached(CheckListHeaderDTO checkListHeaderDTO)
{
var retVal = false;
if (checkListHeaderDTO != null && checkListHeaderDTO.CheckListRowDTO != null && checkListHeaderDTO.CheckListRowDTO.Count > 0)
{
var totalRowCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true).Count();
var answeredCount = checkListHeaderDTO.CheckListRowDTO.Where(w => w.CheckListTemplateRowDTO.AnswerType != "PN" &&
w.CheckListTemplateRowDTO.CheckPointDTO.IsEnabled == true &&
string.IsNullOrEmpty(w.Answer) != true).Count();
if (totalRowCount == answeredCount) { retVal = true; }
}
return retVal;
}
public async Task<bool> DeviceMessageSend(DeviceMessageDTO deviceMessageDTO)
{
var retVal = false;
try
{
var deviceMessage = _mapper.Map<DeviceMessage>(deviceMessageDTO);
deviceMessage.SendDate = DateTime.UtcNow;
deviceMessage.IsReaded = false;
_dbContext.DeviceMessages.Add(deviceMessage);
await _dbContext.SaveChangesAsync(true);
retVal = true;
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<DeviceMessageDTO>> DeviceMessageReadUnreaded(string deviceId)
{
var retVal = new List<DeviceMessageDTO>();
try
{
var res = await _dbContext.DeviceMessages
.Where(w => w.DeviceIdTo == deviceId && w.IsReaded != true)
.ToListAsync();
if (res != null)
{
retVal = _mapper.Map<List<DeviceMessageDTO>>(res);
foreach (var deviceMessage in res)
{
deviceMessage.IsReaded = true;
deviceMessage.ReceiveDate = DateTime.UtcNow;
}
await _dbContext.SaveChangesAsync();
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<DeviceMessageDTO>> DeviceMessageReadUnreadedRole(int roleId)
{
var retVal = new List<DeviceMessageDTO>();
try
{
var res = await _dbContext.DeviceMessages
.Where(w => w.RoleId == roleId && w.IsReaded != true)
.ToListAsync();
if (res != null)
{
retVal = _mapper.Map<List<DeviceMessageDTO>>(res);
foreach (var deviceMessage in res)
{
deviceMessage.IsReaded = true;
deviceMessage.ReceiveDate = DateTime.UtcNow;
}
await _dbContext.SaveChangesAsync();
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -0,0 +1,49 @@
using AutoMapper;
using DocumentFormat.OpenXml.InkML;
using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.DL;
namespace WorkFlowCheck.BL.Services
{
public class SystemService : ISystemService
{
public readonly AppDbContext _dbContext;
public readonly IMapper _mapper;
public readonly IConfiguration _config;
public SystemService(AppDbContext dbContext,
IMapper mapper,
IConfiguration configuration)
{
_config = configuration;
_dbContext = dbContext;
_mapper = mapper;
}
public async Task<string> GetDatabaseAndVersionInfoAsync()
{
var retVal = "";
var connection = _dbContext.Database.GetDbConnection();
var typeName = connection.GetType().Name;
//if (typeName.Contains("Npgsql"))
//{
// var builder = new NpgsqlConnectionStringBuilder(connection.ConnectionString);
// retVal= builder.Database;
//}
if (typeName.Contains("SqlConnection"))
{
var builder = new SqlConnectionStringBuilder(connection.ConnectionString);
retVal= builder.InitialCatalog;
}
return retVal;
}
}
}
+458 -9
View File
@@ -16,20 +16,24 @@ using System.Security.Claims;
using WorkFlowCheck.DL.Entities;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Identity;
using WorkFlowCheck.BL.Static;
using System.Reflection;
namespace WorkFlowCheck.BL.Services
{
public class UserService : IUserService
public class UserService : BaseService, IUserService
{
private AppDbContext _dbContext;
private IMapper _mapper;
private IConfiguration _configuration;
private IMessageService _messageService;
public UserService(AppDbContext dbContext, IMapper mapper, IConfiguration configuration)
public UserService(AppDbContext dbContext,
IMapper mapper,
IConfiguration configuration,
IMessageService messageService) : base(dbContext, mapper)
{
_dbContext = dbContext;
_mapper = mapper;
_configuration = configuration;
_messageService = messageService;
}
public async Task<UserDTO> GetUserAsync(int Id)
@@ -64,7 +68,10 @@ namespace WorkFlowCheck.BL.Services
};
try
{
var users = await _dbContext.Users.ToListAsync();
var users = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
.ToListAsync();
if (users != null)
{
retVal = _mapper.Map<List<UserDTO>>(users);
@@ -76,12 +83,61 @@ namespace WorkFlowCheck.BL.Services
}
return retVal;
}
public async Task<bool> DeleteUserAsync(int id)
{
return await DeleteEntityByIdAsync<User>(id);
}
public async Task<UserDTO> Authenticate(string userName, string password)
{
var retVal = new UserDTO() { RoleDTO = new List<RoleDTO>() };
try
{
Log.ForContext("TAG", "AuditFlow").Information($"Bejelentkezési kísérlet: {userName}");
var user = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
.Where(w => w.UserName == userName && w.Active != false)
.FirstOrDefaultAsync();
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
{
var userDTO = new UserDTO()
{
Id = user.Id,
UserName = user.UserName,
RoleDTO = new List<RoleDTO>(),
};
foreach (var item in user.UserRoles)
{
userDTO.RoleDTO.Add(new RoleDTO()
{
Id = item.Role.Id,
RoleName = item.Role.RoleName,
});
}
user.JwtToken = GenerateJwtToken(userDTO);
await _dbContext.SaveChangesAsync();
Log.ForContext("TAG", "AuditFlow").Information($"Sikeres bejelentkezés: {userName}");
retVal = _mapper.Map<UserDTO>(user);
}
else
{
Log.ForContext("TAG", "AuditFlow").Error($"Sikertelen bejelenkezési kísérlet: {userName}");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<string> Authenticate2F1(string userName, string password)
{
var retVal = "";
try
{
Log.ForContext("TAG", "AuditFlow").Information($"Bejelentkezési kísérlet: {userName}");
var user = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
@@ -89,7 +145,59 @@ namespace WorkFlowCheck.BL.Services
.FirstOrDefaultAsync();
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
{
var canUseWebAdmin = false;
foreach (var userRole in user.UserRoles)
{
if (userRole.Role.CanUseWebAdmin)
{
canUseWebAdmin = true;
break;
}
}
if (!string.IsNullOrEmpty(user.Email) && canUseWebAdmin)
{
var code = CodeGenerator2F.GenerateSixDigitCode();
await _messageService.SendMailAsync(new List<string>()
{
user.Email,
}, "Bejelentkezés megerősítése",
Get2FConfirmationMessageBody(code));
Log.ForContext("TAG", "AuditFlow").Information($"Bejelentkezési kísérlet, email küldés: {user.Email}");
retVal = CodeGenerator2F.GenerateToken2F(userName, password, code);
return retVal;
}
else
{
Log.ForContext("TAG", "AuditFlow").Information($"A WEB felület NEM használható!: {userName}");
}
}
else
{
Log.ForContext("TAG", "AuditFlow").Error($"Sikertelen bejelentkezési kísérlet: {userName}");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<UserDTO> Authenticate2F2(string userName, string password, string code, string token2FA)
{
var retVal = new UserDTO() { RoleDTO = new List<RoleDTO>() };
try
{
var user = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
.Where(w => w.UserName == userName && w.Active != false)
.FirstOrDefaultAsync();
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
{
if (CodeGenerator2F.ValidateToken2F(token2FA, userName, password, code))
{
var userDTO = new UserDTO()
{
Id = user.Id,
@@ -108,6 +216,111 @@ namespace WorkFlowCheck.BL.Services
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<UserDTO>(user);
Log.ForContext("TAG", "AuditFlow").Information($"Sikeres 2FA azonosítás!: {userName}");
return retVal;
}
}
else
{
Log.ForContext("TAG", "AuditFlow").Error($"Sikertelen 2FA bejelentkezési kísérlet: {userName}");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<UserDTO> Authenticate2F2ChangePassword(string userName, string oldPassword, string newPassword, string code, string token2FA)
{
var retVal = new UserDTO() { RoleDTO = new List<RoleDTO>() };
try
{
var user = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
.Where(w => w.UserName == userName && w.Active != false)
.FirstOrDefaultAsync();
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, oldPassword))
{
if (CodeGenerator2F.ValidateToken2F(token2FA, userName, oldPassword, code))
{
user.PasswordHash = PasswordHasher.HashPassword(newPassword);
var userDTO = new UserDTO()
{
Id = user.Id,
UserName = user.UserName,
RoleDTO = new List<RoleDTO>(),
};
foreach (var item in user.UserRoles)
{
userDTO.RoleDTO.Add(new RoleDTO()
{
Id = item.Role.Id,
RoleName = item.Role.RoleName,
});
}
user.PasswordHash = PasswordHasher.HashPassword(newPassword);
user.JwtToken = GenerateJwtToken(userDTO);
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<UserDTO>(user);
Log.ForContext("TAG", "AuditFlow").Information($"Sikeres jelszó módosítás: {userName}");
return retVal;
}
}
else
{
Log.ForContext("TAG", "AuditFlow").Error($"Sikertelen jelszó módosítási kísérlet: {userName}");
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<UserDTO> AuthenticateNFC(string NFCCode)
{
var retVal = new UserDTO() { RoleDTO = new List<RoleDTO>() };
try
{
var user = await _dbContext.Users
.Include(i => i.UserRoles)
.ThenInclude(i => i.Role)
.Where(w => w.NFCCode == NFCCode && w.NFCActive == true)
.FirstOrDefaultAsync();
if (user != null)
{
var userDTO = new UserDTO()
{
Id = user.Id,
UserName = user.UserName,
RoleDTO = new List<RoleDTO>(),
};
foreach (var item in user.UserRoles)
{
userDTO.RoleDTO.Add(new RoleDTO()
{
Id = item.Role.Id,
RoleName = item.Role.RoleName,
});
}
user.JwtToken = GenerateJwtToken(userDTO);
await _dbContext.SaveChangesAsync();
Log.ForContext("TAG", "AuditFlow").Information($"Sikeres NFC kártya azonosítás kísérlet: {user.UserName}");
retVal = _mapper.Map<UserDTO>(user);
}
else
{
Log.ForContext("TAG", "AuditFlow").Error($"Sikertelen NFC kártya azonosítás: {NFCCode}");
}
}
catch (Exception ex)
@@ -158,7 +371,13 @@ namespace WorkFlowCheck.BL.Services
user.FirstName = userDTO.FirstName;
user.LastName = userDTO.LastName;
user.Email = userDTO.Email;
user.NFCActive = userDTO.NFCActive;
user.NFCCode = userDTO.NFCCode;
user.JwtToken = "";
user.Token2FA = "";
user.IsDeleted = false;
user.Active = userDTO.Active;
user.PasswordHash = PasswordHasher.HashPassword(userDTO.Password);
@@ -178,6 +397,10 @@ namespace WorkFlowCheck.BL.Services
user.FirstName = userDTO.FirstName;
user.LastName = userDTO.LastName;
user.Email = userDTO.Email;
user.Active = userDTO.Active;
user.NFCActive = userDTO.NFCActive;
user.NFCCode = userDTO.NFCCode;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<UserDTO>(user);
@@ -192,6 +415,20 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
private string Get2FConfirmationMessageBody(string token2F)
{
var assembly = Assembly.GetExecutingAssembly();
var resourceName = "WorkFlowCheck.BL.HtmlTemplates.Token2FBody.html";
using var stream = assembly.GetManifestResourceStream(resourceName);
if (stream == null)
throw new FileNotFoundException($"Nem található a beágyazott erőforrás: {resourceName}");
using var reader = new StreamReader(stream);
var html = reader.ReadToEnd();
return html.Replace("#token2F#", token2F);
}
public async Task<RoleDTO> GetRoleAsync(int Id)
{
var retVal = new RoleDTO();
@@ -227,6 +464,10 @@ namespace WorkFlowCheck.BL.Services
}
return retVal;
}
public async Task<bool> DeleteRoleAsync(int id)
{
return await DeleteEntityByIdAsync<Role>(id);
}
public async Task<RoleDTO> UpdateRoleAsync(RoleDTO roleDTO)
{
var retVal = new RoleDTO();
@@ -236,7 +477,15 @@ namespace WorkFlowCheck.BL.Services
{
var role = new Role();
role.RoleName = roleDTO.RoleName;
if (roleDTO.ParentId > 0)
{
role.ParentId = roleDTO.ParentId;
}
role.IsAdmin = roleDTO.IsAdmin;
role.CanDownloadAPK = roleDTO.CanDownloadAPK;
role.CanEnableBlocked = roleDTO.CanEnableBlocked;
role.CanUseWebAdmin = roleDTO.CanUseWebAdmin;
role.CanUseMobilApp = roleDTO.CanUseMobilApp;
_dbContext.Roles.Add(role);
await _dbContext.SaveChangesAsync();
@@ -248,7 +497,16 @@ namespace WorkFlowCheck.BL.Services
if (role != null)
{
role.RoleName += roleDTO.RoleName;
role.RoleName = roleDTO.RoleName;
if (roleDTO.ParentId > 0)
{
role.ParentId = roleDTO.ParentId;
}
role.IsAdmin = roleDTO.IsAdmin;
role.CanDownloadAPK = roleDTO.CanDownloadAPK;
role.CanEnableBlocked = roleDTO.CanEnableBlocked;
role.CanUseWebAdmin = roleDTO.CanUseWebAdmin;
role.CanUseMobilApp = roleDTO.CanUseMobilApp;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<RoleDTO>(role);
@@ -302,6 +560,10 @@ namespace WorkFlowCheck.BL.Services
}
return retVal;
}
public async Task<bool> DeleteUserRoleAsync(int id)
{
return await DeleteEntityByIdAsync<UserRole>(id);
}
public async Task<UserRoleDTO> UpdateUserRoleAsync(UserRoleDTO userRoleDTO)
{
var retVal = new UserRoleDTO();
@@ -340,5 +602,192 @@ namespace WorkFlowCheck.BL.Services
return retVal;
}
public async Task<RoleCheckListTemplateHeaderDTO> GetRoleCheckListTemplateHeaderAsync(int Id)
{
var retVal = new RoleCheckListTemplateHeaderDTO();
try
{
var userRole = await _dbContext.RoleCheckListTemplateHeaders.Where(w => w.Id == Id).FirstOrDefaultAsync();
if (userRole != null)
{
retVal = _mapper.Map<RoleCheckListTemplateHeaderDTO>(userRole);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<RoleCheckListTemplateHeaderDTO>> GetAllRoleCheckListTemplateHeadersAsync()
{
var retVal = new List<RoleCheckListTemplateHeaderDTO>();
try
{
var results = await _dbContext.RoleCheckListTemplateHeaders
.Include(i => i.CheckListTemplateHeader)
.Include(i => i.Role)
.AsNoTracking()
.ToListAsync();
if (results != null)
{
retVal = _mapper.Map<List<RoleCheckListTemplateHeaderDTO>>(results);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> DeleteRoleCheckListTemplateHeaderAsync(int id)
{
return await DeleteEntityByIdAsync<RoleCheckListTemplateHeader>(id);
}
public async Task<RoleCheckListTemplateHeaderDTO> UpdateRoleCheckListTemplateHeaderAsync(RoleCheckListTemplateHeaderDTO roleCheckListTemplateHeaderDTO)
{
var retVal = new RoleCheckListTemplateHeaderDTO();
try
{
if (roleCheckListTemplateHeaderDTO.Id == 0)
{
var roleCheckListTemplateHeader_Exists = await _dbContext.RoleCheckListTemplateHeaders
.Where(w => w.RoleId == roleCheckListTemplateHeaderDTO.RoleId &&
w.CheckListTemplateHeaderId == roleCheckListTemplateHeaderDTO.CheckListTemplateHeaderId)
.FirstOrDefaultAsync();
if (roleCheckListTemplateHeader_Exists == null)
{
var roleCheckListTemplateHeader = new RoleCheckListTemplateHeader();
roleCheckListTemplateHeader.CheckListTemplateHeaderId = roleCheckListTemplateHeaderDTO.CheckListTemplateHeaderId;
roleCheckListTemplateHeader.RoleId = roleCheckListTemplateHeaderDTO.RoleId;
roleCheckListTemplateHeader.Enabled = roleCheckListTemplateHeaderDTO.Enabled;
_dbContext.RoleCheckListTemplateHeaders.Add(roleCheckListTemplateHeader);
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<RoleCheckListTemplateHeaderDTO>(roleCheckListTemplateHeader);
}
else
{
retVal = _mapper.Map<RoleCheckListTemplateHeaderDTO>(roleCheckListTemplateHeader_Exists);
}
}
else
{
var roleCheckListTemplateHeader = await _dbContext.RoleCheckListTemplateHeaders.Where(w => w.Id == roleCheckListTemplateHeaderDTO.Id).FirstOrDefaultAsync();
if (roleCheckListTemplateHeader != null)
{
roleCheckListTemplateHeader.CheckListTemplateHeaderId = roleCheckListTemplateHeaderDTO.CheckListTemplateHeaderId;
roleCheckListTemplateHeader.RoleId = roleCheckListTemplateHeaderDTO.RoleId;
roleCheckListTemplateHeader.Enabled = roleCheckListTemplateHeaderDTO.Enabled;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<RoleCheckListTemplateHeaderDTO>(roleCheckListTemplateHeader);
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<RoleCheckPointDTO> GetRoleCheckPointAsync(int Id)
{
var retVal = new RoleCheckPointDTO();
try
{
var userRole = await _dbContext.RoleCheckPoints.Where(w => w.Id == Id).FirstOrDefaultAsync();
if (userRole != null)
{
retVal = _mapper.Map<RoleCheckPointDTO>(userRole);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<List<RoleCheckPointDTO>> GetAllRoleCheckPointsAsync()
{
var retVal = new List<RoleCheckPointDTO>();
try
{
var results = await _dbContext.RoleCheckPoints
.Include(i => i.CheckPoint)
.Include(i => i.Role)
.AsNoTracking()
.ToListAsync();
if (results != null)
{
retVal = _mapper.Map<List<RoleCheckPointDTO>>(results);
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
public async Task<bool> DeleteRoleCheckPointAsync(int id)
{
return await DeleteEntityByIdAsync<RoleCheckPoint>(id);
}
public async Task<RoleCheckPointDTO> UpdateRoleCheckPointAsync(RoleCheckPointDTO roleCheckPointDTO)
{
var retVal = new RoleCheckPointDTO();
try
{
if (roleCheckPointDTO.Id == 0)
{
var roleCheckPoint_Exists = await _dbContext.RoleCheckPoints
.Where(w => w.RoleId == roleCheckPointDTO.RoleId &&
w.CheckPointId == roleCheckPointDTO.CheckPointId)
.FirstOrDefaultAsync();
if (roleCheckPoint_Exists == null)
{
var roleCheckPoint = new RoleCheckPoint();
roleCheckPoint.CheckPointId = roleCheckPointDTO.CheckPointId;
roleCheckPoint.RoleId = roleCheckPointDTO.RoleId;
roleCheckPoint.Enabled = roleCheckPointDTO.Enabled;
_dbContext.RoleCheckPoints.Add(roleCheckPoint);
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint);
}
else
{
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint_Exists);
}
}
else
{
var roleCheckPoint = await _dbContext.RoleCheckPoints.Where(w => w.Id == roleCheckPointDTO.Id).FirstOrDefaultAsync();
if (roleCheckPoint != null)
{
roleCheckPoint.CheckPointId = roleCheckPointDTO.CheckPointId;
roleCheckPoint.RoleId = roleCheckPointDTO.RoleId;
roleCheckPoint.Enabled = roleCheckPointDTO.Enabled;
await _dbContext.SaveChangesAsync();
retVal = _mapper.Map<RoleCheckPointDTO>(roleCheckPoint);
}
}
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return retVal;
}
}
}
@@ -0,0 +1,72 @@
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.BL.Static
{
public static class CodeGenerator2F
{
private static readonly Random _random = new Random();
private const string SecretKey = "874512WcfApplicationNuvolar.hu!%mBX210jUUKL";
private static readonly byte[] KeyBytes = Encoding.UTF8.GetBytes(SecretKey);
public static string GenerateSixDigitCode()
{
return _random.Next(100000, 1000000).ToString(); // 100000 - 999999
}
public static string GenerateToken2F(string value1, string value2, string value3)
{
var tokenHandler = new JwtSecurityTokenHandler();
var claims = new[]
{
new Claim("val1", value1),
new Claim("val2", value2),
new Claim("val3", value3)
};
var descriptor = new SecurityTokenDescriptor
{
Subject = new ClaimsIdentity(claims),
Expires = DateTime.UtcNow.AddSeconds(60 * 60 * 2),
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(KeyBytes), SecurityAlgorithms.HmacSha256Signature)
};
var token = tokenHandler.CreateToken(descriptor);
return tokenHandler.WriteToken(token);
}
public static bool ValidateToken2F(string token, string expected1, string expected2, string expected3)
{
var tokenHandler = new JwtSecurityTokenHandler();
try
{
var parameters = new TokenValidationParameters
{
ValidateIssuer = false,
ValidateAudience = false,
ValidateIssuerSigningKey = true,
IssuerSigningKey = new SymmetricSecurityKey(KeyBytes),
ClockSkew = TimeSpan.Zero // nincs türelmi idő
};
var principal = tokenHandler.ValidateToken(token, parameters, out var validatedToken);
var val1 = principal.FindFirst("val1")?.Value;
var val2 = principal.FindFirst("val2")?.Value;
var val3 = principal.FindFirst("val3")?.Value;
return val1 == expected1 && val2 == expected2 && val3 == expected3;
}
catch
{
return false;
}
}
}
}
@@ -6,9 +6,25 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Remove="HtmlTemplates\Token2FBody.html" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="HtmlTemplates\AcceptCheckListHeaderBody.html" />
<EmbeddedResource Include="HtmlTemplates\Token2FBody.html" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="DocumentFormat.OpenXml" Version="3.3.0" />
<PackageReference Include="Google.Apis.Auth" Version="1.69.0" />
<PackageReference Include="MailKit" Version="4.11.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
</ItemGroup>
<ItemGroup>
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class CheckListHeaderCloseDTO
{
public int Id { get; set; }
public string CloseReason { get; set; } = null!;
public int UserId { get; set; }
}
}
@@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.Enums;
using WorkFlowCheck.Common.Helper;
namespace WorkFlowCheck.Common.DTO
{
@@ -10,17 +13,43 @@ namespace WorkFlowCheck.Common.DTO
{
public int Id { get; set; }
public int CheckListTemplateHeaderId { get; set; }
public CheckListTemplateHeaderDTO CheckListTemplateHeaderDTO { get; set; }
public CheckListTemplateHeaderDTO? CheckListTemplateHeaderDTO { get; set; }
[DisplayName("Státusz")]
public CheckStatus CheckStatus { get; set; }
public string StatusName => DisplayNameHelper.GetEnumDisplayName(CheckStatus);
[DisplayName("Dátum")]
public DateTime DateExecution { get; set; }
[DisplayName("Ellenőrző")]
public int UserId { get; set; }
public UserDTO UserDTO { get; set; }
public UserDTO? UserDTO { get; set; }
[DisplayName("Jóváhagyó")]
public int? AcceptUserId { get; set; }
public UserDTO? AcceptUserDTO { get; set; }
[DisplayName("Megnevezés")]
public string ShortName { get; set; } = null!;
[DisplayName("Leírás")]
public string Description { get; set; } = null!;
[DisplayName("Sorszám")]
public string DocumentNumber { get; set; } = null!;
[DisplayName("Azonosító")]
public Guid GuidNumber { get; set; }
[DisplayName("Stornózva")]
public bool IsStorno { get; set; }
[DisplayName("Szerkeszthető")]
public bool IsEditable { get; set; }
public required ICollection<CheckListRowDTO> CheckListRowDTO { get; set; } = new List<CheckListRowDTO>();
public ICollection<CheckListRowDTO>? CheckListRowDTO { get; set; } = new List<CheckListRowDTO>();
public CheckListHeaderDTO()
{
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class CheckListHeaderInfoDTO
{
public int Id { get; set; }
[DisplayName("Összes ellenőrzési szám")]
public int TotalRowCount { get; set; }
[DisplayName("Még ellenőrizendő száma")]
public int EmptyAnswerCount { get; set; }
[DisplayName("Készültség %")]
public string ReadyPercent { get; set; }
[DisplayName("Ellenőrzési pontok száma")]
public int CheckPointCount { get; set; }
}
}
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -11,12 +13,17 @@ namespace WorkFlowCheck.Common.DTO
public int Id { get; set; }
public int CheckListHeaderId { get; set; }
public int CheckListTemplateRowId { get; set; }
public CheckListTemplateRowDTO CheckListTemplateRowDTO { get; set; }
public string GroupName => $"AnswerGroup_{CheckListTemplateRowDTO.RowIndex}";
public CheckListTemplateRowDTO? CheckListTemplateRowDTO { get; set; }
public string GroupName => $"AnswerGroup_{CheckListTemplateRowDTO?.Id ?? 0}";
[DisplayName("Eredmény")]
public string Answer { get; set; } = null!;
public bool? AnswerYes { get; set; } = null!;
public bool? AnswerNo { get; set; } = null!;
public byte[] Photo { get; set; } = null!;
[DisplayName("Kép")]
public byte[]? Photo { get; set; } = null!;
public Guid GuidNumber { get; set; }
}
}
@@ -1,13 +1,22 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlowCheck.Common.DTO
{
public class CheckListTemplateHeaderDTO
{
public int Id { get; set; }
[DisplayName("Megnevezés")]
public string ShortName { get; set; } = null!;
[DisplayName("Leírás")]
public string Description { get; set; } = null!;
[DisplayName("Sorszám (munkalap)")]
public int? NumberGenerator1Id { get; set; }
[DisplayName("Sorszám (dokumentum)")]
public int? NumberGenerator2Id { get; set; }
public required ICollection<CheckListTemplateRowDTO> CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
public NumberGeneratorTemplateDTO? NumberGenerator1 { get; set; }
public NumberGeneratorTemplateDTO? NumberGenerator2 { get; set; }
public ICollection<CheckListTemplateRowDTO>? CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
}
}
@@ -1,25 +1,33 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace WorkFlowCheck.Common.DTO
{
public class CheckListTemplateRowDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A sorrend megadása kötelező.")]
[DisplayName("Sorrend")]
public int RowIndex { get; set; }
public int CheckListTemplateHeaderId { get; set; }
[DisplayName("Berendezés")]
public int EquipmentId { get; set; }
public EquipmentDTO? EquipmentDTO { get; set; } = null!;
public int CheckPointId { get; set; }
public CheckPointDTO? CheckPointDTO { get; set; } = null!;
[DisplayName("Tevékenység leírása")]
public string OperationDescription { get; set; } = null!;
/// <summary>
///
/// I-N (Igen, nem)
/// P (Fénykép készítése)
/// PN (Fénykép nem kötelező készítése)
/// SI-N (Sárga igen,fehér nem)
/// I-SN (Fehér igen, sárga nem)
/// PI-N (Piros igen,fehér nem)
@@ -27,6 +35,7 @@ namespace WorkFlowCheck.Common.DTO
/// V (Érték megadása)
///
/// </summary>
[DisplayName("Válasz tipus")]
public string AnswerType { get; set; } = null!;
+21 -1
View File
@@ -1,11 +1,31 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace WorkFlowCheck.Common.DTO
{
public class CheckPointDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A megnevezés megadása kötelező.")]
[DisplayName("Megnevezés")]
public string ShortName { get; set; }
[Required(ErrorMessage = "A kód megadása kötelező.")]
[DisplayName("Kód")]
public string Code { get; set; }
public List<CheckListTemplateRowDTO> CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
[DisplayName("Használatban")]
public bool IsEnabled { get; set; }
[DisplayName("Szabály")]
public int? RoleId { get; set; }
[DisplayName("Szabály neve")]
public string? RoleName { get; set; }
public List<CheckListTemplateRowDTO>? CheckListTemplateRowDTO { get; set; } = new List<CheckListTemplateRowDTO>();
}
}
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class DeviceMessageDTO
{
public int Id { get; set; }
public DateTime? SendDate { get; set; }
public DateTime? ReceiveDate { get; set; }
public string DeviceIdFrom { get; set; } = null!;
public string DeviceIdTo { get; set; } = null!;
public string Message { get; set; } = null!;
public string ExtraDataJSON { get; set; } = null!;
public bool IsReaded { get; set; }
public int? RoleId { get; set; }
public RoleDTO? RoleDTO { get; set; }
}
}
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -9,7 +11,13 @@ namespace WorkFlowCheck.Common.DTO
public class EquipmentDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A megnevezést megadása kötelező.")]
[DisplayName("Megnevezés")]
public string ShortName { get; set; } = null!;
[Required(ErrorMessage = "Az azonosító megadása kötelező.")]
[DisplayName("Azonosító")]
public string EquipmentNumber { get; set; } = null!;
}
}
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class FCMMessageDTO
{
public string? Token { get; set; }
public string? Body { get; set; }
public string? Title { get; set; }
public int? UserId { get; set; }
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class ImageFileDTO
{
public string Id { get; set; }
public string FileName { get; set; }
public string FileSize { get; set; }
public string CreateDate { get; set; }
}
}
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -9,6 +11,9 @@ namespace WorkFlowCheck.Common.DTO
public class LocationDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A megnevezést megadása kötelező.")]
[DisplayName("Megnevezés")]
public string FullName { get; set; } = null!;
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class LogFileDTO
{
public string Id { get; set; }
public string FileName { get; set; }
public string FileSize { get; set; }
public string CreateDate { get; set; }
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class MobileUserDTO
{
public int Id { get; set; }
public string? UserName { get; set; }
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? FullName => $"{LastName} {FirstName}";
public string? Email { get; set; }
public bool NFCActive { get; set; }
public string NFCCode { get; set; } = null!;
}
}
@@ -8,5 +8,8 @@ namespace WorkFlowCheck.Common.DTO
{
public class NumberGeneratorTemplateDTO
{
public int Id { get; set; }
public string ShortName { get; set; }
public string Sample { get; set; }
}
}
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class PDFFileDTO
{
public string Id { get; set; }
public string FileName { get; set; }
public string FileSize { get; set; }
public string CreateDate { get; set; }
}
}
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class RoleCheckListTemplateHeaderDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A szabály megnevezésének megadása kötelező.")]
[DisplayName("Szabály")]
public int RoleId { get; set; }
public RoleDTO? RoleDTO { get; set; } = null!;
[Required(ErrorMessage = "Az ellenőrzési sablon megadása kötelező.")]
[DisplayName("Ellenőrzési sablon")]
public int CheckListTemplateHeaderId { get; set; }
public CheckListTemplateHeaderDTO? CheckListTemplateHeaderDTO { get; set; } = null!;
[DisplayName("Engedélyezve?")]
public bool Enabled { get; set; } = false;
}
}
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class RoleCheckPointDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A szabály megadása kötelező.")]
[DisplayName("Szabály")]
public int RoleId { get; set; }
public RoleDTO? RoleDTO { get; set; } = null!;
[Required(ErrorMessage = "Az ellenőrzési pont megadása kötelező.")]
[DisplayName("Ellenőrzési pont")]
public int CheckPointId { get; set; }
public CheckPointDTO? CheckPointDTO { get; set; } = null!;
[DisplayName("Engedélyezve?")]
public bool Enabled { get; set; } = false;
}
}
+28 -1
View File
@@ -1,8 +1,35 @@
namespace WorkFlowCheck.Common.DTO
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace WorkFlowCheck.Common.DTO
{
public class RoleDTO
{
public int Id { get; set; }
[Required(ErrorMessage = "A szabály megnevezésének megadása kötelező.")]
[DisplayName("Megnevezés")]
public string RoleName { get; set; } = null!;
public int? ParentId { get; set; }
[DisplayName("Szülő szerepkör neve")]
public string? ParentRoleName { get; set; }
[DisplayName("Adminisztrátor?")]
public bool IsAdmin { get; set; }
[DisplayName("Új program letöltés?")]
public bool CanDownloadAPK { get; set; }
[DisplayName("Folyamat blokk/engedélyez?")]
public bool CanEnableBlocked { get; set; }
[DisplayName("WEB felület?")]
public bool CanUseWebAdmin { get; set; }
[DisplayName("Mobil App?")]
public bool CanUseMobilApp { get; set; }
}
}
+3 -1
View File
@@ -8,8 +8,10 @@ namespace WorkFlowCheck.Common.DTO
{
public class User2FADTO
{
public int Id { get; set; }
public string UserName { get; set; } = null!;
public string Password { get; set; } = null!;
public string Code { get; set; } = null!;
public string Token2FA { get; set; } = null!;
}
}
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.DTO
{
public class UserChangePassword2FADTO
{
public int UserId { get; set; }
[DisplayName("Felhasználó")]
public string UserName { get; set; } = null!;
[DisplayName("Régi jelszó")]
public string OldPassword { get; set; } = null!;
[Required(ErrorMessage = "A jelszó kötelező.")]
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "Az új jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
[DisplayName("Új jelszó")]
public string NewPassword1 { get; set; } = null!;
[Required(ErrorMessage = "A jelszó kötelező.")]
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "Az új jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
[DisplayName("Jelszó megerősítése")]
public string NewPassword2 { get; set; } = null!;
[DisplayName("Ellenőrző kód")]
public string Code { get; set; } = null!;
public string Token2FA { get; set; } = null!;
}
}
+32 -4
View File
@@ -1,19 +1,47 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace WorkFlowCheck.Common.DTO
{
public class UserDTO
{
public int Id { get; set; }
public string Email { get; set; } = null!;
[Required(ErrorMessage = "Az utónév kötelező.")]
[EmailAddress(ErrorMessage = "Érvénytelen email cím.")]
[RegularExpression(@"^[^@\s]+@[^@\s]+\.[^@\s]+$", ErrorMessage = "Az email formátum nem megfelelő.")]
[DisplayName("E-mail")]
public string Email { get; set; } = null!;
[Required(ErrorMessage = "Az utónév kötelező.")]
[DisplayName("Utónév")]
public string FirstName { get; set; } = null!;
[Required(ErrorMessage = "Az vezetéknév kötelező.")]
[DisplayName("Vezetéknév")]
public string LastName { get; set; } = null!;
[Required(ErrorMessage = "A felhasználónév kötelező.")]
[DisplayName("Felhasználó neve")]
public string UserName { get;set; } = null!;
public string Password { get; set; }
[Required(ErrorMessage = "A jelszó kötelező.")]
[RegularExpression(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{6,}$", ErrorMessage = "A jelszónak legalább 6 karakter hosszúnak kell lennie, és tartalmaznia kell kis- és nagybetűt, számot és speciális karaktert.")]
[DisplayName("Jelszó")]
public string Password { get; set; } = null!;
public string JwtToken { get; set; } = null!;
public required ICollection<RoleDTO> RoleDTO { get; set; } = new List<RoleDTO>();
[DisplayName("Aktív")]
public bool Active { get; set; }
[DisplayName("NFC belépés")]
public bool NFCActive { get; set; }
[DisplayName("NFC kód")]
public string NFCCode { get; set; } = null!;
public ICollection<RoleDTO>? RoleDTO { get; set; } = new List<RoleDTO>();
}
}
+2 -2
View File
@@ -11,9 +11,9 @@ namespace WorkFlowCheck.Common.DTO
{
public int Id { get; set; }
public int? RoleId { get; set; } = 0;
public RoleDTO RoleDTO { get; set; }
public RoleDTO? RoleDTO { get; set; }
public int UserId { get; set; }
public UserDTO UserDTO { get; set; }
public UserDTO? UserDTO { get; set; }
}
}
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace WorkFlowCheck.Common.Enums
{
public enum CheckStatus
{
[Display(Name = "Nyitott")]
Open = 0,
[Display(Name = "Folyamatban")]
InProgress = 1,
[Display(Name = "Blokkolt")]
Blocked = 2,
[Display(Name = "Sztornózva")]
Storno = 3,
[Display(Name = "Beküldött")]
Sent = 4,
[Display(Name = "Jóváhagyva")]
Signed = 5,
[Display(Name = "Lezárva")]
Closed = 6
}
}
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.Common.Helper
{
public static class DisplayNameHelper
{
public static string GetDisplayName(string propertyName, Type modelType)
{
var property = modelType.GetProperty(propertyName);
var displayNameAttribute = property?.GetCustomAttributes(typeof(DisplayNameAttribute), false)
.FirstOrDefault() as DisplayNameAttribute;
return displayNameAttribute?.DisplayName ?? propertyName;
}
public static string GetEnumDisplayName(this Enum enumValue)
{
return enumValue
.GetType()
.GetMember(enumValue.ToString())
.First()
.GetCustomAttribute<DisplayAttribute>()?
.Name ?? enumValue.ToString();
}
}
}
+13 -16
View File
@@ -1,10 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.RequestContext;
using WorkFlowCheck.Common.Security;
using WorkFlowCheck.DL.Configurations;
@@ -23,29 +19,23 @@ namespace WorkFlowCheck.DL
_requestContext = requestContext;
}
#if !DEBUG
private dynamic _requestContext;
public AppDbContext(DbContextOptions<AppDbContext> options)
: base(options)
{
_requestContext = new { CurrentUserEmail = "", CurrentUsername = "admin", TraceId = 0 };
}
#endif
#region Entities DbSet
public DbSet<Entities.CheckListHeader> CheckListHeaders { get; set; } = null!;
public DbSet<Entities.CheckListRow> CheckListRows { get; set; } = null!;
public DbSet<Entities.CheckListTemplateHeader> CheckListTemplateHeaders { get; set; } = null!;
public DbSet<Entities.CheckListTemplateRow> CheckListTemplateRows { get; set; } = null!;
public DbSet<Entities.CheckPoint> CheckPoints { get; set; } = null!;
public DbSet<DeviceMessage> DeviceMessages { get; set; } = null!;
public DbSet<Entities.Equipment> Equipments { get; set; } = null!;
public DbSet<Entities.FCMToken> FCMTokens { get; set; } = null!;
public DbSet<Entities.Location> Locations { get; set; } = null!;
public DbSet<Entities.NumberGeneratorTemplate> NumberGeneratorTemplates { get; set; } = null!;
public DbSet<Entities.NumberGeneratorTemplateDate> NumberGeneratorTemplateDatess { get; set; } = null!;
public DbSet<Entities.NumberGeneratorTemplateDate> NumberGeneratorTemplateDates { get; set; } = null!;
public DbSet<Entities.Role> Roles { get; set; } = null!;
public DbSet<Entities.User> Users { get; set; } = null!;
public DbSet<Entities.UserRole> UserRoles { get; set; } = null!;
public DbSet<Entities.RoleCheckListTemplateHeader> RoleCheckListTemplateHeaders { get; set; } = null!;
public DbSet<Entities.RoleCheckPoint> RoleCheckPoints { get; set; } = null!;
#endregion
@@ -57,12 +47,15 @@ namespace WorkFlowCheck.DL
modelBuilder.ApplyConfiguration(new CheckListTemplateHeaderTypeConfiguration());
modelBuilder.ApplyConfiguration(new CheckListTemplateRowTypeConfiguration());
modelBuilder.ApplyConfiguration(new CheckPointTypeConfiguration());
modelBuilder.ApplyConfiguration(new DeviceMessageTypeConfiguration());
modelBuilder.ApplyConfiguration(new EquipmentTypeConfiguration());
modelBuilder.ApplyConfiguration(new FCMTokenTypeConfiguration());
modelBuilder.ApplyConfiguration(new LocationTypeConfiguration());
modelBuilder.ApplyConfiguration(new NumberGeneratorTypeConfiguration());
modelBuilder.ApplyConfiguration(new NumberGeneratorDateTypeConfiguration());
modelBuilder.ApplyConfiguration(new RoleTypeConfiguration());
modelBuilder.ApplyConfiguration(new RoleCheckListTemplateHeaderTypeConfiguration());
modelBuilder.ApplyConfiguration(new RoleCheckPointTypeConfiguration());
modelBuilder.ApplyConfiguration(new UserTypeConfiguration());
modelBuilder.ApplyConfiguration(new UserRoleTypeConfiguration());
@@ -143,7 +136,9 @@ namespace WorkFlowCheck.DL
LastModBy = "System",
JwtToken = "",
Active = true,
Token2FA = ""
Token2FA = "",
NFCActive = true,
NFCCode = "00000000"
},
new User
{
@@ -160,7 +155,9 @@ namespace WorkFlowCheck.DL
LastModBy = "System",
JwtToken = "",
Active = true,
Token2FA = ""
Token2FA = "",
NFCActive = true,
NFCCode = "00000000"
}
);
modelBuilder.Entity<NumberGeneratorTemplate>().HasData(
@@ -3,8 +3,10 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.DL.Entities;
namespace WorkFlowCheck.DL.Configurations
{
@@ -15,7 +17,11 @@ namespace WorkFlowCheck.DL.Configurations
builder.ToTable("CheckListHeader");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
}
builder
.HasOne(ch => ch.AcceptUser)
.WithMany()
.HasForeignKey(ch => ch.AcceptUserId)
.OnDelete(DeleteBehavior.Restrict); // Elkerüljük a cascade delete-et
}
}
}
@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Configurations
{
public class DeviceMessageTypeConfiguration : IEntityTypeConfiguration<Entities.DeviceMessage>
{
public void Configure(EntityTypeBuilder<Entities.DeviceMessage> builder)
{
builder.ToTable("DeviceMessage");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
builder.HasIndex(e => e.DeviceIdTo)
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
}
}
}
@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Configurations
{
public class FCMTokenTypeConfiguration : IEntityTypeConfiguration<Entities.FCMToken>
{
public void Configure(EntityTypeBuilder<Entities.FCMToken> builder)
{
builder.ToTable("FCMToken");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
}
}
}
@@ -0,0 +1,20 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Configurations
{
public class RoleCheckPointTypeConfiguration : IEntityTypeConfiguration<Entities.RoleCheckPoint>
{
public void Configure(EntityTypeBuilder<Entities.RoleCheckPoint> builder)
{
builder.ToTable("RoleCheckPoint");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
}
}
}
@@ -15,6 +15,10 @@ namespace WorkFlowCheck.DL.Configurations
builder.ToTable("Roles");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
builder.HasOne(r => r.Parent)
.WithMany(r => r.Children)
.HasForeignKey(r => r.ParentId)
.OnDelete(DeleteBehavior.Restrict);
}
}
@@ -1,10 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Configurations
{
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.Common.Enums;
using WorkFlowCheck.DL.Interfaces;
namespace WorkFlowCheck.DL.Entities
@@ -12,9 +13,12 @@ namespace WorkFlowCheck.DL.Entities
public int Id { get; set; }
public int CheckListTemplateHeaderId { get; set; }
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; }
public CheckStatus CheckStatus { get; set; }
public DateTime DateExecution { get; set; }
public int UserId { get; set; }
public virtual User User { get; set; }
public int? AcceptUserId { get; set; }
public virtual User? AcceptUser { get; set; }
public string ShortName { get; set; } = null!;
public string Description { get; set; } = null!;
public string DocumentNumber { get; set; } = null!;
@@ -15,7 +15,7 @@ namespace WorkFlowCheck.DL.Entities
public int CheckListTemplateRowId { get; set; }
public virtual CheckListTemplateRow CheckListTemplateRow { get; set; } = null!;
public string Answer { get; set; } = null!;
public byte[] Photo { get; set; } = null!;
public string PhotoFileName { get; set; }=null!;
public Guid GuidNumber { get; set; }
public DateTime LastModAt { get; set; }
public string LastModBy { get; set; } = null!;
@@ -12,11 +12,14 @@ namespace WorkFlowCheck.DL.Entities
public int Id { get; set; }
public string ShortName { get; set; }
public string Code { get; set; }
public bool IsEnabled { get; set; }
public bool IsDeleted { get; set; }
public DateTime LastModAt { get; set; }
public string LastModBy { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public string CreatedBy { get; set; } = null!;
public int RoleId { get; set; }
public virtual ICollection<CheckListTemplateRow> CheckListTemplateRows { get; set; } = new List<CheckListTemplateRow>();
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Entities
{
public class DeviceMessage
{
public int Id { get; set; }
public DateTime SendDate { get; set; }
public DateTime? ReceiveDate { get; set; }
public string DeviceIdFrom { get; set; } = null!;
public string DeviceIdTo { get; set; } = null!;
public string Message { get; set; } = null!;
public string ExtraDataJSON { get; set; } = null!;
public bool IsReaded { get; set; }
public int? RoleId { get; set; }
public virtual Role? Role { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WorkFlowCheck.DL.Interfaces;
namespace WorkFlowCheck.DL.Entities
{
public class FCMToken:ISoftDeletableEntity, IAuditableEntity
{
public int Id { get; set; }
public string Token { get; set; } = null!;
public bool IsDeleted { get; set; }
public DateTime LastModAt { get; set; }
public string LastModBy { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public string CreatedBy { get; set; } = null!;
}
}
+8 -1
View File
@@ -12,7 +12,14 @@ namespace WorkFlowCheck.DL.Entities
{
public int Id { get; set; }
public string RoleName { get; set; } = null!;
public int? ParentId { get; set; }
public virtual Role? Parent { get; set; }
public bool IsAdmin { get; set; }
public bool CanDownloadAPK { get; set; }
public bool CanEnableBlocked { get; set; }
public bool CanUseWebAdmin { get; set; }
public bool CanUseMobilApp { get; set; }
public virtual ICollection<Role> Children { get; set; } = new List<Role>();
public virtual ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
public bool IsDeleted { get; set; }
@@ -9,6 +9,6 @@ namespace WorkFlowCheck.DL.Entities
public virtual Role Role { get; set; } = null!;
public int CheckListTemplateHeaderId { get; set; }
public virtual CheckListTemplateHeader CheckListTemplateHeader { get; set; } = null!;
public bool Enabled { get; set; } = false;
public bool Enabled { get; set; } = true;
}
}
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WorkFlowCheck.DL.Entities
{
public class RoleCheckPoint
{
public int Id { get; set; }
public int RoleId { get; set; }
public virtual Role Role { get; set; } = null!;
public int CheckPointId { get; set; }
public virtual CheckPoint CheckPoint { get; set; } = null!;
public bool Enabled { get; set; } = true;
}
}
+2
View File
@@ -14,6 +14,8 @@ namespace WorkFlowCheck.DL.Entities
public string JwtToken { get; set; } = null!;
public string Token2FA { get; set; } = null!;
public bool Active { get; set; }
public bool NFCActive { get; set; }
public string NFCCode { get; set; } = null!;
public virtual ICollection<UserRole> UserRoles { get; set; } = new List<UserRole>();
@@ -0,0 +1,847 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250331093742_Extend009")]
partial class Extend009
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("Photo")
.IsRequired()
.HasColumnType("varbinary(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,98 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend009 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CheckStatus",
table: "CheckListHeader",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "RoleCheckPoint",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RoleId = table.Column<int>(type: "int", nullable: false),
CheckPointId = table.Column<int>(type: "int", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleCheckPoint", x => x.Id);
table.ForeignKey(
name: "FK_RoleCheckPoint_CheckPoint_CheckPointId",
column: x => x.CheckPointId,
principalTable: "CheckPoint",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RoleCheckPoint_Roles_RoleId",
column: x => x.RoleId,
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914), new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281), new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285) });
migrationBuilder.CreateIndex(
name: "IX_RoleCheckPoint_CheckPointId",
table: "RoleCheckPoint",
column: "CheckPointId");
migrationBuilder.CreateIndex(
name: "IX_RoleCheckPoint_RoleId",
table: "RoleCheckPoint",
column: "RoleId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RoleCheckPoint");
migrationBuilder.DropColumn(
name: "CheckStatus",
table: "CheckListHeader");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8912), new DateTime(2025, 3, 21, 15, 14, 11, 73, DateTimeKind.Utc).AddTicks(8916) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9869), new DateTime(2025, 3, 21, 15, 14, 11, 84, DateTimeKind.Utc).AddTicks(9870) });
}
}
}
@@ -0,0 +1,850 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250331112123_Extend010")]
partial class Extend010
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("Photo")
.IsRequired()
.HasColumnType("varbinary(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend010 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsEnabled",
table: "CheckPoint",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939), new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859), new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsEnabled",
table: "CheckPoint");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2914), new DateTime(2025, 3, 31, 9, 37, 40, 826, DateTimeKind.Utc).AddTicks(2918) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1281), new DateTime(2025, 3, 31, 9, 37, 40, 838, DateTimeKind.Utc).AddTicks(1285) });
}
}
}
@@ -0,0 +1,854 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250401151609_Extend011")]
partial class Extend011
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("Photo")
.IsRequired()
.HasColumnType("varbinary(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5258),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5260),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7925),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7926),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend011 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "PhotoFileName",
table: "CheckListRow",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5258), new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5260) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7925), new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7926) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "PhotoFileName",
table: "CheckListRow");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5939), new DateTime(2025, 3, 31, 11, 21, 22, 452, DateTimeKind.Utc).AddTicks(5942) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5859), new DateTime(2025, 3, 31, 11, 21, 22, 463, DateTimeKind.Utc).AddTicks(5860) });
}
}
}
@@ -0,0 +1,850 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250402082850_Extend012")]
partial class Extend012
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5537),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5540),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9369),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9370),
LastModBy = "System",
LastName = "System",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend012 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Photo",
table: "CheckListRow");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5537), new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5540) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9369), new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9370) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<byte[]>(
name: "Photo",
table: "CheckListRow",
type: "varbinary(max)",
nullable: false,
defaultValue: new byte[0]);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5258), new DateTime(2025, 4, 1, 15, 16, 7, 535, DateTimeKind.Utc).AddTicks(5260) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7925), new DateTime(2025, 4, 1, 15, 16, 7, 546, DateTimeKind.Utc).AddTicks(7926) });
}
}
}
@@ -0,0 +1,861 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250404104148_Extend013")]
partial class Extend013
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,69 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend013 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "NFCActive",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "NFCCode",
table: "Users",
type: "nvarchar(max)",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt", "NFCActive", "NFCCode" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578), new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580), true, "00000000" });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt", "NFCActive", "NFCCode" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896), new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897), true, "00000000" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "NFCActive",
table: "Users");
migrationBuilder.DropColumn(
name: "NFCCode",
table: "Users");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5537), new DateTime(2025, 4, 2, 8, 28, 48, 480, DateTimeKind.Utc).AddTicks(5540) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9369), new DateTime(2025, 4, 2, 8, 28, 48, 491, DateTimeKind.Utc).AddTicks(9370) });
}
}
}
@@ -0,0 +1,902 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250405121855_Extend014")]
partial class Extend014
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1707),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1709),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6682),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6683),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,74 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend014 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DeviceMessage",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SendDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ReceiveDate = table.Column<DateTime>(type: "datetime2", nullable: true),
DeviceIdFrom = table.Column<string>(type: "nvarchar(max)", nullable: false),
DeviceIdTo = table.Column<string>(type: "nvarchar(450)", nullable: false),
Message = table.Column<string>(type: "nvarchar(max)", nullable: false),
ExtraDataJSON = table.Column<string>(type: "nvarchar(max)", nullable: false),
IsReaded = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceMessage", x => x.Id);
});
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1707), new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1709) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6682), new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6683) });
migrationBuilder.CreateIndex(
name: "IX_DeviceMessage_DeviceIdTo",
table: "DeviceMessage",
column: "DeviceIdTo");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DeviceMessage");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5578), new DateTime(2025, 4, 4, 10, 41, 46, 227, DateTimeKind.Utc).AddTicks(5580) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1896), new DateTime(2025, 4, 4, 10, 41, 46, 239, DateTimeKind.Utc).AddTicks(1897) });
}
}
}
@@ -0,0 +1,928 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250406112447_Extend015")]
partial class Extend015
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7691),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7694),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5371),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5373),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,111 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend015 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CanDownloadAPK",
table: "Roles",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CanEnableBlocked",
table: "Roles",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsAdmin",
table: "Roles",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "ParentId",
table: "Roles",
type: "int",
nullable: true);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7691), new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7694) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5371), new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5373) });
migrationBuilder.CreateIndex(
name: "IX_Roles_ParentId",
table: "Roles",
column: "ParentId");
migrationBuilder.AddForeignKey(
name: "FK_Roles_Roles_ParentId",
table: "Roles",
column: "ParentId",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Roles_Roles_ParentId",
table: "Roles");
migrationBuilder.DropIndex(
name: "IX_Roles_ParentId",
table: "Roles");
migrationBuilder.DropColumn(
name: "CanDownloadAPK",
table: "Roles");
migrationBuilder.DropColumn(
name: "CanEnableBlocked",
table: "Roles");
migrationBuilder.DropColumn(
name: "IsAdmin",
table: "Roles");
migrationBuilder.DropColumn(
name: "ParentId",
table: "Roles");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1707), new DateTime(2025, 4, 5, 12, 18, 54, 939, DateTimeKind.Utc).AddTicks(1709) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6682), new DateTime(2025, 4, 5, 12, 18, 54, 949, DateTimeKind.Utc).AddTicks(6683) });
}
}
}
@@ -0,0 +1,931 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250406192452_Extend016")]
partial class Extend016
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2145),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2148),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5191),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5194),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend016 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "RoleId",
table: "CheckPoint",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2145), new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2148) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5191), new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5194) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RoleId",
table: "CheckPoint");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7691), new DateTime(2025, 4, 6, 11, 24, 45, 650, DateTimeKind.Utc).AddTicks(7694) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5371), new DateTime(2025, 4, 6, 11, 24, 45, 661, DateTimeKind.Utc).AddTicks(5373) });
}
}
}
@@ -0,0 +1,942 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250408065515_Extend017")]
partial class Extend017
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("AcceptUserId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AcceptUserId");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(149),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(150),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5847),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5849),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
.WithMany()
.HasForeignKey("AcceptUserId");
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AcceptUser");
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,77 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend017 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "AcceptUserId",
table: "CheckListHeader",
type: "int",
nullable: true);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(149), new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(150) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5847), new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5849) });
migrationBuilder.CreateIndex(
name: "IX_CheckListHeader_AcceptUserId",
table: "CheckListHeader",
column: "AcceptUserId");
migrationBuilder.AddForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader",
column: "AcceptUserId",
principalTable: "Users",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader");
migrationBuilder.DropIndex(
name: "IX_CheckListHeader_AcceptUserId",
table: "CheckListHeader");
migrationBuilder.DropColumn(
name: "AcceptUserId",
table: "CheckListHeader");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2145), new DateTime(2025, 4, 6, 19, 24, 51, 944, DateTimeKind.Utc).AddTicks(2148) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5191), new DateTime(2025, 4, 6, 19, 24, 51, 956, DateTimeKind.Utc).AddTicks(5194) });
}
}
}
@@ -0,0 +1,956 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250408072927_Extend018")]
partial class Extend018
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("AcceptUserId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AcceptUserId");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.HasIndex("RoleId");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8649),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8652),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(264),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(270),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
.WithMany()
.HasForeignKey("AcceptUserId");
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AcceptUser");
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,77 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend018 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "RoleId",
table: "DeviceMessage",
type: "int",
nullable: true);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8649), new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8652) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(264), new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(270) });
migrationBuilder.CreateIndex(
name: "IX_DeviceMessage_RoleId",
table: "DeviceMessage",
column: "RoleId");
migrationBuilder.AddForeignKey(
name: "FK_DeviceMessage_Roles_RoleId",
table: "DeviceMessage",
column: "RoleId",
principalTable: "Roles",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_DeviceMessage_Roles_RoleId",
table: "DeviceMessage");
migrationBuilder.DropIndex(
name: "IX_DeviceMessage_RoleId",
table: "DeviceMessage");
migrationBuilder.DropColumn(
name: "RoleId",
table: "DeviceMessage");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(149), new DateTime(2025, 4, 8, 6, 55, 14, 155, DateTimeKind.Utc).AddTicks(150) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5847), new DateTime(2025, 4, 8, 6, 55, 14, 166, DateTimeKind.Utc).AddTicks(5849) });
}
}
}
@@ -0,0 +1,957 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250408105039_Extend019")]
partial class Extend019
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("AcceptUserId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AcceptUserId");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.HasIndex("RoleId");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7907),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7910),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1759),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1761),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
.WithMany()
.HasForeignKey("AcceptUserId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AcceptUser");
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,70 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend019 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7907), new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7910) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1759), new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1761) });
migrationBuilder.AddForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader",
column: "AcceptUserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8649), new DateTime(2025, 4, 8, 7, 29, 26, 543, DateTimeKind.Utc).AddTicks(8652) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(264), new DateTime(2025, 4, 8, 7, 29, 26, 556, DateTimeKind.Utc).AddTicks(270) });
migrationBuilder.AddForeignKey(
name: "FK_CheckListHeader_Users_AcceptUserId",
table: "CheckListHeader",
column: "AcceptUserId",
principalTable: "Users",
principalColumn: "Id");
}
}
}
@@ -0,0 +1,963 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250410095014_Extend020")]
partial class Extend020
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("AcceptUserId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AcceptUserId");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.HasIndex("RoleId");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<bool>("CanUseMobilApp")
.HasColumnType("bit");
b.Property<bool>("CanUseWebAdmin")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1377),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1382),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4095),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4096),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
.WithMany()
.HasForeignKey("AcceptUserId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AcceptUser");
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,69 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
/// <inheritdoc />
public partial class Extend020 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CanUseMobilApp",
table: "Roles",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "CanUseWebAdmin",
table: "Roles",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1377), new DateTime(2025, 4, 10, 9, 50, 12, 488, DateTimeKind.Utc).AddTicks(1382) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4095), new DateTime(2025, 4, 10, 9, 50, 12, 499, DateTimeKind.Utc).AddTicks(4096) });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CanUseMobilApp",
table: "Roles");
migrationBuilder.DropColumn(
name: "CanUseWebAdmin",
table: "Roles");
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 1,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7907), new DateTime(2025, 4, 8, 10, 50, 38, 70, DateTimeKind.Utc).AddTicks(7910) });
migrationBuilder.UpdateData(
table: "Users",
keyColumn: "Id",
keyValue: 2,
columns: new[] { "CreatedAt", "LastModAt" },
values: new object[] { new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1759), new DateTime(2025, 4, 8, 10, 50, 38, 83, DateTimeKind.Utc).AddTicks(1761) });
}
}
}
@@ -0,0 +1,997 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using WorkFlowCheck.DL;
#nullable disable
namespace WorkFlowCheck.DL.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20250515123614_Extend021")]
partial class Extend021
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.12")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("AcceptUserId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckStatus")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateExecution")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DocumentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEditable")
.HasColumnType("bit");
b.Property<bool>("IsStorno")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AcceptUserId");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("UserId");
b.ToTable("CheckListHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Answer")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListHeaderId")
.HasColumnType("int");
b.Property<int>("CheckListTemplateRowId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("GuidNumber")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PhotoFileName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CheckListHeaderId");
b.HasIndex("CheckListTemplateRowId");
b.ToTable("CheckListRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("NumberGenerator1Id")
.HasColumnType("int");
b.Property<int?>("NumberGenerator2Id")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("NumberGenerator1Id");
b.HasIndex("NumberGenerator2Id");
b.ToTable("CheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("AnswerType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("EquipmentId")
.HasColumnType("int");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("OperationDescription")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RowIndex")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("CheckPointId");
b.HasIndex("EquipmentId");
b.ToTable("CheckListTemplateRow", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<bool>("IsEnabled")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("CheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("DeviceIdFrom")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("DeviceIdTo")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("ExtraDataJSON")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsReaded")
.HasColumnType("bit");
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("ReceiveDate")
.HasColumnType("datetime2");
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<DateTime>("SendDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("DeviceIdTo")
.HasDatabaseName("IX_DeviceMessage_DeviceIdTo");
b.HasIndex("RoleId");
b.ToTable("DeviceMessage", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Equipment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("EquipmentNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Equipment", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.FCMToken", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("FCMToken", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Location", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FullName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Location", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("DigitFormat")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GenerateType")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PrefixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("ShortName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Suffix")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SuffixSeparator")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("NumberGeneratorTemplate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
DigitFormat = "D4",
GenerateType = 0,
LastGeneratedNumber = "",
Prefix = "CHK",
PrefixSeparator = "-",
ShortName = "Ellenőrzési dokumentum sorszámozása",
Suffix = "",
SuffixSeparator = "-"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CurrentNumber")
.HasColumnType("int");
b.Property<string>("LastGeneratedNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("Month")
.HasColumnType("int");
b.Property<int>("NumberGeneratorTemplateId")
.HasColumnType("int");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("NumberGeneratorTemplateId");
b.ToTable("NumberGeneratorTemplateDate", (string)null);
b.HasData(
new
{
Id = 1,
CurrentNumber = 0,
LastGeneratedNumber = "",
Month = 0,
NumberGeneratorTemplateId = 1,
Year = 1
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("CanDownloadAPK")
.HasColumnType("bit");
b.Property<bool>("CanEnableBlocked")
.HasColumnType("bit");
b.Property<bool>("CanUseMobilApp")
.HasColumnType("bit");
b.Property<bool>("CanUseWebAdmin")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsAdmin")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Roles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckListTemplateHeaderId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckListTemplateHeaderId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckListTemplateHeader", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CheckPointId")
.HasColumnType("int");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CheckPointId");
b.HasIndex("RoleId");
b.ToTable("RoleCheckPoint", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Active")
.HasColumnType("bit");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<string>("JwtToken")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("LastModAt")
.HasColumnType("datetime2");
b.Property<string>("LastModBy")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("NFCActive")
.HasColumnType("bit");
b.Property<string>("NFCCode")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("Token2FA")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users", (string)null);
b.HasData(
new
{
Id = 1,
Active = true,
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5079),
CreatedBy = "System",
Email = "admin@nuvolar.hu",
FirstName = "Administrator",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 645, DateTimeKind.Utc).AddTicks(5082),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMKE5TYwthDBuUsTUEO1fBnCR3VdSCmdz47ue0RoVvnkY",
Token2FA = "",
UserName = "admin"
},
new
{
Id = 2,
Active = true,
CreatedAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8830),
CreatedBy = "System",
Email = "user@nuvolar.hu",
FirstName = "User",
IsDeleted = false,
JwtToken = "",
LastModAt = new DateTime(2025, 5, 15, 12, 36, 12, 656, DateTimeKind.Utc).AddTicks(8834),
LastModBy = "System",
LastName = "System",
NFCActive = true,
NFCCode = "00000000",
PasswordHash = "eGM0NUREZnJ0ISFFRDIxMPwM2D9sQSj7zmaSBIsOGe0I9hBFwCGPVbyrYMA5EnKG",
Token2FA = "",
UserName = "user"
});
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("RoleId")
.HasColumnType("int");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles", (string)null);
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.User", "AcceptUser")
.WithMany()
.HasForeignKey("AcceptUserId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("AcceptUser");
b.Navigation("CheckListTemplateHeader");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListHeader", "CheckListHeader")
.WithMany("CheckListRows")
.HasForeignKey("CheckListHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateRow", "CheckListTemplateRow")
.WithMany()
.HasForeignKey("CheckListTemplateRowId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListHeader");
b.Navigation("CheckListTemplateRow");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator1")
.WithMany()
.HasForeignKey("NumberGenerator1Id");
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGenerator2")
.WithMany()
.HasForeignKey("NumberGenerator2Id");
b.Navigation("NumberGenerator1");
b.Navigation("NumberGenerator2");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateRow", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany("CheckListTemplateRows")
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Equipment", "Equipment")
.WithMany()
.HasForeignKey("EquipmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("CheckPoint");
b.Navigation("Equipment");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.DeviceMessage", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplateDate", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", "NumberGeneratorTemplate")
.WithMany("NumberGeneratorTemplateDates")
.HasForeignKey("NumberGeneratorTemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NumberGeneratorTemplate");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Parent");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckListTemplateHeader", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", "CheckListTemplateHeader")
.WithMany()
.HasForeignKey("CheckListTemplateHeaderId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckListTemplateHeader");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.RoleCheckPoint", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.CheckPoint", "CheckPoint")
.WithMany()
.HasForeignKey("CheckPointId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CheckPoint");
b.Navigation("Role");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.UserRole", b =>
{
b.HasOne("WorkFlowCheck.DL.Entities.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId");
b.HasOne("WorkFlowCheck.DL.Entities.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListHeader", b =>
{
b.Navigation("CheckListRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckListTemplateHeader", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.CheckPoint", b =>
{
b.Navigation("CheckListTemplateRows");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.NumberGeneratorTemplate", b =>
{
b.Navigation("NumberGeneratorTemplateDates");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.Role", b =>
{
b.Navigation("Children");
b.Navigation("UserRoles");
});
modelBuilder.Entity("WorkFlowCheck.DL.Entities.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}

Some files were not shown because too many files have changed in this diff Show More