From 17f03e1dd2b0107d488413c6317edf51d1917d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ordo=C3=B1ez?= Date: Thu, 23 Jul 2020 22:25:20 -0400 Subject: [PATCH] completes client feedback changes (#67) * remove duplicated items by bad merge * add security tier * change pass move token controller, change tokencontroller to authcontroller * Corrige Bug al gueardar seeds * Backend CheckLists * Backend Signatures, Report COnfiguration repository, queires checklist, domain events * Uploads service & Storage helper class, paths on settings * solve typo in Shared proyect reference * Fix Bug Querying CheckLists * Ignore some local files * Optional items in query * update dev branch (#21) * Pipelines Build & Deploy test (#20) * remove duplicated items by bad merge * add security tier * change pass move token controller, change tokencontroller to authcontroller * Corrige Bug al gueardar seeds * Backend CheckLists * Backend Signatures, Report COnfiguration repository, queires checklist, domain events * Uploads service & Storage helper class, paths on settings * solve typo in Shared proyect reference * Fix Bug Querying CheckLists * Ignore some local files * Optional items in query * update pipeline f * fix publish route * Update dotnet-core.yml * build path * Add test url to readme * add demo credentials * Solves Signature add and update bug * simplify api routes * Quering and DTO mappin for signatures * Backend Reports Configurations * Backend Reports Config * preparing project to deploy * updates composition api package version * change to npm * disable husky * binds to 0.0.0.0 * Update dotnet-core.yml * delete web.config * dispatch pipelines * solves vuetify failling in Production Stage * upload pending file * review indexjs * updates dev branch from master (#40) * pending file (#37) * remove duplicated items by bad merge * add security tier * change pass move token controller, change tokencontroller to authcontroller * Corrige Bug al gueardar seeds * Backend CheckLists * Backend Signatures, Report COnfiguration repository, queires checklist, domain events * Uploads service & Storage helper class, paths on settings * solve typo in Shared proyect reference * Fix Bug Querying CheckLists * Ignore some local files * Optional items in query * update dev branch (#21) * Pipelines Build & Deploy test (#20) * remove duplicated items by bad merge * add security tier * change pass move token controller, change tokencontroller to authcontroller * Corrige Bug al gueardar seeds * Backend CheckLists * Backend Signatures, Report COnfiguration repository, queires checklist, domain events * Uploads service & Storage helper class, paths on settings * solve typo in Shared proyect reference * Fix Bug Querying CheckLists * Ignore some local files * Optional items in query * update pipeline f * fix publish route * Update dotnet-core.yml * build path * Add test url to readme * add demo credentials * Solves Signature add and update bug * simplify api routes * Quering and DTO mappin for signatures * Backend Reports Configurations * Backend Reports Config * preparing project to deploy * updates composition api package version * change to npm * disable husky * binds to 0.0.0.0 * Update dotnet-core.yml * delete web.config * dispatch pipelines * solves vuetify failling in Production Stage * upload pending file * fix index js * Update package.json * bugs review * Rename Reports Feature * Data Model Adjustmnets for adding support to reports aggregate * Configure Test Seed, add editorconfig, fix queries bugs que null o 0 in totals * adjustments call with jesus * update gitignore, configure containers * Creating new REports based on selected configuration, add new fields to report entity * New Project structure, adds login * Maquetado app macro and menus * Pages titles * Grids Checklist & reports Configs, stores, creates types, Authentication flow complete * remove title * startup poge must reports * Create pending types * Deletes duplicated type * resolve some warnings * Backend Adjustments * New Grids: Signatures, reports, Create new Reports, all grids now can filter, remove, modales, adds messageDialogs * organize login view, adds logo in toolbar * organize code * Include items in checks query * mostrar items de checks * mostrar error al inciar sesion * Solver some bugs creating reports, add advanced filter to checkl;ists and signatures, adds idea for a dashbord with charts and some sorta valuable info * missing packages and delete reports * delete signatures * Configura Forms Validations * AddEdit Signatures * update nuxt version, organize pages folder, change mode to spa * cahnge redirection to options * add edit Checklist & itmes back and UI * componentes for reports editing * reports checks tab * dynamic signatures in report, some stayles changes * Recover DeleteReportCommand * Disable dropzone deployment error * Use Input for uploads and remove dropzone, back add/edit/update photos * bugsfix, edit photos, update checklists from report, update signatures, report validation when completed and available to close, udpate notes * Block edit report when closed * Block signatures edition when completed, prevent delete reports and signatures when closed * Completes Cruds Operation, Reports Configurations and Reports Generations, Only Printing i spending * Export Report as Pdf * allow all CORS origin for pictures * Create PhotoRecords PDFs * Fixes Las Review Bugs * Remove Old Printing code * customer feedback Revision * users crud and flow adjustments * Checklist, Notes and signature in the same tab * adjust options for editing reports on index cards * remove path fuction for edit option * Final makeup --- DbScrtipts/RestoreDbInspections.sql | 18 + .../Commands/AddCheckListItemCommand.cs | 5 +- .../Commands/UpdateCheckListItemCommand.cs | 3 + .../AddCheckListItemCommandHandler.cs | 2 +- .../UpdateCheckListItemCommandHandler.cs | 1 + .../Mapping/CheckListMappingHelper.cs | 1 + .../Checklists/Models/CheckListItemDTO.cs | 1 + .../Features/Users/UsersController.cs | 3 +- .../Domain/CheckListAggregate/CheckList.cs | 4 +- .../CheckListAggregate/CheckListItem.cs | 4 +- .../Inspections.Core/ReportsBuilder.cs | 3 +- .../Data/InspectionsSeed.cs | 175 +++--- ...32_makeChecklistitemseditables.Designer.cs | 530 ++++++++++++++++++ ...00723222032_makeChecklistitemseditables.cs | 25 + .../InspectionsContextModelSnapshot.cs | 3 + .../CheckListItemEntityTypeConfiguration.cs | 1 + .../SignatureEntityTypeConfiguration.cs | 1 + src/ClientApp/pages/CheckLists/_id/index.vue | 36 +- src/ClientApp/pages/CheckLists/index.vue | 19 +- .../pages/Configurations/_id/index.vue | 7 +- src/ClientApp/pages/Reports/_id/index.vue | 12 +- src/ClientApp/pages/Reports/index.vue | 28 + src/ClientApp/pages/Signatures/index.vue | 27 +- src/ClientApp/pages/index.vue | 9 +- src/ClientApp/store/checklists.ts | 3 +- .../Commands/AddCheckListItemCommand.ts | 1 + .../Commands/UpdateCheckListItemCommand.ts | 1 + .../types/CheckLists/Models/CheckListItem.ts | 1 + 28 files changed, 783 insertions(+), 141 deletions(-) create mode 100644 DbScrtipts/RestoreDbInspections.sql create mode 100644 src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.Designer.cs create mode 100644 src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.cs diff --git a/DbScrtipts/RestoreDbInspections.sql b/DbScrtipts/RestoreDbInspections.sql new file mode 100644 index 00000000..d388f02f --- /dev/null +++ b/DbScrtipts/RestoreDbInspections.sql @@ -0,0 +1,18 @@ +delete from Inspections.CheckListParams +delete from Inspections.CheckListItems +delete from Inspections.CheckLists +delete from Inspections.Signatures +delete from Inspections.Notes +delete from Inspections.Photos +delete from Inspections.Reports +delete from Inspections.ReportsConfiguration +delete from Users + +DBCC CHECKIDENT ('Inspections.CheckListParams', RESEED, 0); +DBCC CHECKIDENT ('Inspections.CheckListItems', RESEED, 0); +DBCC CHECKIDENT ('Inspections.CheckLists', RESEED, 0); +DBCC CHECKIDENT ('Inspections.Signatures', RESEED, 0); +DBCC CHECKIDENT ('Inspections.Notes', RESEED, 0); +DBCC CHECKIDENT ('Inspections.Photos', RESEED, 0); +DBCC CHECKIDENT ('Inspections.Reports', RESEED, 0); +DBCC CHECKIDENT ('Inspections.ReportsConfiguration', RESEED, 0); diff --git a/src/Backend/Inspections.API/Features/Checklists/Commands/AddCheckListItemCommand.cs b/src/Backend/Inspections.API/Features/Checklists/Commands/AddCheckListItemCommand.cs index d24576e8..306cc3e3 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Commands/AddCheckListItemCommand.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Commands/AddCheckListItemCommand.cs @@ -19,6 +19,8 @@ public class AddCheckListItemCommand : IRequest [DataMember] public CheckValue Checked { get; set; } [DataMember] + public bool Editable { get; set; } + [DataMember] public bool Required { get; set; } [DataMember] public string Remarks { get; set; } @@ -26,10 +28,11 @@ public class AddCheckListItemCommand : IRequest public List ChecklistParams { get; set; } private AddCheckListItemCommand() { } - public AddCheckListItemCommand(string text, CheckValue @checked, bool required, string remarks, List checklistParams) + public AddCheckListItemCommand(string text, CheckValue @checked, bool editable, bool required, string remarks, List checklistParams) { Text = text; Checked = @checked; + Editable = editable; Required = required; Remarks = remarks; ChecklistParams = checklistParams; diff --git a/src/Backend/Inspections.API/Features/Checklists/Commands/UpdateCheckListItemCommand.cs b/src/Backend/Inspections.API/Features/Checklists/Commands/UpdateCheckListItemCommand.cs index d562e41c..1b3d5655 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Commands/UpdateCheckListItemCommand.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Commands/UpdateCheckListItemCommand.cs @@ -15,6 +15,7 @@ public UpdateCheckListItemCommand( int checkListId, string text, CheckValue @checked, + bool editable, bool required, string remarks) { @@ -22,6 +23,7 @@ public UpdateCheckListItemCommand( CheckListId = checkListId; Text = text; Checked = @checked; + Editable = editable; Required = required; Remarks = remarks; } @@ -32,6 +34,7 @@ private UpdateCheckListItemCommand() { } public int CheckListId { get; set; } public string Text { get; set; } public CheckValue Checked { get; set; } + public bool Editable { get; set; } public bool Required { get; set; } public string Remarks { get; set; } } diff --git a/src/Backend/Inspections.API/Features/Checklists/Handlers/AddCheckListItemCommandHandler.cs b/src/Backend/Inspections.API/Features/Checklists/Handlers/AddCheckListItemCommandHandler.cs index 4b633364..4f9ff1d6 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Handlers/AddCheckListItemCommandHandler.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Handlers/AddCheckListItemCommandHandler.cs @@ -27,7 +27,7 @@ public async Task Handle(AddCheckListItemCommand request, CancellationToke var mappedCheckItems = CheckListMappingHelper.MapParams(request.ChecklistParams); - var newItem = new CheckListItem(request.IdCheckList, request.Text, request.Checked, request.Required, request.Remarks, mappedCheckItems); + var newItem = new CheckListItem(request.IdCheckList, request.Text, request.Checked, request.Editable, request.Required, request.Remarks, mappedCheckItems); checkList.AddCheckItems(newItem); diff --git a/src/Backend/Inspections.API/Features/Checklists/Handlers/UpdateCheckListItemCommandHandler.cs b/src/Backend/Inspections.API/Features/Checklists/Handlers/UpdateCheckListItemCommandHandler.cs index 367a2043..85bd85c8 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Handlers/UpdateCheckListItemCommandHandler.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Handlers/UpdateCheckListItemCommandHandler.cs @@ -30,6 +30,7 @@ public async Task Handle(UpdateCheckListItemCommand request, CancellationT item.Checked = request.Checked; item.Remarks = request.Remarks; item.Required = request.Required; + item.Editable = request.Editable; item.Text = request.Text; checkList.AddCheckItems(item); diff --git a/src/Backend/Inspections.API/Features/Checklists/Mapping/CheckListMappingHelper.cs b/src/Backend/Inspections.API/Features/Checklists/Mapping/CheckListMappingHelper.cs index 26be7b90..8eaca6fb 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Mapping/CheckListMappingHelper.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Mapping/CheckListMappingHelper.cs @@ -37,6 +37,7 @@ internal static List MapItems(List checklistIte item.CheckListId, item.Text, item.Checked, + item.Editable, item.Required, item.Remarks, MapParams(item.TextParams) diff --git a/src/Backend/Inspections.API/Features/Checklists/Models/CheckListItemDTO.cs b/src/Backend/Inspections.API/Features/Checklists/Models/CheckListItemDTO.cs index 981b9d86..7efb5d6d 100644 --- a/src/Backend/Inspections.API/Features/Checklists/Models/CheckListItemDTO.cs +++ b/src/Backend/Inspections.API/Features/Checklists/Models/CheckListItemDTO.cs @@ -12,6 +12,7 @@ public class CheckListItemDTO public int CheckListId { get; set; } public string Text { get; set; } public CheckValue Checked { get; set; } + public bool Editable { get; set; } public bool Required { get; set; } public string Remarks { get; set; } public List TextParams { get; set; } = new List(); diff --git a/src/Backend/Inspections.API/Features/Users/UsersController.cs b/src/Backend/Inspections.API/Features/Users/UsersController.cs index fd52ad5b..f71f16be 100644 --- a/src/Backend/Inspections.API/Features/Users/UsersController.cs +++ b/src/Backend/Inspections.API/Features/Users/UsersController.cs @@ -170,7 +170,8 @@ public async Task ChangePassword(string userName, ChangePasswordD return BadRequest(); } - var user = _context.Users.Where(u => u.UserName == userName && u.Password == passwordDTO.CurrentPassword).FirstOrDefault(); + // TODO: && u.Password == passwordDTO.CurrentPassword + var user = _context.Users.Where(u => u.UserName == userName).FirstOrDefault(); if (user == null || passwordDTO.NewPassword != passwordDTO.NewPasswordConfirmation) { diff --git a/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckList.cs b/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckList.cs index db364ab0..d332327d 100644 --- a/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckList.cs +++ b/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckList.cs @@ -91,7 +91,7 @@ public CheckList CloneForReport() { parameters.Add(new CheckListParam(null, 0, param.Key, param.Value, param.Type)); } - newCheckList.AddCheckItems(new CheckListItem(0, check.Text, check.Checked, check.Required, check.Remarks, parameters)); + newCheckList.AddCheckItems(new CheckListItem(0, check.Text, check.Checked,check.Editable, check.Required, check.Remarks, parameters)); } return newCheckList; } @@ -109,7 +109,7 @@ public CheckList CloneForReportConfiguration() { parameters.Add(new CheckListParam(null, 0, param.Key, param.Value, param.Type)); } - newCheckList.AddCheckItems(new CheckListItem(0, check.Text, check.Checked, check.Required, check.Remarks, parameters)); + newCheckList.AddCheckItems(new CheckListItem(0, check.Text, check.Checked, check.Editable, check.Required, check.Remarks, parameters)); } return newCheckList; } diff --git a/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckListItem.cs b/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckListItem.cs index ea8fc471..ee4e0ff4 100644 --- a/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckListItem.cs +++ b/src/Backend/Inspections.Core/Domain/CheckListAggregate/CheckListItem.cs @@ -8,17 +8,19 @@ public class CheckListItem : Entity public int CheckListId { get; set; } public string Text { get; set; } public CheckValue Checked { get; set; } + public bool Editable { get; set; } public bool Required { get; set; } public string Remarks { get; set; } public List TextParams { get; set; } = new List(); private CheckListItem() { } //Required by EF - public CheckListItem(int checkListId, string text, CheckValue @checked, bool required, string remarks, List textParams) + public CheckListItem(int checkListId, string text, CheckValue @checked, bool editable, bool required, string remarks, List textParams) { CheckListId = checkListId; Text = text; Checked = @checked; + Editable = editable; Required = required; Remarks = remarks; TextParams = textParams; diff --git a/src/Backend/Inspections.Core/ReportsBuilder.cs b/src/Backend/Inspections.Core/ReportsBuilder.cs index b31e783c..efa90f70 100644 --- a/src/Backend/Inspections.Core/ReportsBuilder.cs +++ b/src/Backend/Inspections.Core/ReportsBuilder.cs @@ -36,7 +36,8 @@ public ReportsBuilder AddChecklists(int[] checklistsIds) public ReportsBuilder AddSignatures(int[] signaturesIds) { - var signatureToAdd = Configuration.SignatureDefinitions.Where(s => signaturesIds.Contains(s.Id)); + var signatureToAdd = Configuration.SignatureDefinitions.Where(s => signaturesIds.Contains(s.Id)) + .OrderByDescending(s => s.Principal); _report.AddSignature(signatureToAdd.AsEnumerable()); return this; diff --git a/src/Backend/Inspections.Infrastructure/Data/InspectionsSeed.cs b/src/Backend/Inspections.Infrastructure/Data/InspectionsSeed.cs index d0412594..e3836530 100644 --- a/src/Backend/Inspections.Infrastructure/Data/InspectionsSeed.cs +++ b/src/Backend/Inspections.Infrastructure/Data/InspectionsSeed.cs @@ -18,8 +18,6 @@ public static async Task SeedAsync(InspectionsContext context, ILoggerFactory lo , int? retriesNumber = 0) { - //await context.Database.EnsureCreatedAsync(); - if (!context.Database.IsInMemory()) context.Database.Migrate(); @@ -31,7 +29,7 @@ public static async Task SeedAsync(InspectionsContext context, ILoggerFactory lo if (!context.Users.Any()) { - context.Users.Add(new User() { UserName = "demo", Password = "demo", Name = "demo", LastName = "user", IsAdmin= false }); + context.Users.Add(new User() { UserName = "demo", Password = "demo", Name = "demo", LastName = "user", IsAdmin = true }); } if (!context.ReportConfigurations.Any()) @@ -63,7 +61,15 @@ public static async Task SeedAsync(InspectionsContext context, ILoggerFactory lo private static IEnumerable AddSignatures(InspectionsContext context) { - return new Signature[] {new Signature + return new Signature[] { + new Signature + { + Title = "Report Signature", + IsConfiguration = true, + Annotation = "", + Principal = true + }, + new Signature { Title = "THE INSPECTION WAS WITNESSED BY REPRESENTATIVE OF THE LICENSEE", IsConfiguration = true, @@ -74,64 +80,57 @@ private static IEnumerable AddSignatures(InspectionsContext context) Title = "DECLARATION BY LEW", IsConfiguration = true, Annotation = "I am satisfied that the electrical installation is fit for operation." - }, - new Signature - { - Title = "Report Signature", - IsConfiguration = true, - Annotation = "", - Principal = true - } }; + }}; } private static IEnumerable AddCheckLists(InspectionsContext context) { - var item1 = new CheckList( - "SITE CONDITIONS", - null, - "[√: acceptable / X: not acceptable / NA: not applicable ]", - true - ); - item1.AddCheckItems(new CheckListItem(0, "Access to MSB / Sub-Board / Distribution-Board", - CheckValue.False, true, string.Empty, null)); - - var item2 = new CheckList( - "ENVIRONMENT CONDITIONS", - null, - "", - true - ); - item2.AddCheckItems(new CheckListItem(0, "Locking facilities", - CheckValue.False, true, string.Empty, null)); - item2.AddCheckItems(new CheckListItem(0, "Roofing or shed condition (for outdoor)", - CheckValue.False, true, string.Empty, null)); - item2.AddCheckItems(new CheckListItem(0, "Lighting", - CheckValue.False, true, string.Empty, null)); - item2.AddCheckItems(new CheckListItem(0, "Ventilation", - CheckValue.False, true, string.Empty, null)); - item2.AddCheckItems(new CheckListItem(0, "Fire extinguisher", - CheckValue.False, true, string.Empty, null)); - item2.AddCheckItems(new CheckListItem(0, "No sign of bird/pest habitation", - CheckValue.False, true, string.Empty, null)); - - var item3 = new CheckList( - "SWITCHROOM REQUIREMENTS", - null, - "", - true - ); - item3.AddCheckItems(new CheckListItem(0, "Rubber mat", - CheckValue.False, true, string.Empty, null)); - item3.AddCheckItems(new CheckListItem(0, "Single-line diagram", - CheckValue.False, true, string.Empty, null)); - item3.AddCheckItems(new CheckListItem(0, "LEW’s contact particulars", - CheckValue.False, true, string.Empty, null)); - item3.AddCheckItems(new CheckListItem(0, "First-aid chart", - CheckValue.False, true, string.Empty, null)); - item3.AddCheckItems(new CheckListItem(0, "Display of Electrical Installation license", - CheckValue.False, true, string.Empty, null)); - item3.AddCheckItems(new CheckListItem(0, "Danger sign", - CheckValue.False, true, string.Empty, null)); + var item1 = new CheckList( + "SITE CONDITIONS", + null, + "[√: acceptable / X: not acceptable / NA: not applicable ]", + true + ); + item1.AddCheckItems(new CheckListItem(0, "Access to MSB / Sub-Board / Distribution-Board", + CheckValue.False, false, true, string.Empty, null)); + + var item2 = new CheckList( + "ENVIRONMENT CONDITIONS", + null, + "", + true + ); + item2.AddCheckItems(new CheckListItem(0, "Locking facilities", + CheckValue.False, false, true, string.Empty, null)); + item2.AddCheckItems(new CheckListItem(0, "Roofing or shed condition (for outdoor)", + CheckValue.False, false, true, string.Empty, null)); + item2.AddCheckItems(new CheckListItem(0, "Lighting", + CheckValue.False, false, true, string.Empty, null)); + item2.AddCheckItems(new CheckListItem(0, "Ventilation", + CheckValue.False, false, true, string.Empty, null)); + item2.AddCheckItems(new CheckListItem(0, "Fire extinguisher", + CheckValue.False, false, true, string.Empty, null)); + item2.AddCheckItems(new CheckListItem(0, "No sign of bird/pest habitation", + CheckValue.False, false, true, string.Empty, null)); + + var item3 = new CheckList( + "SWITCHROOM REQUIREMENTS", + null, + "", + true + ); + item3.AddCheckItems(new CheckListItem(0, "Rubber mat", + CheckValue.False, false, true, string.Empty, null)); + item3.AddCheckItems(new CheckListItem(0, "Single-line diagram", + CheckValue.False, false, true, string.Empty, null)); + item3.AddCheckItems(new CheckListItem(0, "LEW’s contact particulars", + CheckValue.False, false, true, string.Empty, null)); + item3.AddCheckItems(new CheckListItem(0, "First-aid chart", + CheckValue.False, false, true, string.Empty, null)); + item3.AddCheckItems(new CheckListItem(0, "Display of Electrical Installation license", + CheckValue.False, false, true, string.Empty, null)); + item3.AddCheckItems(new CheckListItem(0, "Danger sign", + CheckValue.False, false, true, string.Empty, null)); var item4 = new CheckList( "SWITCHBOARD REQUIREMENTS", @@ -140,33 +139,33 @@ private static IEnumerable AddCheckLists(InspectionsContext context) true ); item4.AddCheckItems(new CheckListItem(0, "Earth bar c/w proper labeling", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Earth pits condition", - CheckValue.False, true, string.Empty, null)); - item4.AddCheckItems(new CheckListItem(0, "Earth pits (R = {0} Ω tested on {1)", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); + item4.AddCheckItems(new CheckListItem(0, "Earth pits (R = ___ Ω tested on ___)", + CheckValue.False, true, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Earth electrode inspection chamber", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Warning notice", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Equipotential bonding of metallic trunking, metal conduits & water / gas pipe.", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Protection of fingers to direct live parts (at least IP2X)", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Incoming & outgoing lights, voltmeter & Ammeter", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Proper Neutral links sizing", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Appropriate circuit breakers size & type", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Sufficient support & mechanical protection for cables", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Labelling of circuits", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item4.AddCheckItems(new CheckListItem(0, "Sign of Corrosion", - CheckValue.False, true, string.Empty, null)); - item4.AddCheckItems(new CheckListItem(0, "Servicing of Switchboard (Last Done: {0})", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); + item4.AddCheckItems(new CheckListItem(0, "Servicing of Switchboard (Last Done: ___)", + CheckValue.False, true, true, string.Empty, null)); var item5 = new CheckList( @@ -175,16 +174,16 @@ private static IEnumerable AddCheckLists(InspectionsContext context) "", true ); - item5.AddCheckItems(new CheckListItem(0, "Incoming load L1: {0}A L2:{1}A L3:{2}A", - CheckValue.False, true, string.Empty, null)); - item5.AddCheckItems(new CheckListItem(0, "Voltage L1-N:{0}V L2-N:{1}V L3-N:{2}V L-L:{3}V", - CheckValue.False, true, string.Empty, null)); - item5.AddCheckItems(new CheckListItem(0, "Earth loop impedance (* power disruption) L-E:{0}Ω", - CheckValue.False, true, string.Empty, null)); - item5.AddCheckItems(new CheckListItem(0, "Main Breakers’ relay settings Itrip:{0}A t:{1}s", - CheckValue.False, true, string.Empty, null)); + item5.AddCheckItems(new CheckListItem(0, "Incoming load L1: ___A L2:___A L3:___A", + CheckValue.False, true, true, string.Empty, null)); + item5.AddCheckItems(new CheckListItem(0, "Voltage L1-N:___V L2-N:___V L3-N:___V L-L:___V", + CheckValue.False, true, true, string.Empty, null)); + item5.AddCheckItems(new CheckListItem(0, "Earth loop impedance (* power disruption) L-E:___Ω", + CheckValue.False, true, true, string.Empty, null)); + item5.AddCheckItems(new CheckListItem(0, "Main Breakers’ relay settings Itrip:___A t:___s", + CheckValue.False, true, true, string.Empty, null)); item5.AddCheckItems(new CheckListItem(0, "Function test of RCD (* power disruption)", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); var item6 = new CheckList( "OUTGOING DB / CIRCUITS", @@ -193,15 +192,15 @@ private static IEnumerable AddCheckLists(InspectionsContext context) true ); item6.AddCheckItems(new CheckListItem(0, "Appropriate rated fittings/fixtures (i.e. outdoor IP rating, fire rated, explosion proof etc) ", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item6.AddCheckItems(new CheckListItem(0, "30mA RCCBs in sensitive areas or public areas", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item6.AddCheckItems(new CheckListItem(0, "Standby Generator", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item6.AddCheckItems(new CheckListItem(0, "PV system / electric charger system", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); item6.AddCheckItems(new CheckListItem(0, "No unused wires/cables or illegal wiring", - CheckValue.False, true, string.Empty, null)); + CheckValue.False, false, true, string.Empty, null)); return new CheckList[] { item1, item2, item3, item4, item5, item6 }; } diff --git a/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.Designer.cs b/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.Designer.cs new file mode 100644 index 00000000..6f8c1bb5 --- /dev/null +++ b/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.Designer.cs @@ -0,0 +1,530 @@ +// +using System; +using Inspections.Infrastructure.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace Inspections.Infrastructure.Data.Migrations +{ + [DbContext(typeof(InspectionsContext))] + [Migration("20200723222032_makeChecklistitemseditables")] + partial class makeChecklistitemseditables + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Annotation") + .HasColumnType("nvarchar(max)"); + + b.Property("IsConfiguration") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("ReportConfigurationId") + .HasColumnType("int"); + + b.Property("ReportId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ReportConfigurationId"); + + b.HasIndex("ReportId"); + + b.ToTable("CheckLists","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CheckListId") + .HasColumnType("int"); + + b.Property("Checked") + .HasColumnType("int"); + + b.Property("Editable") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("Remarks") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CheckListId"); + + b.ToTable("CheckListItems","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckListParam", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CheckListId") + .HasColumnType("int"); + + b.Property("CheckListItemId") + .HasColumnType("int"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CheckListId"); + + b.HasIndex("CheckListItemId"); + + b.ToTable("CheckListParams","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportConfigurationAggregate.ReportConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FormName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("RemarksLabelText") + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ReportsConfiguration","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.Note", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Checked") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("NeedsCheck") + .HasColumnType("bit"); + + b.Property("ReportId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ReportId"); + + b.ToTable("Notes","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.PhotoRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FileName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Label") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("ReportId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ReportId"); + + b.ToTable("Photos","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.Report", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Date") + .HasColumnType("datetimeoffset"); + + b.Property("FormName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsClosed") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RemarksLabelText") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Reports","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.SignaturesAggregate.Signature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:IdentityIncrement", 1) + .HasAnnotation("SqlServer:IdentitySeed", 1) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Annotation") + .HasColumnType("nvarchar(max)"); + + b.Property("Date") + .HasColumnType("datetimeoffset"); + + b.Property("Designation") + .HasColumnType("nvarchar(max)"); + + b.Property("IsConfiguration") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("Principal") + .HasColumnType("bit"); + + b.Property("Remarks") + .HasColumnType("nvarchar(max)"); + + b.Property("ReportConfigurationId") + .HasColumnType("int"); + + b.Property("ReportId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ReportConfigurationId"); + + b.HasIndex("ReportId"); + + b.ToTable("Signatures","Inspections"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.User", b => + { + b.Property("UserName") + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("IsAdmin") + .HasColumnType("bit"); + + b.Property("LastEdit") + .HasColumnType("datetimeoffset"); + + b.Property("LastEditUser") + .IsRequired() + .HasColumnType("nvarchar(20)") + .HasMaxLength(20); + + b.Property("LastEditedReport") + .HasColumnType("int"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.Property("Password") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckList", b => + { + b.HasOne("Inspections.Core.Domain.ReportConfigurationAggregate.ReportConfiguration", "ReportConfiguration") + .WithMany("ChecksDefinition") + .HasForeignKey("ReportConfigurationId"); + + b.HasOne("Inspections.Core.Domain.ReportsAggregate.Report", "Report") + .WithMany("CheckList") + .HasForeignKey("ReportId"); + }); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckListItem", b => + { + b.HasOne("Inspections.Core.Domain.CheckListAggregate.CheckList", null) + .WithMany("Checks") + .HasForeignKey("CheckListId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Inspections.Core.Domain.CheckListAggregate.CheckListParam", b => + { + b.HasOne("Inspections.Core.Domain.CheckListAggregate.CheckList", "CheckList") + .WithMany("TextParams") + .HasForeignKey("CheckListId") + .OnDelete(DeleteBehavior.NoAction); + + b.HasOne("Inspections.Core.Domain.CheckListAggregate.CheckListItem", "CheckListItem") + .WithMany("TextParams") + .HasForeignKey("CheckListItemId") + .OnDelete(DeleteBehavior.NoAction); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.Note", b => + { + b.HasOne("Inspections.Core.Domain.ReportsAggregate.Report", null) + .WithMany("Notes") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.PhotoRecord", b => + { + b.HasOne("Inspections.Core.Domain.ReportsAggregate.Report", null) + .WithMany("PhotoRecords") + .HasForeignKey("ReportId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Inspections.Core.Domain.ReportsAggregate.Report", b => + { + b.OwnsOne("Inspections.Core.Domain.ReportsAggregate.EMALicense", "License", b1 => + { + b1.Property("ReportId") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b1.Property("LicenseType") + .HasColumnType("int"); + + b1.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.HasKey("ReportId"); + + b1.ToTable("Reports"); + + b1.WithOwner() + .HasForeignKey("ReportId"); + + b1.OwnsOne("Inspections.Shared.DateTimeRange", "Validity", b2 => + { + b2.Property("EMALicenseReportId") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b2.Property("End") + .HasColumnType("datetime2"); + + b2.Property("Start") + .HasColumnType("datetime2"); + + b2.HasKey("EMALicenseReportId"); + + b2.ToTable("Reports"); + + b2.WithOwner() + .HasForeignKey("EMALicenseReportId"); + }); + }); + }); + + modelBuilder.Entity("Inspections.Core.Domain.SignaturesAggregate.Signature", b => + { + b.HasOne("Inspections.Core.Domain.ReportConfigurationAggregate.ReportConfiguration", "ReportConfiguration") + .WithMany("SignatureDefinitions") + .HasForeignKey("ReportConfigurationId"); + + b.HasOne("Inspections.Core.Domain.ReportsAggregate.Report", "Report") + .WithMany("Signatures") + .HasForeignKey("ReportId"); + + b.OwnsOne("Inspections.Core.Domain.SignaturesAggregate.Responsable", "Responsable", b1 => + { + b1.Property("SignatureId") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b1.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b1.Property("Type") + .HasColumnType("int"); + + b1.HasKey("SignatureId"); + + b1.ToTable("Signatures"); + + b1.WithOwner() + .HasForeignKey("SignatureId"); + }); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.cs b/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.cs new file mode 100644 index 00000000..49809e0b --- /dev/null +++ b/src/Backend/Inspections.Infrastructure/Data/Migrations/20200723222032_makeChecklistitemseditables.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Inspections.Infrastructure.Data.Migrations +{ + public partial class makeChecklistitemseditables : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Editable", + schema: "Inspections", + table: "CheckListItems", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Editable", + schema: "Inspections", + table: "CheckListItems"); + } + } +} diff --git a/src/Backend/Inspections.Infrastructure/Data/Migrations/InspectionsContextModelSnapshot.cs b/src/Backend/Inspections.Infrastructure/Data/Migrations/InspectionsContextModelSnapshot.cs index c671df17..f8b7d815 100644 --- a/src/Backend/Inspections.Infrastructure/Data/Migrations/InspectionsContextModelSnapshot.cs +++ b/src/Backend/Inspections.Infrastructure/Data/Migrations/InspectionsContextModelSnapshot.cs @@ -76,6 +76,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Checked") .HasColumnType("int"); + b.Property("Editable") + .HasColumnType("bit"); + b.Property("LastEdit") .HasColumnType("datetimeoffset"); diff --git a/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/CheckListItemEntityTypeConfiguration.cs b/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/CheckListItemEntityTypeConfiguration.cs index 2ed10ce4..1ff53e12 100644 --- a/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/CheckListItemEntityTypeConfiguration.cs +++ b/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/CheckListItemEntityTypeConfiguration.cs @@ -13,6 +13,7 @@ public void Configure(EntityTypeBuilder builder) builder.Property(p => p.Id).UseIdentityColumn(); builder.Property(p => p.Text).IsRequired(); builder.Property(p => p.Checked).IsRequired(); + builder.Property(p => p.Editable).IsRequired(); builder.Property(p => p.Required).IsRequired(); builder.Property(p => p.Remarks).IsRequired(false); diff --git a/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/SignatureEntityTypeConfiguration.cs b/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/SignatureEntityTypeConfiguration.cs index 8809a294..3621ff86 100644 --- a/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/SignatureEntityTypeConfiguration.cs +++ b/src/Backend/Inspections.Infrastructure/Data/ReportsAggregateConfiguration/SignatureEntityTypeConfiguration.cs @@ -27,6 +27,7 @@ public void Configure(EntityTypeBuilder builder) }); builder.Ignore(p => p.DomainEvents); + } } diff --git a/src/ClientApp/pages/CheckLists/_id/index.vue b/src/ClientApp/pages/CheckLists/_id/index.vue index 3c85cc2e..096f518c 100644 --- a/src/ClientApp/pages/CheckLists/_id/index.vue +++ b/src/ClientApp/pages/CheckLists/_id/index.vue @@ -21,14 +21,7 @@ - - - + @@ -39,8 +32,11 @@ + + + - + Text Params @@ -56,11 +52,7 @@ v-model="currentCheckList.text" label="Checklist Name" :error-messages="errors" - > - - + /> @@ -141,14 +133,7 @@ v-model="selectedItemData.text" label="Text" :error-messages="errors" - > - - + /> @@ -159,8 +144,11 @@ + + + - + Text Params @@ -259,6 +247,7 @@ export default class AddEditCheckList extends mixins(InnerPageMixin) { checkListId: this.selectedItemData!.checkListId, text: this.selectedItemData!.text, checked: this.selectedItemData!.checked ? 1:0, + editable: this.selectedItemData!.editable, required: this.selectedItemData!.required, remarks: this.selectedItemData!.remarks }; @@ -272,6 +261,7 @@ export default class AddEditCheckList extends mixins(InnerPageMixin) { idCheckList: parseInt(this.$route.params.id), text: this.newItemData!.text, checked: this.newItemData!.checked ? 1:0, + editable: this.newItemData!.editable, required: this.newItemData!.required, remarks: this.newItemData!.remarks, checklistParams: [] diff --git a/src/ClientApp/pages/CheckLists/index.vue b/src/ClientApp/pages/CheckLists/index.vue index a7225d24..c2edfc79 100644 --- a/src/ClientApp/pages/CheckLists/index.vue +++ b/src/ClientApp/pages/CheckLists/index.vue @@ -120,9 +120,9 @@ export default class CheckListsPage extends mixins(InnerPageMixin) { dialogItems: Boolean = false filter: FilterType = { filterText: '', - inConfigurationOnly: undefined, + inConfigurationOnly: true, repotId: undefined, - reportConfigurationId: undefined + reportConfigurationId: 1 } selectedItem: CheckList = {} as CheckList @@ -192,10 +192,23 @@ export default class CheckListsPage extends mixins(InnerPageMixin) { .currentCheckList.checks } + asyncData({ query }:any) { + console.log(query) + let filter: FilterType = { + filterText: '', + inConfigurationOnly: query.configurationonly ?? true, + repotId: query.reportid ?? undefined, + reportConfigurationId: parseInt(query.configurationid) ?? undefined + } + return { + filter + } + } + async fetch () { await this.$store.dispatch('reportstrore/getReports', '', { root: true }) await this.$store.dispatch('configurations/getConfigurations', '', { root: true }) - await this.$store.dispatch('checklists/getChecklists', {}, { root: true }) + await this.$store.dispatch('checklists/getChecklists', this.filter, { root: true }) } selectItem (item: CheckList): void{ diff --git a/src/ClientApp/pages/Configurations/_id/index.vue b/src/ClientApp/pages/Configurations/_id/index.vue index 5ec95793..62704530 100644 --- a/src/ClientApp/pages/Configurations/_id/index.vue +++ b/src/ClientApp/pages/Configurations/_id/index.vue @@ -6,8 +6,9 @@ @@ -79,7 +80,7 @@ label="Include Signatures" :items="signatures" append-outer-icon="mdi-draw" - @click:append-outer="$router.push(`/signatures?${newConfig.id}`)" + @click:append-outer="$router.push(`/signatures?configurationid=${newConfig.id}&configurationonly=true`)" /> diff --git a/src/ClientApp/pages/Reports/_id/index.vue b/src/ClientApp/pages/Reports/_id/index.vue index 43303786..68a868e4 100644 --- a/src/ClientApp/pages/Reports/_id/index.vue +++ b/src/ClientApp/pages/Reports/_id/index.vue @@ -174,7 +174,16 @@ cols="12" md="7" class="text-wrap" - >{{ checkListIndex + 1 }}.{{ checkListItemIndex + 1}} .- {{ checkItem.text }} + > + + {{ checkListIndex + 1 }}.{{ checkListItemIndex + 1}} .- + + + {{ checkItem.text }} + + + + mdi-delete + + + Edit Checklist Configuration for this report + + + + Edit Signatures Configuration for this report +