From 045042f5af198894f00d3028d1848e4d84fd06c1 Mon Sep 17 00:00:00 2001 From: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:09:13 +0000 Subject: [PATCH 1/6] Merge Release 20.6 to develop (#642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tl2023-329 (#617) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces *… * Feature/tl2023 261 add assessment entry result eoj message (#622) * Added feature to remove assessment entry core and occupational specialism * Feature/tl2023 243 add assessment result (#624) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes *… * Feature/tl2023 220 (#623) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespa… * TL2023-243 (#625) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces *… * Fixed the Bug 395.396 (#628) * Fixed the defects 400,401 (#629) * added mapping (#633) * Fix dodgy merge (#636) * fixed the format issue (#637) * Implement the change assessment Result (#638) * Title not in bold (#639) * Bugs/tl2023 406 (#640) * Title not in bold * No bold * Tl2023-398 freeze (#641) * Freeze strategy * Add strategy resolver --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> Co-authored-by: Ibai Gonzalez --- ...esultsAndCertificationInternalApiClient.cs | 24 ++ ...esultsAndCertificationInternalApiClient.cs | 12 + .../Interfaces/IAdminDashboardService.cs | 15 +- .../Interfaces/ICommonService.cs | 17 +- .../Mappers/AdminDashboardMapper.cs | 1 + .../Services/AdminDashboardService.cs | 244 ++++++++++- .../Services/CommonService.cs | 12 - .../Enum/ChangeType.cs | 6 +- .../Extensions/CustomClaimTypes.cs | 7 +- .../Extensions/RolesExtensions.cs | 11 + .../Helpers/ApiConstants.cs | 5 + .../Helpers/RouteConstants.cs | 23 ++ .../Factory/IRepositoryFactory.cs | 10 + .../Factory/RepositoryFactory.cs | 22 + .../Controllers/AdminDashboardController.cs | 41 +- .../Interfaces/IAdminDashboardController.cs | 7 +- .../Startup.cs | 5 +- .../AddCoreAssessmentDetails.cs | 15 + .../AdminDashboard/AddPathwayResultRequest.cs | 13 + .../AdminDashboard/AddSpecialismDetails.cs | 15 + .../AddSpecialismResultRequest.cs | 13 + .../AdminDashboard/AdminLearnerRecord.cs | 2 + .../AdminDashboard/ChangeIPDetails.cs | 4 - .../DetailsChangeAssessmentRemove.cs | 12 + .../DetailsSpecialismAssessmentRemove.cs | 12 + .../ReviewAddCoreAssessmentRequest.cs | 15 + .../ReviewAddSpecialismAssessmentRequest.cs | 16 + .../ReviewChangeIndustryPlacementRequest.cs | 9 +- .../AdminDashboard/ReviewChangeRequest.cs | 11 +- .../ReviewChangeStartYearRequest.cs | 17 +- .../ReviewRemoveAssessmentEntryRequest.cs | 17 + .../AuthenticationExtensions.cs | 71 +--- .../FreezePeriodTokenValidatedStrategy.cs | 154 +++++++ .../Strategies/ITokenValidatedStrategy.cs | 11 + .../Strategies/TokenValidatedStrategy.cs | 89 +++++ .../TokenValidatedStrategyResolver.cs | 6 + .../AdminAddPathwayResult.Designer.cs | 279 +++++++++++++ .../AdminDashboard/AdminAddPathwayResult.resx | 192 +++++++++ ...nAddPathwayResultReviewChanges.Designer.cs | 343 ++++++++++++++++ .../AdminAddPathwayResultReviewChanges.resx | 213 ++++++++++ .../AdminAddSpecialismResult.Designer.cs | 280 +++++++++++++ .../AdminAddSpecialismResult.resx | 192 +++++++++ ...dSpecialismResultReviewChanges.Designer.cs | 334 ++++++++++++++++ ...AdminAddSpecialismResultReviewChanges.resx | 210 ++++++++++ .../AdminChangePathwayResult.Designer.cs | 298 ++++++++++++++ .../AdminChangePathwayResult.resx | 198 +++++++++ .../AdminChangeSpecialismResult.Designer.cs | 289 +++++++++++++ .../AdminChangeSpecialismResult.resx | 195 +++++++++ ...minReviewRemoveAssessmentEntry.Designer.cs | 2 +- .../AdminReviewRemoveAssessmentEntry.resx | 2 +- .../AdminDashboard/LearnerRecord.Designer.cs | 273 ++++++++----- .../ReviewChangeAssessment.Designer.cs | 18 + .../ReviewChangeAssessment.resx | 6 + .../Controllers/AccountController.cs | 13 +- .../Controllers/AdminDashboardController.cs | 378 +++++++++++++++++- .../Filters/FreezePeriodFilterAttribute.cs | 63 --- .../Loader/AdminDashboardLoader.cs | 151 ++++++- .../Interfaces/IAdminDashboardLoader.cs | 33 ++ .../Mapper/AdminDashboardMapper.cs | 207 +++++++++- .../Sfa.Tl.ResultsAndCertification.Web.csproj | 56 +++ .../Startup.cs | 24 +- .../DateValidatorAttribute.cs | 174 ++++---- .../AdminNotificationBanner.cs | 15 + .../AdminReviewSummaryItemModel.cs | 10 + .../AdminLearnerDetailsViewModel.cs | 57 --- .../Assessment/AdminCoreComponentViewModel.cs | 1 + .../AdminOccupationalSpecialismViewModel.cs | 2 + ...minReviewChangesCoreAssessmentViewModel.cs | 12 +- ...iewChangesSpecialismAssessmentViewModel.cs | 8 +- ...eviewRemoveCoreAssessmentEntryViewModel.cs | 2 +- ...emoveSpecialismAssessmentEntryViewModel.cs | 2 +- ...ReviewChangesIndustryPlacementViewModel.cs | 2 +- .../LearnerRecord/AdminAssessmentViewModel.cs | 4 + ...nAddPathwayResultReviewChangesViewModel.cs | 118 ++++++ .../Result/AdminAddPathwayResultViewModel.cs | 89 +++++ ...dSpecialismResultReviewChangesViewModel.cs | 118 ++++++ .../AdminAddSpecialismResultViewModel.cs | 88 ++++ .../AdminChangePathwayResultViewModel.cs | 89 +++++ .../AdminChangeSpecialismResultViewModel.cs | 88 ++++ .../ReviewChangeStartYearViewModel.cs | 6 +- .../AdminAddPathwayResult.cshtml | 97 +++++ .../AdminAddPathwayResultReviewChanges.cshtml | 141 +++++++ .../AdminAddSpecialismResult.cshtml | 96 +++++ ...minAddSpecialismResultReviewChanges.cshtml | 141 +++++++ .../AdminChangePathwayResult.cshtml | 104 +++++ .../AdminChangeSpecialismResult.cshtml | 100 +++++ .../AdminCoreComponentAssessmentEntry.cshtml | 12 +- ...cupationalSpecialismAssessmentEntry.cshtml | 8 +- ...minReviewChangesCoreAssessmentEntry.cshtml | 1 - ...AdminReviewChangesIndustryPlacement.cshtml | 2 +- ...iewChangesSpecialismAssessmentEntry.cshtml | 1 + ...dminReviewRemoveCoreAssessmentEntry.cshtml | 2 +- ...viewRemoveSpecialismAssessmentEntry.cshtml | 2 +- .../Partials/_assessmentResult.cshtml | 5 +- .../Partials/_coreComponent.cshtml | 2 +- .../Partials/_occupationalSpecialism.cshtml | 2 +- .../ReviewChangeStartYear.cshtml | 2 +- ...en_ProcessAdminAddPathwayResult_Called.cs} | 57 +-- ...ProcessAdminAddSpecialismResult_Called.cs} | 48 +-- .../AdminDashboardServiceBaseTest.cs | 12 +- .../ProcessAdminAddPathwayResultTestsBase.cs | 23 ++ .../When_Assessment_Doesnt_Exist.cs | 42 ++ .../When_Assessment_Exists.cs | 52 +++ ...rocessAdminAddSpecialismResultTestsBase.cs | 23 ++ .../When_Assessment_Doesnt_Exist.cs | 42 ++ .../When_Assessment_Exists.cs | 52 +++ .../AdminDashboardServiceBaseTest.cs | 165 ++++---- .../ProcessAdminAddPathwayResultTestsBase.cs | 76 ++++ .../When_Assessment_Doesnt_Exist.cs | 33 ++ .../When_Assessment_Is_From_Active_Learner.cs | 57 +++ ...en_Assessment_Is_From_Withdrawn_Learner.cs | 57 +++ ...rocessAdminAddSpecialismResultTestsBase.cs | 76 ++++ .../When_Assessment_Doesnt_Exist.cs | 33 ++ .../When_Assessment_Is_From_Active_Learner.cs | 58 +++ ...en_Assessment_Is_From_Withdrawn_Learner.cs | 58 +++ ...n_ProcessRemoveAssessmentEntry_IsCalled.cs | 146 +++++++ ...emoveSpecialismAssessmentEntry_IsCalled.cs | 144 +++++++ ...n_ProcessReviewChangeStartYear_IsCalled.cs | 86 +--- ...ProcessReviewIndustryPlacement_IsCalled.cs | 167 +++----- ...tsAndCertification.IntegrationTests.csproj | 1 + .../When_Called.cs | 37 ++ .../AdminAddPathwayResultGet/TestSetup.cs | 34 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../AdminAddPathwayResultPost/TestSetup.cs | 27 ++ .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 +++ .../TestSetup.cs | 34 ++ .../When_Cache_Empty.cs | 30 ++ .../When_Cache_Not_Empty.cs | 34 ++ .../TestSetup.cs | 26 ++ .../When_ModelState_Invalid.cs | 48 +++ .../When_ModelState_Valid.cs | 43 ++ .../When_Called.cs | 37 ++ .../AdminAddSpecialismResultGet/TestSetup.cs | 34 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../AdminAddSpecialismResultPost/TestSetup.cs | 27 ++ .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 +++ .../TestSetup.cs | 34 ++ .../When_Cache_Empty.cs | 30 ++ .../When_Cache_Not_Empty.cs | 34 ++ .../TestSetup.cs | 26 ++ .../When_ModelState_Invalid.cs | 48 +++ .../When_ModelState_Valid.cs | 43 ++ .../When_Called.cs | 37 ++ .../AdminChangePathwayResultGet/TestSetup.cs | 34 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../AdminChangePathwayResultPost/TestSetup.cs | 27 ++ .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 +++ .../TestSetup.cs | 34 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../TestSetup.cs | 27 ++ .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 +++ .../When_Failed.cs | 68 ++++ .../When_Success.cs | 66 +++ .../When_ModelState_Invalid.cs | 84 ++++ .../TestSetup.cs | 42 ++ .../When_Failed.cs | 67 ++++ .../When_Success.cs | 66 +++ .../TestSetup.cs | 18 + .../When_Failed.cs | 47 +++ .../When_ModelState_Invalid.cs | 57 +++ .../When_Success.cs | 50 +++ .../When_Called.cs | 5 +- .../Then_No_Access_Granted_To_Service.cs | 65 --- .../When_FilterAttribute_Action_Is_Called.cs | 34 -- .../Helpers/ActionResultExtensions.cs | 4 + .../AdminAddCoreAssessmentEntry/TestSetup.cs | 66 +++ .../When_Called_With_Invalid_Data.cs | 23 ++ .../When_Called_With_Valid_Data.cs | 67 ++++ .../TestSetup.cs | 64 +++ .../When_Called_With_Invalid_Data.cs | 23 ++ .../When_Called_With_Valid_Data.cs | 64 +++ .../AdminDashboardLoaderTestsBase.cs | 199 ++++++++- .../When_Called_With_Invalid_Data.cs | 47 +++ .../When_Called_With_Valid_Data.cs | 101 +++++ .../When_Called_With_Invalid_Data.cs | 47 +++ .../When_Called_With_Valid_Data.cs | 102 +++++ .../When_Called_With_Valid_Data.cs | 6 +- .../When_Called_With_Invalid_Data.cs | 39 ++ .../When_Called_With_Valid_Data.cs | 98 +++++ .../When_Called.cs | 49 +++ .../When_Called.cs | 49 +++ .../When_Called_With_Invalid_Data.cs | 34 ++ .../When_Called_With_Valid_Data.cs | 49 +++ .../When_Called_With_Invalid_Data.cs | 34 ++ .../When_Called_With_Valid_Data.cs | 49 +++ .../DateValidatorAttributeTests.cs | 87 ++++ .../DateValidatorAttributeBaseTests.cs | 32 -- ...When_Validation_Date_Greater_Than_Today.cs | 32 -- .../When_Validation_IsTriggered.cs | 33 -- .../When_Validation_With_Invalid_Date.cs | 32 -- 202 files changed, 10822 insertions(+), 1090 deletions(-) create mode 100644 src/Sfa.Tl.ResultsAndCertification.Data/Factory/IRepositoryFactory.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Data/Factory/RepositoryFactory.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsChangeAssessmentRemove.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsSpecialismAssessmentRemove.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/FreezePeriodTokenValidatedStrategy.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/ITokenValidatedStrategy.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategy.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategyResolver.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.resx delete mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Filters/FreezePeriodFilterAttribute.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/NotificationBanner/AdminNotificationBanner.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/Summary/SummaryItem/AdminReviewSummaryItemModel.cs delete mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/AdminLearnerDetailsViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResult.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResultReviewChanges.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResult.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResultReviewChanges.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml rename src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/{When_GetAdminChangeStartYear_Called.cs => When_ProcessAdminAddPathwayResult_Called.cs} (50%) rename src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/{When_GetAdminChangeIndustryPlacement_Called.cs => When_ProcessAdminAddSpecialismResult_Called.cs} (53%) create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/ProcessAdminAddSpecialismResultTestsBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Active_Learner.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/ProcessAdminAddSpecialismResultTestsBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Valid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Valid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Failed.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Success.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeIndustryPlacementPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Failed.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Success.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Failed.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Success.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/Then_No_Access_Granted_To_Service.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/When_FilterAttribute_Action_Is_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddPathwayResultGrades/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddSpecialismResultGrades/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/DateValidatorAttributeBaseTests.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_Date_Greater_Than_Today.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_IsTriggered.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_With_Invalid_Date.cs diff --git a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs index 027ba645a..7142e966d 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs @@ -466,6 +466,30 @@ public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustry return await PostAsync(ApiConstants.ProcessChangeIPUri, request); } + public async Task ProcessAddCoreAssessmentRequestAsync(ReviewAddCoreAssessmentRequest request) + { + return await PostAsync(ApiConstants.ProcessAddCoreAssessmentUri, request); + } + + public async Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request) + { + return await PostAsync(ApiConstants.ProcessAddSpecialismAssessmentUri, request); + } + public async Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request) + { + return await PostAsync(ApiConstants.ReviewRemoveAssessmentEntryUri, request); + } + + public async Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request) + { + return await PostAsync(ApiConstants.ReviewRemoveAssessmentEntryUri, request); + } + + public Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request) + => PostAsync(ApiConstants.ProcessAdminAddPathwayResult, request); + + public Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request) + => PostAsync(ApiConstants.ProcessAdminAddSpecialismResult, request); #endregion diff --git a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs index db82431a3..614b3c573 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs @@ -128,6 +128,18 @@ public interface IResultsAndCertificationInternalApiClient Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request); + Task ProcessAddCoreAssessmentRequestAsync(ReviewAddCoreAssessmentRequest request); + + Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request); + + Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + + Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + + Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request); + + Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request); + #endregion } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs index 5b08da9da..533d16de6 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs @@ -7,12 +7,21 @@ namespace Sfa.Tl.ResultsAndCertification.Application.Interfaces public interface IAdminDashboardService { Task GetAdminSearchLearnerFiltersAsync(); - Task> GetAdminSearchLearnerDetailsAsync(AdminSearchLearnerRequest request); - Task GetAdminLearnerRecordAsync(int registrationPathwayId); - Task ProcessChangeStartYearAsync(ReviewChangeStartYearRequest request); + Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request); + Task ProcessAddCoreAssessmentAsync(ReviewAddCoreAssessmentRequest request); + Task ProcessAddSpecialismAssessmentAsync(ReviewAddSpecialismAssessmentRequest request); + + + Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + + Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + + Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request); + + Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/ICommonService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/ICommonService.cs index cd2d6a24d..e2c444e68 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/ICommonService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/ICommonService.cs @@ -1,5 +1,4 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; -using DomainModel = Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; using System; @@ -11,24 +10,22 @@ namespace Sfa.Tl.ResultsAndCertification.Application.Interfaces public interface ICommonService { Task> GetLookupDataAsync(LookupCategory lookupCategory); - + Task GetLoggedInUserTypeInfoAsync(long ukprn); // FunctionLog Task CreateFunctionLog(FunctionLogDetails model); - + Task UpdateFunctionLog(FunctionLogDetails model); Task SendFunctionJobFailedNotification(string jobName, string errorMessage); - + Task> GetCurrentAcademicYearsAsync(); - + Task> GetAcademicYearsAsync(); - + bool IsIndustryPlacementTriggerDateValid(); - - DateTime CurrentDate { get; } - Task AddChangelog(DomainModel.ChangeLog changeLog); + DateTime CurrentDate { get; } } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/AdminDashboardMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/AdminDashboardMapper.cs index 7c8439643..38cd1989b 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/AdminDashboardMapper.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/AdminDashboardMapper.cs @@ -20,6 +20,7 @@ public AdminDashboardLearnerMapper() .ForMember(d => d.DateofBirth, opts => opts.MapFrom(s => s.TqRegistrationProfile.DateofBirth)) .ForMember(d => d.MathsStatus, opts => opts.MapFrom(s => s.TqRegistrationProfile.MathsStatus)) .ForMember(d => d.EnglishStatus, opts => opts.MapFrom(s => s.TqRegistrationProfile.EnglishStatus)) + .ForMember(d => d.IsPendingWithdrawl, opts => opts.MapFrom(s => s.IsPendingWithdrawal)) .ForMember(d => d.Pathway, opts => opts.MapFrom(s => s)) .ForMember(d => d.AwardingOrganisation, opts => opts.MapFrom(s => s.TqProvider.TqAwardingOrganisation.TlAwardingOrganisaton)) .ForMember(d => d.OverallCalculationStatus, opts => opts.MapFrom(s => GetOverallCalculationStatus(s.OverallResults))); diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs index 06b2d306e..28cd85dda 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs @@ -1,8 +1,10 @@ using AutoMapper; using Newtonsoft.Json; using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Data.Factory; using Sfa.Tl.ResultsAndCertification.Data.Interfaces; using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; @@ -10,6 +12,7 @@ using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Application.Services @@ -17,25 +20,19 @@ namespace Sfa.Tl.ResultsAndCertification.Application.Services public class AdminDashboardService : IAdminDashboardService { private readonly IAdminDashboardRepository _adminDashboardRepository; - private readonly IRepository _tqRegistrationPathwayRepository; - private readonly IRepository _industryPlacementRepository; + private readonly IRepositoryFactory _repositoryFactory; private readonly ISystemProvider _systemProvider; - private readonly ICommonService _commonService; private readonly IMapper _mapper; public AdminDashboardService( IAdminDashboardRepository adminDashboardRepository, - IRepository tqRegistrationPathwayRepository, - IRepository industryPlacementRepository, + IRepositoryFactory repositoryFactory, ISystemProvider systemProvider, - ICommonService commonService, IMapper mapper) { _adminDashboardRepository = adminDashboardRepository; - _tqRegistrationPathwayRepository = tqRegistrationPathwayRepository; - _industryPlacementRepository = industryPlacementRepository; + _repositoryFactory = repositoryFactory; _systemProvider = systemProvider; - _commonService = commonService; _mapper = mapper; } @@ -61,20 +58,107 @@ public async Task GetAdminLearnerRecordAsync(int registratio public async Task ProcessChangeStartYearAsync(ReviewChangeStartYearRequest request) { - var pathway = await _tqRegistrationPathwayRepository.GetFirstOrDefaultAsync(p => p.Id == request.RegistrationPathwayId); + var tqRegistrationPathwayRepository = _repositoryFactory.GetRepository(); + + var pathway = await tqRegistrationPathwayRepository.GetFirstOrDefaultAsync(p => p.Id == request.RegistrationPathwayId); if (pathway == null) return false; pathway.AcademicYear = request.ChangeStartYearDetails.StartYearTo; - var status = await _tqRegistrationPathwayRepository.UpdateWithSpecifedColumnsOnlyAsync(pathway, u => u.AcademicYear, u => u.ModifiedBy, u => u.ModifiedOn); + bool updated = await tqRegistrationPathwayRepository.UpdateWithSpecifedColumnsOnlyAsync(pathway, u => u.AcademicYear, u => u.ModifiedBy, u => u.ModifiedOn) > 0; + + if (updated) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + var changeLog = CreateChangeLog(request, request.ChangeStartYearDetails); + + return await changeLongRepository.CreateAsync(changeLog) > 0; + } + + return false; + } + + + public async Task ProcessAddCoreAssessmentAsync(ReviewAddCoreAssessmentRequest request) + { + var tqRegistrationPathwayRepository = _repositoryFactory.GetRepository(); + var pathway = await tqRegistrationPathwayRepository.GetFirstOrDefaultAsync(p => p.Id == request.RegistrationPathwayId); + if (pathway == null) return false; + var tqAssessmentSeriesRepository = _repositoryFactory.GetRepository(); + var assessmentSeries = await tqAssessmentSeriesRepository.GetFirstOrDefaultAsync(a => a.Name == request.AddCoreAssessmentDetails.CoreAssessmentTo && a.ComponentType == ComponentType.Core); + + int status; + DateTime utcNow = _systemProvider.UtcNow; + var pathwayAssessment = new TqPathwayAssessment + { + CreatedBy = request.CreatedBy, + TqRegistrationPathwayId = request.RegistrationPathwayId, + AssessmentSeriesId = assessmentSeries.Id, + IsOptedin = true, + EndDate = pathway.Status == RegistrationPathwayStatus.Withdrawn ? utcNow : null, + StartDate = utcNow + }; + + var tqPathwayAssesmentRepository = _repositoryFactory.GetRepository(); + status = await tqPathwayAssesmentRepository.CreateAsync(pathwayAssessment); if (status > 0) - return await _commonService.AddChangelog(CreateChangeLogRequest(request, JsonConvert.SerializeObject((request.ChangeStartYearDetails)))); + { + + var changeLongRepository = _repositoryFactory.GetRepository(); + var changeLog = CreateChangeLog(request, request.AddCoreAssessmentDetails); + + return await changeLongRepository.CreateAsync(changeLog) > 0; + } + return false; + } + public async Task ProcessAddSpecialismAssessmentAsync(ReviewAddSpecialismAssessmentRequest request) + { + var tqRegistrationPathwayRepository = _repositoryFactory.GetRepository(); + var pathway = await tqRegistrationPathwayRepository.GetFirstOrDefaultAsync(p => p.Id == request.RegistrationPathwayId); + if (pathway == null) return false; + var tqAssessmentSeriesRepository = _repositoryFactory.GetRepository(); + var assessmentSeries = await tqAssessmentSeriesRepository.GetFirstOrDefaultAsync(a => a.Name == request.AddSpecialismDetails.SpecialismAssessmentTo && a.ComponentType == ComponentType.Specialism); + + int status; + DateTime utcNow = _systemProvider.UtcNow; + + var specialismAssessment = new TqSpecialismAssessment + { + CreatedBy = request.CreatedBy, + TqRegistrationSpecialismId = request.SpecialismId, + AssessmentSeriesId = assessmentSeries.Id, + IsOptedin = true, + EndDate = pathway.Status == RegistrationPathwayStatus.Withdrawn ? utcNow : null, + StartDate = utcNow + }; + + var tqPathwaySpecialismAssesmentRepository = _repositoryFactory.GetRepository(); + status = await tqPathwaySpecialismAssesmentRepository.CreateAsync(specialismAssessment); + + if (status > 0) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + var changeLog = CreateChangeLog(request, request.AddSpecialismDetails); + + return await changeLongRepository.CreateAsync(changeLog) > 0; + } + + return false; + + } + + + + + public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request) { - var industryPlacement = await _industryPlacementRepository.GetFirstOrDefaultAsync(p => p.TqRegistrationPathwayId == request.RegistrationPathwayId); + var industryPlacementRepository = _repositoryFactory.GetRepository(); + + var industryPlacement = await industryPlacementRepository.GetFirstOrDefaultAsync(p => p.TqRegistrationPathwayId == request.RegistrationPathwayId); int status; if (industryPlacement == null) @@ -87,7 +171,7 @@ public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustry Details = request.ChangeIPDetails.IndustryPlacementStatusTo == Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration ? JsonConvert.SerializeObject(ConstructIndustryPlacementDetails(request.ChangeIPDetails)) : null }; - status = await _industryPlacementRepository.CreateAsync(industryPlacement); + status = await industryPlacementRepository.CreateAsync(industryPlacement); } else { @@ -96,18 +180,140 @@ public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustry industryPlacement.Status = request.ChangeIPDetails.IndustryPlacementStatusTo; industryPlacement.Details = request.ChangeIPDetails.IndustryPlacementStatusTo == Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration ? JsonConvert.SerializeObject(ConstructIndustryPlacementDetails(request.ChangeIPDetails)) : null; - status = await _industryPlacementRepository.UpdateWithSpecifedColumnsOnlyAsync(industryPlacement, u => u.Status, u => u.Details, u => u.ModifiedBy, u => u.ModifiedOn); + status = await industryPlacementRepository.UpdateWithSpecifedColumnsOnlyAsync(industryPlacement, u => u.Status, u => u.Details, u => u.ModifiedBy, u => u.ModifiedOn); } if (status > 0) { - return await _commonService.AddChangelog(CreateChangeLogRequest(request, JsonConvert.SerializeObject(request.ChangeIPDetails))); + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, request.ChangeIPDetails)) > 0; + } + + return false; + } + + public async Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) + { + var pathwayAssessmentRepository = _repositoryFactory.GetRepository(); + + var pathwayAssessment = await pathwayAssessmentRepository.GetFirstOrDefaultAsync(pa => pa.Id == model.AssessmentId && pa.IsOptedin + && !pa.TqPathwayResults.Any(x => x.IsOptedin && x.EndDate == null)); + if (pathwayAssessment == null) return false; + + DateTime utcNow = _systemProvider.UtcNow; + + pathwayAssessment.IsOptedin = false; + pathwayAssessment.EndDate = utcNow; + pathwayAssessment.ModifiedOn = utcNow; + pathwayAssessment.ModifiedBy = model.CreatedBy; + + var isSuccess = await pathwayAssessmentRepository.UpdateAsync(pathwayAssessment) > 0; + + if (isSuccess) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(model, model.ChangeAssessmentDetails)) > 0; + } + + return false; + } + + public async Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) + { + var specialismAssessmentRepository = _repositoryFactory.GetRepository(); + + var specialismAssessment = await specialismAssessmentRepository.GetFirstOrDefaultAsync(sa => sa.Id == model.AssessmentId && sa.IsOptedin); + if (specialismAssessment == null) return false; + + DateTime utcNow = _systemProvider.UtcNow; + + specialismAssessment.IsOptedin = false; + specialismAssessment.EndDate = utcNow; + specialismAssessment.ModifiedOn = utcNow; + specialismAssessment.ModifiedBy = model.CreatedBy; + + var isSuccess = await specialismAssessmentRepository.UpdateAsync(specialismAssessment) > 0; + + if (isSuccess) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(model, model.ChangeSpecialismAssessmentDetails)) > 0; + } + + return false; + } + + public async Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request) + { + var pathwayAssessmentRepo = _repositoryFactory.GetRepository(); + + TqPathwayAssessment pathwayAssessment = await pathwayAssessmentRepo.GetSingleOrDefaultAsync(p => p.Id == request.PathwayAssessmentId); + if (pathwayAssessment == null) + { + return false; + } + + var pathwayResultRepo = _repositoryFactory.GetRepository(); + DateTime utcNow = _systemProvider.UtcNow; + + var pathwayResult = new TqPathwayResult + { + TqPathwayAssessmentId = request.PathwayAssessmentId, + TlLookupId = request.SelectedGradeId, + IsOptedin = true, + StartDate = utcNow, + EndDate = pathwayAssessment.EndDate.HasValue ? utcNow : null, + IsBulkUpload = false, + CreatedBy = request.CreatedBy + }; + + bool created = await pathwayResultRepo.CreateAsync(pathwayResult) > 0; + + if (created) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, new { PathwayResultId = pathwayResult.Id })) > 0; + } + + return false; + } + + public async Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request) + { + var specialismAssessmentRepo = _repositoryFactory.GetRepository(); + + TqSpecialismAssessment specialismAssessment = await specialismAssessmentRepo.GetSingleOrDefaultAsync(p => p.Id == request.SpecialismAssessmentId); + if (specialismAssessment == null) + { + return false; + } + + var specialismResultRepo = _repositoryFactory.GetRepository(); + DateTime utcNow = _systemProvider.UtcNow; + + var specialismResult = new TqSpecialismResult + { + TqSpecialismAssessmentId = request.SpecialismAssessmentId, + TlLookupId = request.SelectedGradeId, + IsOptedin = true, + StartDate = utcNow, + EndDate = specialismAssessment.EndDate.HasValue ? utcNow : null, + IsBulkUpload = false, + CreatedBy = request.CreatedBy + }; + + bool created = await specialismResultRepo.CreateAsync(specialismResult) > 0; + + if (created) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, new { SpecialismResultId = specialismResult.Id })) > 0; } return false; } - private ChangeLog CreateChangeLogRequest(ReviewChangeRequest request, string details) + private ChangeLog CreateChangeLog(ReviewChangeRequest request, object details) { const string SystemUser = "System"; @@ -115,8 +321,8 @@ private ChangeLog CreateChangeLogRequest(ReviewChangeRequest request, string det { ChangeType = (int)request.ChangeType, ReasonForChange = request.ChangeReason, - DateOfRequest = Convert.ToDateTime(request.RequestDate), - Details = details, + DateOfRequest = request.RequestDate, + Details = JsonConvert.SerializeObject(details), ZendeskTicketID = request.ZendeskId, Name = request.ContactName, TqRegistrationPathwayId = request.RegistrationPathwayId, diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Services/CommonService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Services/CommonService.cs index 150b4d951..c2d2c1327 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Services/CommonService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Services/CommonService.cs @@ -23,7 +23,6 @@ public class CommonService : ICommonService private readonly IMapper _mapper; private readonly IRepository _tlLookupRepository; private readonly IRepository _functionLogRepository; - private readonly IRepository _changeLogRepository; private readonly ICommonRepository _commonRepository; private readonly INotificationService _notificationService; private readonly ResultsAndCertificationConfiguration _configuration; @@ -44,7 +43,6 @@ public CommonService(ILogger logger, IMapper mapper, _commonRepository = commonRepository; _notificationService = notificationService; _configuration = configuration; - _changeLogRepository = changeLogRepository; } public async Task> GetLookupDataAsync(LookupCategory lookupCategory) @@ -137,15 +135,5 @@ public bool IsIndustryPlacementTriggerDateValid() { return await _commonRepository.GetAcademicYearsAsync(); } - - public async Task AddChangelog(ChangeLog model) - { - if (model != null) - { - return await _changeLogRepository.CreateAsync(model) > 0; - } - return false; - } - } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs index b8e5a7b83..9d1fc3689 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs @@ -3,6 +3,10 @@ public enum ChangeType { StartYear = 1, - IndustryPlacement = 2 + IndustryPlacement = 2, + AssessmentEntryAdd = 3, + AssessmentEntryRemove = 4, + AddPathwayResult = 5, + AddSpecialismResult = 6 } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/CustomClaimTypes.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/CustomClaimTypes.cs index 77462e38b..9aef80d3d 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/CustomClaimTypes.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/CustomClaimTypes.cs @@ -35,6 +35,11 @@ public static class CustomClaimTypes /// /// The user type /// - public const string LoginUserType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/loginusertype"; + public const string LoginUserType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/loginusertype"; + + /// + /// The in freeze period + /// + public const string InFreezePeriod = "http://schemas.microsoft.com/ws/2008/06/identity/claims/infreezeperiod"; } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/RolesExtensions.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/RolesExtensions.cs index b3bf8b504..d6058e140 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/RolesExtensions.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Extensions/RolesExtensions.cs @@ -48,6 +48,17 @@ public static bool HasAccessToService(this ClaimsPrincipal user) return false; } + public static bool IsInFreezePeriod(this ClaimsPrincipal user) + { + var hasAccess = user.Claims.SingleOrDefault(c => c.Type == CustomClaimTypes.InFreezePeriod)?.Value; + + if (bool.TryParse(hasAccess, out var result)) + { + return result; + } + return false; + } + public static bool HasSiteAdministratorRole(this ClaimsPrincipal user) { return user.IsInRole(SiteAdministrator); diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs index e03b9ec5b..a017d3742 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs @@ -128,6 +128,11 @@ public static class ApiConstants public const string GetAdminLearnerRecordUri = "/api/admindashboard/GetAdminLearnerRecord/{0}"; public const string ProcessChangeStartYearUri = "/api/admindashboard/ProcessChangeStartYear"; public const string ProcessChangeIPUri = "/api/admindashboard/ProcessChangeIndustryPlacement"; + public const string ProcessAddCoreAssessmentUri = "/api/admindashboard/ProcessAddCoreAssessmentRequest"; + public const string ProcessAddSpecialismAssessmentUri = "/api/admindashboard/ProcessAddSpecialismAssessmentRequest"; + public const string ReviewRemoveAssessmentEntryUri = "/api/admindashboard/ReviewRemoveAssessmentEntry"; + public const string ProcessAdminAddPathwayResult = "/api/admindashboard/ProcessAdminAddPathwayResult"; + public const string ProcessAdminAddSpecialismResult = "/api/admindashboard/ProcessAdminAddSpecialismResult"; } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs index 0592f4a7e..f746bd411 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs @@ -441,6 +441,29 @@ public static class RouteConstants public const string SubmitReviewRemoveCoreAssessmentEntry = "SubmitReviewRemoveCoreAssessmentEntry"; public const string AdminReviewRemoveSpecialismAssessmentEntry = "AdminReviewRemoveSpecialismAssessmentEntry"; public const string SubmitReviewRemoveSpecialismAssessmentEntry = "SubmitReviewRemoveSpecialismAssessmentEntry"; + public const string AdminAddPathwayResultClear = "AdminAddPathwayResultClear"; + public const string AdminAddPathwayResult = "AdminAddPathwayResult"; + public const string SubmitAdminAddPathwayResult = "SubmitAdminAddPathwayResult"; + public const string AdminAddPathwayResultReviewChanges = "AdminAddPathwayResultReviewChanges"; + public const string SubmitAdminAddPathwayResultReviewChanges = "SubmitAdminAddPathwayResultReviewChanges"; + public const string AdminAddSpecialismResultClear = "AdminAddSpecialismResultClear"; + public const string AdminAddSpecialismResult = "AdminAddSpecialismResult"; + public const string SubmitAdminAddSpecialismResult = "SubmitAdminAddSpecialismResult"; + public const string AdminAddSpecialismResultReviewChanges = "AdminAddSpecialismResultReviewChanges"; + public const string SubmitAdminAddSpecialismResultReviewChanges = "SubmitAdminAddSpecialismResultReviewChanges"; + + public const string AdminCoreComponentAssessmentEntryClear = "AdminCoreComponentAssessmentEntryClear"; + public const string AdminOccupationalSpecialisAssessmentEntryClear = "AdminOccupationalSpecialisAssessmentEntryClear"; + + public const string AdminChangePathwayResult = "AdminChangePathwayResult"; + public const string AdminChangePathwayResultClear = "AdminChangePathwayResultClear"; + public const string SubmitAdminChangePathwayResult = "SubmitAdminChangePathwayResult"; + public const string AdminChangeSpecialismResult = "AdminChangeSpecialismResult"; + public const string AdminChangeSpecialismResultClear = "AdminChangeSpecialismResultClear"; + public const string SubmitAdminChangeSpecialismResult = "SubmitAdminChangeSpecialismResult"; + public const string AdminChangeSpecialismResultReviewChanges = "AdminChangeSpecialismResultReviewChanges"; + public const string AdminChangePathwayResultReviewChanges = "AdminAddPathwayResultReviewChanges"; + #endregion } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Data/Factory/IRepositoryFactory.cs b/src/Sfa.Tl.ResultsAndCertification.Data/Factory/IRepositoryFactory.cs new file mode 100644 index 000000000..3c4e0762a --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Data/Factory/IRepositoryFactory.cs @@ -0,0 +1,10 @@ +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; + +namespace Sfa.Tl.ResultsAndCertification.Data.Factory +{ + public interface IRepositoryFactory + { + IRepository GetRepository() where T : BaseEntity, new(); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Data/Factory/RepositoryFactory.cs b/src/Sfa.Tl.ResultsAndCertification.Data/Factory/RepositoryFactory.cs new file mode 100644 index 000000000..a77d8c192 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Data/Factory/RepositoryFactory.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.Logging; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Data.Repositories; +using Sfa.Tl.ResultsAndCertification.Domain.Models; + +namespace Sfa.Tl.ResultsAndCertification.Data.Factory +{ + public class RepositoryFactory : IRepositoryFactory + { + private readonly ILoggerFactory _loggerFactory; + private readonly ResultsAndCertificationDbContext _dbContext; + + public RepositoryFactory(ILoggerFactory loggerFactory, ResultsAndCertificationDbContext dbContext) + { + _loggerFactory = loggerFactory; + _dbContext = dbContext; + } + + public IRepository GetRepository() where T : BaseEntity, new() + => new GenericRepository(_loggerFactory.CreateLogger>(), _dbContext); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs index c2c1729da..d928c4f78 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs @@ -1,11 +1,9 @@ using Microsoft.AspNetCore.Mvc; using Sfa.Tl.ResultsAndCertification.Application.Interfaces; -using Sfa.Tl.ResultsAndCertification.Application.Services; -using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.InternalApi.Interfaces; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.InternalApi.Controllers @@ -57,6 +55,41 @@ public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustry return await _adminDashboardService.ProcessChangeIndustryPlacementAsync(request); } - } + [HttpPost] + [Route("ProcessAddCoreAssessmentRequest")] + public async Task ProcessAddCoreAssessmentRequestAsync(ReviewAddCoreAssessmentRequest request) + { + return await _adminDashboardService.ProcessAddCoreAssessmentAsync(request); + } + + [HttpPost] + [Route("ProcessAddSpecialismAssessmentRequest")] + public async Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request) + { + return await _adminDashboardService.ProcessAddSpecialismAssessmentAsync(request); + } + [HttpPost] + [Route("ReviewRemoveAssessmentEntry")] + public async Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) + { + return model.ComponentType switch + { + ComponentType.Core => await _adminDashboardService.ProcessRemovePathwayAssessmentEntryAsync(model), + ComponentType.Specialism => await _adminDashboardService.ProcessRemoveSpecialismAssessmentEntryAsync(model), + ComponentType.NotSpecified => false, + _ => false + }; + } + + [HttpPost] + [Route("ProcessAdminAddPathwayResult")] + public Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request) + => _adminDashboardService.ProcessAdminAddPathwayResultAsync(request); + + [HttpPost] + [Route("ProcessAdminAddSpecialismResult")] + public Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request) + => _adminDashboardService.ProcessAdminAddSpecialismResultAsync(request); + } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs index 792dec937..9840f6ed1 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs @@ -6,10 +6,13 @@ namespace Sfa.Tl.ResultsAndCertification.InternalApi.Interfaces public interface IAdminDashboardController { Task GetAdminSearchLearnerFiltersAsync(); - Task GetAdminLearnerRecordAsync(int registrationPathwayId); - Task ProcessChangeStartYearAsync(ReviewChangeStartYearRequest request); + Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request); + Task ProcessAddCoreAssessmentRequestAsync(ReviewAddCoreAssessmentRequest request); + Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request); + + Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs index dd5c3364c..48648859e 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs @@ -28,6 +28,7 @@ using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; using Sfa.Tl.ResultsAndCertification.Data; using Sfa.Tl.ResultsAndCertification.Data.Builder; +using Sfa.Tl.ResultsAndCertification.Data.Factory; using Sfa.Tl.ResultsAndCertification.Data.Interfaces; using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.InternalApi.Extensions; @@ -125,7 +126,8 @@ private void RegisterDependencies(IServiceCollection services) services.AddAutoMapper(typeof(Startup).Assembly.GetReferencedAssemblies().Where(a => a.FullName.Contains("Sfa.Tl.ResultsAndCertification.Application")).Select(Assembly.Load)); RegisterApplicationServices(services); - ValidatorOptions.Global.DisplayNameResolver = (type, memberInfo, expression) => { + ValidatorOptions.Global.DisplayNameResolver = (type, memberInfo, expression) => + { return memberInfo.GetCustomAttribute()?.GetName(); }; } @@ -154,6 +156,7 @@ private void RegisterApplicationServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); // Bulk Registrations services.AddTransient, RegistrationParser>(); diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs new file mode 100644 index 000000000..5a2d32501 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class AddCoreAssessmentDetails + { + public string CoreAssessmentFrom { get; set; } + public string CoreAssessmentTo { get; set; } + public int AssessmentSeriesId { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs new file mode 100644 index 000000000..eb0d891d4 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs @@ -0,0 +1,13 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class AddPathwayResultRequest : ReviewChangeRequest + { + public int PathwayAssessmentId { get; set; } + + public int SelectedGradeId { get; set; } + + public override ChangeType ChangeType => ChangeType.AddPathwayResult; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs new file mode 100644 index 000000000..b9be828f6 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class AddSpecialismDetails + { + public string SpecialismAssessmentFrom { get;set; } + public string SpecialismAssessmentTo { get; set; } + public int AssessmentSeriesId { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs new file mode 100644 index 000000000..fa608a7de --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs @@ -0,0 +1,13 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class AddSpecialismResultRequest : ReviewChangeRequest + { + public int SpecialismAssessmentId { get; set; } + + public int SelectedGradeId { get; set; } + + public override ChangeType ChangeType => ChangeType.AddSpecialismResult; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AdminLearnerRecord.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AdminLearnerRecord.cs index d240cb52d..5a716326d 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AdminLearnerRecord.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AdminLearnerRecord.cs @@ -19,6 +19,8 @@ public class AdminLearnerRecord public bool IsRegistered => Pathway != null && Pathway.Status == RegistrationPathwayStatus.Active || Pathway.Status == RegistrationPathwayStatus.Withdrawn; + public bool IsPendingWithdrawl { get; set; } + public SubjectStatus? MathsStatus { get; set; } public SubjectStatus? EnglishStatus { get; set; } diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs index 31db63508..0ed9ec8c9 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs @@ -1,9 +1,5 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsChangeAssessmentRemove.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsChangeAssessmentRemove.cs new file mode 100644 index 000000000..d3524c037 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsChangeAssessmentRemove.cs @@ -0,0 +1,12 @@ +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class DetailsChangeAssessmentRemove + { + public string PathwayName { get; set; } + + public string From { get; set; } + + public string To { get; set; } + + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsSpecialismAssessmentRemove.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsSpecialismAssessmentRemove.cs new file mode 100644 index 000000000..00d186702 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/DetailsSpecialismAssessmentRemove.cs @@ -0,0 +1,12 @@ +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class DetailsSpecialismAssessmentRemove + { + public string SpecialismName { get; set; } + + public string From { get; set; } + + public string To { get; set; } + + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs new file mode 100644 index 000000000..d5d4a4f33 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs @@ -0,0 +1,15 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ReviewAddCoreAssessmentRequest: ReviewChangeRequest + { + public AddCoreAssessmentDetails AddCoreAssessmentDetails { get; set; } + public override ChangeType ChangeType => ChangeType.AssessmentEntryAdd; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs new file mode 100644 index 000000000..12f8aa02a --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs @@ -0,0 +1,16 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ReviewAddSpecialismAssessmentRequest:ReviewChangeRequest + { + public AddSpecialismDetails AddSpecialismDetails { get; set; } + public override ChangeType ChangeType => ChangeType.AssessmentEntryAdd; + public int SpecialismId { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs index 55ca6b38a..896afd8aa 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs @@ -1,15 +1,10 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class ReviewChangeIndustryPlacementRequest : ReviewChangeRequest { public ChangeIPDetails ChangeIPDetails { get; set; } - public override ChangeType ChangeType { get; set; } = ChangeType.IndustryPlacement; + public override ChangeType ChangeType => ChangeType.IndustryPlacement; } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeRequest.cs index 743652237..4160fd5a7 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeRequest.cs @@ -1,9 +1,5 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { @@ -11,12 +7,11 @@ public abstract class ReviewChangeRequest { public int RegistrationPathwayId { get; set; } public string ContactName { get; set; } - public string RequestDate { get; set; } + public DateTime RequestDate { get; set; } public string ChangeReason { get; set; } public string ZendeskId { get; set; } public string CreatedBy { get; set; } - public string Details { get; set; } - public abstract ChangeType ChangeType { get; set; } + public abstract ChangeType ChangeType { get; } } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeStartYearRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeStartYearRequest.cs index 9619c9f64..e56a7ce5c 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeStartYearRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeStartYearRequest.cs @@ -1,18 +1,11 @@ -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Sfa.Tl.ResultsAndCertification.Common.Enum; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Sfa.Tl.ResultsAndCertification.Common.Enum; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { - public class ReviewChangeStartYearRequest :ReviewChangeRequest + public class ReviewChangeStartYearRequest : ReviewChangeRequest { - public ChangeStartYearDetails ChangeStartYearDetails { get; set; } + public ChangeStartYearDetails ChangeStartYearDetails { get; set; } - public override ChangeType ChangeType { get; set; } = ChangeType.StartYear; + public override ChangeType ChangeType => ChangeType.StartYear; } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs new file mode 100644 index 000000000..3bf6ce9be --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs @@ -0,0 +1,17 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ReviewRemoveAssessmentEntryRequest : ReviewChangeRequest + { + public int AssessmentId { get; set; } + + public DetailsChangeAssessmentRemove ChangeAssessmentDetails { get; set; } + + public DetailsSpecialismAssessmentRemove ChangeSpecialismAssessmentDetails { get; set; } + + public ComponentType ComponentType { get; set; } + + public override ChangeType ChangeType => ChangeType.AssessmentEntryRemove; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/AuthenticationExtensions.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/AuthenticationExtensions.cs index 06a6df089..9c59b9184 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/AuthenticationExtensions.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/AuthenticationExtensions.cs @@ -5,19 +5,12 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Protocols.OpenIdConnect; -using Microsoft.IdentityModel.Tokens; -using Newtonsoft.Json.Linq; -using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; -using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Models.Configuration; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; using Sfa.Tl.ResultsAndCertification.Web.Authentication.Local; +using Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies; using System; using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; -using System.Linq; -using System.Security.Claims; using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Web.Authentication @@ -145,66 +138,20 @@ public static IServiceCollection AddWebAuthentication(this IServiceCollection se // that event is called after the OIDC middleware received the authorisation code, // redeemed it for an access token and a refresh token, // and validated the identity token - OnTokenValidated = async ctx => + OnTokenValidated = context => { - var claims = new List(); - var organisation = JObject.Parse(ctx.Principal.FindFirst("Organisation").Value); + var resolver = context.GetService(); + ITokenValidatedStrategy strategy = resolver(config.FreezePeriodStartDate, config.FreezePeriodEndDate); - if (organisation.HasValues) - { - var organisationId = organisation.SelectToken("id").ToString(); - var userId = ctx.Principal.FindFirst("sub").Value; - - var dfeSignInApiClient = ctx.HttpContext.RequestServices.GetService(); - var userInfo = await dfeSignInApiClient.GetDfeSignInUserInfo(organisationId, userId); - - if (userInfo.HasAccessToService) - { - var internalApiClient = ctx.HttpContext.RequestServices.GetService(); - - var loggedInUserTypeResponse = !userInfo.Ukprn.HasValue ? new LoggedInUserTypeInfo { UserType = LoginUserType.Admin } : userInfo.Ukprn.Value == 1 - ? new LoggedInUserTypeInfo { Ukprn = userInfo.Ukprn.Value, UserType = LoginUserType.AwardingOrganisation } - : await internalApiClient.GetLoggedInUserTypeInfoAsync(userInfo.Ukprn.Value); - - if (loggedInUserTypeResponse != null && loggedInUserTypeResponse.UserType != LoginUserType.NotSpecified) - { - claims.AddRange(new List - { - new Claim(CustomClaimTypes.UserId, userId), - new Claim(CustomClaimTypes.OrganisationId, organisationId), - new Claim(CustomClaimTypes.Ukprn, userInfo.Ukprn.HasValue ? userInfo.Ukprn.Value.ToString() : string.Empty), - new Claim(ClaimTypes.GivenName, ctx.Principal.FindFirst("given_name").Value), - new Claim(ClaimTypes.Surname, ctx.Principal.FindFirst("family_name").Value), - new Claim(ClaimTypes.Email, ctx.Principal.FindFirst("email").Value), - new Claim(CustomClaimTypes.HasAccessToService, userInfo.HasAccessToService.ToString()), - new Claim(CustomClaimTypes.LoginUserType, ((int)loggedInUserTypeResponse.UserType).ToString()) - }); - - if (userInfo.Roles != null && userInfo.Roles.Any()) - { - claims.AddRange(userInfo.Roles.Select(role => new Claim(ClaimTypes.Role, role.Name))); - } - } - - } - else - { claims.Add(new Claim(CustomClaimTypes.HasAccessToService, "true")); } - } - else - { - claims.Add(new Claim(CustomClaimTypes.HasAccessToService, "false")); - } - - ctx.Principal = new ClaimsPrincipal(new ClaimsIdentity(claims, "DfE-SignIn")); - - // so that we don't issue a session cookie but one with a fixed expiration - ctx.Properties.IsPersistent = true; - ctx.Properties.ExpiresUtc = DateTime.UtcNow.Add(overallSessionTimeout); + return strategy.GetOnTokenValidatedTask(context); } }; }); return services; } } + + private static TService GetService(this TokenValidatedContext context) where TService : class + => context?.HttpContext?.RequestServices?.GetService(); } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/FreezePeriodTokenValidatedStrategy.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/FreezePeriodTokenValidatedStrategy.cs new file mode 100644 index 000000000..7a2ba0780 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/FreezePeriodTokenValidatedStrategy.cs @@ -0,0 +1,154 @@ +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Newtonsoft.Json.Linq; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Models.Authentication; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies +{ + public class FreezePeriodTokenValidatedStrategy : ITokenValidatedStrategy + { + private readonly IDfeSignInApiClient _dfeSignInApiClient; + private readonly IResultsAndCertificationInternalApiClient _resultsAndCertificationInternalApiClient; + private readonly ISystemProvider _systemProvider; + + private readonly int _timeout; + + public FreezePeriodTokenValidatedStrategy( + IDfeSignInApiClient dfeSignInApiClient, + IResultsAndCertificationInternalApiClient resultsAndCertificationInternalApiClient, + ISystemProvider systemProvider, + ResultsAndCertificationConfiguration config) + { + _dfeSignInApiClient = dfeSignInApiClient; + _resultsAndCertificationInternalApiClient = resultsAndCertificationInternalApiClient; + _systemProvider = systemProvider; + _timeout = config.DfeSignInSettings.Timeout; + } + + public async Task GetOnTokenValidatedTask(TokenValidatedContext context) + { + IEnumerable claims = await GetClaimsAsync(context); + context.Principal = new ClaimsPrincipal(new ClaimsIdentity(claims, "DfE-SignIn")); + + // so that we don't issue a session cookie but one with a fixed expiration + context.Properties.IsPersistent = true; + + var cookieAndSessionTimeout = _timeout; + var overallSessionTimeout = TimeSpan.FromMinutes(cookieAndSessionTimeout); + context.Properties.ExpiresUtc = _systemProvider.UtcNow.Add(overallSessionTimeout); + } + + private async Task> GetClaimsAsync(TokenValidatedContext context) + { + ClaimsPrincipal claimsPrincipal = context.Principal; + + var organisationId = GetOrganisationId(claimsPrincipal); + if (string.IsNullOrEmpty(organisationId)) + { + return new[] { CreateHasAccessToServiceClaim(false) }; + } + + var userId = GetUserId(claimsPrincipal); + DfeUserInfo dfeUserInfo = await _dfeSignInApiClient.GetDfeSignInUserInfo(organisationId, userId); + + LoginUserType loginUseType = await GetLoginUserTypeAsync(dfeUserInfo); + if (loginUseType == LoginUserType.NotSpecified) + { + return Enumerable.Empty(); + } + + if (loginUseType != LoginUserType.Admin) + { + return new[] + { + CreateHasAccessToServiceClaim(false), + CreateBooleanClaim(CustomClaimTypes.InFreezePeriod, true) + }; + } + + IEnumerable createdClaims = CreateClaims(claimsPrincipal, dfeUserInfo, loginUseType); + IEnumerable dfeUserInfoClaims = GetClaims(dfeUserInfo); + + return createdClaims.Concat(dfeUserInfoClaims); + } + + private async Task GetLoginUserTypeAsync(DfeUserInfo dfeUserInfo) + { + if (IsAdminUser(dfeUserInfo)) + { + return LoginUserType.Admin; + } + + if (IsAwardingOrganisation(dfeUserInfo)) + { + return LoginUserType.AwardingOrganisation; + } + + LoggedInUserTypeInfo loggedInUserTypeInfo = await _resultsAndCertificationInternalApiClient.GetLoggedInUserTypeInfoAsync(dfeUserInfo.Ukprn.Value); + return loggedInUserTypeInfo == null ? LoginUserType.NotSpecified : loggedInUserTypeInfo.UserType; + } + + private static bool IsAdminUser(DfeUserInfo dfeUserInfo) + => dfeUserInfo?.Ukprn.HasValue == false; + + private static bool IsAwardingOrganisation(DfeUserInfo dfeUserInfo) + => dfeUserInfo?.Ukprn.Value == 1; + + private static IEnumerable GetClaims(DfeUserInfo dfeUserInfo) + { + if (dfeUserInfo?.Roles == null || !dfeUserInfo.Roles.Any()) + { + return Enumerable.Empty(); + } + + return dfeUserInfo.Roles.Select(role => new Claim(ClaimTypes.Role, role.Name)).ToList(); + } + + private static IEnumerable CreateClaims(ClaimsPrincipal claimsPrincipal, DfeUserInfo dfeUserInfo, LoginUserType loginUserType) + => new[] + { + // Claims principal + new Claim(CustomClaimTypes.UserId, GetUserId(claimsPrincipal)), + new Claim(CustomClaimTypes.OrganisationId, GetOrganisationId(claimsPrincipal)), + new Claim(ClaimTypes.GivenName, claimsPrincipal.FindFirst("given_name").Value), + new Claim(ClaimTypes.Surname, claimsPrincipal.FindFirst("family_name").Value), + new Claim(ClaimTypes.Email, claimsPrincipal.FindFirst("email").Value), + + // DfE user info + new Claim(CustomClaimTypes.Ukprn, dfeUserInfo.Ukprn.HasValue ? dfeUserInfo.Ukprn.Value.ToString() : string.Empty), + new Claim(CustomClaimTypes.HasAccessToService, dfeUserInfo.HasAccessToService.ToString()), + + // Login user type + new Claim(CustomClaimTypes.LoginUserType, ((int)loginUserType).ToString()) + }; + + private static string GetOrganisationId(ClaimsPrincipal claimsPrincipal) + { + var organisationClaim = claimsPrincipal.FindFirst("Organisation"); + var organisation = JObject.Parse(organisationClaim.Value); + + return organisation.HasValues + ? organisation.SelectToken("id").ToString() + : string.Empty; + } + + private static string GetUserId(ClaimsPrincipal claimsPrincipal) + => claimsPrincipal.FindFirst("sub").Value; + + private static Claim CreateHasAccessToServiceClaim(bool hasAccess) + => CreateBooleanClaim(CustomClaimTypes.HasAccessToService, hasAccess); + + private static Claim CreateBooleanClaim(string name, bool value) + => new(name, value ? "true" : "false"); + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/ITokenValidatedStrategy.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/ITokenValidatedStrategy.cs new file mode 100644 index 000000000..8ec61c7a1 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/ITokenValidatedStrategy.cs @@ -0,0 +1,11 @@ +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using System; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies +{ + public interface ITokenValidatedStrategy + { + Task GetOnTokenValidatedTask(TokenValidatedContext context); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategy.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategy.cs new file mode 100644 index 000000000..76e22056c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategy.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Newtonsoft.Json.Linq; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies +{ + public class TokenValidatedStrategy : ITokenValidatedStrategy + { + private readonly IDfeSignInApiClient _dfeSignInApiClient; + private readonly IResultsAndCertificationInternalApiClient _resultsAndCertificationInternalApiClient; + private readonly int _timeout; + + public TokenValidatedStrategy( + IDfeSignInApiClient dfeSignInApiClient, + IResultsAndCertificationInternalApiClient resultsAndCertificationInternalApiClient, + ISystemProvider systemProvider, + ResultsAndCertificationConfiguration config) + { + _dfeSignInApiClient = dfeSignInApiClient; + _resultsAndCertificationInternalApiClient = resultsAndCertificationInternalApiClient; + _timeout = config.DfeSignInSettings.Timeout; + } + + public async Task GetOnTokenValidatedTask(TokenValidatedContext context) + { + var claims = new List(); + var organisation = JObject.Parse(context.Principal.FindFirst("Organisation").Value); + + if (organisation.HasValues) + { + var organisationId = organisation.SelectToken("id").ToString(); + var userId = context.Principal.FindFirst("sub").Value; + var userInfo = await _dfeSignInApiClient.GetDfeSignInUserInfo(organisationId, userId); + + if (userInfo.HasAccessToService) + { + var loggedInUserTypeResponse = !userInfo.Ukprn.HasValue ? new LoggedInUserTypeInfo { UserType = LoginUserType.Admin } : userInfo.Ukprn.Value == 1 + ? new LoggedInUserTypeInfo { Ukprn = userInfo.Ukprn.Value, UserType = LoginUserType.AwardingOrganisation } + : await _resultsAndCertificationInternalApiClient.GetLoggedInUserTypeInfoAsync(userInfo.Ukprn.Value); + + if (loggedInUserTypeResponse != null && loggedInUserTypeResponse.UserType != LoginUserType.NotSpecified) + { + claims.AddRange(new List + { + new Claim(CustomClaimTypes.UserId, userId), + new Claim(CustomClaimTypes.OrganisationId, organisationId), + new Claim(CustomClaimTypes.Ukprn, userInfo.Ukprn.HasValue ? userInfo.Ukprn.Value.ToString() : string.Empty), + new Claim(ClaimTypes.GivenName, context.Principal.FindFirst("given_name").Value), + new Claim(ClaimTypes.Surname, context.Principal.FindFirst("family_name").Value), + new Claim(ClaimTypes.Email, context.Principal.FindFirst("email").Value), + new Claim(CustomClaimTypes.HasAccessToService, userInfo.HasAccessToService.ToString()), + new Claim(CustomClaimTypes.LoginUserType, ((int)loggedInUserTypeResponse.UserType).ToString()) + }); + + if (userInfo.Roles != null && userInfo.Roles.Any()) + { + claims.AddRange(userInfo.Roles.Select(role => new Claim(ClaimTypes.Role, role.Name))); + } + } + + } + else + { claims.Add(new Claim(CustomClaimTypes.HasAccessToService, "true")); } + } + else + { + claims.Add(new Claim(CustomClaimTypes.HasAccessToService, "false")); + } + + context.Principal = new ClaimsPrincipal(new ClaimsIdentity(claims, "DfE-SignIn")); + + // so that we don't issue a session cookie but one with a fixed expiration + context.Properties.IsPersistent = true; + + var overallSessionTimeout = TimeSpan.FromMinutes(_timeout); + context.Properties.ExpiresUtc = DateTime.UtcNow.Add(overallSessionTimeout); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategyResolver.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategyResolver.cs new file mode 100644 index 000000000..cd302b979 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Authentication/Strategies/TokenValidatedStrategyResolver.cs @@ -0,0 +1,6 @@ +using System; + +namespace Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies +{ + public delegate ITokenValidatedStrategy TokenValidatedStrategyResolver(DateTime freezePeriodFrom, DateTime freezePeriodTo); +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.Designer.cs new file mode 100644 index 000000000..12c30a48b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.Designer.cs @@ -0,0 +1,279 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddPathwayResult { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddPathwayResult() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminAddPathwayResult", typeof(AdminAddPathwayResult).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.resx new file mode 100644 index 000000000..632ea2a67 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResult.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Core component: {0} + + + Add assessment result + + + Personal details + + + Select the grade + + + No grade entered + + + Add assessment result – Admin + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs new file mode 100644 index 000000000..f669f457f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs @@ -0,0 +1,343 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddPathwayResultReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddPathwayResultReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminAddPathwayResultRe" + + "viewChanges", typeof(AdminAddPathwayResultReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core Component. + /// + public static string Core_Component { + get { + return ResourceManager.GetString("Core_Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a problem. + /// + public static string Error_Summary_Header { + get { + return ResourceManager.GetString("Error_Summary_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the correct start year. + /// + public static string Error_Summary_Text { + get { + return ResourceManager.GetString("Error_Summary_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result. + /// + public static string Heading_Review_Changes_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Review_Changes_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An assessment result has been added. + /// + public static string Notification_Message_Asessment_Result_Added { + get { + return ResourceManager.GetString("Notification_Message_Asessment_Result_Added", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to selectedgradecode. + /// + public static string Summary_Selected_Grade_Id { + get { + return ResourceManager.GetString("Summary_Selected_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the name of the contact who requested this change. + /// + public static string Validation_Contact_Name_Blank_Text { + get { + return ResourceManager.GetString("Validation_Contact_Name_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the date when the change was requested. + /// + public static string Validation_Date_When_Change_Requested_Blank_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be today or in the past. + /// + public static string Validation_Date_When_Change_Requested_Future_Date_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Future_Date_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be a real date. + /// + public static string Validation_Date_When_Change_Requested_Invalid_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Invalid_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the reason why this change is needed. + /// + public static string Validation_Reason_For_Change_Blank_Text { + get { + return ResourceManager.GetString("Validation_Reason_For_Change_Blank_Text", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx new file mode 100644 index 000000000..a9df98485 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Submit + + + Core Component + + + Core component: {0} + + + There is a problem + + + Select the correct start year + + + Change summary + + + Personal details + + + Review changes to assessment result + + + Who has asked for this change? + + + Change + + + An assessment result has been added + + + No grade entered + + + Review changes to assessment result – Admin + + + Grade + + + selectedgradecode + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Enter the name of the contact who requested this change + + + Enter the date when the change was requested + + + Date must be today or in the past + + + Date must be a real date + + + Enter the reason why this change is needed + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.Designer.cs new file mode 100644 index 000000000..649ab9bb0 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.Designer.cs @@ -0,0 +1,280 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddSpecialismResult { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddSpecialismResult() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminAddSpecialismResul" + + "t", typeof(AdminAddSpecialismResult).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.resx new file mode 100644 index 000000000..edd52d034 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResult.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Add assessment result + + + Personal details + + + Select the grade + + + No grade entered + + + Add assessment result – Admin + + + Occupational specialism: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs new file mode 100644 index 000000000..b29d3ccd8 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs @@ -0,0 +1,334 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddSpecialismResultReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddSpecialismResultReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminAddSpecialismResul" + + "tReviewChanges", typeof(AdminAddSpecialismResultReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a problem. + /// + public static string Error_Summary_Header { + get { + return ResourceManager.GetString("Error_Summary_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the correct start year. + /// + public static string Error_Summary_Text { + get { + return ResourceManager.GetString("Error_Summary_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result. + /// + public static string Heading_Review_Changes_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Review_Changes_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An assessment result has been added. + /// + public static string Notification_Message_Asessment_Result_Added { + get { + return ResourceManager.GetString("Notification_Message_Asessment_Result_Added", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to selectedgradecode. + /// + public static string Summary_Selected_Grade_Id { + get { + return ResourceManager.GetString("Summary_Selected_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the name of the contact who requested this change. + /// + public static string Validation_Contact_Name_Blank_Text { + get { + return ResourceManager.GetString("Validation_Contact_Name_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the date when the change was requested. + /// + public static string Validation_Date_When_Change_Requested_Blank_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be today or in the past. + /// + public static string Validation_Date_When_Change_Requested_Future_Date_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Future_Date_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be a real date. + /// + public static string Validation_Date_When_Change_Requested_Invalid_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Invalid_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the reason why this change is needed. + /// + public static string Validation_Reason_For_Change_Blank_Text { + get { + return ResourceManager.GetString("Validation_Reason_For_Change_Blank_Text", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx new file mode 100644 index 000000000..99e076143 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Submit + + + There is a problem + + + Select the correct start year + + + Change summary + + + Personal details + + + Review changes to assessment result + + + Who has asked for this change? + + + Change + + + An assessment result has been added + + + No grade entered + + + Review changes to assessment result – Admin + + + Occupational specialism: {0} + + + Grade + + + selectedgradecode + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Enter the name of the contact who requested this change + + + Enter the date when the change was requested + + + Date must be today or in the past + + + Date must be a real date + + + Enter the reason why this change is needed + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.Designer.cs new file mode 100644 index 000000000..3a5ffc9b7 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.Designer.cs @@ -0,0 +1,298 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminChangePathwayResult { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminChangePathwayResult() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminChangePathwayResul" + + "t", typeof(AdminChangePathwayResult).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to or. + /// + public static string Or_Text { + get { + return ResourceManager.GetString("Or_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove result. + /// + public static string Remove_Result { + get { + return ResourceManager.GetString("Remove_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.resx new file mode 100644 index 000000000..368c3b63b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResult.resx @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Core component: {0} + + + Change assessment result + + + Personal details + + + Select the new grade + + + No grade entered + + + or + + + Change assessment result – Admin + + + Remove result + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the new grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.Designer.cs new file mode 100644 index 000000000..2938bdff8 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.Designer.cs @@ -0,0 +1,289 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminChangeSpecialismResult { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminChangeSpecialismResult() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminChangeSpecialismRe" + + "sult", typeof(AdminChangeSpecialismResult).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Or. + /// + public static string Or_Text { + get { + return ResourceManager.GetString("Or_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.resx new file mode 100644 index 000000000..0ec54100e --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResult.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Change assessment result + + + Personal details + + + Select the new grade + + + No grade entered + + + Or + + + Change assessment result – Admin + + + Occupational specialism: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the new grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.Designer.cs index ebe6c53c8..4e1c507cc 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.Designer.cs @@ -161,7 +161,7 @@ public static string Link_Change_Text { } /// - /// Looks up a localized string similar to <b>Industry placement status updated</b>. + /// Looks up a localized string similar to <b>An assessment entry has been removed</b>. /// public static string Message_Notification_Success { get { diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.resx index 670a541ae..6afeda82a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminReviewRemoveAssessmentEntry.resx @@ -151,7 +151,7 @@ Change - <b>Industry placement status updated</b> + <b>An assessment entry has been removed</b> You can enter up to 2,000 characters diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/LearnerRecord.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/LearnerRecord.Designer.cs index 7b780ed40..c586e24be 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/LearnerRecord.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/LearnerRecord.Designer.cs @@ -8,10 +8,11 @@ // //------------------------------------------------------------------------------ -namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard +{ using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -22,44 +23,52 @@ namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class LearnerRecord { - + public class LearnerRecord + { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal LearnerRecord() { + internal LearnerRecord() + { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.LearnerRecord", typeof(LearnerRecord).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { + public static global::System.Globalization.CultureInfo Culture + { + get + { return resourceCulture; } - set { + set + { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Add outcome. /// @@ -108,21 +117,25 @@ public static string Action_Button_Request_Change { /// /// Looks up a localized string similar to Add. /// - public static string Action_Text_Link_Add { - get { + public static string Action_Text_Link_Add + { + get + { return ResourceManager.GetString("Action_Text_Link_Add", resourceCulture); } } - + /// /// Looks up a localized string similar to Change. /// - public static string Action_Text_Link_Change { - get { + public static string Action_Text_Link_Change + { + get + { return ResourceManager.GetString("Action_Text_Link_Change", resourceCulture); } } - + /// /// Looks up a localized string similar to Add an assessment entry for {0}. /// @@ -153,12 +166,14 @@ public static string Add_Result_To_Learners_Previous_Assessment { /// /// Looks up a localized string similar to < Back to home. /// - public static string Back_To_Home_Text { - get { + public static string Back_To_Home_Text + { + get + { return ResourceManager.GetString("Back_To_Home_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to before entering new assessment details.. /// @@ -207,30 +222,36 @@ public static string Core_Heading_Text { /// /// Looks up a localized string similar to english status. /// - public static string Hidden_Action_Text_English { - get { + public static string Hidden_Action_Text_English + { + get + { return ResourceManager.GetString("Hidden_Action_Text_English", resourceCulture); } } - + /// /// Looks up a localized string similar to industry placement information. /// - public static string Hidden_Action_Text_Industry_Placement { - get { + public static string Hidden_Action_Text_Industry_Placement + { + get + { return ResourceManager.GetString("Hidden_Action_Text_Industry_Placement", resourceCulture); } } - + /// /// Looks up a localized string similar to maths status. /// - public static string Hidden_Action_Text_Maths { - get { + public static string Hidden_Action_Text_Maths + { + get + { return ResourceManager.GetString("Hidden_Action_Text_Maths", resourceCulture); } } - + /// /// Looks up a localized string similar to Add an occupational specialism to this learner's record. /// @@ -242,12 +263,14 @@ public static string Link_Add_An_Occupational_Specialism { /// /// Looks up a localized string similar to <b>Start year updated</b>. /// - public static string Message_Notification_Success { - get { + public static string Message_Notification_Success + { + get + { return ResourceManager.GetString("Message_Notification_Success", resourceCulture); } } - + /// /// Looks up a localized string similar to No assessment entries have yet been recorded.. /// @@ -269,75 +292,91 @@ public static string Occupational_Specialism_Heading { /// /// Looks up a localized string similar to - Learner record – Admin. /// - public static string Page_Title { - get { + public static string Page_Title + { + get + { return ResourceManager.GetString("Page_Title", resourceCulture); } } - + /// /// Looks up a localized string similar to Personal details. /// - public static string Personal_Details_Text { - get { + public static string Personal_Details_Text + { + get + { return ResourceManager.GetString("Personal_Details_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Search again. /// - public static string Search_Again_Text { - get { + public static string Search_Again_Text + { + get + { return ResourceManager.GetString("Search_Again_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Core component. /// - public static string Section_Heading_Core_Component { - get { + public static string Section_Heading_Core_Component + { + get + { return ResourceManager.GetString("Section_Heading_Core_Component", resourceCulture); } } - + /// /// Looks up a localized string similar to Industry placement. /// - public static string Section_Heading_Industry_Placement { - get { + public static string Section_Heading_Industry_Placement + { + get + { return ResourceManager.GetString("Section_Heading_Industry_Placement", resourceCulture); } } - + /// /// Looks up a localized string similar to Level 2 maths and English. /// - public static string Section_Heading_Level2_Maths_English { - get { + public static string Section_Heading_Level2_Maths_English + { + get + { return ResourceManager.GetString("Section_Heading_Level2_Maths_English", resourceCulture); } } - + /// /// Looks up a localized string similar to Occupational specialism(s). /// - public static string Section_Heading_OccupationalSpecialism { - get { + public static string Section_Heading_OccupationalSpecialism + { + get + { return ResourceManager.GetString("Section_Heading_OccupationalSpecialism", resourceCulture); } } - + /// /// Looks up a localized string similar to Overall T Level result. /// - public static string Section_Heading_Overall_Result_Tlevel { - get { + public static string Section_Heading_Overall_Result_Tlevel + { + get + { return ResourceManager.GetString("Section_Heading_Overall_Result_Tlevel", resourceCulture); } } - + /// /// Looks up a localized string similar to Occupational specialism: {0}. /// @@ -350,30 +389,36 @@ public static string Specialism_Heading_Text { /// /// Looks up a localized string similar to {0} to {1}. /// - public static string Start_Year_Value { - get { + public static string Start_Year_Value + { + get + { return ResourceManager.GetString("Start_Year_Value", resourceCulture); } } - + /// /// Looks up a localized string similar to Record Incomplete. /// - public static string Status_Tag_Incomplete { - get { + public static string Status_Tag_Incomplete + { + get + { return ResourceManager.GetString("Status_Tag_Incomplete", resourceCulture); } } - + /// /// Looks up a localized string similar to Record Complete. /// - public static string Status_Tag_Record_Complete { - get { + public static string Status_Tag_Record_Complete + { + get + { return ResourceManager.GetString("Status_Tag_Record_Complete", resourceCulture); } } - + /// /// Looks up a localized string similar to Action. /// @@ -431,98 +476,120 @@ public static string This_Learner_Does_Not_Have_Occupational_Specialism_Recorded /// /// Looks up a localized string similar to Awarding organisation. /// - public static string Title_AoName_Text { - get { + public static string Title_AoName_Text + { + get + { return ResourceManager.GetString("Title_AoName_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Date of birth. /// - public static string Title_DateofBirth_Text { - get { + public static string Title_DateofBirth_Text + { + get + { return ResourceManager.GetString("Title_DateofBirth_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to English. /// - public static string Title_English_Text { - get { + public static string Title_English_Text + { + get + { return ResourceManager.GetString("Title_English_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Status. /// - public static string Title_IP_Status_Text { - get { + public static string Title_IP_Status_Text + { + get + { return ResourceManager.GetString("Title_IP_Status_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Maths. /// - public static string Title_Maths_Text { - get { + public static string Title_Maths_Text + { + get + { return ResourceManager.GetString("Title_Maths_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Provider (UKPRN). /// - public static string Title_Provider_Ukprn_Name_Text { - get { + public static string Title_Provider_Ukprn_Name_Text + { + get + { return ResourceManager.GetString("Title_Provider_Ukprn_Name_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Start year. /// - public static string Title_StartYear_Text { - get { + public static string Title_StartYear_Text + { + get + { return ResourceManager.GetString("Title_StartYear_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to T Level status. /// - public static string Title_TLevel_Status_Text { - get { + public static string Title_TLevel_Status_Text + { + get + { return ResourceManager.GetString("Title_TLevel_Status_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to T Level. /// - public static string Title_TLevel_Text { - get { + public static string Title_TLevel_Text + { + get + { return ResourceManager.GetString("Title_TLevel_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to Pending Withdrawal. /// - public static string TLevel_Status_Pending_Withdrawal_Text { - get { + public static string TLevel_Status_Pending_Withdrawal_Text + { + get + { return ResourceManager.GetString("TLevel_Status_Pending_Withdrawal_Text", resourceCulture); } } - + /// /// Looks up a localized string similar to ULN . /// - public static string Uln_Text { - get { + public static string Uln_Text + { + get + { return ResourceManager.GetString("Uln_Text", resourceCulture); } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.Designer.cs index 63a6f6865..aa0bb98c3 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.Designer.cs @@ -159,6 +159,15 @@ public static string Message_Inset_Text { } } + /// + /// Looks up a localized string similar to <b> An assessment entry has been added</b>. + /// + public static string Message_Notification_Success { + get { + return ResourceManager.GetString("Message_Notification_Success", resourceCulture); + } + } + /// /// Looks up a localized string similar to You can enter up to 2,000 characters. /// @@ -177,6 +186,15 @@ public static string Message_You_Have_Characters_Remaining { } } + /// + /// Looks up a localized string similar to No assessment entry recorded for. + /// + public static string No_Assessment_Recorded { + get { + return ResourceManager.GetString("No_Assessment_Recorded", resourceCulture); + } + } + /// /// Looks up a localized string similar to Occupational Specialism. /// diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.resx index 282be22d3..202b62b85 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/ReviewChangeAssessment.resx @@ -150,12 +150,18 @@ Any assessment entries or results assigned to this learner will remain active. + + <b> An assessment entry has been added</b> + You can enter up to 2,000 characters You have 2,000 characters remaining + + No assessment entry recorded for + Occupational Specialism diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AccountController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AccountController.cs index 3e7c39b81..09bb4b2a6 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AccountController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AccountController.cs @@ -13,7 +13,7 @@ using Sfa.Tl.ResultsAndCertification.Models.Configuration; namespace Sfa.Tl.ResultsAndCertification.Web.Controllers -{ +{ public class AccountController : Controller { private readonly ILogger _logger; @@ -29,7 +29,7 @@ public AccountController(ResultsAndCertificationConfiguration configuration, ICa { _configuration = configuration; _cacheService = cacheService; - _logger = logger; + _logger = logger; } [AllowAnonymous] @@ -46,6 +46,11 @@ public IActionResult PostSignIn() { if (User.Identity.IsAuthenticated) { + if (User.IsInFreezePeriod()) + { + return RedirectToAction(nameof(HelpController.ServiceUnavailable), Constants.HelpController); + }; + return !HttpContext.User.HasAccessToService() ? RedirectToAction(nameof(ErrorController.ServiceAccessDenied), Constants.ErrorController) : RedirectToAction(nameof(DashboardController.Index), Constants.DashboardController); @@ -92,8 +97,8 @@ public IActionResult SignoutComplete() [Route("account-profile", Name = RouteConstants.AccountProfile)] public IActionResult Profile() { - if (_configuration == null || - _configuration.DfeSignInSettings == null || + if (_configuration == null || + _configuration.DfeSignInSettings == null || string.IsNullOrEmpty(_configuration.DfeSignInSettings.ProfileUrl)) { _logger.LogWarning(LogEvent.ConfigurationMissing, $"Unable to read config: DfeSignInSettings.ProfileUrl, User: {User?.GetUserEmail()}"); diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs index 9b5faf200..e4c0127ab 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs @@ -1,13 +1,11 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.DotNet.Scaffolding.Shared.Project; using Microsoft.Extensions.Logging; using Sfa.Tl.ResultsAndCertification.Common.Constants; using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.Helpers; using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; @@ -17,6 +15,7 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.LearnerRecord; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Provider; using System; using System.Collections.Generic; @@ -433,7 +432,7 @@ public async Task AdminReviewChangesIndustryPlacementAsync(AdminR { var _cachedModel = await _cacheService.GetAsync(CacheKey); model.AdminChangeIpViewModel = _cachedModel ?? new AdminChangeIpViewModel(); - + if (!ModelState.IsValid) { return View(model); @@ -457,6 +456,7 @@ public async Task AdminReviewChangesIndustryPlacementAsync(AdminR } + #endregion #region Assesment Entry @@ -465,6 +465,14 @@ public async Task AdminReviewChangesIndustryPlacementAsync(AdminR [Route("admin/add-assessment-entry-core/{registrationPathwayId}", Name = RouteConstants.AdminCoreComponentAssessmentEntry)] public async Task AdminCoreComponentAssessmentEntry(int registrationPathwayId) { + + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + var viewModel = await _loader.GetAdminLearnerRecordWithCoreComponents(registrationPathwayId); if (viewModel == null) @@ -477,6 +485,12 @@ public async Task AdminCoreComponentAssessmentEntry(int registrat [Route("admin/add-assessment-entry-specialism/{registrationPathwayId}/{specialismsId}", Name = RouteConstants.AdminOccupationalSpecialisAssessmentEntry)] public async Task AdminOccupationalSpecialismAssessmentEntry(int registrationPathwayId, int specialismsId) { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + var viewModel = await _loader.GetAdminLearnerRecordWithOccupationalSpecialism(registrationPathwayId, specialismsId); if (viewModel == null) @@ -494,9 +508,8 @@ public async Task AdminCoreComponentAssessmentEntry(AdminCoreComp { return View(adminCoreComponent); } - - adminCoreComponent.AssessmentYearTo = model.AssessmentYearTo; - await _cacheService.SetAsync(CacheKey, adminCoreComponent); + model.ValidPathwayAssessmentSeries = adminCoreComponent.ValidPathwayAssessmentSeries; + await _cacheService.SetAsync(CacheKey, model); return RedirectToAction(nameof(RouteConstants.AdminReviewChangesCoreAssessmentEntry), new { registrationPathwayId = model.RegistrationPathwayId }); } @@ -512,12 +525,9 @@ public async Task AdminOccupationalSpecialismAssessmentEntry(Admi { return View(adminOccupationalSpecialism); } - - adminOccupationalSpecialism.SpecialismAssessmentName = model.SpecialismAssessmentName; - adminOccupationalSpecialism.AssessmentYearTo = model.AssessmentYearTo; - - - await _cacheService.SetAsync(CacheKey, adminOccupationalSpecialism); + model.AssessmentDetails = adminOccupationalSpecialism.AssessmentDetails; + model.ValidPathwayAssessmentSeries = adminOccupationalSpecialism.ValidPathwayAssessmentSeries; + await _cacheService.SetAsync(CacheKey, model); return RedirectToAction(nameof(RouteConstants.AdminReviewChangesSpecialismAssessmentEntry), new { registrationPathwayId = model.RegistrationPathwayId }); } @@ -547,9 +557,21 @@ public async Task AdminReviewChangesCoreAssessmentEntry(AdminRevi { return View(model); } + var isSuccess = await _loader.ProcessAddCoreAssessmentRequestAsync(model); - return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { registrationPathwayId = model.RegistrationPathwayId }); + if (isSuccess) + { + await _cacheService.SetAsync(CacheKey, new NotificationBannerModel + { + DisplayMessageBody = true, + Message = ReviewChangeAssessment.Message_Notification_Success, + IsRawHtml = true, + }, + CacheExpiryTime.XSmall); + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.AdminCoreComponentViewModel.RegistrationPathwayId }); + } + else { return RedirectToAction(RouteConstants.ProblemWithService); } } [HttpGet] @@ -578,10 +600,42 @@ public async Task AdminReviewChangesSpecialismAssessmentEntry(Adm return View(model); } - return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { registrationPathwayId = model.RegistrationPathwayId }); + var isSuccess = await _loader.ProcessAddSpecialismAssessmentRequestAsync(model); + if (isSuccess) + { + await _cacheService.SetAsync(CacheKey, new NotificationBannerModel + { + DisplayMessageBody = true, + Message = ReviewChangeAssessment.Message_Notification_Success, + IsRawHtml = true, + }, + CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.AdminOccupationalSpecialismViewModel.RegistrationPathwayId }); + } + else { return RedirectToAction(RouteConstants.ProblemWithService); } + + } + + + [HttpGet] + [Route("admin/add-assessment-core-entry-clear/{registrationPathwayId}", Name = RouteConstants.AdminCoreComponentAssessmentEntryClear)] + public async Task AdminCoreComponentAssessmentEntryClearAsync(int registrationPathwayId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminCoreComponentAssessmentEntry, new { registrationPathwayId }); + } + + [HttpGet] + [Route("admin/add-assessment-specialism-entry-clear/{registrationPathwayId}/{specialismsId}", Name = RouteConstants.AdminOccupationalSpecialisAssessmentEntryClear)] + public async Task AdminOccupationalSpecialisAssessmentEntryClearAsync(int registrationPathwayId, int specialismsId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminOccupationalSpecialisAssessmentEntry, new { registrationPathwayId, specialismsId }); } + #endregion #region Remove assessments @@ -642,7 +696,7 @@ public async Task AdminReviewRemoveCoreAssessmentEntryAsync() if (cachedModel == null) return RedirectToRoute(RouteConstants.PageNotFound); - + AdminReviewRemoveCoreAssessmentEntryViewModel viewModel = new() { PathwayAssessmentViewModel = cachedModel @@ -660,7 +714,24 @@ public async Task AdminReviewRemoveCoreAssessmentEntryAsync(Admin return View(model); } - return View(model); + var isSuccess = await _loader.ProcessRemoveAssessmentEntry(model); + + if (isSuccess) + { + await _cacheService.SetAsync(CacheKey, new NotificationBannerModel + { + DisplayMessageBody = true, + Message = AdminReviewRemoveAssessmentEntry.Message_Notification_Success, + IsRawHtml = true, + }, + CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.PathwayAssessmentViewModel.RegistrationPathwayId }); + } + else + { + return RedirectToAction(RouteConstants.ProblemWithService); + } } [HttpGet] @@ -737,11 +808,284 @@ public async Task AdminReviewRemoveSpecialismAssessmentEntryAsync return View(model); } - return View(model); + var isSuccess = await _loader.ProcessRemoveSpecialismAssessmentEntryAsync(model); + + if (isSuccess) + { + await _cacheService.SetAsync(CacheKey, new NotificationBannerModel + { + DisplayMessageBody = true, + Message = AdminReviewRemoveAssessmentEntry.Message_Notification_Success, + IsRawHtml = true, + }, + CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.PathwayAssessmentViewModel.RegistrationPathwayId }); + } + else + { + return RedirectToAction(RouteConstants.ProblemWithService); + } + } + + #endregion + + #region Add pathway result + + [HttpGet] + [Route("admin/add-assessment-result-core-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddPathwayResultClear)] + public async Task AdminAddPathwayResultClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddPathwayResult, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/add-assessment-result-core/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddPathwayResult)] + public async Task AdminAddPathwayResultAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddPathwayResultViewModel viewModel = await _loader.GetAdminAddPathwayResultAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AddResultCoreAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-assessment-result-core", Name = RouteConstants.SubmitAdminAddPathwayResult)] + public async Task AdminAddPathwayResultAsync(AdminAddPathwayResultViewModel model) + { + await _loader.LoadAdminAddPathwayResultGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminAddPathwayResultReviewChanges); + } + + [HttpGet] + [Route("admin/review-changes-assessment-result-core", Name = RouteConstants.AdminAddPathwayResultReviewChanges)] + public async Task AdminAddPathwayResultReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminAddPathwayResultReviewChangesViewModel viewModel = _loader.CreateAdminAddPathwayResultReviewChanges(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/review-changes-assessment-result-core", Name = RouteConstants.SubmitAdminAddPathwayResultReviewChanges)] + public async Task AdminAddPathwayResultReviewChangesAsync(AdminAddPathwayResultReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessAddPathwayResultReviewChangesAsync(model); + if (!success) + { + return RedirectToAction(RouteConstants.ProblemWithService); + } + + var notificationBanner = new AdminNotificationBannerModel(AdminAddPathwayResultReviewChanges.Notification_Message_Asessment_Result_Added); + await _cacheService.SetAsync(CacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + #endregion + + #region Add specialism result + + [HttpGet] + [Route("admin/add-assessment-result-specialism-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddSpecialismResultClear)] + public async Task AdminAddSpecialismResultClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddSpecialismResult, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/add-assessment-result-specialism/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddSpecialismResult)] + public async Task AdminAddSpecialismResultAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddSpecialismResultViewModel viewModel = await _loader.GetAdminAddSpecialismResultAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AdminAddSpecialismResultAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-assessment-result-specialism", Name = RouteConstants.SubmitAdminAddSpecialismResult)] + public async Task AdminAddSpecialismResultAsync(AdminAddSpecialismResultViewModel model) + { + await _loader.LoadAdminAddSpecialismResultGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminAddSpecialismResultReviewChanges); + } + + [HttpGet] + [Route("admin/review-changes-assessment-result-specialism", Name = RouteConstants.AdminAddSpecialismResultReviewChanges)] + public async Task AdminAddSpecialismResultReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminAddSpecialismResultReviewChangesViewModel viewModel = _loader.CreateAdminAddSpecialismResultReviewChanges(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/review-changes-assessment-result-specialism", Name = RouteConstants.SubmitAdminAddSpecialismResultReviewChanges)] + public async Task AdminAddSpecialismResultReviewChangesAsync(AdminAddSpecialismResultReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessAddSpecialismResultReviewChangesAsync(model); + if (!success) + { + return RedirectToAction(RouteConstants.ProblemWithService); + } + + var notificationBanner = new AdminNotificationBannerModel(AdminAddSpecialismResultReviewChanges.Notification_Message_Asessment_Result_Added); + await _cacheService.SetAsync(CacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); } #endregion + #region change result + [HttpGet] + [Route("admin/change-assessment-result-core/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminChangePathwayResult)] + public async Task AdminChangePathwayResultAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminChangePathwayResultViewModel viewModel = await _loader.GetAdminChangePathwayResultAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AddResultCoreAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/change-assessment-result-core", Name = RouteConstants.SubmitAdminChangePathwayResult)] + public async Task AdminChangePathwayResultAsync(AdminChangePathwayResultViewModel model) + { + await _loader.LoadAdminChangePathwayResultGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId });// need to change this + } + + [HttpGet] + [Route("admin/change-assessment-result-core-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminChangePathwayResultClear)] + public async Task AdminChangePathwayResultClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminChangePathwayResult, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/change-assessment-result-specialism/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminChangeSpecialismResult)] + public async Task AdminChangeSpecialismResultAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminChangeSpecialismResultViewModel viewModel = await _loader.GetAdminChangeSpecialismResultAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AddResultCoreAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + + [HttpPost] + [Route("admin/change-assessment-result-specialism", Name = RouteConstants.SubmitAdminChangeSpecialismResult)] + public async Task AdminChangeSpecialismResultAsync(AdminChangeSpecialismResultViewModel model) + { + await _loader.LoadAdminChangeSpecialismResultGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId });// need to change this + } + + [HttpGet] + [Route("admin/change-assessment-result-specialism-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminChangeSpecialismResultClear)] + public async Task AdminChangeSpecialismResultClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminChangeSpecialismResult, new { registrationPathwayId, assessmentId }); + } + + + #endregion } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Filters/FreezePeriodFilterAttribute.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Filters/FreezePeriodFilterAttribute.cs deleted file mode 100644 index 9b2a41c42..000000000 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Filters/FreezePeriodFilterAttribute.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Routing; -using Microsoft.Extensions.Logging; -using Sfa.Tl.ResultsAndCertification.Common.Helpers; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; -using Sfa.Tl.ResultsAndCertification.Web.Controllers; -using System; -using System.Threading.Tasks; - -namespace Sfa.Tl.ResultsAndCertification.Web.Filters -{ - public class FreezePeriodFilterAttribute : IAsyncActionFilter - { - private readonly ResultsAndCertificationConfiguration _configuration; - private readonly ILogger _logger; - - public FreezePeriodFilterAttribute(ResultsAndCertificationConfiguration configuration, ILogger logger) - { - _configuration = configuration; - _logger = logger; - } - - public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) - { - try - { - //if (context.Controller.GetType() != typeof(HelpController) && context.Controller.GetType() != typeof(ErrorController) && IsFreezePeriodActive()) - if (context.Controller.GetType() != typeof(HelpController) && IsFreezePeriodActive() && !HasAnyAllowedActions(context)) - { - var routeValues = new RouteValueDictionary - { - { "controller", Constants.HelpController }, - { "action", nameof(HelpController.ServiceUnavailable) } - }; - context.Result = new RedirectToRouteResult(routeValues); - await context.Result.ExecuteResultAsync(context); - } - else - { - await next(); - } - } - catch (Exception ex) - { - _logger.LogError(ex, ex.Message); - } - } - - private bool IsFreezePeriodActive() - { - return DateTime.UtcNow >= _configuration.FreezePeriodStartDate && DateTime.UtcNow <= _configuration.FreezePeriodEndDate; - } - - private static bool HasAnyAllowedActions(ActionContext context) - { - return context.ActionDescriptor is ControllerActionDescriptor controllerActionDescriptor - && (controllerActionDescriptor.ControllerName == Constants.ErrorController && controllerActionDescriptor.ActionName == nameof(ErrorController.ProblemWithService) || - controllerActionDescriptor.ControllerName == Constants.AccountController && controllerActionDescriptor.ActionName == nameof(AccountController.SignOut)); - } - } -} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs index acf12e496..193775cf6 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs @@ -12,7 +12,11 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.Eventing.Reader; using System.Linq; using System.Threading.Tasks; @@ -34,7 +38,7 @@ public async Task GetAdminSearchLearnerFilte AdminSearchLearnerFilters apiResponse = await _internalApiClient.GetAdminSearchLearnerFiltersAsync(); return _mapper.Map(apiResponse); } - + public async Task GetAdminSearchLearnerDetailsListAsync(AdminSearchLearnerCriteriaViewModel adminSearchCriteria) { var adminSearchLearnerRequest = _mapper.Map(adminSearchCriteria); @@ -73,7 +77,7 @@ public async Task GetAdminLearnerRecordWithCoreComp SeriesName = a.Name }); - var validAssessments = activeAssessmentIncludingPreviousYear.Except(learnerRecord.Pathway.PathwayAssessments, new AssessmentComparer()).ToList(); + var validAssessments = activeAssessmentIncludingPreviousYear.Except(learnerRecord.Pathway.PathwayAssessments, new AssessmentComparer()).ToList(); AdminCoreComponentViewModel response = _mapper.Map(learnerRecord, opt => { @@ -130,10 +134,12 @@ public async Task ProcessChangeStartYearAsync(ReviewChangeStartYearViewMod public async Task ProcessChangeIndustryPlacementAsync(AdminReviewChangesIndustryPlacementViewModel adminChangeIpViewModel) { - var reviewChangeStartYearRequest = _mapper.Map(adminChangeIpViewModel); - return await _internalApiClient.ProcessChangeIndustryPlacementAsync(reviewChangeStartYearRequest); + var reviewIndustryPlacementRequest = _mapper.Map(adminChangeIpViewModel); + return await _internalApiClient.ProcessChangeIndustryPlacementAsync(reviewIndustryPlacementRequest); } + #region Remove assessment + public Task GetRemovePathwayAssessmentEntryAsync(int registrationPathwayId, int pathwayAssessmentId) => GetRemoveAssessmentEntryAsync(registrationPathwayId, pathwayAssessmentId); @@ -149,5 +155,142 @@ private async Task GetRemoveAssessmentEntryAsyn opt.Items[Constants.AssessmentId] = assessmentId; }); } + + public async Task ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel adminReviewChangesCoreAssessmentViewModel) + { + var reviewAddCoreAssessmentRequest = _mapper.Map(adminReviewChangesCoreAssessmentViewModel); + return await _internalApiClient.ProcessAddCoreAssessmentRequestAsync(reviewAddCoreAssessmentRequest); + } + + public async Task ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel adminReviewChangesSpeciaismAssessmentViewModel) + { + var reviewAddSpecialismAssessmentRequest = _mapper.Map(adminReviewChangesSpeciaismAssessmentViewModel); + return await _internalApiClient.ProcessAddSpecialismAssessmentRequestAsync(reviewAddSpecialismAssessmentRequest); + } + + public async Task ProcessRemoveAssessmentEntry(AdminReviewRemoveCoreAssessmentEntryViewModel model) + { + var reviewRemoveAssessmentEntryRequest = _mapper.Map(model); + return await _internalApiClient.RemoveAssessmentEntryAsync(reviewRemoveAssessmentEntryRequest); + } + + public async Task ProcessRemoveSpecialismAssessmentEntryAsync(AdminReviewRemoveSpecialismAssessmentEntryViewModel model) + { + var reviewRemoveSpecialismEntryRequest = _mapper.Map(model); + return await _internalApiClient.RemoveSpecialAssessmentEntryAsync(reviewRemoveSpecialismEntryRequest); + } + + #endregion + + #region Add result + + public Task GetAdminAddPathwayResultAsync(int registrationPathwayId, int assessmentId) + => GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.PathwayComponentGrade); + + public async Task LoadAdminAddPathwayResultGrades(AdminAddPathwayResultViewModel model) + => model.Grades = await GetAdminAddResultGrades(LookupCategory.PathwayComponentGrade); + + public Task GetAdminAddSpecialismResultAsync(int registrationPathwayId, int assessmentId) + => GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.SpecialismComponentGrade); + + public async Task LoadAdminAddSpecialismResultGrades(AdminAddSpecialismResultViewModel model) + => model.Grades = await GetAdminAddResultGrades(LookupCategory.SpecialismComponentGrade); + + private async Task GetAdminAddResultAsync(int registrationPathwayId, int assessmentId, LookupCategory lookupCategory, bool ischange = false) + where TAddResultViewModel : class + { + Task learnerRecordTask = _internalApiClient.GetAdminLearnerRecordAsync(registrationPathwayId); + Task> gradesTask = _internalApiClient.GetLookupDataAsync(lookupCategory); + + await Task.WhenAll(learnerRecordTask, gradesTask); + + AdminLearnerRecord learnerRecord = learnerRecordTask.Result; + IList grades = gradesTask.Result; + if (ischange) + { + grades.Insert(grades.Count, new LookupData { Code = Constants.NotReceived, Value = Content.Result.ManageSpecialismResult.Option_Remove_Result }); + } + + if (learnerRecord == null || grades == null) + return null; + + return _mapper.Map(learnerRecord, opt => + { + opt.Items[Constants.AssessmentId] = assessmentId; + opt.Items["grades"] = grades; + }); + } + + private async Task> GetAdminAddResultGrades(LookupCategory lookupCategory) + { + IList grades = await _internalApiClient.GetLookupDataAsync(lookupCategory); + return _mapper.Map>(grades); + } + + public AdminAddPathwayResultReviewChangesViewModel CreateAdminAddPathwayResultReviewChanges(AdminAddPathwayResultViewModel model) + => _mapper.Map(model); + + public Task ProcessAddPathwayResultReviewChangesAsync(AdminAddPathwayResultReviewChangesViewModel model) + { + if (model == null) + { + return Task.FromResult(false); + } + + var request = _mapper.Map(model); + return _internalApiClient.ProcessAdminAddPathwayResultAsync(request); + } + + public AdminAddSpecialismResultReviewChangesViewModel CreateAdminAddSpecialismResultReviewChanges(AdminAddSpecialismResultViewModel model) + => _mapper.Map(model); + + public Task ProcessAddSpecialismResultReviewChangesAsync(AdminAddSpecialismResultReviewChangesViewModel model) + { + if (model == null) + { + return Task.FromResult(false); + } + + var request = _mapper.Map(model); + return _internalApiClient.ProcessAdminAddSpecialismResultAsync(request); + } + + #endregion + + #region change Result + public async Task GetAdminChangePathwayResultAsync(int registrationPathwayId, int assessmentId) + { + var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.PathwayComponentGrade, true); + viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); + return viewmodel; + + } + + public async Task LoadAdminChangePathwayResultGrades(AdminChangePathwayResultViewModel model) + => model.Grades = await GetAdminChangeResultGrades(LookupCategory.PathwayComponentGrade, model.Grade); + + + private async Task> GetAdminChangeResultGrades(LookupCategory lookupCategory, string grade) + { + IList grades = await _internalApiClient.GetLookupDataAsync(lookupCategory); + grades.Remove(grades.Where(t => t.Value == grade).FirstOrDefault()); + grades.Insert(grades.Count, new LookupData { Code = Constants.NotReceived, Value = Content.Result.ManageSpecialismResult.Option_Remove_Result }); + return _mapper.Map>(grades); + } + + public async Task GetAdminChangeSpecialismResultAsync(int registrationPathwayId, int assessmentId) + { + var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.SpecialismComponentGrade, true); + viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); + return viewmodel; + + } + + public async Task LoadAdminChangeSpecialismResultGrades(AdminChangeSpecialismResultViewModel model) + => model.Grades = await GetAdminChangeResultGrades(LookupCategory.SpecialismComponentGrade, model.Grade); + + + + #endregion } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs index d869d6a5b..68896c44d 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs @@ -1,6 +1,7 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces @@ -24,5 +25,37 @@ public interface IAdminDashboardLoader Task GetRemovePathwayAssessmentEntryAsync(int registrationPathwayId, int pathwayAssessmentId); Task GetRemoveSpecialismAssessmentEntryAsync(int registrationPathwayId, int specialismAssessmentId); + + Task ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel adminReviewChangesCoreAssessmentViewModel); + + Task ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel adminReviewChangesSpecialismAssessmentViewModel); + + Task ProcessRemoveAssessmentEntry(AdminReviewRemoveCoreAssessmentEntryViewModel model); + + Task ProcessRemoveSpecialismAssessmentEntryAsync(AdminReviewRemoveSpecialismAssessmentEntryViewModel model); + + Task GetAdminAddPathwayResultAsync(int registrationPathwayId, int assessmentId); + + Task GetAdminAddSpecialismResultAsync(int registrationPathwayId, int assessmentId); + + Task LoadAdminAddPathwayResultGrades(AdminAddPathwayResultViewModel model); + + Task LoadAdminAddSpecialismResultGrades(AdminAddSpecialismResultViewModel model); + + AdminAddPathwayResultReviewChangesViewModel CreateAdminAddPathwayResultReviewChanges(AdminAddPathwayResultViewModel model); + + Task ProcessAddPathwayResultReviewChangesAsync(AdminAddPathwayResultReviewChangesViewModel model); + + AdminAddSpecialismResultReviewChangesViewModel CreateAdminAddSpecialismResultReviewChanges(AdminAddSpecialismResultViewModel model); + + Task ProcessAddSpecialismResultReviewChangesAsync(AdminAddSpecialismResultReviewChangesViewModel model); + + Task GetAdminChangePathwayResultAsync(int registrationPathwayId, int assessmentId); + + Task LoadAdminChangePathwayResultGrades(AdminChangePathwayResultViewModel model); + + Task GetAdminChangeSpecialismResultAsync(int registrationPathwayId, int assessmentId); + + Task LoadAdminChangeSpecialismResultGrades(AdminChangeSpecialismResultViewModel model); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs index 082cc0ac3..6f8f25862 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs @@ -13,6 +13,7 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.LearnerRecord; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; using System; using System.Collections.Generic; using System.Linq; @@ -44,7 +45,8 @@ public AdminDashboardMapper() .ForMember(d => d.IsLearnerRegistered, opts => opts.MapFrom(s => s.IsRegistered)) .ForMember(d => d.IndustryPlacementId, opts => opts.MapFrom(s => GetIndustryPlacementId(s))) .ForMember(d => d.IndustryPlacementStatus, opts => opts.MapFrom(s => GetIndustryPlacementStatus(s))) - .ForMember(d => d.AssessmentDetails, opts => opts.MapFrom(s => s.Pathway)); + .ForMember(d => d.AssessmentDetails, opts => opts.MapFrom(s => s.Pathway)) + .ForMember(d => d.IsPendingWithdrawal, opts => opts.MapFrom(s => s.IsPendingWithdrawl)); CreateMap() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom((src, dest, destMember, context) => context.Items[Constants.RegistrationPathwayId])) @@ -62,7 +64,19 @@ public AdminDashboardMapper() .ForMember(d => d.LastUpdated, opts => opts.MapFrom(s => s.LastUpdatedOn.ToDobFormat())) .ForMember(d => d.UpdatedBy, opts => opts.MapFrom(s => s.LastUpdatedBy)) .ForMember(d => d.IsResultChangeAllowed, opt => opt.MapFrom()) - .ForMember(d => d.ActionButton, opt => opt.MapFrom()); + .ForMember(d => d.ActionButton, opt => opt.MapFrom()) + .ForMember(d => d.AddResultRouteName, opt => opt.MapFrom(s => + s.ComponentType == ComponentType.Core + ? RouteConstants.AdminAddPathwayResultClear + : s.ComponentType == ComponentType.Specialism + ? RouteConstants.AdminAddSpecialismResultClear + : string.Empty)) + .ForMember(d => d.ChangeResultRoute, opt => opt.MapFrom(s => + s.ComponentType == ComponentType.Core + ? RouteConstants.AdminChangePathwayResultClear + : s.ComponentType == ComponentType.Specialism + ? RouteConstants.AdminChangeSpecialismResultClear + : string.Empty)); CreateMap() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom((src, dest, destMember, context) => context.Items[Constants.RegistrationPathwayId])) @@ -222,6 +236,195 @@ public AdminDashboardMapper() .ForMember(d => d.LastUpdated, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.LastUpdatedOn.ToDobFormat()))) .ForMember(d => d.UpdatedBy, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.LastUpdatedBy))) .ForMember(d => d.CanAssessmentEntryBeRemoved, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result == null))); + + CreateMap() + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.AdminCoreComponentViewModel.RegistrationPathwayId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()) + .ForMember(d => d.AddCoreAssessmentDetails, opts => opts.MapFrom(s => s)); + + CreateMap() + .ForMember(d => d.CoreAssessmentFrom, opts => opts.MapFrom(s => $"{ReviewChangeAssessment.No_Assessment_Recorded} {s.AdminCoreComponentViewModel.AssessmentYearTo.ToLower()}")) + .ForMember(d => d.CoreAssessmentTo, opts => opts.MapFrom(s => s.AdminCoreComponentViewModel.AssessmentYearTo)); + + + CreateMap() + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.AdminOccupationalSpecialismViewModel.RegistrationPathwayId)) + .ForMember(d => d.SpecialismId, opts => opts.MapFrom(s => s.AdminOccupationalSpecialismViewModel.SpecialismAssessmentId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()) + .ForMember(d => d.AddSpecialismDetails, opts => opts.MapFrom(s => s)); + + CreateMap() + .ForMember(d => d.SpecialismAssessmentFrom, opts => opts.MapFrom(s => $"{ReviewChangeAssessment.No_Assessment_Recorded} {s.AdminOccupationalSpecialismViewModel.AssessmentYearTo.ToLower()}")) + .ForMember(d => d.SpecialismAssessmentTo, opts => opts.MapFrom(s => s.AdminOccupationalSpecialismViewModel.AssessmentYearTo)); + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) + .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayAssessmentId)) + .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Core)) + .ForPath(d => d.ChangeAssessmentDetails.PathwayName, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayName)) + .ForPath(d => d.ChangeAssessmentDetails.From, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.ExamPeriod)) + .ForPath(d => d.ChangeAssessmentDetails.To, opts => opts.MapFrom(s => string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, s.PathwayAssessmentViewModel.ExamPeriod))) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + #region Add pathway result + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId.HasValue ? s.SelectedGradeId.Value : default)) + .ForMember(d => d.SelectedGradeValue, opts => opts.MapFrom(s => s.SelectedGradeValue)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + #endregion + + #region Add specialism result + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom((src, dest, destMember, context) => + { + int assessmentId = (int)context.Items[Constants.AssessmentId]; + Specialism specialism = src?.Pathway?.Specialisms?.SingleOrDefault(s => s.Assessments.Any(a => a.Id == assessmentId)); + + return $"{specialism?.Name} ({specialism.LarId})"; + + })).ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId.HasValue ? s.SelectedGradeId.Value : default)) + .ForMember(d => d.SelectedGradeValue, opts => opts.MapFrom(s => s.SelectedGradeValue)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + #endregion + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) + .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayAssessmentId)) + .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Core)) + .ForPath(d => d.ChangeAssessmentDetails.PathwayName, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayName)) + .ForPath(d => d.ChangeAssessmentDetails.From, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.ExamPeriod)) + .ForPath(d => d.ChangeAssessmentDetails.To, opts => opts.MapFrom(s => string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, s.PathwayAssessmentViewModel.ExamPeriod))) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) + .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.SpecialismAssessmentId)) + .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Specialism)) + .ForPath(d => d.ChangeSpecialismAssessmentDetails.SpecialismName, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.SpecialismName)) + .ForPath(d => d.ChangeSpecialismAssessmentDetails.From, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.ExamPeriod)) + .ForPath(d => d.ChangeSpecialismAssessmentDetails.To, opts => opts.MapFrom(s => string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, s.PathwayAssessmentViewModel.ExamPeriod))) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom((src, dest, destMember, context) => + { + int assessmentId = (int)context.Items[Constants.AssessmentId]; + Specialism specialism = src?.Pathway?.Specialisms?.SingleOrDefault(s => s.Assessments.Any(a => a.Id == assessmentId)); + + return $"{specialism?.Name} ({specialism.LarId})"; + + })).ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); } private int? GetSelectedProviderId(AdminSearchLearnerCriteriaViewModel searchCriteria) diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj b/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj index efaf02800..35839dca4 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj @@ -42,6 +42,31 @@ + + AdminChangeSpecialismResult.resx + True + True + + + AdminChangePathwayResult.resx + True + True + + + True + True + AdminAddPathwayResult.resx + + + AdminAddSpecialismResultReviewChanges.resx + True + True + + + True + True + AdminAddSpecialismResult.resx + AdminLearnerAssessmentEntry.resx True @@ -82,6 +107,11 @@ True True + + AdminAddPathwayResultReviewChanges.resx + True + True + ReviewChangesIndustryPlacement.resx True @@ -1101,6 +1131,27 @@ + + AdminChangeSpecialismResult.Designer.cs + PublicResXFileCodeGenerator + + + AdminChangePathwayResult.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + AdminAddPathwayResult.Designer.cs + + + Designer + AdminAddSpecialismResultReviewChanges.Designer.cs + PublicResXFileCodeGenerator + + + PublicResXFileCodeGenerator + AdminAddSpecialismResult.Designer.cs + AdminLearnerAssessmentEntry.Designer.cs PublicResXFileCodeGenerator @@ -1138,6 +1189,11 @@ AdminReviewRemoveAssessmentEntry.Designer.cs PublicResXFileCodeGenerator + + Designer + AdminAddPathwayResultReviewChanges.Designer.cs + PublicResXFileCodeGenerator + Designer ReviewChangesIndustryPlacement.Designer.cs diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs index 7f30a8a7f..83fcb7c88 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs @@ -18,8 +18,10 @@ using Sfa.Tl.ResultsAndCertification.Common.Services.Configuration; using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; +using Sfa.Tl.ResultsAndCertification.Common.Utils.Ranges; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Web.Authentication; +using Sfa.Tl.ResultsAndCertification.Web.Authentication.Strategies; using Sfa.Tl.ResultsAndCertification.Web.Filters; using Sfa.Tl.ResultsAndCertification.Web.Loader; using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; @@ -91,7 +93,6 @@ public void ConfigureServices(IServiceCollection services) }); config.Filters.Add(); config.Filters.Add(); - config.Filters.Add(); }); if (_env.IsDevelopment()) @@ -101,10 +102,29 @@ public void ConfigureServices(IServiceCollection services) } else { - services.AddSingleton(x => ConnectionMultiplexer.Connect(_env.IsDevelopment() ? "localhost" : ResultsAndCertificationConfiguration.RedisSettings.CacheConnection)); + services.AddSingleton(x => ConnectionMultiplexer.Connect(ResultsAndCertificationConfiguration.RedisSettings.CacheConnection)); services.AddSingleton(); } + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(serviceProvider => (from, to) => + { + var freezePeriod = new DateTimeRange + { + From = from, + To = to + }; + + var systemProvider = serviceProvider.GetService(); + bool isFreezePeriodNow = freezePeriod.Contains(systemProvider.UtcNow); + + return isFreezePeriodNow + ? serviceProvider.GetService() + : serviceProvider.GetService(); + }); + services.AddWebAuthentication(ResultsAndCertificationConfiguration, _env); services.AddAuthorization(options => { diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Utilities/CustomValidations/DateValidatorAttribute.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Utilities/CustomValidations/DateValidatorAttribute.cs index eaa225e15..9a1d93209 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Utilities/CustomValidations/DateValidatorAttribute.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Utilities/CustomValidations/DateValidatorAttribute.cs @@ -1,8 +1,7 @@ -using System; -using System.ComponentModel.DataAnnotations; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; using Sfa.Tl.ResultsAndCertification.Web.Helpers; -using System.Linq; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using System; +using System.ComponentModel.DataAnnotations; namespace Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations { @@ -10,103 +9,90 @@ public class DateValidatorAttribute : ValidationAttribute { public string Property { get; set; } public Type ErrorResourceType { get; set; } - public string ErrorResourceName { get; set; } protected override ValidationResult IsValid(object value, ValidationContext validationContext) { - object instance = validationContext.ObjectInstance; - Type type = instance.GetType(); - var propVal = type.GetProperty(Property).GetValue(instance); - - // Validate input parameters - var dateTokens = value.ToString().Split("/"); - if (dateTokens.Count() != 3) - throw new Exception($"Invalid usage of DateValidationAttribute. Parameters Value: {value}, PropertyName {Property}"); - - var year = dateTokens[0]; - var month = dateTokens[1]; - var day = dateTokens[2]; - - // All empty - if (string.IsNullOrWhiteSpace(day) && string.IsNullOrWhiteSpace(month) && string.IsNullOrWhiteSpace(year)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Day and Month empty - if (string.IsNullOrWhiteSpace(day) && string.IsNullOrWhiteSpace(month)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Day and Year empty - if (string.IsNullOrWhiteSpace(day) && string.IsNullOrWhiteSpace(year)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Month and Year empty - if (string.IsNullOrWhiteSpace(month) && string.IsNullOrWhiteSpace(year)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Day empty - if (string.IsNullOrWhiteSpace(day)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Month empty - if (string.IsNullOrWhiteSpace(month)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - // Year empty - if (string.IsNullOrWhiteSpace(year)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Blank_Text"), propVal)); - - day = day.PadLeft(2, '0'); - month = month.PadLeft(2, '0'); - - // Invalid Day/Month/Year - var isYearValid = (year.TrimStart('0').Length == 4) && string.Concat("01", "01", year).IsDateTimeWithFormat(); - var isMonthValid = string.Concat("01", month, 2020).IsDateTimeWithFormat(); - - bool isDayValid; - if (isMonthValid && isYearValid) - isDayValid = string.Concat(day, month, year).IsDateTimeWithFormat(); - else - isDayValid = string.Concat(day, "01", 2020).IsDateTimeWithFormat(); - - // Month and Year invalid - if (!isMonthValid && !isYearValid && int.TryParse(day, out int intDay) && (intDay >= 1 && intDay <= 31)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Day and Year invalid - if (!isDayValid && !isYearValid && int.TryParse(month, out int intMonth) && (intMonth >= 1 && intMonth <= 12)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Day and Month invalid - if (!isDayValid && !isMonthValid && int.TryParse(year, out int intYear) && (intYear >= 1000 && intYear <= 9999)) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Day only invalid - if (isMonthValid && isYearValid && !isDayValid) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Month only invalid - if (isDayValid && isYearValid && !isMonthValid) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Year only invalid - if (isDayValid && isMonthValid && !isYearValid) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Invalid date - if (!string.Concat(day, month, year).IsDateTimeWithFormat()) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Invalid_Text"), propVal)); - - // Future date - var date = string.Concat(day, month, year).ParseStringToDateTime(); - if (date > DateTime.UtcNow) - return new ValidationResult(string.Format(GetResourceMessage("Validation_Date_When_Change_Requested_Future_Date_Text"), propVal)); + if (value is null || value is not string) + { + return ValidationResult.Success; + } + + string[] tokens = ((string)value).Split("/"); + + if (tokens.Length != 3) + { + return ValidationResult.Success; + } + + string year = tokens[0]; + string month = tokens[1]; + string day = tokens[2]; + + if (ContainsBlankText(year, month, day)) + { + return CreateValidationResult("Validation_Date_When_Change_Requested_Blank_Text"); + } + + if (!IsValidDate(year, month, day, out DateTime dateTime)) + { + return CreateValidationResult("Validation_Date_When_Change_Requested_Invalid_Text"); + } + + var systemProvider = (ISystemProvider)validationContext.GetService(typeof(ISystemProvider)); + + bool isFutureDate = dateTime > systemProvider.Today; + if (isFutureDate) + { + return CreateValidationResult("Validation_Date_When_Change_Requested_Future_Date_Text"); + } return ValidationResult.Success; } - private string GetResourceMessage(string errorResourceName) + private static bool ContainsBlankText(string year, string month, string day) + => IsBlankText(year) || IsBlankText(month) || IsBlankText(day); + + private static bool IsBlankText(string value) + => string.IsNullOrWhiteSpace(value); + + private static bool IsValidDate(string year, string month, string day, out DateTime parsed) + { + parsed = DateTime.MinValue; + + bool allNumeric = IsNumericText(year, out int parsedYear) & IsNumericText(month, out int parsedMonth) & IsNumericText(day, out int parsedDay); + if (!allNumeric) + { + return false; + } + + bool validNumbers = IsBetween(parsedYear, 1000, 9999) && IsBetween(parsedMonth, 1, 12) && IsBetween(parsedDay, 1, 31); + if (!validNumbers) + { + return false; + } + + try + { + parsed = new DateTime(parsedYear, parsedMonth, parsedDay); + } + catch (ArgumentOutOfRangeException) + { + return false; + } + + return true; + } + + private static bool IsNumericText(string value, out int parsed) + => int.TryParse(value, out parsed); + + private static bool IsBetween(int number, int from, int to) + => number >= from && number <= to; + + private ValidationResult CreateValidationResult(string resourceName) { - return CommonHelper.GetResourceMessage(errorResourceName, ErrorResourceType); + string message = CommonHelper.GetResourceMessage(resourceName, ErrorResourceType); + return new ValidationResult(message, new[] { Property }); } } -} +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/NotificationBanner/AdminNotificationBanner.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/NotificationBanner/AdminNotificationBanner.cs new file mode 100644 index 000000000..8429b0a26 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/NotificationBanner/AdminNotificationBanner.cs @@ -0,0 +1,15 @@ +namespace Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner +{ + public class AdminNotificationBannerModel : NotificationBannerModel + { + public AdminNotificationBannerModel(string message) + { + IsRawHtml = true; + DisplayMessageBody = true; + + Message = string.IsNullOrWhiteSpace(message) + ? string.Empty : + $"{message}"; + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/Summary/SummaryItem/AdminReviewSummaryItemModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/Summary/SummaryItem/AdminReviewSummaryItemModel.cs new file mode 100644 index 000000000..c0fc2cf2f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/Summary/SummaryItem/AdminReviewSummaryItemModel.cs @@ -0,0 +1,10 @@ +namespace Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem +{ + public class AdminReviewSummaryItemModel : SummaryItemModel + { + public AdminReviewSummaryItemModel() + { + TitleCss = "govuk-summary-list__value"; + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/AdminLearnerDetailsViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/AdminLearnerDetailsViewModel.cs deleted file mode 100644 index dcec67310..000000000 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/AdminLearnerDetailsViewModel.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Breadcrumb; -using Sfa.Tl.ResultsAndCertification.Common.Helpers; -using System.Collections.Generic; -using ChangeStarYear = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.ChangeStartYear; - -using BreadcrumbContent = Sfa.Tl.ResultsAndCertification.Web.Content.ViewComponents.Breadcrumb; -using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; - -namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard -{ - public class AdminLearnerDetailsViewModel - { - public int ProfileId { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - public string Learner => $"{FirstName} {LastName}"; - public long Uln { get; set; } - public string Provider { get; set; } - public string StartYear { get; set; } - - public BreadcrumbModel Breadcrumb => new() - { - BreadcrumbItems = new List - { - new BreadcrumbItem { DisplayName = BreadcrumbContent.Home, RouteName = RouteConstants.Home } - } - }; - - public SummaryItemModel SummaryLearner => new() - { - Id = "learner", - Title = ChangeStarYear.Title_ULN_Text, - Value = Learner - }; - - public SummaryItemModel SummaryULN => new() - { - Id = "uln", - Title = ChangeStarYear.Title_ULN_Text, - Value = Uln.ToString() - }; - - public SummaryItemModel SummaryProvider => new() - { - Id = "provider", - Title = ChangeStarYear.Title_Provider_Text, - Value = Provider - }; - - public SummaryItemModel SummaryStartYear => new() - { - Id = "startyear", - Title = ChangeStarYear.Title_StartYear_Text, - Value = StartYear - }; - } -} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminCoreComponentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminCoreComponentViewModel.cs index 95cdf248b..1c4b58d87 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminCoreComponentViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminCoreComponentViewModel.cs @@ -22,5 +22,6 @@ public class AdminCoreComponentViewModel : AdminAssessmentLearnerDetails public bool HasCoreAssessmentEntries { get; set; } public bool HasReachedAssessmentsThreashold => AssessmentDetails?.PathwayAssessments?.Count() == Constants.AdminAssessmentEntryLimit && !ValidPathwayAssessmentSeries.Any(); + } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminOccupationalSpecialismViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminOccupationalSpecialismViewModel.cs index 5501568d7..8b9cd2c8b 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminOccupationalSpecialismViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminOccupationalSpecialismViewModel.cs @@ -22,5 +22,7 @@ public class AdminOccupationalSpecialismViewModel : AdminAssessmentLearnerDetail public string SpecialismAssessmentName { get; set; } + public int AssessmentSeriesId { get; set; } + } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesCoreAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesCoreAssessmentViewModel.cs index 7122d6d87..f597330f7 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesCoreAssessmentViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesCoreAssessmentViewModel.cs @@ -1,12 +1,10 @@ -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment { @@ -15,13 +13,11 @@ public class AdminReviewChangesCoreAssessmentViewModel public AdminCoreComponentViewModel AdminCoreComponentViewModel { get; set; } public int RegistrationPathwayId { get;set; } - - [Required(ErrorMessageResourceType = typeof(ReviewChangeAssessment), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] [MaxLength(100, ErrorMessageResourceType = typeof(ReviewChangeAssessment), ErrorMessageResourceName = "Validation_Contact_Name_Max_Length")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangeAssessment), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangeAssessment))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } public string Month { get; set; } @@ -75,8 +71,8 @@ public class AdminReviewChangesCoreAssessmentViewModel public SummaryItemModel SummaryAssessment => new() { Id = "assessment", - Title = $"{ReviewChangeAssessment.Core_Component}:{AdminCoreComponentViewModel.PathwayDisplayName}", - Value = $"{ReviewChangeAssessment.Text_No_Assement_Message} {CoreChangeTo}", + Title = $"{ReviewChangeAssessment.Core_Component}: {AdminCoreComponentViewModel.PathwayDisplayName}", + Value = $"{ReviewChangeAssessment.Text_No_Assement_Message} {CoreChangeTo.ToLower()}", Value2 = CoreChangeTo, ActionText = ReviewChangeAssessment.Link_Change_Text, TitleCss = "govuk-summary-list__value", diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesSpecialismAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesSpecialismAssessmentViewModel.cs index b9bf51b1f..8b02b1355 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesSpecialismAssessmentViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewChangesSpecialismAssessmentViewModel.cs @@ -3,10 +3,8 @@ using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; -using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.LearnerRecord; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment { @@ -20,7 +18,7 @@ public class AdminReviewChangesSpecialismAssessmentViewModel [MaxLength(100, ErrorMessageResourceType = typeof(ReviewChangeAssessment), ErrorMessageResourceName = "Validation_Contact_Name_Max_Length")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangeAssessment), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangeAssessment))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } public string Month { get; set; } @@ -76,8 +74,8 @@ public class AdminReviewChangesSpecialismAssessmentViewModel public SummaryItemModel SummaryAssessment => new() { Id = "assessment", - Title = $"{ReviewChangeAssessment.Occupational_Specialism}:{SpecialismDisplayName}", - Value = $"{ReviewChangeAssessment.Text_No_Assement_Message} {CoreChangeTo}", + Title = $"{ReviewChangeAssessment.Occupational_Specialism}: {SpecialismDisplayName}", + Value = $"{ReviewChangeAssessment.Text_No_Assement_Message} {CoreChangeTo.ToLower()}", Value2 = CoreChangeTo, ActionText = ReviewChangeAssessment.Link_Change_Text, RouteName = RouteConstants.AdminOccupationalSpecialisAssessmentEntry, diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveCoreAssessmentEntryViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveCoreAssessmentEntryViewModel.cs index 33f24846d..857db06e1 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveCoreAssessmentEntryViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveCoreAssessmentEntryViewModel.cs @@ -15,7 +15,7 @@ public class AdminReviewRemoveCoreAssessmentEntryViewModel [Required(ErrorMessageResourceType = typeof(AdminReviewRemoveAssessmentEntry), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(AdminReviewRemoveAssessmentEntry), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(AdminReviewRemoveAssessmentEntry))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveSpecialismAssessmentEntryViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveSpecialismAssessmentEntryViewModel.cs index 8babfbce2..9d2a4c581 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveSpecialismAssessmentEntryViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Assessment/AdminReviewRemoveSpecialismAssessmentEntryViewModel.cs @@ -15,7 +15,7 @@ public class AdminReviewRemoveSpecialismAssessmentEntryViewModel [Required(ErrorMessageResourceType = typeof(AdminReviewRemoveAssessmentEntry), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(AdminReviewRemoveAssessmentEntry), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(AdminReviewRemoveAssessmentEntry))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/IndustryPlacement/AdminReviewChangesIndustryPlacementViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/IndustryPlacement/AdminReviewChangesIndustryPlacementViewModel.cs index 03267c8ed..c0a4d4459 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/IndustryPlacement/AdminReviewChangesIndustryPlacementViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/IndustryPlacement/AdminReviewChangesIndustryPlacementViewModel.cs @@ -21,7 +21,7 @@ public class AdminReviewChangesIndustryPlacementViewModel [Required(ErrorMessageResourceType = typeof(ReviewChangesIndustryPlacement), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangesIndustryPlacement), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangesIndustryPlacement))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/LearnerRecord/AdminAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/LearnerRecord/AdminAssessmentViewModel.cs index 117fccf17..4ac868702 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/LearnerRecord/AdminAssessmentViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/LearnerRecord/AdminAssessmentViewModel.cs @@ -27,5 +27,9 @@ public bool HasGrade public bool IsResultChangeAllowed { get; set; } public TableButtonModel ActionButton { get; set; } + + public string AddResultRouteName { get; set; } + + public string ChangeResultRoute { get; set; } } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs new file mode 100644 index 000000000..3b753568f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs @@ -0,0 +1,118 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminAddPathwayResultReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public string PathwayName { get; set; } + + public int SelectedGradeId { get; set; } + + public string SelectedGradeValue { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Exam_Period_Id, AdminAddPathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddPathwayResult.Summary_Grade_Id, + AdminAddPathwayResult.Summary_Grade_Text, + AdminAddPathwayResult.No_Grade_Entered); + + #endregion + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminAddPathwayResultReviewChanges.Summary_Selected_Grade_Id, + Title = AdminAddPathwayResultReviewChanges.Summary_Grade_Text, + Value = AdminAddPathwayResultReviewChanges.No_Grade_Entered, + Value2 = SelectedGradeValue, + ActionText = AdminAddPathwayResultReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminAddPathwayResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminAddPathwayResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminAddPathwayResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultViewModel.cs new file mode 100644 index 000000000..220e106a5 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultViewModel.cs @@ -0,0 +1,89 @@ +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminAddPathwayResultViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public string PathwayName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Exam_Period_Id, AdminAddPathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddPathwayResult.Summary_Grade_Id, + AdminAddPathwayResult.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminAddPathwayResult.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResult), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs new file mode 100644 index 000000000..56943290b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs @@ -0,0 +1,118 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminAddSpecialismResultReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public string SpecialismName { get; set; } + + public int SelectedGradeId { get; set; } + + public string SelectedGradeValue { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Exam_Period_Id, AdminAddPathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddPathwayResult.Summary_Grade_Id, + AdminAddPathwayResult.Summary_Grade_Text, + AdminAddPathwayResult.No_Grade_Entered); + + #endregion + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminAddSpecialismResultReviewChanges.Summary_Selected_Grade_Id, + Title = AdminAddSpecialismResultReviewChanges.Summary_Grade_Text, + Value = AdminAddSpecialismResultReviewChanges.No_Grade_Entered, + Value2 = SelectedGradeValue, + ActionText = AdminAddSpecialismResultReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminAddSpecialismResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminAddSpecialismResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminAddSpecialismResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultViewModel.cs new file mode 100644 index 000000000..1b9a5d3d1 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminAddSpecialismResultViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public string SpecialismName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_Learner_Id, RemoveAssessmentEntryCore.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_ULN_Id, RemoveAssessmentEntryCore.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_Provider_Id, RemoveAssessmentEntryCore.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_TLevel_Id, RemoveAssessmentEntryCore.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_StartYear_Id, RemoveAssessmentEntryCore.Summary_StartYear_Text, StartYear); + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddSpecialismResult.Summary_Exam_Period_Id, AdminAddSpecialismResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddSpecialismResult.Summary_Grade_Id, + AdminAddSpecialismResult.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminAddPathwayResult.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismResult), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs new file mode 100644 index 000000000..cce08a8cb --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs @@ -0,0 +1,89 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminChangePathwayResultViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public string PathwayName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public bool IsRemoveResult { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Learner_Id, AdminChangePathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_ULN_Id, AdminChangePathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Provider_Id, AdminChangePathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_TLevel_Id, AdminChangePathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_StartYear_Id, AdminChangePathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Exam_Period_Id, AdminChangePathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminChangePathwayResult.Summary_Grade_Id, + AdminChangePathwayResult.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminChangePathwayResult.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminChangePathwayResult), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs new file mode 100644 index 000000000..a2eb9c3af --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminChangeSpecialismResultViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public string SpecialismName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_Learner_Id, RemoveAssessmentEntryCore.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_ULN_Id, RemoveAssessmentEntryCore.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_Provider_Id, RemoveAssessmentEntryCore.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_TLevel_Id, RemoveAssessmentEntryCore.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(RemoveAssessmentEntryCore.Summary_StartYear_Id, RemoveAssessmentEntryCore.Summary_StartYear_Text, StartYear); + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminChangeSpecialismResult.Summary_Exam_Period_Id, AdminChangeSpecialismResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminChangeSpecialismResult.Summary_Grade_Id, + AdminChangeSpecialismResult.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminChangePathwayResult.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminChangeSpecialismResult), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/ReviewChangeStartYearViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/ReviewChangeStartYearViewModel.cs index d1483ea81..46925b3a8 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/ReviewChangeStartYearViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/ReviewChangeStartYearViewModel.cs @@ -1,10 +1,8 @@ -using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; @@ -28,7 +26,7 @@ public class ReviewChangeStartYearViewModel [Required(ErrorMessageResourceType = typeof(ErrorResource.ReviewChangeStartYear), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] public string ContactName { get; set; } - [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ErrorResource.ReviewChangeStartYear), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] + [DateValidator(Property = nameof(RequestDate), ErrorResourceType = typeof(ReviewChangeStartYear))] public string RequestDate => $"{Year}/{Month}/{Day}"; public string Day { get; set; } public string Month { get; set; } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResult.cshtml new file mode 100644 index 000000000..205e51a0d --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResult.cshtml @@ -0,0 +1,97 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminAddPathwayResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminAddPathwayResult.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + +
+

+ @AdminAddPathwayResult.Heading_Add_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminAddPathwayResult.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddPathwayResult.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminAddPathwayResult.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; + +
+ + +
+ } +
+
+ + +
+ + @AdminAddPathwayResult.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResultReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResultReviewChanges.cshtml new file mode 100644 index 000000000..fa4ebafaf --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddPathwayResultReviewChanges.cshtml @@ -0,0 +1,141 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminAddPathwayResultReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminAddPathwayResultReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + +
+

+ @AdminAddPathwayResultReviewChanges.Heading_Review_Changes_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminAddPathwayResultReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + +
+

+ @string.Format(AdminAddPathwayResultReviewChanges.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + +

+ @AdminAddPathwayResultReviewChanges.Heading_Change_Summary +

+
+
+
@AdminAddPathwayResultReviewChanges.Title_Change_Summary_Change_Text
+
@AdminAddPathwayResultReviewChanges.Title_Change_Summary_From_Text
+
@AdminAddPathwayResultReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminAddPathwayResultReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + + +
+
+ + +
+ + +
+
+
+ +
+ + @AdminAddPathwayResultReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResult.cshtml new file mode 100644 index 000000000..2a1e93013 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResult.cshtml @@ -0,0 +1,96 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminAddSpecialismResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminAddSpecialismResult.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + +
+

+ @AdminAddSpecialismResult.Heading_Add_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminAddSpecialismResult.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddSpecialismResult.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminAddSpecialismResult.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; +
+ + +
+ } +
+
+ + +
+ + @AdminAddSpecialismResult.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResultReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResultReviewChanges.cshtml new file mode 100644 index 000000000..52827bd3c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminAddSpecialismResultReviewChanges.cshtml @@ -0,0 +1,141 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminAddSpecialismResultReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminAddSpecialismResultReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + +
+

+ @AdminAddSpecialismResultReviewChanges.Heading_Review_Changes_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminAddSpecialismResultReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + +
+

+ @string.Format(AdminAddSpecialismResultReviewChanges.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + +

+ @AdminAddSpecialismResultReviewChanges.Heading_Change_Summary +

+
+
+
@AdminAddSpecialismResultReviewChanges.Title_Change_Summary_Change_Text
+
@AdminAddSpecialismResultReviewChanges.Title_Change_Summary_From_Text
+
@AdminAddSpecialismResultReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminAddSpecialismResultReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + + +
+
+ + +
+ + +
+
+
+ +
+ + @AdminAddSpecialismResultReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml new file mode 100644 index 000000000..4e69ed79d --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml @@ -0,0 +1,104 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminChangePathwayResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminChangePathwayResult.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + +
+

+ @AdminChangePathwayResult.Heading_Add_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminChangePathwayResult.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminChangePathwayResult.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminChangePathwayResult.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + if (!string.IsNullOrWhiteSpace(grade.value.Code) && grade.value.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)) + { +
@AdminChangePathwayResult.Or_Text
+ } + + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; + +
+ + +
+ } + + +
+
+ + +
+ + @AdminChangePathwayResult.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml new file mode 100644 index 000000000..59814696a --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml @@ -0,0 +1,100 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminChangeSpecialismResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminChangeSpecialismResult.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + +
+

+ @AdminChangeSpecialismResult.Heading_Add_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminChangeSpecialismResult.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminChangeSpecialismResult.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminChangeSpecialismResult.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + if (!string.IsNullOrWhiteSpace(grade.value.Code) && grade.value.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)) + { +
@AdminChangeSpecialismResult.Or_Text
+ } + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; +
+ + +
+ } +
+
+ + +
+ + @AdminChangeSpecialismResult.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminCoreComponentAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminCoreComponentAssessmentEntry.cshtml index 2a8983229..8118a3307 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminCoreComponentAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminCoreComponentAssessmentEntry.cshtml @@ -30,6 +30,14 @@ + + + @for (int i = 0; i < @Model.ValidPathwayAssessmentSeries.ToList().Count(); i++) + { + + } + +

@AdminLearnerAssessmentEntry.Heading_Add_Assessment_Entry @@ -111,9 +119,9 @@ {
-
} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminOccupationalSpecialismAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminOccupationalSpecialismAssessmentEntry.cshtml index fb1473ffd..012f853dc 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminOccupationalSpecialismAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminOccupationalSpecialismAssessmentEntry.cshtml @@ -26,6 +26,12 @@
+ + + + + +

@AdminLearnerAssessmentEntry.Heading_Add_Assessment_Entry @@ -112,7 +118,7 @@ +

} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesCoreAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesCoreAssessmentEntry.cshtml index f13894acd..59cca6c71 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesCoreAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesCoreAssessmentEntry.cshtml @@ -51,7 +51,6 @@ -
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesIndustryPlacement.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesIndustryPlacement.cshtml index 0478e3f4c..9cb1108c9 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesIndustryPlacement.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesIndustryPlacement.cshtml @@ -65,7 +65,7 @@
- +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesSpecialismAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesSpecialismAssessmentEntry.cshtml index 2cbddcdd4..7a4da4ebe 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesSpecialismAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewChangesSpecialismAssessmentEntry.cshtml @@ -52,6 +52,7 @@ +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveCoreAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveCoreAssessmentEntry.cshtml index a5a81c3b2..0521837ec 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveCoreAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveCoreAssessmentEntry.cshtml @@ -68,7 +68,7 @@
- +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveSpecialismAssessmentEntry.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveSpecialismAssessmentEntry.cshtml index 3a47b0f72..4c3e7c4ea 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveSpecialismAssessmentEntry.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminReviewRemoveSpecialismAssessmentEntry.cshtml @@ -68,7 +68,7 @@
- +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_assessmentResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_assessmentResult.cshtml index fcf477dc5..286f950ce 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_assessmentResult.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_assessmentResult.cshtml @@ -34,14 +34,15 @@ if (assessment.IsResultChangeAllowed) { - + + @LearnerRecord.Change_Result_Action_Link_Text } } else { - + @LearnerRecord.Add_Result_Action_Link_Text } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_coreComponent.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_coreComponent.cshtml index f19881edd..6412d2d11 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_coreComponent.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_coreComponent.cshtml @@ -20,5 +20,5 @@ else }

- @string.Format(LearnerRecord.Add_An_Assessment_Entry_For, Model.PathwayDisplayName) + @string.Format(LearnerRecord.Add_An_Assessment_Entry_For, Model.PathwayDisplayName)

\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_occupationalSpecialism.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_occupationalSpecialism.cshtml index 221c882bd..a77a19314 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_occupationalSpecialism.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/Partials/_occupationalSpecialism.cshtml @@ -33,7 +33,7 @@ else }

- @string.Format(LearnerRecord.Add_An_Assessment_Entry_For, specialism.DisplayName) + @string.Format(LearnerRecord.Add_An_Assessment_Entry_For, specialism.DisplayName)

} } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/ReviewChangeStartYear.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/ReviewChangeStartYear.cshtml index 60d3df786..23325472e 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/ReviewChangeStartYear.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/ReviewChangeStartYear.cshtml @@ -66,7 +66,7 @@
- +
diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeStartYear_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddPathwayResult_Called.cs similarity index 50% rename from src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeStartYear_Called.cs rename to src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddPathwayResult_Called.cs index 1e46b829d..8a4fa9724 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeStartYear_Called.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddPathwayResult_Called.cs @@ -1,34 +1,29 @@ -using NSubstitute; +using FluentAssertions; +using Newtonsoft.Json; +using NSubstitute; using Sfa.Tl.ResultsAndCertification.Api.Client.Clients; using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; -using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; using System.Net; -using System.Text; +using System.Net.Http; using System.Threading.Tasks; using Xunit; -using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; -using FluentAssertions; namespace Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests.Clients.ResultsAndCertificationInternalApiClientTest { - public class When_GetAdminChangeStartYear_Called:BaseTest + public class When_ProcessAdminAddPathwayResult_Called : BaseTest { - private readonly long _ukprn = 12345678; - private readonly int _pathwayId = 1; - private readonly RegistrationPathwayStatus _registrationPathwayStatus = RegistrationPathwayStatus.Active; - protected AdminLearnerRecord _mockHttpResult; - private ITokenServiceClient _tokenServiceClient; private ResultsAndCertificationConfiguration _configuration; private ResultsAndCertificationInternalApiClient _apiClient; - private AdminLearnerRecord _result; + private readonly bool _mockHttpResult = true; + + private AddPathwayResultRequest _model; + private bool _result; public override void Setup() { @@ -39,42 +34,34 @@ public override void Setup() ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://tlevel.api.com" } }; - _mockHttpResult = new AdminLearnerRecord + _model = new AddPathwayResultRequest { - PathwayId = 1, - Uln = 1234567890, - Name = "John Smith", - DateofBirth = System.DateTime.UtcNow.AddYears(-29), - ProviderName = "NCFE", RegistrationPathwayId = 1, - TlPathwayId = 1, - ProviderUkprn = 1008900, - TlevelName = "", - AcademicYear = 2020 - + PathwayAssessmentId = 1, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "", + ZendeskId = "987654321", + CreatedBy = "created-by" }; } public override void Given() { - HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, string.Format(ApiConstants.GetAdminLearnerRecordUri, _pathwayId), HttpStatusCode.OK)); + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminAddPathwayResult, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); } public async override Task When() { - _result = await _apiClient.GetAdminLearnerRecordAsync(_pathwayId); + _result = await _apiClient.ProcessAdminAddPathwayResultAsync(_model); } [Fact] public void Then_Returns_Expected_Results() { - _result.Should().NotBeNull(); - _result.Uln.Should().Be(_mockHttpResult.Uln); - _result.Name.Should().Be(_mockHttpResult.Name); - _result.TlevelName.Should().Be(_mockHttpResult.TlevelName); - _result.DateofBirth.Should().Be(_mockHttpResult.DateofBirth); - _result.AcademicYear.Should().Be(_mockHttpResult.AcademicYear); + _result.Should().Be(_mockHttpResult); } } -} +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeIndustryPlacement_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs similarity index 53% rename from src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeIndustryPlacement_Called.cs rename to src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs index 921375b06..ac515a677 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminChangeIndustryPlacement_Called.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs @@ -1,12 +1,13 @@ using FluentAssertions; +using Newtonsoft.Json; using NSubstitute; using Sfa.Tl.ResultsAndCertification.Api.Client.Clients; using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; -using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using System; using System.Net; using System.Net.Http; using System.Threading.Tasks; @@ -14,16 +15,15 @@ namespace Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests.Clients.ResultsAndCertificationInternalApiClientTest { - public class When_GetAdminChangeIndustryPlacement_Called : BaseTest + public class When_ProcessAdminAddSpecialismResult_Called : BaseTest { - private readonly long _ukprn = 12345678; - private readonly int _pathwayId = 1; - protected AdminLearnerRecord _mockHttpResult; - private ITokenServiceClient _tokenServiceClient; private ResultsAndCertificationConfiguration _configuration; private ResultsAndCertificationInternalApiClient _apiClient; - private AdminLearnerRecord _result; + private readonly bool _mockHttpResult = true; + + private AddSpecialismResultRequest _model; + private bool _result; public override void Setup() { @@ -34,44 +34,34 @@ public override void Setup() ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://tlevel.api.com" } }; - _mockHttpResult = new AdminLearnerRecord + _model = new AddSpecialismResultRequest { - PathwayId = 1, - Uln = 1234567890, - Name = "John Smith", - DateofBirth = System.DateTime.UtcNow.AddYears(-29), - ProviderName = "NCFE", RegistrationPathwayId = 1, - TlPathwayId = 1, - ProviderUkprn = 1008900, - TlevelName = "", - AcademicYear = 2020, - IndustryPlacementStatus = IndustryPlacementStatus.Completed - + SpecialismAssessmentId = 1, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "", + ZendeskId = "987654321", + CreatedBy = "created-by" }; } public override void Given() { - HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, string.Format(ApiConstants.GetAdminLearnerRecordUri, _pathwayId), HttpStatusCode.OK)); + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminAddSpecialismResult, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); } public async override Task When() { - _result = await _apiClient.GetAdminLearnerRecordAsync(_pathwayId); + _result = await _apiClient.ProcessAdminAddSpecialismResultAsync(_model); } [Fact] public void Then_Returns_Expected_Results() { - _result.Should().NotBeNull(); - _result.Uln.Should().Be(_mockHttpResult.Uln); - _result.Name.Should().Be(_mockHttpResult.Name); - _result.TlevelName.Should().Be(_mockHttpResult.TlevelName); - _result.DateofBirth.Should().Be(_mockHttpResult.DateofBirth); - _result.AcademicYear.Should().Be(_mockHttpResult.AcademicYear); - _result.IndustryPlacementStatus.Should().Be(_mockHttpResult.IndustryPlacementStatus); + _result.Should().Be(_mockHttpResult); } } -} +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs index a6b3bc9ba..5012e47b3 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs @@ -4,19 +4,17 @@ using Sfa.Tl.ResultsAndCertification.Application.Mappers; using Sfa.Tl.ResultsAndCertification.Application.Services; using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Data.Factory; using Sfa.Tl.ResultsAndCertification.Data.Interfaces; -using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; using System; -using IndustryPlacement = Sfa.Tl.ResultsAndCertification.Domain.Models.IndustryPlacement; namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests { public abstract class AdminDashboardServiceBaseTest : BaseTest { protected IAdminDashboardRepository AdminDashboardRepository; - protected IRepository RegistrationPathwayRepo; - protected IRepository IndustryPlacementRepo; + protected IRepositoryFactory RepositoryFactory; protected ISystemProvider SystemProvider; protected ICommonService CommonService; protected IMapper Mapper; @@ -28,16 +26,14 @@ public override void Setup() var today = new DateTime(2023, 1, 1); AdminDashboardRepository = Substitute.For(); - RegistrationPathwayRepo = Substitute.For>(); - IndustryPlacementRepo = Substitute.For>(); + RepositoryFactory = Substitute.For(); SystemProvider = Substitute.For(); SystemProvider.UtcToday.Returns(today); - CommonService = Substitute.For(); Mapper = CreateMapper(); - AdminDashboardService = new AdminDashboardService(AdminDashboardRepository, RegistrationPathwayRepo, IndustryPlacementRepo, SystemProvider, CommonService, Mapper); + AdminDashboardService = new AdminDashboardService(AdminDashboardRepository, RepositoryFactory, SystemProvider, Mapper); } private static AutoMapper.Mapper CreateMapper() diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs new file mode 100644 index 000000000..f270928e1 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs @@ -0,0 +1,23 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public abstract class ProcessAdminAddPathwayResultTestsBase : AdminDashboardServiceBaseTest + { + protected static AddPathwayResultRequest CreateRequest(int registrationPathwayId, int pathwayAssessmentId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + PathwayAssessmentId = pathwayAssessmentId, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskId = "1234567890", + CreatedBy = "created-by" + }; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs new file mode 100644 index 000000000..f73866988 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Linq.Expressions; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public class When_Assessment_Doesnt_Exist : ProcessAdminAddPathwayResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private readonly IRepository _pathwayAssessmentRepo = Substitute.For>(); + + private AddPathwayResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayAssessmentId); + _pathwayAssessmentRepo.GetSingleOrDefaultAsync(Arg.Any>>()).Returns(null as TqPathwayAssessment); + + RepositoryFactory.GetRepository().Returns(_pathwayAssessmentRepo); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddPathwayResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Exists.cs new file mode 100644 index 000000000..6680c2401 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Exists.cs @@ -0,0 +1,52 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public class When_Assessment_Exists : ProcessAdminAddPathwayResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private readonly IRepository _pathwayAssessmentRepo = Substitute.For>(); + private readonly IRepository _pathwayResultRepo = Substitute.For>(); + private readonly IRepository _changeLogRepo = Substitute.For>(); + + private AddPathwayResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayAssessmentId); + + DateTime utcNow = new(2024, 1, 1); + SystemProvider.UtcNow.Returns(utcNow); + + _pathwayAssessmentRepo.GetSingleOrDefaultAsync(Arg.Any>>()).Returns(new TqPathwayAssessment()); + _pathwayResultRepo.CreateAsync(Arg.Any()).Returns(1); + _changeLogRepo.CreateAsync(Arg.Any()).Returns(1); + + RepositoryFactory.GetRepository().Returns(_pathwayAssessmentRepo); + RepositoryFactory.GetRepository().Returns(_pathwayResultRepo); + RepositoryFactory.GetRepository().Returns(_changeLogRepo); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddPathwayResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_True() + { + _result.Should().BeTrue(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/ProcessAdminAddSpecialismResultTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/ProcessAdminAddSpecialismResultTestsBase.cs new file mode 100644 index 000000000..95f910164 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/ProcessAdminAddSpecialismResultTestsBase.cs @@ -0,0 +1,23 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResult +{ + public abstract class ProcessAdminAddSpecialismResultTestsBase : AdminDashboardServiceBaseTest + { + protected static AddSpecialismResultRequest CreateRequest(int registrationPathwayId, int specialismAssessmentId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + SpecialismAssessmentId = specialismAssessmentId, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskId = "1234567890", + CreatedBy = "created-by" + }; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Doesnt_Exist.cs new file mode 100644 index 000000000..acbc1f4c6 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Doesnt_Exist.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Linq.Expressions; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResult +{ + public class When_Assessment_Doesnt_Exist : ProcessAdminAddSpecialismResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private readonly IRepository _specialismAssessmentRepo = Substitute.For>(); + + private AddSpecialismResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayAssessmentId); + _specialismAssessmentRepo.GetSingleOrDefaultAsync(Arg.Any>>()).Returns(null as TqSpecialismAssessment); + + RepositoryFactory.GetRepository().Returns(_specialismAssessmentRepo); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddSpecialismResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Exists.cs new file mode 100644 index 000000000..f573088df --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResult/When_Assessment_Exists.cs @@ -0,0 +1,52 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResult +{ + public class When_Assessment_Exists : ProcessAdminAddSpecialismResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 1; + + private readonly IRepository _specialismAssessmentRepo = Substitute.For>(); + private readonly IRepository _specialismResultRepo = Substitute.For>(); + private readonly IRepository _changeLogRepo = Substitute.For>(); + + private AddSpecialismResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, SpecialismAssessmentId); + + DateTime utcNow = new(2024, 1, 1); + SystemProvider.UtcNow.Returns(utcNow); + + _specialismAssessmentRepo.GetSingleOrDefaultAsync(Arg.Any>>()).Returns(new TqSpecialismAssessment()); + _specialismResultRepo.CreateAsync(Arg.Any()).Returns(1); + _changeLogRepo.CreateAsync(Arg.Any()).Returns(1); + + RepositoryFactory.GetRepository().Returns(_specialismAssessmentRepo); + RepositoryFactory.GetRepository().Returns(_specialismResultRepo); + RepositoryFactory.GetRepository().Returns(_changeLogRepo); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddSpecialismResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_True() + { + _result.Should().BeTrue(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs index 26645ad2e..e85b773b0 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/AdminDashboardServiceBaseTest.cs @@ -1,15 +1,14 @@ using AutoMapper; -using Microsoft.Extensions.Logging; -using Notify.Interfaces; +using Microsoft.Extensions.Logging.Abstractions; using Sfa.Tl.ResultsAndCertification.Application.Interfaces; using Sfa.Tl.ResultsAndCertification.Application.Mappers; using Sfa.Tl.ResultsAndCertification.Application.Services; using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; -using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; +using Sfa.Tl.ResultsAndCertification.Data.Factory; using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.Domain.Models; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Tests.Common.DataBuilders; using Sfa.Tl.ResultsAndCertification.Tests.Common.DataProvider; using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; @@ -21,82 +20,44 @@ namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboar { public abstract class AdminDashboardServiceBaseTest : BaseTest { - protected long AoUkprn = 10011881; - protected LearnerService LearnerService; - protected TlRoute Route; - protected TlPathway Pathway; - protected IList Specialisms; - protected TlProvider TlProvider; - protected TlAwardingOrganisation TlAwardingOrganisation; - protected TqAwardingOrganisation TqAwardingOrganisation; protected TqProvider TqProvider; - protected IList TlProviders; - protected IList TqProviders; - protected IList AssessmentSeries; - protected IList TlLookup; - public IList AcademicYears; - - protected IRepository RegistrationPathwayRepository; - protected ILogger> RegistrationPathwayRepositoryLogger; - - protected IMapper Mapper; - - protected ICommonService commonService; - protected CommonService CommonService; - protected ILogger CommonServiceLogger; - - protected IRepository TlLookupRepository; - protected IRepository FunctionLogRepository; - protected ICommonRepository CommonRepository; - protected ResultsAndCertificationConfiguration Configuration; - - protected IMapper CommonMapper; - protected ILogger> TlLookupRepositoryLogger; - protected ILogger> FunctionLogRepositoryLogger; - protected ILogger> ChangeLogRepositoryLogger; - protected IRepository ChangeLogRepository; - protected ILogger LearnerRepositoryLogger; - protected ILearnerRepository LearnerRepository; - - protected IAdminDashboardService AdminDashboardService; - protected IAdminDashboardRepository AdminDashboardRepository; - - - protected IAsyncNotificationClient NotificationsClient; - protected ILogger NotificationLogger; - protected IRepository NotificationTemplateRepository; - protected ILogger> NotificationTemplateRepositoryLogger; - protected ILogger NotificationServiceLogger; - protected INotificationService NotificationService; protected ISystemProvider SystemProvider; - protected IList IpLookup; - + private IList _specialisms; + private IList _academicYears; + protected IList AssessmentSeries; + + protected IAdminDashboardService AdminDashboardService; - protected virtual void CreateMapper() + protected void CreateAdminDasboardService() { - var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(LearnerMapper).Assembly)); - Mapper = new Mapper(mapperConfig); + var adminDashboardRepository = new AdminDashboardRepository(DbContext); + var repositoryFactory = new RepositoryFactory(new NullLoggerFactory(), DbContext); + SystemProvider = new SystemProvider(); + var mapper = CreateMapper(); + + AdminDashboardService = new AdminDashboardService(adminDashboardRepository, repositoryFactory, SystemProvider, mapper); } - protected virtual void CreateCommonMapper() + private static Mapper CreateMapper() { - var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(CommonMapper).Assembly)); - CommonMapper = new Mapper(mapperConfig); + var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(LearnerMapper).Assembly)); + return new Mapper(mapperConfig); } protected virtual void SeedTestData(EnumAwardingOrganisation awardingOrganisation = EnumAwardingOrganisation.Pearson, bool seedMultipleProviders = false) { - TlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); - Route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); - Pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, Route); - Specialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, Pathway); - TqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, Pathway, TlAwardingOrganisation); - TlProvider = ProviderDataProvider.CreateTlProvider(DbContext); - TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, TqAwardingOrganisation, TlProvider); + var tlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); + var route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); + var _pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, route); + _specialisms = TlevelDataProvider.CreateTlSpecialisms(DbContext, awardingOrganisation, _pathway); + var tqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, _pathway, tlAwardingOrganisation); + var tlProvider = ProviderDataProvider.CreateTlProvider(DbContext); + TqProvider = ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider); AssessmentSeries = AssessmentSeriesDataProvider.CreateAssessmentSeriesList(DbContext, null, true); - TlLookup = TlLookupDataProvider.CreateTlLookupList(DbContext, null, true); - AcademicYears = AcademicYearDataProvider.CreateAcademicYearList(DbContext, null); + TlLookupDataProvider.CreateTlLookupList(DbContext, null, true); + _academicYears = AcademicYearDataProvider.CreateAcademicYearList(DbContext, null); + DbContext.SaveChangesAsync(); } @@ -117,7 +78,7 @@ public TqRegistrationProfile SeedRegistrationData(long uln, RegistrationPathwayS var tqRegistrationProfile = RegistrationsDataProvider.CreateTqRegistrationProfile(DbContext, profile); var tqRegistrationPathway = RegistrationsDataProvider.CreateTqRegistrationPathway(DbContext, tqRegistrationProfile, tqProvider ?? TqProvider); var tqRegistrationSpecialisms = isCouplet ? RegistrationsDataProvider.CreateTqRegistrationSpecialisms(DbContext, tqRegistrationPathway) - : new List { RegistrationsDataProvider.CreateTqRegistrationSpecialism(DbContext, tqRegistrationPathway, Specialisms.First()) }; + : new List { RegistrationsDataProvider.CreateTqRegistrationSpecialism(DbContext, tqRegistrationPathway, _specialisms.First()) }; if (status == RegistrationPathwayStatus.Withdrawn) { @@ -134,10 +95,6 @@ public TqRegistrationProfile SeedRegistrationData(long uln, RegistrationPathwayS return profile; } - - - - public List GetPathwayAssessmentsDataToProcess(List pathwayRegistrations, bool seedPathwayAssessmentsAsActive = true, bool isHistorical = false, string assessmentSeriesName = "Summer 2021") { var tqPathwayAssessments = new List(); @@ -205,15 +162,71 @@ public void RegisterUlnForNextAcademicYear(List _registra ulns.ToList().ForEach(uln => { var registration = _registrations.FirstOrDefault(x => x.UniqueLearnerNumber == uln); - registration.TqRegistrationPathways.FirstOrDefault().AcademicYear = AcademicYears.FirstOrDefault(x => DateTime.Today >= x.StartDate && DateTime.Today <= x.EndDate).Year + 1; + registration.TqRegistrationPathways.FirstOrDefault().AcademicYear = _academicYears.FirstOrDefault(x => DateTime.Today >= x.StartDate && DateTime.Today <= x.EndDate).Year + 1; }); } public void SeedSpecialConsiderationsLookupData() { - IpLookup = IpLookupDataProvider.CreateIpLookupList(DbContext, null, IpLookupType.SpecialConsideration, true); + IpLookupDataProvider.CreateIpLookupList(DbContext, null, IpLookupType.SpecialConsideration, true); DbContext.SaveChanges(); } - + + public List SeedPathwayAssessmentsData(List pathwayAssessments, bool saveChanges = true) + { + var tqPathwayAssessment = PathwayAssessmentDataProvider.CreateTqPathwayAssessments(DbContext, pathwayAssessments); + if (saveChanges) + DbContext.SaveChanges(); + + return tqPathwayAssessment; + } + + public List SeedSpecialismAssessmentsData(List specialismAssessments, bool saveChanges = true) + { + var tqSpecialismAssessments = SpecialismAssessmentDataProvider.CreateTqSpecialismAssessments(DbContext, specialismAssessments); + if (saveChanges) + DbContext.SaveChanges(); + + return tqSpecialismAssessments; + } + + public List SeedPathwayResultsData(List pathwayResults, bool saveChanges = true) + { + var tqPathwayResult = TqPathwayResultDataProvider.CreateTqPathwayResults(DbContext, pathwayResults); + if (saveChanges) + DbContext.SaveChanges(); + + return tqPathwayResult; + } + + public List GetSpecialismAssessmentsDataToProcess(List specialismRegistrations, bool seedSpecialismAssessmentsAsActive = true, bool isHistorical = false, string assessmentSeriesName = "Summer 2021") + { + var tqSpecialismAssessments = new List(); + + foreach (var (specialismRegistration, index) in specialismRegistrations.Select((value, i) => (value, i))) + { + if (isHistorical) + { + // Historical record + var specialismAssessment = new TqSpecialismAssessmentBuilder().Build(specialismRegistration, AssessmentSeries[index]); + specialismAssessment.IsOptedin = false; + specialismAssessment.EndDate = DateTime.UtcNow.AddDays(-1); + + var tqSpecialismAssessmentHistorical = SpecialismAssessmentDataProvider.CreateTqSpecialismAssessment(DbContext, specialismAssessment); + tqSpecialismAssessments.Add(tqSpecialismAssessmentHistorical); + } + + var activeSpecialismAssessment = new TqSpecialismAssessmentBuilder().Build(specialismRegistration, AssessmentSeries[index]); + var tqSpecialismAssessment = SpecialismAssessmentDataProvider.CreateTqSpecialismAssessment(DbContext, activeSpecialismAssessment); + if (!seedSpecialismAssessmentsAsActive) + { + tqSpecialismAssessment.IsOptedin = specialismRegistration.TqRegistrationPathway.Status == RegistrationPathwayStatus.Withdrawn; + tqSpecialismAssessment.EndDate = DateTime.UtcNow; + } + tqSpecialismAssessments.Add(tqSpecialismAssessment); + + } + return tqSpecialismAssessments; + } } -} +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs new file mode 100644 index 000000000..7a1af49cc --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/ProcessAdminAddPathwayResultTestsBase.cs @@ -0,0 +1,76 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using System; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public abstract class ProcessAdminAddPathwayResultTestsBase : AdminDashboardServiceBaseTest + { + protected int CreateAndSavePathwayAssessment(int registrationPathwayId, DateTime? endDate = null) + { + AssessmentSeries assessmentSeries = CreateAssessmentSeries(); + DbContext.Add(assessmentSeries); + DbContext.SaveChanges(); + + TqPathwayAssessment assessment = CreatePathwayAssessment(registrationPathwayId, assessmentSeries.Id, endDate); + DbContext.Add(assessment); + DbContext.SaveChanges(); + + return assessment.Id; + } + + protected static AddPathwayResultRequest CreateRequest(int registrationPathwayId, int pathwayAssessmentId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + PathwayAssessmentId = pathwayAssessmentId, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskId = "1234567890", + CreatedBy = "created-by" + }; + } + + private static AssessmentSeries CreateAssessmentSeries() + { + DateTime currentDate = new(2020, 11, 25); + + return new() + { + ComponentType = ComponentType.Core, + Name = "Summer 2021", + Description = "Summer 2021", + Year = 2021, + StartDate = currentDate, + EndDate = currentDate.AddMonths(3), + RommEndDate = currentDate.AddMonths(4), + AppealEndDate = currentDate.AddMonths(5), + ResultCalculationYear = 2020, + ResultPublishDate = currentDate.AddMonths(6), + PrintAvailableDate = currentDate.AddMonths(7), + CreatedBy = Constants.CreatedByUser, + CreatedOn = Constants.CreatedOn, + ModifiedBy = Constants.ModifiedByUser, + ModifiedOn = Constants.ModifiedOn + }; + } + + private static TqPathwayAssessment CreatePathwayAssessment(int registrationPathwayId, int assessmentSeriesId, DateTime? endDate) + { + return new() + { + TqRegistrationPathwayId = registrationPathwayId, + AssessmentSeriesId = assessmentSeriesId, + StartDate = new DateTime(2021, 1, 1), + EndDate = endDate, + IsOptedin = true, + IsBulkUpload = false + }; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs new file mode 100644 index 000000000..456daedf4 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Doesnt_Exist.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public class When_Assessment_Doesnt_Exist : ProcessAdminAddPathwayResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private AddPathwayResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayAssessmentId); + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddPathwayResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Active_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Active_Learner.cs new file mode 100644 index 000000000..56210212d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Active_Learner.cs @@ -0,0 +1,57 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public class When_Assessment_Is_From_Active_Learner : ProcessAdminAddPathwayResultTestsBase + { + private const int RegistrationPathwayId = 1; + + private AddPathwayResultRequest _request; + private bool _result; + + public override void Given() + { + int pathwayAssessmentId = CreateAndSavePathwayAssessment(RegistrationPathwayId); + _request = CreateRequest(RegistrationPathwayId, pathwayAssessmentId); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddPathwayResultAsync(_request); + } + + [Fact] + public async Task Then_Should_Return_True() + { + _result.Should().BeTrue(); + + TqPathwayResult pathwayResult = await DbContext.TqPathwayResult.SingleAsync(ip => ip.TqPathwayAssessmentId == _request.PathwayAssessmentId); + pathwayResult.TqPathwayAssessmentId.Should().Be(_request.PathwayAssessmentId); + pathwayResult.TlLookupId.Should().Be(_request.SelectedGradeId); + pathwayResult.IsOptedin.Should().BeTrue(); + pathwayResult.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + pathwayResult.EndDate.Should().BeNull(); + pathwayResult.IsBulkUpload.Should().BeFalse(); + pathwayResult.CreatedBy.Should().Be(_request.CreatedBy); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs new file mode 100644 index 000000000..8977efa40 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs @@ -0,0 +1,57 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddPathwayResultTests +{ + public class When_Assessment_Is_From_Withdrawn_Learner : ProcessAdminAddPathwayResultTestsBase + { + private const int RegistrationPathwayId = 1; + + private AddPathwayResultRequest _request; + private bool _result; + + public override void Given() + { + int pathwayAssessmentId = CreateAndSavePathwayAssessment(RegistrationPathwayId, new DateTime(2024, 1, 1)); + _request = CreateRequest(RegistrationPathwayId, pathwayAssessmentId); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddPathwayResultAsync(_request); + } + + [Fact] + public async Task Then_Should_Return_True() + { + _result.Should().BeTrue(); + + TqPathwayResult pathwayResult = await DbContext.TqPathwayResult.SingleAsync(ip => ip.TqPathwayAssessmentId == _request.PathwayAssessmentId); + pathwayResult.TqPathwayAssessmentId.Should().Be(_request.PathwayAssessmentId); + pathwayResult.TlLookupId.Should().Be(_request.SelectedGradeId); + pathwayResult.IsOptedin.Should().BeTrue(); + pathwayResult.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + pathwayResult.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + pathwayResult.IsBulkUpload.Should().BeFalse(); + pathwayResult.CreatedBy.Should().Be(_request.CreatedBy); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/ProcessAdminAddSpecialismResultTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/ProcessAdminAddSpecialismResultTestsBase.cs new file mode 100644 index 000000000..044382546 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/ProcessAdminAddSpecialismResultTestsBase.cs @@ -0,0 +1,76 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using System; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResultTests +{ + public abstract class ProcessAdminAddSpecialismResultTestsBase : AdminDashboardServiceBaseTest + { + protected int CreateAndSaveSpecialismAssessment(int registrationSpecialismId, DateTime? endDate = null) + { + AssessmentSeries assessmentSeries = CreateAssessmentSeries(); + DbContext.Add(assessmentSeries); + DbContext.SaveChanges(); + + TqSpecialismAssessment assessment = CreateSpecialismAssessment(registrationSpecialismId, assessmentSeries.Id, endDate); + DbContext.Add(assessment); + DbContext.SaveChanges(); + + return assessment.Id; + } + + protected static AddSpecialismResultRequest CreateRequest(int registrationPathwayId, int specialismAssessmentId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + SpecialismAssessmentId = specialismAssessmentId, + SelectedGradeId = 1, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskId = "1234567890", + CreatedBy = "created-by" + }; + } + + private static AssessmentSeries CreateAssessmentSeries() + { + DateTime currentDate = new(2020, 11, 25); + + return new() + { + ComponentType = ComponentType.Core, + Name = "Summer 2021", + Description = "Summer 2021", + Year = 2021, + StartDate = currentDate, + EndDate = currentDate.AddMonths(3), + RommEndDate = currentDate.AddMonths(4), + AppealEndDate = currentDate.AddMonths(5), + ResultCalculationYear = 2020, + ResultPublishDate = currentDate.AddMonths(6), + PrintAvailableDate = currentDate.AddMonths(7), + CreatedBy = Constants.CreatedByUser, + CreatedOn = Constants.CreatedOn, + ModifiedBy = Constants.ModifiedByUser, + ModifiedOn = Constants.ModifiedOn + }; + } + + private static TqSpecialismAssessment CreateSpecialismAssessment(int registrationSpecialismId, int assessmentSeriesId, DateTime? endDate) + { + return new() + { + TqRegistrationSpecialismId = registrationSpecialismId, + AssessmentSeriesId = assessmentSeriesId, + StartDate = new DateTime(2021, 1, 1), + EndDate = endDate, + IsOptedin = true, + IsBulkUpload = false + }; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Doesnt_Exist.cs new file mode 100644 index 000000000..4e9265e18 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Doesnt_Exist.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResultTests +{ + public class When_Assessment_Doesnt_Exist : ProcessAdminAddSpecialismResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 1; + + private AddSpecialismResultRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, SpecialismAssessmentId); + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddSpecialismResultAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs new file mode 100644 index 000000000..826f6522f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs @@ -0,0 +1,58 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResultTests +{ + public class When_Assessment_Is_From_Active_Learner : ProcessAdminAddSpecialismResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int RegistrationSpecialismId = 1; + + private AddSpecialismResultRequest _request; + private bool _result; + + public override void Given() + { + int specialismAssessmentId = CreateAndSaveSpecialismAssessment(RegistrationSpecialismId); + _request = CreateRequest(RegistrationPathwayId, specialismAssessmentId); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddSpecialismResultAsync(_request); + } + + [Fact] + public async Task Then_Should_Return_True() + { + _result.Should().BeTrue(); + + TqSpecialismResult specialismResult = await DbContext.TqSpecialismResult.SingleAsync(ip => ip.TqSpecialismAssessmentId == _request.SpecialismAssessmentId); + specialismResult.TqSpecialismAssessmentId.Should().Be(_request.SpecialismAssessmentId); + specialismResult.TlLookupId.Should().Be(_request.SelectedGradeId); + specialismResult.IsOptedin.Should().BeTrue(); + specialismResult.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + specialismResult.EndDate.Should().BeNull(); + specialismResult.IsBulkUpload.Should().BeFalse(); + specialismResult.CreatedBy.Should().Be(_request.CreatedBy); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs new file mode 100644 index 000000000..ecd6f5b25 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs @@ -0,0 +1,58 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessAdminAddSpecialismResultTests +{ + public class When_Assessment_Is_From_Withdrawn_Learner : ProcessAdminAddSpecialismResultTestsBase + { + private const int RegistrationPathwayId = 1; + private const int RegistrationSpecialismId = 1; + + private AddSpecialismResultRequest _request; + private bool _result; + + public override void Given() + { + int specialismAssessmentId = CreateAndSaveSpecialismAssessment(RegistrationSpecialismId, new DateTime(2024, 1, 1)); + _request = CreateRequest(RegistrationPathwayId, specialismAssessmentId); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessAdminAddSpecialismResultAsync(_request); + } + + [Fact] + public async Task Then_Should_Return_True() + { + _result.Should().BeTrue(); + + TqSpecialismResult specialismResult = await DbContext.TqSpecialismResult.SingleAsync(ip => ip.TqSpecialismAssessmentId == _request.SpecialismAssessmentId); + specialismResult.TqSpecialismAssessmentId.Should().Be(_request.SpecialismAssessmentId); + specialismResult.TlLookupId.Should().Be(_request.SelectedGradeId); + specialismResult.IsOptedin.Should().BeTrue(); + specialismResult.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + specialismResult.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + specialismResult.IsBulkUpload.Should().BeFalse(); + specialismResult.CreatedBy.Should().Be(_request.CreatedBy); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs new file mode 100644 index 000000000..64a1c83ce --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs @@ -0,0 +1,146 @@ +using FluentAssertions; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Application.Services; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Data.Repositories; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests +{ + public class When_ProcessRemoveAssessmentEntry_IsCalled : AdminDashboardServiceBaseTest + { + private Dictionary _ulns; + private ReviewRemoveAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; + private List _registrations; + private List _pathwayAssessments; + + private bool _result; + private int AssessmentId; + private int RegistrationPathwayId; + + public override void Given() + { + // Parameters + _ulns = new Dictionary + { + { 1111111111, RegistrationPathwayStatus.Active }, + { 1111111112, RegistrationPathwayStatus.Active }, + { 1111111113, RegistrationPathwayStatus.Withdrawn }, + { 1111111114, RegistrationPathwayStatus.Active }, + { 1111111115, RegistrationPathwayStatus.Active }, + }; + + // Registrations seed + SeedTestData(EnumAwardingOrganisation.Pearson, true); + _registrations = SeedRegistrationsData(_ulns, TqProvider); + + // Assessments seed + var tqPathwayAssessmentsSeedData = new List(); + var tqPathwayResultsSeedData = new List(); + foreach (var registration in _registrations.Where(x => x.UniqueLearnerNumber != 1111111111)) + { + var hasHitoricData = new List { 1111111112 }; + var isHistoricAssessent = hasHitoricData.Any(x => x == registration.UniqueLearnerNumber); + var isLatestActive = _ulns[registration.UniqueLearnerNumber] != RegistrationPathwayStatus.Withdrawn; + + var pathwayAssessments = GetPathwayAssessmentsDataToProcess(registration.TqRegistrationPathways.ToList(), isLatestActive, isHistoricAssessent); + tqPathwayAssessmentsSeedData.AddRange(pathwayAssessments); + + //Build Pathway results + var ulnWithResult = new List { 1111111114, 1111111115 }; + if (ulnWithResult.Any(x => x == registration.UniqueLearnerNumber)) + { + foreach (var assessment in pathwayAssessments) + { + var hasHitoricResult = new List { 1111111115 }; + var isHistoricResult = hasHitoricResult.Any(x => x == registration.UniqueLearnerNumber); + var isLatestActiveResult = !isHistoricResult; + + var tqPathwayResultSeedData = GetPathwayResultDataToProcess(assessment, isLatestActiveResult, isHistoricResult); + tqPathwayResultsSeedData.AddRange(tqPathwayResultSeedData); + } + } + } + _pathwayAssessments = SeedPathwayAssessmentsData(tqPathwayAssessmentsSeedData, false); + SeedPathwayResultsData(tqPathwayResultsSeedData); + + CreateAdminDasboardService(); + } + + public override Task When() + { + return Task.CompletedTask; + } + + public async Task WhenAsync() + { + var assessment = DbContext.TqPathwayAssessment.FirstOrDefault(s => s.IsOptedin && s.EndDate == null && s.TqRegistrationPathway.Status == RegistrationPathwayStatus.Active); + + AssessmentId = assessment.Id; + RegistrationPathwayId = assessment.TqRegistrationPathwayId; + + ReviewRemoveAssessmentEntryRequest = new ReviewRemoveAssessmentEntryRequest + { + AssessmentId = AssessmentId, + ComponentType = ComponentType.Core, + RegistrationPathwayId = RegistrationPathwayId, + CreatedBy = "Admin User", + ChangeReason = "Change Reason", + ContactName = "Test User", + RequestDate = SystemProvider.Today, + ZendeskId = "123456789", + ChangeAssessmentDetails = new() + { + From = "Autumn 2023", + To = string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, "Autumn 2022"), + PathwayName = "Design, Surveying and Planning (10123456)" + } + }; + + _result = await AdminDashboardService.ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest); + } + + [Fact] + public async Task Then_Expected_Results_Are_Returned() + { + await WhenAsync(); + _result.Should().Be(true); + + var actualPathwayAssessment = DbContext.TqPathwayAssessment.SingleOrDefault(s => s.Id == ReviewRemoveAssessmentEntryRequest.AssessmentId); + var actualChangeLog = DbContext.ChangeLog.SingleOrDefault(s => s.TqRegistrationPathwayId == ReviewRemoveAssessmentEntryRequest.RegistrationPathwayId); + var actualChangeDetails = JsonConvert.DeserializeObject(actualChangeLog.Details); + + actualPathwayAssessment.Should().NotBeNull(); + actualPathwayAssessment.IsOptedin.Should().BeFalse(); + actualPathwayAssessment.EndDate.Should().NotBeNull(); + actualPathwayAssessment.ModifiedBy.Should().NotBeNull(); + actualPathwayAssessment.ModifiedOn.Should().NotBeNull(); + + actualChangeLog.Should().NotBeNull(); + actualChangeLog.ChangeType.Should().Be((int)ReviewRemoveAssessmentEntryRequest.ChangeType); + actualChangeLog.Name.Should().Be(ReviewRemoveAssessmentEntryRequest.ContactName); + actualChangeLog.CreatedBy.Should().Be(ReviewRemoveAssessmentEntryRequest.CreatedBy); + actualChangeLog.ReasonForChange.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeReason); + actualChangeLog.DateOfRequest.Should().Be(ReviewRemoveAssessmentEntryRequest.RequestDate); + actualChangeLog.ZendeskTicketID.Should().Be(ReviewRemoveAssessmentEntryRequest.ZendeskId); + + actualChangeDetails.Should().NotBeNull(); + actualChangeDetails.From.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeAssessmentDetails.From); + actualChangeDetails.To.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeAssessmentDetails.To); + actualChangeDetails.PathwayName.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeAssessmentDetails.PathwayName); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs new file mode 100644 index 000000000..3c8f27b50 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs @@ -0,0 +1,144 @@ +using FluentAssertions; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests +{ + public class When_ProcessRemoveSpecialismAssessmentEntry_IsCalled : AdminDashboardServiceBaseTest + { + private Dictionary _ulns; + private ReviewRemoveAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; + private List _registrations; + private List _specialismAssessments; + + private bool _result; + private int AssessmentId; + private int RegistrationPathwayId; + + public override void Given() + { + // Parameters + _ulns = new Dictionary + { + { 1111111111, RegistrationPathwayStatus.Active }, + { 1111111112, RegistrationPathwayStatus.Active }, + { 1111111113, RegistrationPathwayStatus.Withdrawn }, + { 1111111114, RegistrationPathwayStatus.Active }, + { 1111111115, RegistrationPathwayStatus.Active }, + }; + + // Registrations seed + SeedTestData(EnumAwardingOrganisation.Pearson, true); + _registrations = SeedRegistrationsData(_ulns, TqProvider); + + // Specialisms seed + var tqSpecialismAssessmentsSeedData = new List(); + + // Assessments seed + var tqPathwayAssessmentsSeedData = new List(); + var tqPathwayResultsSeedData = new List(); + foreach (var registration in _registrations.Where(x => x.UniqueLearnerNumber != 1111111111)) + { + var hasHitoricData = new List { 1111111112 }; + var isHistoricAssessent = hasHitoricData.Any(x => x == registration.UniqueLearnerNumber); + var isLatestActive = _ulns[registration.UniqueLearnerNumber] != RegistrationPathwayStatus.Withdrawn; + + var pathwayAssessments = GetPathwayAssessmentsDataToProcess(registration.TqRegistrationPathways.ToList(), isLatestActive, isHistoricAssessent); + tqPathwayAssessmentsSeedData.AddRange(pathwayAssessments); + + //Build Pathway results + var ulnWithResult = new List { 1111111114, 1111111115 }; + if (ulnWithResult.Any(x => x == registration.UniqueLearnerNumber)) + { + foreach (var assessment in pathwayAssessments) + { + var hasHitoricResult = new List { 1111111115 }; + var isHistoricResult = hasHitoricResult.Any(x => x == registration.UniqueLearnerNumber); + var isLatestActiveResult = !isHistoricResult; + + var specialismAssessments = GetSpecialismAssessmentsDataToProcess(registration.TqRegistrationPathways.SelectMany(p => p.TqRegistrationSpecialisms).ToList(), isLatestActive, isHistoricAssessent); + tqSpecialismAssessmentsSeedData.AddRange(specialismAssessments); + } + } + } + _specialismAssessments = SeedSpecialismAssessmentsData(tqSpecialismAssessmentsSeedData); + + SeedPathwayResultsData(tqPathwayResultsSeedData); + + CreateAdminDasboardService(); + } + + public override Task When() + { + return Task.CompletedTask; + } + + public async Task WhenAsync() + { + TqSpecialismAssessment specialismAssessment = null; + + specialismAssessment = _specialismAssessments.FirstOrDefault(e => e.IsOptedin && e.EndDate == null && e.TqRegistrationSpecialism.TqRegistrationPathway.Status == RegistrationPathwayStatus.Active); + + AssessmentId = specialismAssessment.Id; + RegistrationPathwayId = specialismAssessment.TqRegistrationSpecialism.TqRegistrationPathwayId; + + ReviewRemoveAssessmentEntryRequest = new ReviewRemoveAssessmentEntryRequest + { + AssessmentId = AssessmentId, + ComponentType = ComponentType.Specialism, + RegistrationPathwayId = RegistrationPathwayId, + CreatedBy = "Admin User", + ChangeReason = "Change Reason", + ContactName = "Test User", + RequestDate = SystemProvider.Today, + ZendeskId = "123456789", + ChangeSpecialismAssessmentDetails = new() + { + From = "Summer 2023", + To = string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, "Summer 2023"), + SpecialismName = "Heating Engineering (10202101)" + } + }; + + _result = await AdminDashboardService.ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest); + } + + [Fact] + public async Task Then_Expected_Results_Are_Returned() + { + await WhenAsync(); + _result.Should().Be(true); + + var actualPathwayAssessment = DbContext.TqPathwayAssessment.SingleOrDefault(s => s.Id == ReviewRemoveAssessmentEntryRequest.AssessmentId); + var actualChangeLog = DbContext.ChangeLog.SingleOrDefault(s => s.TqRegistrationPathwayId == ReviewRemoveAssessmentEntryRequest.RegistrationPathwayId); + var actualChangeDetails = JsonConvert.DeserializeObject(actualChangeLog.Details); + + actualPathwayAssessment.Should().NotBeNull(); + actualPathwayAssessment.IsOptedin.Should().BeFalse(); + actualPathwayAssessment.EndDate.Should().NotBeNull(); + actualPathwayAssessment.ModifiedBy.Should().NotBeNull(); + actualPathwayAssessment.ModifiedOn.Should().NotBeNull(); + + actualChangeLog.Should().NotBeNull(); + actualChangeLog.ChangeType.Should().Be((int)ReviewRemoveAssessmentEntryRequest.ChangeType); + actualChangeLog.Name.Should().Be(ReviewRemoveAssessmentEntryRequest.ContactName); + actualChangeLog.CreatedBy.Should().Be(ReviewRemoveAssessmentEntryRequest.CreatedBy); + actualChangeLog.ReasonForChange.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeReason); + actualChangeLog.DateOfRequest.Should().Be(ReviewRemoveAssessmentEntryRequest.RequestDate); + actualChangeLog.ZendeskTicketID.Should().Be(ReviewRemoveAssessmentEntryRequest.ZendeskId); + + actualChangeDetails.Should().NotBeNull(); + actualChangeDetails.From.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeSpecialismAssessmentDetails.From); + actualChangeDetails.To.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeSpecialismAssessmentDetails.To); + actualChangeDetails.SpecialismName.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeSpecialismAssessmentDetails.SpecialismName); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewChangeStartYear_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewChangeStartYear_IsCalled.cs index 8dd1d9e0e..9e8d0e3a6 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewChangeStartYear_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewChangeStartYear_IsCalled.cs @@ -1,15 +1,6 @@ using FluentAssertions; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; -using Notify.Interfaces; -using NSubstitute; -using Sfa.Tl.ResultsAndCertification.Application.Services; using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; -using Sfa.Tl.ResultsAndCertification.Data.Interfaces; -using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.Domain.Models; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; using System; @@ -22,25 +13,18 @@ namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboar { public class When_ProcessReviewChangeStartYear_IsCalled : AdminDashboardServiceBaseTest { - private Dictionary _ulns; private List _registrations; public override void Given() { // Parameters - AoUkprn = 10011881; _ulns = new Dictionary { { 1111111111, RegistrationPathwayStatus.Active }, { 1111111112, RegistrationPathwayStatus.Active }, }; - - // Create mapper - CreateMapper(); - CreateCommonMapper(); - // Registrations seed SeedTestData(EnumAwardingOrganisation.Pearson, true); _registrations = SeedRegistrationsData(_ulns, TqProvider); @@ -48,48 +32,12 @@ public override void Given() var currentYearUln = new List { 1111111111 }; RegisterUlnForNextAcademicYear(_registrations, currentYearUln); - // Assessments seed - var tqPathwayAssessmentsSeedData = new List(); - var tqPathwayResultsSeedData = new List(); - - var tqSpecialismAssessmentsSeedData = new List(); - var tqSpecialismResultsSeedData = new List(); - var industryPlacementUln = 1111111111; - var profilesWithPrsStatus = new List<(long, PrsStatus?)> { (1111111111, null), (1111111112, null), (1111111113, null), (1111111114, PrsStatus.BeingAppealed), (1111111115, null) }; - - DbContext.SaveChanges(); DetachAll(); - Configuration = new ResultsAndCertificationConfiguration - { - TlevelQueriedSupportEmailAddress = "test@test.com" - }; - - CommonServiceLogger = new Logger(new NullLoggerFactory()); - TlLookupRepositoryLogger = new Logger>(new NullLoggerFactory()); - TlLookupRepository = new GenericRepository(TlLookupRepositoryLogger, DbContext); - FunctionLogRepositoryLogger = new Logger>(new NullLoggerFactory()); - FunctionLogRepository = new GenericRepository(FunctionLogRepositoryLogger, DbContext); - CommonRepository = new CommonRepository(DbContext); - - - NotificationsClient = Substitute.For(); - NotificationLogger = new Logger(new NullLoggerFactory()); - NotificationTemplateRepositoryLogger = new Logger>(new NullLoggerFactory()); - NotificationTemplateRepository = new GenericRepository(NotificationTemplateRepositoryLogger, DbContext); - NotificationService = new NotificationService(NotificationTemplateRepository, NotificationsClient, NotificationLogger); - ChangeLogRepositoryLogger = new Logger>(new NullLoggerFactory()); - ChangeLogRepository = new GenericRepository(ChangeLogRepositoryLogger, DbContext); - commonService = new CommonService(CommonServiceLogger, CommonMapper, TlLookupRepository, FunctionLogRepository, CommonRepository, NotificationService, Configuration, ChangeLogRepository); - SystemProvider = new SystemProvider(); - - AdminDashboardRepository = new AdminDashboardRepository(DbContext); - RegistrationPathwayRepositoryLogger = new Logger>(new NullLoggerFactory()); - RegistrationPathwayRepository = new GenericRepository(RegistrationPathwayRepositoryLogger, DbContext); - var industryPlacementRepository = Substitute.For>(); - AdminDashboardService = new AdminDashboardService(AdminDashboardRepository, RegistrationPathwayRepository, industryPlacementRepository, SystemProvider, commonService, Mapper); + CreateAdminDasboardService(); } + private bool _actualResult; public override Task When() @@ -119,14 +67,11 @@ public async Task Then_Expected_Results_Are_Returned(ReviewChangeStartYearReques var actualIndustryPlacement = DbContext.TqRegistrationPathway.FirstOrDefault(ip => ip.Id == request.RegistrationPathwayId); - // Assert request.RegistrationPathwayId.Should().Be(actualIndustryPlacement.Id); request.ChangeStartYearDetails.StartYearTo.Should().Be(actualIndustryPlacement.AcademicYear); - } - public static IEnumerable Data { get @@ -134,22 +79,23 @@ public static IEnumerable Data return new[] { // Uln not found - new object[] { new ReviewChangeStartYearRequest() + new object[] { - ChangeReason = "Test Reason", - ContactName = "Test User", - RegistrationPathwayId = 1, - ChangeStartYearDetails = new ChangeStartYearDetails() { StartYearFrom = 2022, StartYearTo = 2021 }, - RequestDate = DateTime.Now.ToShortDateString(), - ZendeskId = "1234567890", - CreatedBy = "System" - }, - true,1111111111 } - + new ReviewChangeStartYearRequest + { + ChangeReason = "Test Reason", + ContactName = "Test User", + RegistrationPathwayId = 1, + ChangeStartYearDetails = new ChangeStartYearDetails() { StartYearFrom = 2022, StartYearTo = 2021 }, + RequestDate = DateTime.Now, + ZendeskId = "1234567890", + CreatedBy = "System" + }, + true, + 1111111111 + } }; } } - - } } \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs index 3197a58be..695276609 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs @@ -1,20 +1,9 @@ -using AutoMapper; -using FluentAssertions; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; +using FluentAssertions; using Newtonsoft.Json; -using Notify.Interfaces; -using NSubstitute; -using Sfa.Tl.ResultsAndCertification.Application.Services; using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; -using Sfa.Tl.ResultsAndCertification.Data.Interfaces; -using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.Domain.Models; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; using Sfa.Tl.ResultsAndCertification.Tests.Common.DataProvider; using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; using System; @@ -27,33 +16,24 @@ namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboar { public class When_ProcessReviewIndustryPlacement_IsCalled : AdminDashboardServiceBaseTest { - private Dictionary _ulns; private List _industryPlacementDatas; - private LearnerRecord _result; private IList _profiles; public override void Given() { - // Parameters - AoUkprn = 10011881; - - // Create mapper - CreateMapper(); - CreateCommonMapper(); - // Registrations seed SeedTestData(EnumAwardingOrganisation.Pearson, true); _ulns = new Dictionary - { - { 1111111111, RegistrationPathwayStatus.Active }, - { 1111111112, RegistrationPathwayStatus.Withdrawn }, - { 1111111113, RegistrationPathwayStatus.Active }, - { 1111111114, RegistrationPathwayStatus.Active }, - { 1111111115, RegistrationPathwayStatus.Active }, - { 1111111116, RegistrationPathwayStatus.Active }, - }; + { + { 1111111111, RegistrationPathwayStatus.Active }, + { 1111111112, RegistrationPathwayStatus.Withdrawn }, + { 1111111113, RegistrationPathwayStatus.Active }, + { 1111111114, RegistrationPathwayStatus.Active }, + { 1111111115, RegistrationPathwayStatus.Active }, + { 1111111116, RegistrationPathwayStatus.Active }, + }; // Registrations seed SeedTestData(EnumAwardingOrganisation.Pearson, true); @@ -62,48 +42,18 @@ public override void Given() _profiles = SeedRegistrationsData(_ulns, TqProvider); _industryPlacementDatas = new List - { - new IndustryPlacementData { Uln = 1111111111, IndustryPlacementStatus = IndustryPlacementStatus.NotCompleted, Details = null }, - new IndustryPlacementData { Uln = 1111111114, IndustryPlacementStatus = IndustryPlacementStatus.Completed, Details = null }, - new IndustryPlacementData { Uln = 1111111115, IndustryPlacementStatus = IndustryPlacementStatus.CompletedWithSpecialConsideration, Details = new IndustryPlacementDetails { HoursSpentOnPlacement = 100, SpecialConsiderationReasons = new List { 1, 2 } } }, - - }; + { + new IndustryPlacementData { Uln = 1111111111, IndustryPlacementStatus = IndustryPlacementStatus.NotCompleted, Details = null }, + new IndustryPlacementData { Uln = 1111111114, IndustryPlacementStatus = IndustryPlacementStatus.Completed, Details = null }, + new IndustryPlacementData { Uln = 1111111115, IndustryPlacementStatus = IndustryPlacementStatus.CompletedWithSpecialConsideration, Details = new IndustryPlacementDetails { HoursSpentOnPlacement = 100, SpecialConsiderationReasons = new List { 1, 2 } } }, + }; SeedIndustyPlacementData(_industryPlacementDatas); DbContext.SaveChanges(); DetachAll(); - Configuration = new ResultsAndCertificationConfiguration - { - TlevelQueriedSupportEmailAddress = "test@test.com" - }; - - CommonServiceLogger = new Logger(new NullLoggerFactory()); - TlLookupRepositoryLogger = new Logger>(new NullLoggerFactory()); - TlLookupRepository = new GenericRepository(TlLookupRepositoryLogger, DbContext); - FunctionLogRepositoryLogger = new Logger>(new NullLoggerFactory()); - FunctionLogRepository = new GenericRepository(FunctionLogRepositoryLogger, DbContext); - CommonRepository = new CommonRepository(DbContext); - - - NotificationsClient = Substitute.For(); - NotificationLogger = new Logger(new NullLoggerFactory()); - NotificationTemplateRepositoryLogger = new Logger>(new NullLoggerFactory()); - NotificationTemplateRepository = new GenericRepository(NotificationTemplateRepositoryLogger, DbContext); - NotificationService = new NotificationService(NotificationTemplateRepository, NotificationsClient, NotificationLogger); - ChangeLogRepositoryLogger = new Logger>(new NullLoggerFactory()); - ChangeLogRepository = new GenericRepository(ChangeLogRepositoryLogger, DbContext); - commonService = new CommonService(CommonServiceLogger, CommonMapper, TlLookupRepository, FunctionLogRepository, CommonRepository, NotificationService, Configuration, ChangeLogRepository); - SystemProvider = new SystemProvider(); - - AdminDashboardRepository = new AdminDashboardRepository(DbContext); - RegistrationPathwayRepositoryLogger = new Logger>(new NullLoggerFactory()); - RegistrationPathwayRepository = new GenericRepository(RegistrationPathwayRepositoryLogger, DbContext); - var industryPlacementRepository = Substitute.For>(); - - AdminDashboardService = new AdminDashboardService(AdminDashboardRepository, RegistrationPathwayRepository, industryPlacementRepository, SystemProvider, CommonService, Mapper); - + CreateAdminDasboardService(); } private bool _actualResult; @@ -120,7 +70,7 @@ public async Task WhenAsync(ReviewChangeIndustryPlacementRequest request) [Theory()] [MemberData(nameof(Data))] - public async Task Then_Expected_Results_Are_Returned(ReviewChangeIndustryPlacementRequest request, bool expectedResponse, long uln) + public async Task Then_Expected_Results_Are_Returned(ReviewChangeIndustryPlacementRequest request, bool expectedResponse) { await WhenAsync(request); @@ -132,7 +82,6 @@ public async Task Then_Expected_Results_Are_Returned(ReviewChangeIndustryPlaceme var actualIndustryPlacement = DbContext.IndustryPlacement.FirstOrDefault(ip => ip.Id == request.RegistrationPathwayId); - request.RegistrationPathwayId.Should().Be(actualIndustryPlacement.Id); if (request.ChangeIPDetails.IndustryPlacementStatusTo == IndustryPlacementStatus.Completed || request.ChangeIPDetails.IndustryPlacementStatusTo == IndustryPlacementStatus.NotCompleted) { @@ -145,7 +94,6 @@ public async Task Then_Expected_Results_Are_Returned(ReviewChangeIndustryPlaceme var actualDetails = JsonConvert.DeserializeObject(actualIndustryPlacement.Details); request.ChangeIPDetails.HoursSpentOnPlacementTo.Should().Be(actualDetails.HoursSpentOnPlacement); } - } public static IEnumerable Data @@ -154,46 +102,57 @@ public static IEnumerable Data { return new[] { - - new object[] { new ReviewChangeIndustryPlacementRequest() + new object[] { - ChangeReason = "Test Reason", - ContactName = "Test User", - RegistrationPathwayId = 1, - ChangeIPDetails = new ChangeIPDetails(){ IndustryPlacementStatusTo = IndustryPlacementStatus.NotCompleted }, - RequestDate = DateTime.Now.ToShortDateString(), - ZendeskId = "1234567890", - CreatedBy = "System" - }, - true,1111111114, - }, - new object[] { new ReviewChangeIndustryPlacementRequest() + new ReviewChangeIndustryPlacementRequest + { + ChangeReason = "Test Reason", + ContactName = "Test User", + RegistrationPathwayId = 1, + ChangeIPDetails = new ChangeIPDetails + { + IndustryPlacementStatusTo = IndustryPlacementStatus.NotCompleted + }, + RequestDate = DateTime.Now, + ZendeskId = "1234567890", + CreatedBy = "System" + }, + true }, + new object[] { - ChangeReason = "Test Reason1", - ContactName = "Test User1", - RegistrationPathwayId = 2, - ChangeIPDetails = new ChangeIPDetails(){ IndustryPlacementStatusTo = IndustryPlacementStatus.Completed }, - RequestDate = DateTime.Now.ToShortDateString(), - ZendeskId = "768568909", - CreatedBy = "System" - }, - true,1111111115, - }, - new object[] { new ReviewChangeIndustryPlacementRequest () + new ReviewChangeIndustryPlacementRequest + { + ChangeReason = "Test Reason1", + ContactName = "Test User1", + RegistrationPathwayId = 2, + ChangeIPDetails = new ChangeIPDetails + { + IndustryPlacementStatusTo = IndustryPlacementStatus.Completed + }, + RequestDate = DateTime.Now, + ZendeskId = "768568909", + CreatedBy = "System" + }, + true }, + new object[] { - ChangeReason = "Test Reason1", - ContactName = "Test User1", - RegistrationPathwayId = 3, - Details = JsonConvert.SerializeObject(new ChangeIPDetails() { IndustryPlacementStatusTo=IndustryPlacementStatus.CompletedWithSpecialConsideration }), - ChangeIPDetails = new ChangeIPDetails(){ IndustryPlacementStatusTo = IndustryPlacementStatus.CompletedWithSpecialConsideration, HoursSpentOnPlacementTo=100, SpecialConsiderationReasonsTo= new List(){1,2} }, - RequestDate = DateTime.Now.ToShortDateString(), - ZendeskId = "768568909", - CreatedBy = "System" - }, - true,1111111115, + new ReviewChangeIndustryPlacementRequest + { + ChangeReason = "Test Reason1", + ContactName = "Test User1", + RegistrationPathwayId = 3, + ChangeIPDetails = new ChangeIPDetails + { + IndustryPlacementStatusTo = IndustryPlacementStatus.CompletedWithSpecialConsideration, + HoursSpentOnPlacementTo=100, + SpecialConsiderationReasonsTo = new List{ 1, 2 } + }, + RequestDate = DateTime.Now, + ZendeskId = "768568909", + CreatedBy = "System" + }, + true } - - }; } } diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Sfa.Tl.ResultsAndCertification.IntegrationTests.csproj b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Sfa.Tl.ResultsAndCertification.IntegrationTests.csproj index bcb8c33b0..8e5cba1cf 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Sfa.Tl.ResultsAndCertification.IntegrationTests.csproj +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Sfa.Tl.ResultsAndCertification.IntegrationTests.csproj @@ -31,6 +31,7 @@ + diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultClearGet/When_Called.cs new file mode 100644 index 000000000..7359fe0bf --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultClearGet/When_Called.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultClearGet +{ + public class When_Called : AdminDashboardControllerTestBase + { + private const int RegistrationPathwayId = 1, AssessmentId = 1; + + private IActionResult _result; + + public async override Task When() + { + _result = await Controller.AdminAddPathwayResultClearAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminAddPathwayResult() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminAddPathwayResult, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, AssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/TestSetup.cs new file mode 100644 index 000000000..e97f20a94 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminAddPathwayResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..6fc1c6078 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..414d82c4e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddPathwayResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminDashboardLoader.GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..292ac6d1d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddPathwayResultViewModel); + AdminDashboardLoader.GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/TestSetup.cs new file mode 100644 index 000000000..ee280ca59 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/TestSetup.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddPathwayResultViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_Grade_Selected.cs new file mode 100644 index 000000000..0fc5120ef --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultPost +{ + public class When_Grade_Selected : TestSetup + { + private AdminAddPathwayResultViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminAddPathwayResultGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminAddPathwayResultReviewChanges); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..374d384d4 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultPost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddPathwayResultViewModel _viewModel; + private const string ErrorKey = "AdminAddPathwayResult"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddPathwayResult.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminAddPathwayResultGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddPathwayResult.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..bb1282dbb --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultReviewChangesAsync(); + } + + protected static AdminAddPathwayResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..eaa68172e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,30 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + AdminAddPathwayResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().CreateAdminAddPathwayResultReviewChanges(Arg.Any()); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..22a2e5054 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private readonly AdminAddPathwayResultViewModel _model = ViewModel; + private readonly AdminAddPathwayResultReviewChangesViewModel _reviewChangesModel = new(); + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_model); + AdminDashboardLoader.CreateAdminAddPathwayResultReviewChanges(_model).Returns(_reviewChangesModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).CreateAdminAddPathwayResultReviewChanges(_model); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_reviewChangesModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..d4d8af02e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/TestSetup.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddPathwayResultReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..e2b9e8c9d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private readonly AdminAddPathwayResultReviewChangesViewModel _viewModel = CreateViewModel(); + private const string ErrorKey = "AdminAddPathwayResultReviewChanges"; + + public override void Given() + { + Controller.ModelState.AddModelError(ErrorKey, AdminAddPathwayResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.DidNotReceive().ProcessAddPathwayResultReviewChangesAsync(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, Arg.Any(), CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddPathwayResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Valid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Valid.cs new file mode 100644 index 000000000..0e3c0c265 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddPathwayResultReviewChangesPost/When_ModelState_Valid.cs @@ -0,0 +1,43 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddPathwayResultReviewChangesPost +{ + public class When_ModelState_Valid : TestSetup + { + private readonly AdminAddPathwayResultReviewChangesViewModel _viewModel = CreateViewModel(); + + public override void Given() + { + AdminDashboardLoader.ProcessAddPathwayResultReviewChangesAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + Result = await Controller.AdminAddPathwayResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddPathwayResultReviewChangesAsync(_viewModel); + CacheService.Received(1).SetAsync( + CacheKey, + Arg.Is(p => p.Message.Contains(AdminAddPathwayResultReviewChanges.Notification_Message_Asessment_Result_Added)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord, (Constants.PathwayId, _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultClearGet/When_Called.cs new file mode 100644 index 000000000..a2a38196a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultClearGet/When_Called.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultClearGet +{ + public class When_Called : AdminDashboardControllerTestBase + { + private const int RegistrationPathwayId = 1, AssessmentId = 1; + + private IActionResult _result; + + public async override Task When() + { + _result = await Controller.AdminAddSpecialismResultClearAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminAddSpecialismResult() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminAddSpecialismResult, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, AssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/TestSetup.cs new file mode 100644 index 000000000..94d781b06 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminAddSpecialismResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Plastering (ZTLOS025)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 10 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..d7f5639ab --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().GetAdminAddPathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..7af19ae1e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddSpecialismResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminDashboardLoader.GetAdminAddSpecialismResultAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminAddSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..007d86c47 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddSpecialismResultViewModel); + AdminDashboardLoader.GetAdminAddSpecialismResultAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminAddSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/TestSetup.cs new file mode 100644 index 000000000..b4fafe6c2 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/TestSetup.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddSpecialismResultViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_Grade_Selected.cs new file mode 100644 index 000000000..452d73cd0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultPost +{ + public class When_Grade_Selected : TestSetup + { + private AdminAddSpecialismResultViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminAddSpecialismResultGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminAddSpecialismResultReviewChanges); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..ffcd61027 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultPost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddSpecialismResultViewModel _viewModel; + private const string ErrorKey = "AdminAddSpecialismResult"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddSpecialismResult.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminAddSpecialismResultGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddSpecialismResult.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..97b4ba935 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultReviewChangesAsync(); + } + + protected static AdminAddSpecialismResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..f6e938811 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,30 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + AdminAddSpecialismResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().CreateAdminAddSpecialismResultReviewChanges(Arg.Any()); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..72b315274 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private readonly AdminAddSpecialismResultViewModel _model = ViewModel; + private readonly AdminAddSpecialismResultReviewChangesViewModel _reviewChangesModel = new(); + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_model); + AdminDashboardLoader.CreateAdminAddSpecialismResultReviewChanges(_model).Returns(_reviewChangesModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).CreateAdminAddSpecialismResultReviewChanges(_model); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_reviewChangesModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..058099277 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/TestSetup.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddSpecialismResultReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..53531a324 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private readonly AdminAddSpecialismResultReviewChangesViewModel _viewModel = CreateViewModel(); + private const string ErrorKey = "AdminAddSpecialismResultReviewChanges"; + + public override void Given() + { + Controller.ModelState.AddModelError(ErrorKey, AdminAddSpecialismResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.DidNotReceive().ProcessAddSpecialismResultReviewChangesAsync(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, Arg.Any(), CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddSpecialismResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Valid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Valid.cs new file mode 100644 index 000000000..d5c78cbc7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminAddSpecialismResultReviewChangesPost/When_ModelState_Valid.cs @@ -0,0 +1,43 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminAddSpecialismResultReviewChangesPost +{ + public class When_ModelState_Valid : TestSetup + { + private readonly AdminAddSpecialismResultReviewChangesViewModel _viewModel = CreateViewModel(); + + public override void Given() + { + AdminDashboardLoader.ProcessAddSpecialismResultReviewChangesAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddSpecialismResultReviewChangesAsync(_viewModel); + CacheService.Received(1).SetAsync( + CacheKey, + Arg.Is(p => p.Message.Contains(AdminAddSpecialismResultReviewChanges.Notification_Message_Asessment_Result_Added)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord, (Constants.PathwayId, _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultClearGet/When_Called.cs new file mode 100644 index 000000000..e8d5723b7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultClearGet/When_Called.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultClearGet +{ + public class When_Called : AdminDashboardControllerTestBase + { + private const int RegistrationPathwayId = 1, AssessmentId = 1; + + private IActionResult _result; + + public async override Task When() + { + _result = await Controller.AdminChangePathwayResultClearAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminChangePathwayResult() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminChangePathwayResult, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, AssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/TestSetup.cs new file mode 100644 index 000000000..3e754db1a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminChangePathwayResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..91da277c4 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..1537f123b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminChangePathwayResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminDashboardLoader.GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..5977979b4 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminChangePathwayResultViewModel); + AdminDashboardLoader.GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/TestSetup.cs new file mode 100644 index 000000000..493147531 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/TestSetup.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminChangePathwayResultViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs new file mode 100644 index 000000000..85e90a3dd --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultPost +{ + public class When_Grade_Selected : TestSetup + { + private AdminChangePathwayResultViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminChangePathwayResultGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_ReviewChangePathwayResult() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..5f4e6992e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminChangePathwayResultViewModel _viewModel; + private const string ErrorKey = "AdminChangePathwayResult"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminChangePathwayResult.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminChangePathwayResultGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminChangePathwayResult.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/TestSetup.cs new file mode 100644 index 000000000..51a6f0f44 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminChangeSpecialismResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Plastering (ZTLOS025)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 10 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..8c2f1b651 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().GetAdminChangePathwayResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..80038edbe --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminChangeSpecialismResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminDashboardLoader.GetAdminChangeSpecialismResultAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminChangeSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..2b3db9cd6 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminChangeSpecialismResultViewModel); + AdminDashboardLoader.GetAdminChangeSpecialismResultAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).GetAdminChangeSpecialismResultAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/TestSetup.cs new file mode 100644 index 000000000..280835744 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/TestSetup.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminChangeSpecialismResultViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs new file mode 100644 index 000000000..9f8a2ae77 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultPost +{ + public class When_Grade_Selected : TestSetup + { + private AdminChangeSpecialismResultViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminChangeSpecialismResultGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_ReviewChangeSpecialismResult() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..9b9b75611 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminChangeSpecialismResultViewModel _viewModel; + private const string ErrorKey = "AdminChangeSpecialismResult"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminChangeSpecialismResult.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).LoadAdminChangeSpecialismResultGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminChangeSpecialismResult.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Failed.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Failed.cs new file mode 100644 index 000000000..16225343b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Failed.cs @@ -0,0 +1,68 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Routing; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminCoreComponentAssessmentPost; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeCoreAssessmentPost +{ + public class When_Failed : TestSetup + { + private AdminReviewChangesCoreAssessmentViewModel MockResult = null; + private NotificationBannerModel _expectedNotificationBannerModel; + public override void Given() + { + var isSuccess = false; + AdminReviewChangesCoreAssessmentViewModel = new AdminReviewChangesCoreAssessmentViewModel() + { + RegistrationPathwayId = 1, + ContactName = "firstname", + AdminCoreComponentViewModel = new AdminCoreComponentViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970" + }; + + + AdminDashboardLoader.ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel).Returns(isSuccess = false); + + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel); + + } + + [Fact] + public void Then_Redirected_To_ProblemWithService() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(RouteConstants.ProblemWithService); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Success.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Success.cs new file mode 100644 index 000000000..ae61f5bd9 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeCoreAssessmentPost/When_Success.cs @@ -0,0 +1,66 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminCoreComponentAssessmentPost; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeCoreAssessmentPost +{ + public class When_Success : TestSetup + { + public override void Given() + { + AdminReviewChangesCoreAssessmentViewModel = new AdminReviewChangesCoreAssessmentViewModel() + { + + ContactName = "firstname", + AdminCoreComponentViewModel = new AdminCoreComponentViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + RegistrationPathwayId = 1 + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970" + }; + AdminDashboardLoader.ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel).Returns(true); + + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddCoreAssessmentRequestAsync(AdminReviewChangesCoreAssessmentViewModel); + CacheService.Received(1).SetAsync(CacheKey, Arg.Is(p => p.Message == ReviewChangeAssessment.Message_Notification_Success), CacheExpiryTime.XSmall); + + } + + [Fact] + public void Then_Redirected_To_Expected_ActionResult() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(nameof(RouteConstants.AdminLearnerRecord)); + route.RouteValues[Constants.PathwayId].Should().Be(AdminReviewChangesCoreAssessmentViewModel.AdminCoreComponentViewModel.RegistrationPathwayId); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeIndustryPlacementPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeIndustryPlacementPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..dbe589b94 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeIndustryPlacementPost/When_ModelState_Invalid.cs @@ -0,0 +1,84 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.IndustryPlacement.Manual; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeIndustryPlacementPost +{ + public class When_ModelState_Invalid : TestSetup + { + + private AdminChangeIpViewModel _cacheModel; + private const string ErrorKey = "AdminReviewChangesIndustryPlacement"; + + public override void Given() + { + + ViewModel = CreateViewModel(IndustryPlacementStatus.CompletedWithSpecialConsideration); + _cacheModel = new AdminChangeIpViewModel() + { + AdminIpCompletion = new AdminIpCompletionViewModel() + { + RegistrationPathwayId = 1, + IndustryPlacementStatusTo = IndustryPlacementStatus.CompletedWithSpecialConsideration + + + }, + ReasonsViewModel = new AdminIpSpecialConsiderationReasonsViewModel() + { + ReasonsList = new List + { + new IpLookupDataViewModel + { + Id = 1, + Name = "Domestic crisis", + IsSelected = false + } + } + }, + HoursViewModel = new AdminIpSpecialConsiderationHoursViewModel + { + RegistrationPathwayId = 1, + Hours = "10" + } + + }; + + Controller.ModelState.AddModelError(ErrorKey, ReviewChangeAssessment.Validation_Contact_Name_Blank_Text); + CacheService.GetAsync(CacheKey).Returns(_cacheModel); + + } + + [Fact] + public void Then_Expected_Method_Are_Called() + { + CacheService.Received(1).GetAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_ProblemWithService() + { + var model = ActualResult.ShouldBeViewResult(); + + model.Should().NotBeNull(); + model.AdminChangeIpViewModel.ReasonsViewModel.Should().NotBeNull(); + model.AdminChangeIpViewModel.HoursViewModel.Should().NotBeNull(); + } + + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/TestSetup.cs new file mode 100644 index 000000000..c9f3a9918 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/TestSetup.cs @@ -0,0 +1,42 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Routing; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Controllers; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Constants; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeSpecialismAssessmentPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + + protected AdminReviewChangesSpecialismAssessmentViewModel AdminReviewChangesSpecialismAssessmentViewModel; + + public IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminReviewChangesSpecialismAssessmentEntry(AdminReviewChangesSpecialismAssessmentViewModel); + } + + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Failed.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Failed.cs new file mode 100644 index 000000000..0f9c40d16 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Failed.cs @@ -0,0 +1,67 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Routing; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminCoreComponentAssessmentPost; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeSpecialismAssessmentPost +{ + public class When_Failed : TestSetup + { + + public override void Given() + { + + AdminReviewChangesSpecialismAssessmentViewModel = new AdminReviewChangesSpecialismAssessmentViewModel() + { + RegistrationPathwayId = 1, + ContactName = "firstname", + AdminOccupationalSpecialismViewModel = new AdminOccupationalSpecialismViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970" + }; + + + AdminDashboardLoader.ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel).Returns(false); + + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel); + + } + + [Fact] + public void Then_Redirected_To_ProblemWithService() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(RouteConstants.ProblemWithService); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Success.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Success.cs new file mode 100644 index 000000000..85946686f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewChangeSpecialismAssessmentPost/When_Success.cs @@ -0,0 +1,66 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeSpecialismAssessmentPost; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewChangeSpecialismAssessmentPost +{ + public class When_Success : TestSetup + { + public override void Given() + { + AdminReviewChangesSpecialismAssessmentViewModel = new AdminReviewChangesSpecialismAssessmentViewModel() + { + + ContactName = "firstname", + AdminOccupationalSpecialismViewModel = new AdminOccupationalSpecialismViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + RegistrationPathwayId = 1 + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970" + }; + AdminDashboardLoader.ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel).Returns(true); + + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessAddSpecialismAssessmentRequestAsync(AdminReviewChangesSpecialismAssessmentViewModel); + CacheService.Received(1).SetAsync(CacheKey, Arg.Is(p => p.Message == ReviewChangeAssessment.Message_Notification_Success), CacheExpiryTime.XSmall); + + } + + [Fact] + public void Then_Redirected_To_Expected_ActionResult() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(nameof(RouteConstants.AdminLearnerRecord)); + route.RouteValues[Constants.PathwayId].Should().Be(AdminReviewChangesSpecialismAssessmentViewModel.AdminOccupationalSpecialismViewModel.RegistrationPathwayId); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/TestSetup.cs new file mode 100644 index 000000000..8ba7f0288 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/TestSetup.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewRemoveAssessmentEntryCorePost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected AdminReviewRemoveCoreAssessmentEntryViewModel ReviewRemoveCoreAssessmentEntryViewModel; + + public IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminReviewRemoveCoreAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryViewModel); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Failed.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Failed.cs new file mode 100644 index 000000000..ad007e40a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Failed.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewRemoveAssessmentEntryCorePost +{ + public class When_Failed : TestSetup + { + public override void Given() + { + ReviewRemoveCoreAssessmentEntryViewModel = new() + { + PathwayAssessmentViewModel = new() + { + RegistrationPathwayId = 1 + }, + ContactName = "John Smith", + Day = "01", + Month = "01", + Year = "1970", + ChangeReason = "Reason for change", + ZendeskId = "1234566780" + }; + + AdminDashboardLoader.ProcessRemoveAssessmentEntry(ReviewRemoveCoreAssessmentEntryViewModel).Returns(false); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessRemoveAssessmentEntry(ReviewRemoveCoreAssessmentEntryViewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, Arg.Any()); + } + + [Fact] + public void Then_Redirected_To_ProblemWithService() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(RouteConstants.ProblemWithService); + route.RouteValues.Should().BeNullOrEmpty(); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..9b115fb4b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_ModelState_Invalid.cs @@ -0,0 +1,57 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewRemoveAssessmentEntryCorePost +{ + public class When_ModelState_Invalid : TestSetup + { + private const string ErrorKey = "AdminReviewRemoveAssessmentEntry"; + private int RegistrationPathwayId = 1; + + public override void Given() + { + ReviewRemoveCoreAssessmentEntryViewModel = new() + { + PathwayAssessmentViewModel = new() { + RegistrationPathwayId = 1, + } + }; + + Controller.ModelState.AddModelError(ErrorKey, AdminReviewRemoveAssessmentEntry.Validation_Contact_Name_Blank_Text); + Controller.ModelState.AddModelError(ErrorKey, AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Blank_Text); + Controller.ModelState.AddModelError(ErrorKey, AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Invalid_Text); + Controller.ModelState.AddModelError(ErrorKey, AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Future_Date_Text); + Controller.ModelState.AddModelError(ErrorKey, AdminReviewRemoveAssessmentEntry.Validation_Reason_For_Change_Blank_Text); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.DidNotReceive().ProcessRemoveAssessmentEntry(ReviewRemoveCoreAssessmentEntryViewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + + model.Should().NotBeNull(); + model.PathwayAssessmentViewModel.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminReviewRemoveAssessmentEntry.Validation_Contact_Name_Blank_Text); + modelState[ErrorKey].Errors[1].ErrorMessage.Should().Be(AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Blank_Text); + modelState[ErrorKey].Errors[2].ErrorMessage.Should().Be(AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Invalid_Text); + modelState[ErrorKey].Errors[3].ErrorMessage.Should().Be(AdminReviewRemoveAssessmentEntry.Validation_Date_When_Change_Requested_Future_Date_Text); + modelState[ErrorKey].Errors[4].ErrorMessage.Should().Be(AdminReviewRemoveAssessmentEntry.Validation_Reason_For_Change_Blank_Text); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Success.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Success.cs new file mode 100644 index 000000000..d5326c2c9 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminReviewRemoveAssessmentEntryCorePost/When_Success.cs @@ -0,0 +1,50 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminReviewRemoveAssessmentEntryCorePost +{ + public class When_Success : TestSetup + { + private int RegistrationPathwayId = 1; + + public override void Given() + { + ReviewRemoveCoreAssessmentEntryViewModel = new() + { + PathwayAssessmentViewModel = new() + { + RegistrationPathwayId = 1 + }, + ContactName = "John Smith", + Day = "01", + Month = "01", + Year = "1970", + ChangeReason = "Reason for change", + ZendeskId = "1234566780" + }; + + AdminDashboardLoader.ProcessRemoveAssessmentEntry(ReviewRemoveCoreAssessmentEntryViewModel).Returns(true); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessRemoveAssessmentEntry(ReviewRemoveCoreAssessmentEntryViewModel); + CacheService.Received(1).SetAsync(CacheKey, Arg.Is(p => p.Message == AdminReviewRemoveAssessmentEntry.Message_Notification_Success), CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Redirected_To_AdminLearnerRecord() + { + var route = Result as RedirectToActionResult; + route.ActionName.Should().Be(nameof(RouteConstants.AdminLearnerRecord)); + route.RouteValues[Constants.PathwayId].Should().Be(RegistrationPathwayId); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/RemoveAssessmentEntryCoreClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/RemoveAssessmentEntryCoreClearGet/When_Called.cs index 407bed545..6317a56a6 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/RemoveAssessmentEntryCoreClearGet/When_Called.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/RemoveAssessmentEntryCoreClearGet/When_Called.cs @@ -28,7 +28,10 @@ public void Then_Expected_Methods_AreCalled() [Fact] public void Then_Redirected_To_RemoveAssessmentEntryCore() { - _result.ShouldBeRedirectToRouteResult(RouteConstants.RemoveAssessmentEntryCore, (Constants.RegistrationPathwayId, RegistrationPathwayId)); + _result.ShouldBeRedirectToRouteResult( + RouteConstants.RemoveAssessmentEntryCore, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, AssessmentId)); } } } \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/Then_No_Access_Granted_To_Service.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/Then_No_Access_Granted_To_Service.cs deleted file mode 100644 index 55ef29d97..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/Then_No_Access_Granted_To_Service.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.AspNetCore.Routing; -using Microsoft.Extensions.Logging; -using NSubstitute; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; -using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; -using Sfa.Tl.ResultsAndCertification.Web.Controllers; -using System; -using System.Collections.Generic; -using Xunit; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Filters.FreezePeriod -{ - public class Then_No_Access_Granted_To_Service : When_FilterAttribute_Action_Is_Called - { - private HomeController _homeController; - private ILogger _logger; - private ILogger _errorLogger; - private ErrorController _errorController; - - public override void Given() - { - ResultsAndCertificationConfiguration = new ResultsAndCertificationConfiguration { FreezePeriodStartDate = DateTime.UtcNow, FreezePeriodEndDate = DateTime.UtcNow.AddDays(5) }; - _logger = Substitute.For>(); - _homeController = new HomeController(_logger); - - _errorLogger = Substitute.For>(); - _errorController = new ErrorController(ResultsAndCertificationConfiguration, _errorLogger); - - var httpContext = new ClaimsIdentityBuilder(_homeController) - .Add(CustomClaimTypes.UserId, Guid.NewGuid().ToString()) - .Build() - .HttpContext; - - HttpContextAccessor.HttpContext.Returns(httpContext); - - var routeData = new RouteData(); - routeData.Values.Add("controller", "Home"); - routeData.Values.Add("action", nameof(HomeController.Index)); - - var controllerActionDescriptor = new ControllerActionDescriptor - { - ControllerName = "Home", - ActionName = nameof(HomeController.Index) - }; - - var actionContext = new ActionContext(HttpContextAccessor.HttpContext, routeData, controllerActionDescriptor, Substitute.For()); - ActionExecutingContext = new ActionExecutingContext(actionContext, new List(), new Dictionary(), _homeController); - - //mockDelegate = () => { - // return Task.FromResult(new ActionExecutedContext(actionContext, new List(), _errorController)); - //}; - } - - [Fact(Skip = "TODO")] - public void Then_Redirected_To_ServiceUnavailable() - { - var terst = ActionExecutingContext; - } - } -} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/When_FilterAttribute_Action_Is_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/When_FilterAttribute_Action_Is_Called.cs deleted file mode 100644 index 121f905df..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Filters/FreezePeriod/When_FilterAttribute_Action_Is_Called.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.Logging; -using NSubstitute; -using Sfa.Tl.ResultsAndCertification.Models.Configuration; -using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; -using Sfa.Tl.ResultsAndCertification.Web.Filters; -using System.Threading.Tasks; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Filters.FreezePeriod -{ - public abstract class When_FilterAttribute_Action_Is_Called : BaseTest - { - protected IHttpContextAccessor HttpContextAccessor; - protected ILogger Logger; - protected ActionExecutingContext ActionExecutingContext; - protected ResultsAndCertificationConfiguration ResultsAndCertificationConfiguration; - protected ActionExecutionDelegate mockDelegate; - - public override void Setup() - { - Logger = Substitute.For>(); - HttpContextAccessor = Substitute.For(); - } - - public override Task When() - { - var filterAttribute = new FreezePeriodFilterAttribute(ResultsAndCertificationConfiguration, Logger); - var actionExecutionDelegate = Substitute.For(); - filterAttribute.OnActionExecutionAsync(ActionExecutingContext, mockDelegate).GetAwaiter().GetResult(); - return Task.CompletedTask; - } - } -} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Helpers/ActionResultExtensions.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Helpers/ActionResultExtensions.cs index 001e0495a..0d84476d1 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Helpers/ActionResultExtensions.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Helpers/ActionResultExtensions.cs @@ -23,6 +23,8 @@ public static void ShouldBeRedirectToRouteResult(this IActionResult actionResult if (!values.IsNullOrEmpty()) { + redirectToRouteResult.RouteValues.Should().HaveCount(values.Length); + foreach (var (key, value) in values) { redirectToRouteResult.RouteValues.Should().ContainEquivalentOf(new KeyValuePair(key, value)); @@ -40,6 +42,8 @@ public static void ShouldBeRedirectToActionResult(this IActionResult actionResul if (!values.IsNullOrEmpty()) { + redirectToRouteResult.RouteValues.Should().HaveCount(values.Length); + foreach (var (key, value) in values) { redirectToRouteResult.RouteValues.Should().ContainEquivalentOf(new KeyValuePair(key, value)); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/TestSetup.cs new file mode 100644 index 000000000..cfdafda59 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/TestSetup.cs @@ -0,0 +1,66 @@ +using AutoMapper; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Services.BlobStorage.Interface; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.Mapper; +using Sfa.Tl.ResultsAndCertification.Web.Mapper.Resolver; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddCoreAssessmentEntry +{ + public abstract class TestSetup : BaseTest + { + + protected AdminReviewChangesCoreAssessmentViewModel ViewModel; + protected IMapper Mapper; + protected IResultsAndCertificationInternalApiClient InternalApiClient; + protected AdminDashboardLoader Loader; + protected bool ActualResult; + + protected IHttpContextAccessor HttpContextAccessor; + protected readonly string Givenname = "test"; + protected readonly string Surname = "user"; + protected readonly string Email = "test.user@test.com"; + + public override void Setup() + { + + InternalApiClient = Substitute.For(); + + HttpContextAccessor = Substitute.For(); + HttpContextAccessor.HttpContext.Returns(new DefaultHttpContext + { + User = new ClaimsPrincipal(new ClaimsIdentity(new[] + { + new Claim(ClaimTypes.GivenName, Givenname), + new Claim(ClaimTypes.Surname, Surname), + new Claim(ClaimTypes.Email, Email) + })) + }); + + var mapperConfig = new MapperConfiguration(c => + { + c.AddMaps(typeof(AssessmentMapper).Assembly); + c.ConstructServicesUsing(type => + type.Name.Contains("UserNameResolver") ? + new UserNameResolver(HttpContextAccessor) : null); + }); + + Mapper = new AutoMapper.Mapper(mapperConfig); + Loader = new AdminDashboardLoader(InternalApiClient, Mapper); + } + + public async override Task When() + { + ActualResult = await Loader.ProcessAddCoreAssessmentRequestAsync(ViewModel); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..7c1ea6909 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Invalid_Data.cs @@ -0,0 +1,23 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddCoreAssessmentEntry +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + InternalApiClient.ProcessAddCoreAssessmentRequestAsync(Arg.Any()) + .Returns(ActualResult); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + ActualResult.Should().BeFalse(); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..d22fa50cb --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs @@ -0,0 +1,67 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Assessment.Manual; +using System; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddCoreAssessmentEntry +{ + public class When_Called_With_Valid_Data : TestSetup + { + private bool ExpectedResult { get; set; } + private bool ExpectedApiResult { get; set; } + + public override void Given() + { + ViewModel = new AdminReviewChangesCoreAssessmentViewModel() + { + + ContactName = "firstname", + AdminCoreComponentViewModel = new AdminCoreComponentViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + RegistrationPathwayId = 1, + AssessmentYearTo = "Autumn 2023" + + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970", + + ZendeskId ="122356761" + + }; + + + InternalApiClient + .ProcessAddCoreAssessmentRequestAsync(Arg.Is( + x => x.RegistrationPathwayId == ViewModel.AdminCoreComponentViewModel.RegistrationPathwayId && + x.ChangeReason == ViewModel.ChangeReason && + x.ChangeType == Common.Enum.ChangeType.AssessmentEntryAdd && + x.ContactName == ViewModel.ContactName && + x.RequestDate == Convert.ToDateTime(ViewModel.RequestDate) && + x.ZendeskId == ViewModel.ZendeskId && + x.AddCoreAssessmentDetails.CoreAssessmentTo == ViewModel.AdminCoreComponentViewModel.AssessmentYearTo && + x.AddCoreAssessmentDetails.CoreAssessmentFrom == $"{ReviewChangeAssessment.No_Assessment_Recorded} {ViewModel.AdminCoreComponentViewModel.AssessmentYearTo.ToLower()}")) + + .Returns(true); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + ActualResult.Should().BeTrue(); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/TestSetup.cs new file mode 100644 index 000000000..0f00cde47 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/TestSetup.cs @@ -0,0 +1,64 @@ +using AutoMapper; +using Microsoft.AspNetCore.Http; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.Mapper; +using Sfa.Tl.ResultsAndCertification.Web.Mapper.Resolver; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using System.Security.Claims; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddSpecialismAssessmentEntry +{ + public abstract class TestSetup : BaseTest + { + + protected AdminReviewChangesSpecialismAssessmentViewModel ViewModel; + protected IMapper Mapper; + protected IResultsAndCertificationInternalApiClient InternalApiClient; + protected AdminDashboardLoader Loader; + protected bool ActualResult; + + + protected IHttpContextAccessor HttpContextAccessor; + protected readonly string Givenname = "test"; + protected readonly string Surname = "user"; + protected readonly string Email = "test.user@test.com"; + + public override void Setup() + { + + InternalApiClient = Substitute.For(); + + HttpContextAccessor = Substitute.For(); + HttpContextAccessor.HttpContext.Returns(new DefaultHttpContext + { + User = new ClaimsPrincipal(new ClaimsIdentity(new[] + { + new Claim(ClaimTypes.GivenName, Givenname), + new Claim(ClaimTypes.Surname, Surname), + new Claim(ClaimTypes.Email, Email) + })) + }); + + var mapperConfig = new MapperConfiguration(c => + { + c.AddMaps(typeof(AssessmentMapper).Assembly); + c.ConstructServicesUsing(type => + type.Name.Contains("UserNameResolver") ? + new UserNameResolver(HttpContextAccessor) : null); + }); + + Mapper = new AutoMapper.Mapper(mapperConfig); + Loader = new AdminDashboardLoader(InternalApiClient, Mapper); + } + + public async override Task When() + { + ActualResult = await Loader.ProcessAddSpecialismAssessmentRequestAsync(ViewModel); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..8aec118d1 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs @@ -0,0 +1,23 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddSpecialismAssessmentEntry +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + InternalApiClient.ProcessAddSpecialismAssessmentRequestAsync(Arg.Any()) + .Returns(ActualResult); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + ActualResult.Should().BeFalse(); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..4d0083bb9 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs @@ -0,0 +1,64 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Assessment; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Assessment.Manual; +using System; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.AdminAddSpecialismAssessmentEntry +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + ViewModel = new AdminReviewChangesSpecialismAssessmentViewModel() + { + + ContactName = "firstname", + + AdminOccupationalSpecialismViewModel = new AdminOccupationalSpecialismViewModel() + { + Uln = 1100000001, + Provider = "provider-name (10000536)", + TlevelName = "t-level-name", + StartYear = 2022, + DisplayStartYear = "2022 to 2023", + RegistrationPathwayId = 1, + AssessmentYearTo = "Autumn 2023", + + }, + + ChangeReason = "change-reason", + Day = "01", + Month = "01", + Year = "1970", + ZendeskId ="122356761" + + }; + + + InternalApiClient + .ProcessAddSpecialismAssessmentRequestAsync(Arg.Is( + x => x.RegistrationPathwayId == ViewModel.AdminOccupationalSpecialismViewModel.RegistrationPathwayId && + x.ChangeReason == ViewModel.ChangeReason && + x.ChangeType == Common.Enum.ChangeType.AssessmentEntryAdd && + x.ContactName == ViewModel.ContactName && + x.RequestDate == Convert.ToDateTime(ViewModel.RequestDate) && + x.ZendeskId == ViewModel.ZendeskId && + x.AddSpecialismDetails.SpecialismAssessmentTo == ViewModel.AdminOccupationalSpecialismViewModel.AssessmentYearTo && + x.AddSpecialismDetails.SpecialismAssessmentFrom == $"{ReviewChangeAssessment.No_Assessment_Recorded} {ViewModel.AdminOccupationalSpecialismViewModel.AssessmentYearTo.ToLower()}")) + + .Returns(true); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + ActualResult.Should().BeTrue(); + + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminDashboardLoaderTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminDashboardLoaderTestsBase.cs index aec383b35..56fc2c354 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminDashboardLoaderTestsBase.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminDashboardLoaderTestsBase.cs @@ -1,13 +1,21 @@ using AutoMapper; +using Microsoft.AspNetCore.Http; using NSubstitute; using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; using Sfa.Tl.ResultsAndCertification.Web.Loader; using Sfa.Tl.ResultsAndCertification.Web.Mapper; +using Sfa.Tl.ResultsAndCertification.Web.Mapper.Resolver; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; using System; +using System.Collections.Generic; +using System.Security.Claims; namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests { @@ -26,7 +34,51 @@ public override void Setup() private AutoMapper.Mapper CreateMapper() { - var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(AdminDashboardMapper).Assembly)); + string Givenname = "test"; + string Surname = "user"; + string Email = "test.user@test.com"; + + IHttpContextAccessor httpContextAccessor = Substitute.For(); + + httpContextAccessor.HttpContext.Returns(new DefaultHttpContext + { + User = new ClaimsPrincipal(new ClaimsIdentity(new[] + { + new Claim(ClaimTypes.GivenName, Givenname), + new Claim(ClaimTypes.Surname, Surname), + new Claim(ClaimTypes.Email, Email) + })) + }); + + var mapperConfig = new MapperConfiguration(c => + { + c.AddMaps(typeof(AdminDashboardMapper).Assembly); + + c.ConstructServicesUsing(type => + { + if (type.Equals(typeof(UserNameResolver))) + { + return new UserNameResolver(httpContextAccessor); + } + else if (type.Equals(typeof(UserNameResolver))) + { + return new UserNameResolver(httpContextAccessor); + } + else if (type.Equals(typeof(UserNameResolver))) + { + return new UserNameResolver(httpContextAccessor); + } + else if (type.Equals(typeof(UserNameResolver))) + { + return new UserNameResolver(httpContextAccessor); + } + else + { + return null; + } + }); + }); + return new AutoMapper.Mapper(mapperConfig); } @@ -77,7 +129,7 @@ protected AdminLearnerRecord CreateAdminLearnerRecord(int registrationPathwayId) }; } - protected AdminLearnerRecord CreateAdminLearnerRecord(int registrationPathwayId, int pathwayAssessmentId) + protected AdminLearnerRecord CreateAdminLearnerRecordWithPathwayAssessment(int registrationPathwayId, int pathwayAssessmentId) { var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId); @@ -93,20 +145,147 @@ protected AdminLearnerRecord CreateAdminLearnerRecord(int registrationPathwayId, AppealEndDate = new DateTime(2024, 3, 1), LastUpdatedOn = new DateTime(2023, 9, 15), LastUpdatedBy = "test-user", - ComponentType = ComponentType.Core, - Result = new Result + ComponentType = ComponentType.Core + } + }; + + return learnerRecord; + } + + protected AdminLearnerRecord CreateAdminLearnerRecordWithSpecialismAssessment(int registrationPathwayId, int specialismAssessmentId) + { + var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId); + + learnerRecord.Pathway.Specialisms = new[] + { + new Specialism + { + Id = 1, + LarId = "ZTLOS001", + Name = "Surveying and Design for Construction and the Built Environment", + Assessments = new[] { - Id = 4567, - Grade = "A", - GradeCode = "PCG2", - PrsStatus = PrsStatus.NotSpecified, - LastUpdatedOn = new DateTime(2023, 12, 31), - LastUpdatedBy = "test-user" + new Assessment + { + Id = specialismAssessmentId, + SeriesId = 1, + SeriesName = "Autum 2023", + ResultEndDate = new DateTime(2024, 1, 1), + RommEndDate = new DateTime(2024, 2, 1), + AppealEndDate = new DateTime(2024, 3, 1), + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user", + ComponentType = ComponentType.Core } } + } }; return learnerRecord; } + + protected List CreatePathwayGrades() + { + return new List + { + new LookupData + { + Id = 1, + Code = "PCG1", + Value = "A*" + }, + new LookupData + { + Id = 2, + Code = "PCG2", + Value = "A" + }, + new LookupData + { + Id = 3, + Code = "PCG3", + Value = "B" + }, + new LookupData + { + Id = 4, + Code = "PCG4", + Value = "C" + }, + new LookupData + { + Id = 5, + Code = "PCG5", + Value = "D" + }, + new LookupData + { + Id = 6, + Code = "PCG6", + Value = "E" + }, + new LookupData + { + Id = 7, + Code = "PCG7", + Value = "Unclassified" + }, + new LookupData + { + Id = 25, + Code = "PCG8", + Value = "Q - pending result" + }, + new LookupData + { + Id = 26, + Code = "PCG9", + Value = "X - no result" + } + }; + } + + protected List CreateSpecialismGrades() + { + return new List + { + new LookupData + { + Id = 10, + Code = "SCG1", + Value = "Distinction" + }, + new LookupData + { + Id = 11, + Code = "SCG2", + Value = "Merit" + }, + new LookupData + { + Id = 12, + Code = "SCG3", + Value = "Pass" + }, + new LookupData + { + Id = 13, + Code = "SCG4", + Value = "Unclassified" + }, + new LookupData + { + Id = 14, + Code = "SCG5", + Value = "Q - pending result" + }, + new LookupData + { + Id = 15, + Code = "SCG6", + Value = "X - no result" + } + }; + } } } \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..af2cd3b6d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Invalid_Data.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetAdminAddPathwayResult +{ + public class When_Called_With_Invalid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private List _grades; + private AdminAddPathwayResultViewModel _result; + + public override void Given() + { + _grades = CreatePathwayGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddPathwayResultAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..06ef4f59e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddPathwayResult/When_Called_With_Valid_Data.cs @@ -0,0 +1,101 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetAdminAddPathwayResult +{ + public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private AdminLearnerRecord _apiResult; + private List _grades; + + private AdminAddPathwayResultViewModel _result; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId); + _grades = CreatePathwayGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddPathwayResultAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + + Assessment pathwayAssessment = _apiResult.Pathway.PathwayAssessments.First(); + Provider provider = _apiResult.Pathway.Provider; + + _result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + _result.PathwayAssessmentId.Should().Be(pathwayAssessment.Id); + _result.PathwayName.Should().Be($"{_apiResult.Pathway.Name} ({_apiResult.Pathway.LarId})"); + + _result.Learner.Should().Be($"{_apiResult.Firstname} {_apiResult.Lastname}"); + _result.Uln.Should().Be(_apiResult.Uln); + _result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + _result.Tlevel.Should().Be(_apiResult.Pathway.Name); + _result.StartYear.Should().Be($"{_apiResult.Pathway.AcademicYear} to {_apiResult.Pathway.AcademicYear + 1}"); + + _result.SummaryLearner.Id.Should().Be(AdminAddPathwayResult.Summary_Learner_Id); + _result.SummaryLearner.Title.Should().Be(AdminAddPathwayResult.Summary_Learner_Text); + _result.SummaryLearner.Value.Should().Be(_result.Learner); + + _result.SummaryUln.Id.Should().Be(AdminAddPathwayResult.Summary_ULN_Id); + _result.SummaryUln.Title.Should().Be(AdminAddPathwayResult.Summary_ULN_Text); + _result.SummaryUln.Value.Should().Be(_result.Uln.ToString()); + + _result.SummaryProvider.Id.Should().Be(AdminAddPathwayResult.Summary_Provider_Id); + _result.SummaryProvider.Title.Should().Be(AdminAddPathwayResult.Summary_Provider_Text); + _result.SummaryProvider.Value.Should().Be(_result.Provider); + + _result.SummaryTlevel.Id.Should().Be(AdminAddPathwayResult.Summary_TLevel_Id); + _result.SummaryTlevel.Title.Should().Be(AdminAddPathwayResult.Summary_TLevel_Text); + _result.SummaryTlevel.Value.Should().Be(_result.Tlevel); + + _result.SummaryStartYear.Id.Should().Be(AdminAddPathwayResult.Summary_StartYear_Id); + _result.SummaryStartYear.Title.Should().Be(AdminAddPathwayResult.Summary_StartYear_Text); + _result.SummaryStartYear.Value.Should().Be(_result.StartYear); + + _result.ExamPeriod.Should().Be(pathwayAssessment.SeriesName); + _result.Grade.Should().BeNull(); + + _result.SelectedGradeId.Should().BeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + + BackLinkModel backLink = _result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminLearnerRecord); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.PathwayId] = RegistrationPathwayId.ToString() + }); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..c5e243d4f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Invalid_Data.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetAdminAddSpecialismResult +{ + public class When_Called_With_Invalid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 777; + + private List _grades; + private AdminAddSpecialismResultViewModel _result; + + public override void Given() + { + _grades = CreateSpecialismGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + ApiClient.GetLookupDataAsync(LookupCategory.SpecialismComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddSpecialismResultAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..74e922beb --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetAdminAddSpecialismResult/When_Called_With_Valid_Data.cs @@ -0,0 +1,102 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetAdminAddSpecialismResult +{ + public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 888; + + private AdminLearnerRecord _apiResult; + private List _grades; + + private AdminAddSpecialismResultViewModel _result; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId); + _grades = CreateSpecialismGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + ApiClient.GetLookupDataAsync(LookupCategory.SpecialismComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddSpecialismResultAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + + Specialism specialism = _apiResult.Pathway.Specialisms.First(p => p.Assessments.Any(a => a.Id == SpecialismAssessmentId)); + Assessment specialismAssessment = specialism.Assessments.First(a => a.Id == SpecialismAssessmentId); + Provider provider = _apiResult.Pathway.Provider; + + _result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + _result.SpecialismAssessmentId.Should().Be(SpecialismAssessmentId); + _result.SpecialismName.Should().Be($"{specialism.Name} ({specialism.LarId})"); + + _result.Learner.Should().Be($"{_apiResult.Firstname} {_apiResult.Lastname}"); + _result.Uln.Should().Be(_apiResult.Uln); + _result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + _result.Tlevel.Should().Be(_apiResult.Pathway.Name); + _result.StartYear.Should().Be($"{_apiResult.Pathway.AcademicYear} to {_apiResult.Pathway.AcademicYear + 1}"); + + _result.SummaryLearner.Id.Should().Be(AdminAddPathwayResult.Summary_Learner_Id); + _result.SummaryLearner.Title.Should().Be(AdminAddPathwayResult.Summary_Learner_Text); + _result.SummaryLearner.Value.Should().Be(_result.Learner); + + _result.SummaryUln.Id.Should().Be(AdminAddPathwayResult.Summary_ULN_Id); + _result.SummaryUln.Title.Should().Be(AdminAddPathwayResult.Summary_ULN_Text); + _result.SummaryUln.Value.Should().Be(_result.Uln.ToString()); + + _result.SummaryProvider.Id.Should().Be(AdminAddPathwayResult.Summary_Provider_Id); + _result.SummaryProvider.Title.Should().Be(AdminAddPathwayResult.Summary_Provider_Text); + _result.SummaryProvider.Value.Should().Be(_result.Provider); + + _result.SummaryTlevel.Id.Should().Be(AdminAddPathwayResult.Summary_TLevel_Id); + _result.SummaryTlevel.Title.Should().Be(AdminAddPathwayResult.Summary_TLevel_Text); + _result.SummaryTlevel.Value.Should().Be(_result.Tlevel); + + _result.SummaryStartYear.Id.Should().Be(AdminAddPathwayResult.Summary_StartYear_Id); + _result.SummaryStartYear.Title.Should().Be(AdminAddPathwayResult.Summary_StartYear_Text); + _result.SummaryStartYear.Value.Should().Be(_result.StartYear); + + _result.ExamPeriod.Should().Be(specialismAssessment.SeriesName); + _result.Grade.Should().BeNull(); + + _result.SelectedGradeId.Should().BeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + + BackLinkModel backLink = _result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminLearnerRecord); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.PathwayId] = RegistrationPathwayId.ToString() + }); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemovePathwayAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemovePathwayAssessmentEntry/When_Called_With_Valid_Data.cs index 5f4e76a3b..6846c7271 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemovePathwayAssessmentEntry/When_Called_With_Valid_Data.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemovePathwayAssessmentEntry/When_Called_With_Valid_Data.cs @@ -25,7 +25,7 @@ public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase public override void Given() { - _apiResult = CreateAdminLearnerRecord(RegistrationPathwayId, PathwayAssessmentId); + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId); ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); } @@ -79,11 +79,11 @@ public void Then_Returns_Expected_Results() _result.SummaryStartYear.Value.Should().Be(_result.StartYear); _result.ExamPeriod.Should().Be(pathwayAssessment.SeriesName); - _result.Grade.Should().Be(pathwayAssessment.Result.Grade); + _result.Grade.Should().BeNull(); _result.LastUpdated.Should().Be(pathwayAssessment.LastUpdatedOn.ToDobFormat()); _result.UpdatedBy.Should().Be(pathwayAssessment.LastUpdatedBy); - _result.CanAssessmentEntryBeRemoved.Should().BeFalse(); + _result.CanAssessmentEntryBeRemoved.Should().BeTrue(); _result.DoYouWantToRemoveThisAssessmentEntry.Should().NotHaveValue(); BackLinkModel backLink = _result.BackLink; diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..599d41375 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Invalid_Data.cs @@ -0,0 +1,39 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetRemoveSpecialismAssessmentEntry +{ + public class When_Called_With_Invalid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 999; + + private AdminRemoveSpecialismAssessmentEntryViewModel _result; + + public override void Given() + { + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + } + + public async override Task When() + { + _result = await Loader.GetRemoveSpecialismAssessmentEntryAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..a6008ad9c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/GetRemoveSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.GetRemoveSpecialismAssessmentEntry +{ + public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 999; + + + private AdminLearnerRecord _apiResult; + private AdminRemoveSpecialismAssessmentEntryViewModel _result; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + public async override Task When() + { + _result = await Loader.GetRemoveSpecialismAssessmentEntryAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + + Specialism specialism = _apiResult.Pathway.Specialisms.First(p => p.Assessments.Any(a => a.Id == SpecialismAssessmentId)); + Assessment specialismAssessment = specialism.Assessments.First(a => a.Id == SpecialismAssessmentId); + Provider provider = _apiResult.Pathway.Provider; + + _result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + _result.SpecialismAssessmentId.Should().Be(SpecialismAssessmentId); + _result.SpecialismName.Should().Be($"{specialism.Name} ({specialism.LarId})"); + + _result.Learner.Should().Be($"{_apiResult.Firstname} {_apiResult.Lastname}"); + _result.Uln.Should().Be(_apiResult.Uln); + _result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + _result.Tlevel.Should().Be(_apiResult.Pathway.Name); + _result.StartYear.Should().Be($"{_apiResult.Pathway.AcademicYear} to {_apiResult.Pathway.AcademicYear + 1}"); + + _result.SummaryLearner.Id.Should().Be(RemoveAssessmentEntryCore.Summary_Learner_Id); + _result.SummaryLearner.Title.Should().Be(RemoveAssessmentEntryCore.Summary_Learner_Text); + _result.SummaryLearner.Value.Should().Be(_result.Learner); + + _result.SummaryUln.Id.Should().Be(RemoveAssessmentEntryCore.Summary_ULN_Id); + _result.SummaryUln.Title.Should().Be(RemoveAssessmentEntryCore.Summary_ULN_Text); + _result.SummaryUln.Value.Should().Be(_result.Uln.ToString()); + + _result.SummaryProvider.Id.Should().Be(RemoveAssessmentEntryCore.Summary_Provider_Id); + _result.SummaryProvider.Title.Should().Be(RemoveAssessmentEntryCore.Summary_Provider_Text); + _result.SummaryProvider.Value.Should().Be(_result.Provider); + + _result.SummaryTlevel.Id.Should().Be(RemoveAssessmentEntryCore.Summary_TLevel_Id); + _result.SummaryTlevel.Title.Should().Be(RemoveAssessmentEntryCore.Summary_TLevel_Text); + _result.SummaryTlevel.Value.Should().Be(_result.Tlevel); + + _result.SummaryStartYear.Id.Should().Be(RemoveAssessmentEntryCore.Summary_StartYear_Id); + _result.SummaryStartYear.Title.Should().Be(RemoveAssessmentEntryCore.Summary_StartYear_Text); + _result.SummaryStartYear.Value.Should().Be(_result.StartYear); + + _result.ExamPeriod.Should().Be(specialismAssessment.SeriesName); + _result.Grade.Should().BeNull(); + _result.LastUpdated.Should().Be(specialismAssessment.LastUpdatedOn.ToDobFormat()); + _result.UpdatedBy.Should().Be(specialismAssessment.LastUpdatedBy); + + _result.CanAssessmentEntryBeRemoved.Should().BeTrue(); + _result.DoYouWantToRemoveThisAssessmentEntry.Should().NotHaveValue(); + + BackLinkModel backLink = _result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminLearnerRecord); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.PathwayId] = RegistrationPathwayId.ToString() + }); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddPathwayResultGrades/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddPathwayResultGrades/When_Called.cs new file mode 100644 index 000000000..0b3fc3660 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddPathwayResultGrades/When_Called.cs @@ -0,0 +1,49 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.LoadAdminAddPathwayResultGrades +{ + public class When_Called : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private List _grades; + + private readonly AdminAddPathwayResultViewModel _result = new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId + }; + + public override void Given() + { + _grades = CreatePathwayGrades(); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + await Loader.LoadAdminAddPathwayResultGrades(_result); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddSpecialismResultGrades/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddSpecialismResultGrades/When_Called.cs new file mode 100644 index 000000000..7804e49d2 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/LoadAdminAddSpecialismResultGrades/When_Called.cs @@ -0,0 +1,49 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.LoadAdminAddSpecialismResultGrades +{ + public class When_Called : AdminDashboardLoaderTestsBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 125; + + private List _grades; + + private readonly AdminAddSpecialismResultViewModel _result = new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId + }; + + public override void Given() + { + _grades = CreatePathwayGrades(); + ApiClient.GetLookupDataAsync(LookupCategory.SpecialismComponentGrade).Returns(_grades); + } + + public async override Task When() + { + await Loader.LoadAdminAddSpecialismResultGrades(_result); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..408e26601 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Invalid_Data.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.ProcessAddPathwayResultReviewChanges +{ + public class When_Called_With_Invalid_Data : AdminDashboardLoaderTestsBase + { + private bool _result; + + public override void Given() + { + } + + public async override Task When() + { + _result = await Loader.ProcessAddPathwayResultReviewChangesAsync(null); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.DidNotReceive().ProcessAdminAddPathwayResultAsync(Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..b503685a3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddPathwayResultReviewChanges/When_Called_With_Valid_Data.cs @@ -0,0 +1,49 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.ProcessAddPathwayResultReviewChanges +{ + public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase + { + private readonly AdminAddPathwayResultReviewChangesViewModel _model = new() + { + RegistrationPathwayId = 1, + PathwayAssessmentId = 1, + SelectedGradeId = 1, + ContactName = "test-contact-name", + Day = "01", + Month = "01", + Year = "2024", + ChangeReason = "test-change-reason", + ZendeskTicketId = "12345" + }; + + private bool _result; + + public override void Given() + { + ApiClient.ProcessAdminAddPathwayResultAsync(Arg.Any()).Returns(true); + } + + public async override Task When() + { + _result = await Loader.ProcessAddPathwayResultReviewChangesAsync(_model); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).ProcessAdminAddPathwayResultAsync(Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeTrue(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..3d4ce285e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Invalid_Data.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.ProcessAddSpecialismResultReviewChanges +{ + public class When_Called_With_Invalid_Data : AdminDashboardLoaderTestsBase + { + private bool _result; + + public override void Given() + { + } + + public async override Task When() + { + _result = await Loader.ProcessAddSpecialismResultReviewChangesAsync(null); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.DidNotReceive().ProcessAdminAddSpecialismResultAsync(Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..95d043f10 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/ProcessAddSpecialismResultReviewChanges/When_Called_With_Valid_Data.cs @@ -0,0 +1,49 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests.ProcessAddSpecialismResultReviewChanges +{ + public class When_Called_With_Valid_Data : AdminDashboardLoaderTestsBase + { + private readonly AdminAddSpecialismResultReviewChangesViewModel _model = new() + { + RegistrationPathwayId = 1, + SpecialismAssessmentId = 1, + SelectedGradeId = 1, + ContactName = "test-contact-name", + Day = "01", + Month = "01", + Year = "2024", + ChangeReason = "test-change-reason", + ZendeskTicketId = "12345" + }; + + private bool _result; + + public override void Given() + { + ApiClient.ProcessAdminAddSpecialismResultAsync(Arg.Any()).Returns(true); + } + + public async override Task When() + { + _result = await Loader.ProcessAddSpecialismResultReviewChangesAsync(_model); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).ProcessAdminAddSpecialismResultAsync(Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeTrue(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests.cs new file mode 100644 index 000000000..eb6479e05 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests.cs @@ -0,0 +1,87 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Xunit; +using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Utilities.CustomValidations +{ + public class DateValidatorAttributeTests + { + [Theory] + + // Blank + [InlineData("", "", "", false)] + [InlineData("2024", "", "", false)] + [InlineData("", "3", "", false)] + [InlineData("", "", "1", false)] + [InlineData("2024", "3", "", false)] + [InlineData("2024", "", "1", false)] + [InlineData("", "3", "1", false)] + + // Invalid + [InlineData("2023", "13", "1", false)] + [InlineData("2023", "2", "45", false)] + [InlineData("2023", "-2", "1", false)] + [InlineData("0", "2", "1", false)] + [InlineData("2023", "2", "29", false)] + [InlineData("2024", "2", "30", false)] + [InlineData("999", "2", "30", false)] + + // Future + [InlineData("2024", "3", "2", false)] + [InlineData("2025", "1", "1", false)] + + // Valid + [InlineData("2024", "3", "1", true)] + [InlineData("2024", "03", "01", true)] + [InlineData("2024", "02", "29", true)] + [InlineData("1999", "12", "31", true)] + public void Then_Returns_ExpectedResults(string year, string month, string day, bool isValid) + { + // Arrange + var today = new DateTime(2024, 3, 1); + + var systemProvider = Substitute.For(); + systemProvider.Today.Returns(today); + + var serviceProvider = Substitute.For(); + serviceProvider.GetService(typeof(ISystemProvider)).Returns(systemProvider); + + var model = new DateValidatorAttributeTestModel(year, month, day); + var validationContext = new ValidationContext(model, serviceProvider, null); + var validationResults = new List(); + + // Act + bool result = Validator.TryValidateObject(model, validationContext, validationResults, true); + + // Assert + result.Should().Be(isValid); + + if (isValid) + { + validationResults.Should().HaveCount(0); + } + else + { + validationResults.Should().HaveCount(1); + validationResults[0].ErrorMessage.Should().NotBeNullOrEmpty(); + } + } + + private class DateValidatorAttributeTestModel + { + private readonly string _year, _month, _day; + + public DateValidatorAttributeTestModel(string year, string month, string day) + => (_year, _month, _day) = (year, month, day); + + [DateValidator(Property = nameof(DateToValidate), ErrorResourceType = typeof(ErrorResource.ReviewChangeStartYear))] + public string DateToValidate => $"{_year}/{_month}/{_day}"; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/DateValidatorAttributeBaseTests.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/DateValidatorAttributeBaseTests.cs deleted file mode 100644 index c4e726680..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/DateValidatorAttributeBaseTests.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; -using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Utilities.CustomValidations.DateValidatorAttributeTests -{ - public abstract class DateValidatorAttributeBaseTests: BaseTest - { - protected RequiredDateViewModel model; - protected ValidationContext validationContext; - protected List validationResults; - protected bool overAllResult; - - public override void Setup() - { - validationResults = new List(); - } - - public class RequiredDateViewModel - { - [DateValidator(Property = nameof(RequiredDate), ErrorResourceType = typeof(ErrorResource.ReviewChangeStartYear), ErrorResourceName = "Validation_Date_When_Change_Requested_Blank_Text")] - public string RequiredDate => $"{Year}/{Month}/{Day}"; - public string Day { get; set; } - public string Month { get; set; } - public string Year { get; set; } - } - } -} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_Date_Greater_Than_Today.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_Date_Greater_Than_Today.cs deleted file mode 100644 index 933802489..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_Date_Greater_Than_Today.cs +++ /dev/null @@ -1,32 +0,0 @@ -using FluentAssertions; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Xunit; -using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Utilities.CustomValidations.DateValidatorAttributeTests -{ - public class When_Validation_Date_Greater_Than_Today : DateValidatorAttributeBaseTests - { - public override void Given() - { - model = new RequiredDateViewModel { Day = "01", Month = "01", Year = "2050" }; - validationContext = new ValidationContext(model); - } - - public override Task When() - { - overAllResult = Validator.TryValidateObject(model, validationContext, validationResults, true); - return Task.CompletedTask; - } - - [Fact] - public void Then_Returns_ExpectedResults() - { - overAllResult.Should().BeFalse(); - validationResults.Should().NotBeNull(); - validationResults.Should().HaveCount(1); - validationResults[0].ErrorMessage.Should().Be(string.Format(ErrorResource.ReviewChangeStartYear.Validation_Date_When_Change_Requested_Future_Date_Text, model.RequiredDate)); - } - } -} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_IsTriggered.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_IsTriggered.cs deleted file mode 100644 index 871016f64..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_IsTriggered.cs +++ /dev/null @@ -1,33 +0,0 @@ -using FluentAssertions; -using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Xunit; -using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Utilities.CustomValidations.DateValidatorAttributeTests -{ - public class When_Validation_IsTriggered : DateValidatorAttributeBaseTests - { - public override void Given() - { - model = new RequiredDateViewModel { Day = string.Empty, Month = string.Empty, Year = string.Empty }; - validationContext = new ValidationContext(model); - } - - public override Task When() - { - overAllResult = Validator.TryValidateObject(model, validationContext, validationResults, true); - return Task.CompletedTask; - } - - [Fact] - public void Then_Returns_ExpectedResults() - { - overAllResult.Should().BeFalse(); - validationResults.Should().NotBeNull(); - validationResults.Should().HaveCount(1); - validationResults[0].ErrorMessage.Should().Be(string.Format(ErrorResource.ReviewChangeStartYear.Validation_Date_When_Change_Requested_Blank_Text, model.RequiredDate)); - } - } -} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_With_Invalid_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_With_Invalid_Date.cs deleted file mode 100644 index c55ecaefc..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Utilities/CustomValidations/DateValidatorAttributeTests/When_Validation_With_Invalid_Date.cs +++ /dev/null @@ -1,32 +0,0 @@ -using FluentAssertions; -using System.ComponentModel.DataAnnotations; -using System.Threading.Tasks; -using Xunit; -using ErrorResource = Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; - -namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Utilities.CustomValidations.DateValidatorAttributeTests -{ - public class When_Validation_With_Invalid_Date : DateValidatorAttributeBaseTests - { - public override void Given() - { - model = new RequiredDateViewModel { Day = "32", Month = "12", Year = "2023" }; - validationContext = new ValidationContext(model); - } - - public override Task When() - { - overAllResult = Validator.TryValidateObject(model, validationContext, validationResults, true); - return Task.CompletedTask; - } - - [Fact] - public void Then_Returns_ExpectedResults() - { - overAllResult.Should().BeFalse(); - validationResults.Should().NotBeNull(); - validationResults.Should().HaveCount(1); - validationResults[0].ErrorMessage.Should().Be(string.Format(ErrorResource.ReviewChangeStartYear.Validation_Date_When_Change_Requested_Invalid_Text, model.RequiredDate)); - } - } -} \ No newline at end of file From b498349e10e8b9c64a641eda5353a026f4056d5a Mon Sep 17 00:00:00 2001 From: Calum Rees Date: Wed, 13 Mar 2024 11:00:50 +0000 Subject: [PATCH 2/6] modified pipeline triggers --- azure-pipelines-new.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/azure-pipelines-new.yml b/azure-pipelines-new.yml index f492c5284..0a9cdba0d 100644 --- a/azure-pipelines-new.yml +++ b/azure-pipelines-new.yml @@ -12,18 +12,21 @@ resources: trigger: branches: include: - - master - - feature/* - # - feature/lrs-integration + - master + - develop + - Release* + - feature/* + - hotfix/* + - bugfix/* pr: - - feature/* - master - develop + - Release* pool: name: 'Azure Pipelines' - vmImage: 'windows-latest' #'vs2017-win2016' + vmImage: 'windows-latest' variables: - template: ./Automation/variables/vars-global.yml@devopsTemplates From 0a1d21142eb0aa4a1aa10a4e85e0bbd3a53ae324 Mon Sep 17 00:00:00 2001 From: Calum Rees Date: Thu, 4 Apr 2024 15:00:09 +0100 Subject: [PATCH 3/6] added github release task --- yaml/jobs/tlevels-build-application-job.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yaml/jobs/tlevels-build-application-job.yml b/yaml/jobs/tlevels-build-application-job.yml index abb9baa48..c4a2305f8 100644 --- a/yaml/jobs/tlevels-build-application-job.yml +++ b/yaml/jobs/tlevels-build-application-job.yml @@ -100,3 +100,11 @@ jobs: PathtoPublish: '$(build.artifactstagingdirectory)/publish' ArtifactName: 'appdrop' publishLocation: 'Container' + + - task: GitHubRelease@1 + displayName: 'GitHub release (create)' + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master') , eq(variables['Build.Reason'], 'IndividualCI')) + inputs: + gitHubConnection: SkillsFundingAgency + tagSource: userSpecifiedTag + tag: '$(Build.BuildNumber)' From b712e88a5ac93cf59bd1313096932f357bb9d5d6 Mon Sep 17 00:00:00 2001 From: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:06:52 +0100 Subject: [PATCH 4/6] Release20.7 (#666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * TL2023-296 (#644) * Tl2023-329 (#617) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove… * Bug/tl2023 313 special consideration (#645) * Fix * Unit tests * Mapping error fixed (#647) * Fix and unit tests (#650) * Feature/tl2023 312 change log change record UI functionality (#648) implemented change log record UI functionality * Feature/tl2023-328 (#651) * Open pathway ROMM * Open specialism ROMM * Test fix * Specialism test * Extra line * Feature/tl2023 283 (#649) * Implement changes for 283 * implementation of change result * revert changes to web config * merge conflicts resolve * updated code to fix issue. * latest merge and inlcuded the resulte id in changelog * updated the change result functionality * updated the functionality * Feature/tl2023 308 change log functionality (#652) * Added to link between search results and view change record page * Feature/TL2023-336 Add ROMM Review (#653) * UI, API, tests * Tests * Fix * Fix * Merge fix * format time and text label (#654) * Bugfix/tl2023 312 time format different (#655) * Fixed date formatting * Bugfix/tl2023 312 time format different (#656) * Updated mapper * Display result last updated date and user (#658) * Updated route (#659) * Added feature Add Romm outcome core/specialism (#660) * Tl2023 355 (#661) * 355 implementation * Integration of add romm outcome * romm change * removed extra lines * refactored code * Refactored code * Tl2023 355 (#662) * 355 implementation * Integration of add romm outcome * romm change * removed extra lines * refactored code * Refactored code * updated the back link * Tl2023 355 (#663) * 355 implementation * Integration of add romm outcome * romm change * removed extra lines * refactored code * Refactored code * updated the back link * fixed unit test case --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> Co-authored-by: skumarhpa --- ...esultsAndCertificationInternalApiClient.cs | 45 +- ...esultsAndCertificationInternalApiClient.cs | 28 +- .../Interfaces/IAdminChangeLogService.cs | 13 + .../Interfaces/IAdminDashboardService.cs | 14 +- .../Interfaces/IAdminPostResultsService.cs | 12 + .../Mappers/ChangeLogMapper.cs | 34 ++ .../Services/AdminChangeLogService.cs | 30 ++ .../Services/AdminDashboardService.cs | 233 +++++++-- .../Services/AdminPostResultsService.cs | 142 +++++ .../Constants/CacheConstants.cs | 2 + .../Enum/ChangeType.cs | 14 +- .../Helpers/ApiConstants.cs | 20 +- .../Helpers/Constants.cs | 1 + .../Helpers/RouteConstants.cs | 57 +- .../Interfaces/IAdminChangeLogRepository.cs | 14 + .../Repositories/AdminChangeLogRepository.cs | 94 ++++ .../Repositories/AdminDashboardRepository.cs | 3 +- .../Models/ChangeLog.cs | 15 +- .../Controllers/AdminChangeLogController.cs | 30 ++ .../Controllers/AdminDashboardController.cs | 29 +- .../Controllers/AdminPostResultsController.cs | 29 ++ .../Interfaces/IAdminChangeLogController.cs | 13 + .../Interfaces/IAdminDashboardController.cs | 3 +- ...ResultsAndCertification.InternalApi.csproj | 1 + .../Startup.cs | 13 +- .../AdminChangeLog/AdminChangeLogRecord.cs | 46 ++ .../AdminChangeLog/AdminSearchChangeLog.cs | 28 + .../AdminSearchChangeLogRequest.cs | 9 + .../AddCoreAssessmentDetails.cs | 8 +- .../AdminDashboard/AddPathwayResultRequest.cs | 2 + .../AdminDashboard/AddSpecialismDetails.cs | 8 +- .../AddSpecialismResultRequest.cs | 2 + ...s.cs => ChangeIndustryPlacementRequest.cs} | 3 +- .../AdminDashboard/ChangePathwayDetails.cs | 19 + .../ChangePathwayResultRequest.cs | 18 + .../AdminDashboard/ChangeSpecialismDetails.cs | 19 + .../ChangeSpecilalismResultRequest.cs | 13 + .../AdminDashboard/ChangeStartYearDetails.cs | 8 +- .../ReviewAddCoreAssessmentRequest.cs | 7 +- .../ReviewAddSpecialismAssessmentRequest.cs | 9 +- .../ReviewChangeIndustryPlacementRequest.cs | 8 +- .../ReviewRemoveAssessmentEntryRequest.cs | 6 +- ...wRemoveSpecialismAssessmentEntryRequest.cs | 15 + .../AdminPostResultsRequest.cs | 19 + .../OpenPathwayRommRequest.cs | 7 + .../OpenSpecialismRommRequest.cs | 7 + .../AdminSearchChangeLog.Designer.cs | 207 ++++++++ .../AdminChangeLog/AdminSearchChangeLog.resx | 168 ++++++ .../AdminViewChangeRecord.Designer.cs | 486 ++++++++++++++++++ .../AdminChangeLog/AdminViewChangeRecord.resx | 261 ++++++++++ ...nAddPathwayResultReviewChanges.Designer.cs | 126 +++++ .../AdminAddPathwayResultReviewChanges.resx | 42 ++ ...dSpecialismResultReviewChanges.Designer.cs | 135 +++++ ...AdminAddSpecialismResultReviewChanges.resx | 45 ++ ...angePathwayResultReviewChanges.Designer.cs | 343 ++++++++++++ ...AdminChangePathwayResultReviewChanges.resx | 213 ++++++++ ...eSpecialismResultReviewChanges.Designer.cs | 334 ++++++++++++ ...inChangeSpecialismResultReviewChanges.resx | 210 ++++++++ .../AdminAddCoreRommOutcome.Designer.cs | 343 ++++++++++++ .../AdminAddCoreRommOutcome.resx | 213 ++++++++ ...nAddRommOutcomeChangeGradeCore.Designer.cs | 280 ++++++++++ .../AdminAddRommOutcomeChangeGradeCore.resx | 192 +++++++ ...mmOutcomeChangeGradeSpecialism.Designer.cs | 280 ++++++++++ ...inAddRommOutcomeChangeGradeSpecialism.resx | 192 +++++++ .../AdminAddSpecialismRommOutcome.Designer.cs | 343 ++++++++++++ .../AdminAddSpecialismRommOutcome.resx | 213 ++++++++ .../AdminOpenPathwayRomm.Designer.cs | 333 ++++++++++++ .../AdminOpenPathwayRomm.resx | 210 ++++++++ ...inOpenPathwayRommReviewChanges.Designer.cs | 469 +++++++++++++++++ .../AdminOpenPathwayRommReviewChanges.resx | 255 +++++++++ .../AdminOpenSpecialismRomm.Designer.cs | 334 ++++++++++++ .../AdminOpenSpecialismRomm.resx | 210 ++++++++ ...penSpecialismRommReviewChanges.Designer.cs | 478 +++++++++++++++++ .../AdminOpenSpecialismRommReviewChanges.resx | 258 ++++++++++ .../ViewComponents/Breadcrumb.Designer.cs | 9 + .../Content/ViewComponents/Breadcrumb.resx | 3 + .../Controllers/AdminChangeLogController.cs | 159 ++++++ .../Controllers/AdminDashboardController.cs | 83 ++- .../Controllers/AdminPostResultsController.cs | 385 ++++++++++++++ .../Controllers/ErrorController.cs | 7 +- .../Loader/AdminChangeLogLoader.cs | 103 ++++ .../Loader/AdminDashboardLoader.cs | 46 +- .../Loader/AdminPostResultsLoader.cs | 144 ++++++ .../Interfaces/IAdminChangeLogLoader.cs | 26 + .../Interfaces/IAdminDashboardLoader.cs | 8 + .../Interfaces/IAdminPostResultsLoader.cs | 30 ++ .../Mapper/AdminChangeLogMapper.cs | 149 ++++++ .../Mapper/AdminDashboardMapper.cs | 165 ++++-- .../Mapper/AdminPostResultsMapper.cs | 199 +++++++ .../TableButtonResolver.cs | 6 +- .../Sfa.Tl.ResultsAndCertification.Web.csproj | 83 ++- .../Startup.cs | 2 + .../ChangeRecordLink/ChangeRecord.cs | 12 + .../ChangeRecordLink/ChangeRecordModel.cs | 18 + .../ChangeRecordLink/Default.cshtml | 10 + .../AdminSearchChangeLogCriteriaViewModel.cs | 12 + .../AdminSearchChangeLogDetailsViewModel.cs | 24 + .../AdminSearchChangeLogViewModel.cs | 58 +++ ...ewChangeRecordAddPathwayResultViewModel.cs | 41 ++ ...hangeRecordAddSpecialismResultViewModel.cs | 41 ++ ...ViewChangeRecordCoreAssessmentViewModel.cs | 20 + ...wChangeRecordIndustryPlacementViewModel.cs | 79 +++ ...angeRecordRemoveCoreAssessmentViewModel.cs | 20 + ...cordRemoveSpecialismAssessmentViewModel.cs | 21 + ...angeRecordSpecialismAssessmentViewModel.cs | 20 + ...AdminViewChangeRecordStartYearViewModel.cs | 19 + .../AdminViewChangeRecordViewModel.cs | 83 +++ ...nAddPathwayResultReviewChangesViewModel.cs | 12 +- ...dSpecialismResultReviewChangesViewModel.cs | 10 +- ...angePathwayResultReviewChangesViewModel.cs | 122 +++++ .../AdminChangePathwayResultViewModel.cs | 7 +- ...eSpecialismResultReviewChangesViewModel.cs | 121 +++++ .../AdminChangeSpecialismResultViewModel.cs | 2 +- .../AdminAddCoreRommOutcomeViewModel.cs | 88 ++++ ...nAddRommOutcomeChangeGradeCoreViewModel.cs | 99 ++++ ...mmOutcomeChangeGradeSpecialismViewModel.cs | 99 ++++ .../AdminAddSpecialismRommOutcomeViewModel.cs | 88 ++++ ...inOpenPathwayRommReviewChangesViewModel.cs | 125 +++++ .../AdminOpenPathwayRommViewModel.cs | 88 ++++ ...penSpecialismRommReviewChangesViewModel.cs | 125 +++++ .../AdminOpenSpecialismRommViewModel.cs | 88 ++++ .../AdminSearchChangeLog.cshtml | 85 +++ ...minViewChangeRecordAddPathwayResult.cshtml | 41 ++ ...ViewChangeRecordAddSpecialismResult.cshtml | 41 ++ ...AdminViewChangeRecordCoreAssessment.cshtml | 33 ++ .../AdminViewChangeRecordIP.cshtml | 36 ++ ...iewChangeRecordRemoveCoreAssessment.cshtml | 33 ++ ...ngeRecordRemoveSpecialismAssessment.cshtml | 33 ++ ...iewChangeRecordSpecialismAssessment.cshtml | 32 ++ .../AdminViewChangeRecordStartYear.cshtml | 33 ++ .../AdminChangeLog/Partials/_searchKey.cshtml | 18 + .../_viewRecordChangeRequestedDetails.cshtml | 35 ++ .../Partials/_viewRecordLogDetails.cshtml | 16 + .../AdminChangePathwayResult.cshtml | 2 + ...minChangePathwayResultReviewChanges.cshtml | 143 ++++++ .../AdminChangeSpecialismResult.cshtml | 2 + ...ChangeSpecialismResultReviewChanges.cshtml | 144 ++++++ .../AdminAddCoreRommOutcome.cshtml | 117 +++++ .../AdminAddRommOutcomeChangeGradeCore.cshtml | 102 ++++ ...AddRommOutcomeChangeGradeSpecialism.cshtml | 102 ++++ .../AdminAddSpecialismRommOutcome.cshtml | 117 +++++ .../AdminOpenPathwayRomm.cshtml | 117 +++++ .../AdminOpenPathwayRommReviewChanges.cshtml | 145 ++++++ .../AdminOpenSpecialismRomm.cshtml | 116 +++++ ...dminOpenSpecialismRommReviewChanges.cshtml | 146 ++++++ .../Views/Dashboard/_adminDashboard.cshtml | 2 +- .../web.config | 15 +- src/Sfa.Tl.ResultsAndCertification.sln | 2 +- ...hen_GetAdminSearchLearnerDetails_Called.cs | 2 +- ...hen_ProcessAdminAddPathwayResult_Called.cs | 2 +- ..._ProcessAdminAddSpecialismResult_Called.cs | 2 +- ...When_ProcessAdminOpenPathwayRomm_Called.cs | 66 +++ ...n_ProcessAdminOpenSpecialismRomm_Called.cs | 66 +++ .../When_SearchChangeLogs_Called.cs | 79 +++ .../AdminChangeLogServiceBaseTest.cs | 30 ++ .../When_GetChangeLogRecordAsync_IsCalled.cs | 99 ++++ .../When_SearchChangeLogs_IsCalled.cs | 57 ++ .../When_SearchChangeLogsAsync_IsCalled.cs | 385 ++++++++++++++ ...When_SearchLearnerDetailsAsync_IsCalled.cs | 4 +- .../ProcessAdminAddPathwayResultTestsBase.cs | 1 + .../When_Assessment_Is_From_Active_Learner.cs | 5 +- ...en_Assessment_Is_From_Withdrawn_Learner.cs | 5 +- .../When_Assessment_Is_From_Active_Learner.cs | 5 +- ...en_Assessment_Is_From_Withdrawn_Learner.cs | 5 +- ...ProcessChangeIndustryPlacementTestsBase.cs | 62 +++ ...esnt_Exist_And_Not_SpecialConsideration.cs | 62 +++ ...t_Doesnt_Exist_And_SpecialConsideration.cs | 71 +++ ...ment_Exist_And_Not_SpecialConsideration.cs | 66 +++ ...lacement_Exist_And_SpecialConsideration.cs | 76 +++ ...n_ProcessRemoveAssessmentEntry_IsCalled.cs | 14 +- ...emoveSpecialismAssessmentEntry_IsCalled.cs | 6 +- ...ProcessReviewIndustryPlacement_IsCalled.cs | 176 ------- .../AdminPostResultsServiceBaseTest.cs | 21 + .../ProcessAdminOpenPathwayRommBaseTest.cs | 89 ++++ .../When_Result_Doesnt_Exist.cs | 36 ++ .../When_Result_Exists.cs | 81 +++ .../ProcessAdminOpenSpecialismRommBaseTest.cs | 91 ++++ .../When_Result_Doesnt_Exist.cs | 36 ++ .../When_Result_Exists.cs | 81 +++ ...When_User_Authenticated_In_FreezePeriod.cs | 36 ++ ...ss.cs => When_User_WithNoServiceAccess.cs} | 2 +- .../AdminChangeLogControllerTestBase.cs | 50 ++ .../When_Called.cs | 33 ++ .../When_Cache_Empty.cs | 42 ++ .../When_Cache_Not_Empty.cs | 89 ++++ .../When_Cache_Empty.cs | 99 ++++ .../When_Cache_Not_Empty.cs | 99 ++++ .../When_Cache_Empty.cs | 48 ++ .../When_Cache_Not_Empty.cs | 94 ++++ .../When_Called.cs | 96 ++++ .../When_Called.cs | 96 ++++ .../When_Called.cs | 98 ++++ .../AdminViewChangeRecordIPGet/When_Called.cs | 101 ++++ .../When_Called.cs | 98 ++++ .../When_Called.cs | 98 ++++ .../When_Called.cs | 98 ++++ .../When_Called.cs | 98 ++++ .../When_Grade_Selected.cs | 2 +- .../TestSetup.cs | 34 ++ .../When_Cache_Empty.cs | 30 ++ .../When_Cache_Not_Empty.cs | 34 ++ .../TestSetup.cs | 26 + .../When_ModelState_Invalid.cs | 48 ++ .../When_ModelState_Valid.cs | 43 ++ .../When_Grade_Selected.cs | 2 +- .../TestSetup.cs | 35 ++ .../When_Cache_Empty.cs | 30 ++ .../When_Cache_Not_Empty.cs | 34 ++ .../TestSetup.cs | 27 + .../When_ModelState_Invalid.cs | 48 ++ .../When_ModelState_Valid.cs | 43 ++ .../When_Called.cs | 38 ++ .../AdminAddCoreRommOutcomeGet/TestSetup.cs | 34 ++ .../When_Cache_Empty_And_Invalid_Data.cs | 31 ++ .../When_Cache_Empty_And_Valid_Data.cs | 35 ++ .../When_Cache_Not_Empty.cs | 33 ++ .../AdminAddCoreRommOutcomePost/TestSetup.cs | 28 + .../When_GradeHasChanged_Selected.cs | 36 ++ .../When_GradeIsSame_Selected.cs | 29 ++ .../When_ModelState_Invalid.cs | 39 ++ .../TestSetup.cs | 35 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../TestSetup.cs | 28 + .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 ++ .../TestSetup.cs | 36 ++ .../When_Cache_Not_Empty.cs | 30 ++ .../When_Called_With_Invalid_Data.cs | 31 ++ .../When_Called_With_Valid_Data.cs | 31 ++ .../TestSetup.cs | 28 + .../When_Grade_Selected.cs | 37 ++ .../When_ModelState_Invalid.cs | 47 ++ .../When_Called.cs | 38 ++ .../TestSetup.cs | 34 ++ .../When_Cache_Empty_And_Invalid_Data.cs | 31 ++ .../When_Cache_Empty_And_Valid_Data.cs | 35 ++ .../When_Cache_Not_Empty.cs | 33 ++ .../TestSetup.cs | 28 + .../When_GradeHasChanged_Selected.cs | 36 ++ .../When_GradeIsSame_Selected.cs | 29 ++ .../When_ModelState_Invalid.cs | 39 ++ .../When_Called.cs | 38 ++ .../AdminOpenPathwayRommGet/TestSetup.cs | 34 ++ .../When_Cache_Empty_And_Invalid_Data.cs | 31 ++ .../When_Cache_Empty_And_Valid_Data.cs | 35 ++ .../When_Cache_Not_Empty.cs | 33 ++ .../AdminOpenPathwayRommPost/TestSetup.cs | 28 + .../When_ModelState_Invalid.cs | 39 ++ .../When_No_Selected.cs | 29 ++ .../When_Yes_Selected.cs | 36 ++ .../TestSetup.cs | 35 ++ .../When_Cache_Empty.cs | 21 + .../When_Cache_Not_Empty.cs | 44 ++ .../TestSetup.cs | 26 + .../When_ModelState_Invalid.cs | 42 ++ .../When_Process_Fails.cs | 33 ++ .../When_Process_Ok.cs | 45 ++ .../When_Called.cs | 38 ++ .../AdminOpenSpecialismRommGet/TestSetup.cs | 34 ++ .../When_Cache_Empty_And_Invalid_Data.cs | 31 ++ .../When_Cache_Empty_And_Valid_Data.cs | 35 ++ .../When_Cache_Not_Empty.cs | 33 ++ .../AdminOpenSpecialismRommPost/TestSetup.cs | 28 + .../When_ModelState_Invalid.cs | 39 ++ .../When_No_Selected.cs | 29 ++ .../When_Yes_Selected.cs | 36 ++ .../TestSetup.cs | 34 ++ .../When_Cache_Empty.cs | 21 + .../When_Cache_Not_Empty.cs | 44 ++ .../TestSetup.cs | 26 + .../When_ModelState_Invalid.cs | 42 ++ .../When_Process_Fails.cs | 33 ++ .../When_Process_Ok.cs | 45 ++ .../AdminPostResultsControllerTestBase.cs | 50 ++ .../ServiceAccessDenied/TestSetup.cs | 46 ++ .../When_User_In_FreezePeriod.cs | 34 ++ .../When_User_Not_In_FreezePeriod.cs | 30 ++ .../AdminChangeLogLoaderBaseTest.cs | 27 + .../When_SearchChangeLogs_IsCalled.cs | 97 ++++ .../When_Called_With_Valid_Data.cs | 2 +- .../When_Called_With_Valid_Data.cs | 2 +- .../When_Called_With_Invalid_Data.cs | 48 ++ .../When_Called_With_Valid_Data.cs | 107 ++++ .../When_Called_With_Invalid_Data.cs | 48 ++ .../When_Called_With_Valid_Data.cs | 110 ++++ .../AdminPostResultsLoaderBaseTest.cs | 284 ++++++++++ .../GetAdminOpenPathwayRomm/TestSetup.cs | 123 +++++ .../When_Learner_Doesnt_Exist.cs | 27 + .../When_Learner_Exists.cs | 34 ++ .../When_Learner_Result_QPending.cs | 36 ++ .../When_Learner_Result_XNoResult.cs | 36 ++ .../When_Learner_Widthdrawn.cs | 35 ++ .../GetAdminOpenSpecialismRomm/TestSetup.cs | 133 +++++ .../When_Learner_Doesnt_Exist.cs | 27 + .../When_Learner_Exists.cs | 34 ++ .../When_Learner_Result_QPending.cs | 36 ++ .../When_Learner_Result_XNoResult.cs | 36 ++ .../When_Learner_Widthdrawn.cs | 35 ++ .../When_Called.cs | 57 ++ .../When_Called.cs | 55 ++ ...Add_Romm_Outcome_Before_Appeal_End_Date.cs | 8 +- .../When_Result_Doesnt_Have_Grade.cs | 8 +- ...sult_Open_Appeal_Before_Appeal_End_Date.cs | 8 +- ...n_Appeal_Outcome_Before_Appeal_End_Date.cs | 8 +- ...en_Result_Open_Romm_After_Romm_End_Date.cs | 8 +- ...n_Result_Open_Romm_Before_Romm_End_Date.cs | 8 +- 308 files changed, 20171 insertions(+), 430 deletions(-) create mode 100644 src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminChangeLogService.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminPostResultsService.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Application/Mappers/ChangeLogMapper.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminChangeLogService.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminPostResultsService.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Data/Interfaces/IAdminChangeLogRepository.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminChangeLogRepository.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminChangeLogController.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminPostResultsController.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminChangeLogController.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminChangeLogRecord.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLog.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLogRequest.cs rename src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/{ChangeIPDetails.cs => ChangeIndustryPlacementRequest.cs} (92%) create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayDetails.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayResultRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecialismDetails.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecilalismResultRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveSpecialismAssessmentEntryRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/AdminPostResultsRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenPathwayRommRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenSpecialismRommRequest.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.Designer.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.resx create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminChangeLogController.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminPostResultsController.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminChangeLogLoader.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminPostResultsLoader.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminChangeLogLoader.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminPostResultsLoader.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminChangeLogMapper.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminPostResultsMapper.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecord.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecordModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/Default.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogCriteriaViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogDetailsViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddPathwayResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddSpecialismResultViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordCoreAssessmentViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordIndustryPlacementViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessmentViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessmentViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordSpecialismAssessmentViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordStartYearViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddCoreRommOutcomeViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeCoreViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialismViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddSpecialismRommOutcomeViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommReviewChangesViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommViewModel.cs create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminSearchChangeLog.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddPathwayResult.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddSpecialismResult.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordCoreAssessment.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordIP.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessment.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessment.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordSpecialismAssessment.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordStartYear.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_searchKey.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordChangeRequestedDetails.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordLogDetails.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResultReviewChanges.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResultReviewChanges.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddCoreRommOutcome.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddSpecialismRommOutcome.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRomm.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRommReviewChanges.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRomm.cshtml create mode 100644 src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRommReviewChanges.cshtml create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenPathwayRomm_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenSpecialismRomm_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_SearchChangeLogs_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/AdminChangeLogServiceBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_GetChangeLogRecordAsync_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_SearchChangeLogs_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminChangeLogRepositoryTests/When_SearchChangeLogsAsync_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/ProcessChangeIndustryPlacementTestsBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_Not_SpecialConsideration.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_SpecialConsideration.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_Not_SpecialConsideration.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_SpecialConsideration.cs delete mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/AdminPostResultsServiceBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/ProcessAdminOpenPathwayRommBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/ProcessAdminOpenSpecialismRommBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_Authenticated_In_FreezePeriod.cs rename src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/{When_User_WithNoServiceAcess.cs => When_User_WithNoServiceAccess.cs} (95%) create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminChangeLogControllerTestBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddPathwayResultGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddSpecialismResultGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordCoreAssessmentGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordIPGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveCoreAssessmentGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveSpecialismAssessmentGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordSpecialismAssessmentGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordStartYearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Valid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Valid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeHasChanged_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeIsSame_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_Grade_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeHasChanged_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeIsSame_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_No_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_Yes_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Fails.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Ok.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommClearGet/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_No_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_Yes_Selected.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Not_Empty.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_ModelState_Invalid.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Fails.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Ok.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminPostResultsControllerTestBase.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_In_FreezePeriod.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_Not_In_FreezePeriod.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/AdminChangeLogLoaderBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/When_SearchChangeLogs_IsCalled.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Invalid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Valid_Data.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminPostResultsLoaderBaseTest.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_QPending.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_XNoResult.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Widthdrawn.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/TestSetup.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Doesnt_Exist.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Exists.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_QPending.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_XNoResult.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Widthdrawn.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeCoreGrades/When_Called.cs create mode 100644 src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeSpecialismGrades/When_Called.cs diff --git a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs index 7142e966d..5d8e300db 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Clients/ResultsAndCertificationInternalApiClient.cs @@ -4,7 +4,9 @@ using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; using Sfa.Tl.ResultsAndCertification.Models.Contracts.DataExport; using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; @@ -19,7 +21,6 @@ using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; - namespace Sfa.Tl.ResultsAndCertification.Api.Client.Clients { public class ResultsAndCertificationInternalApiClient : IResultsAndCertificationInternalApiClient @@ -475,21 +476,51 @@ public async Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpec { return await PostAsync(ApiConstants.ProcessAddSpecialismAssessmentUri, request); } - public async Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request) + + public async Task RemoveAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest request) { - return await PostAsync(ApiConstants.ReviewRemoveAssessmentEntryUri, request); + return await PostAsync(ApiConstants.ReviewRemoveCoreAssessmentEntryUri, request); } - public async Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request) + public async Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest request) { - return await PostAsync(ApiConstants.ReviewRemoveAssessmentEntryUri, request); + return await PostAsync(ApiConstants.ReviewRemoveSpecialismAssessmentEntryUri, request); } public Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request) - => PostAsync(ApiConstants.ProcessAdminAddPathwayResult, request); + => PostAsync(ApiConstants.ProcessAdminAddPathwayResultUri, request); public Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request) - => PostAsync(ApiConstants.ProcessAdminAddSpecialismResult, request); + => PostAsync(ApiConstants.ProcessAdminAddSpecialismResultUri, request); + + #endregion + + #region Admin change log + + public Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request) + { + var requestUri = ApiConstants.SearchChangeLogsUri; + return PostAsync>(requestUri, request); + } + + public Task ProcessAdminChangePathwayResultAsync(ChangePathwayResultRequest request) + => PostAsync(ApiConstants.ProcessAdminChangePathwayResult, request); + + public Task ProcessAdminChangeSpecialismResultAsync(ChangeSpecialismResultRequest request) + => PostAsync(ApiConstants.ProcessAdminChangeSpecialismResult, request); + + public Task GetAdminChangeLogRecordAsync(int changeLogId) + => GetAsync(string.Format(ApiConstants.GetAdminChangeLogRecord, changeLogId)); + + #endregion + + #region Admin post results + + public Task ProcessAdminOpenPathwayRommAsync(OpenPathwayRommRequest request) + => PostAsync(ApiConstants.ProcessAdminOpenPathwayRomm, request); + + public Task ProcessAdminOpenSpecialismRommAsync(OpenSpecialismRommRequest request) + => PostAsync(ApiConstants.ProcessAdminOpenSpecialismRomm, request); #endregion diff --git a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs index 614b3c573..cde18a07a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Api.Client/Interfaces/IResultsAndCertificationInternalApiClient.cs @@ -1,6 +1,8 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Models.Contracts; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; using Sfa.Tl.ResultsAndCertification.Models.Contracts.DataExport; using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; @@ -132,14 +134,34 @@ public interface IResultsAndCertificationInternalApiClient Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request); - Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); - - Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + Task RemoveAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest request); + + Task RemoveSpecialAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest request); Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request); Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request); + Task ProcessAdminChangePathwayResultAsync(ChangePathwayResultRequest request); + + Task ProcessAdminChangeSpecialismResultAsync(ChangeSpecialismResultRequest request); + + #endregion + + #region Admin change log + + Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request); + + Task GetAdminChangeLogRecordAsync(int changeLogId); + + #endregion + + #region Admin post results + + Task ProcessAdminOpenPathwayRommAsync(OpenPathwayRommRequest request); + + Task ProcessAdminOpenSpecialismRommAsync(OpenSpecialismRommRequest request); + #endregion } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminChangeLogService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminChangeLogService.cs new file mode 100644 index 000000000..60a476e9d --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminChangeLogService.cs @@ -0,0 +1,13 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Application.Interfaces +{ + public interface IAdminChangeLogService + { + Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request); + + Task GetChangeLogRecordAsync(int changeLogId); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs index 533d16de6..d88e23d23 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminDashboardService.cs @@ -7,21 +7,29 @@ namespace Sfa.Tl.ResultsAndCertification.Application.Interfaces public interface IAdminDashboardService { Task GetAdminSearchLearnerFiltersAsync(); + Task> GetAdminSearchLearnerDetailsAsync(AdminSearchLearnerRequest request); + Task GetAdminLearnerRecordAsync(int registrationPathwayId); + Task ProcessChangeStartYearAsync(ReviewChangeStartYearRequest request); Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request); + Task ProcessAddCoreAssessmentAsync(ReviewAddCoreAssessmentRequest request); - Task ProcessAddSpecialismAssessmentAsync(ReviewAddSpecialismAssessmentRequest request); + Task ProcessAddSpecialismAssessmentAsync(ReviewAddSpecialismAssessmentRequest request); - Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest request); - Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest request); Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest request); Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request); + + Task ProcessAdminChangePathwayResultAsync(ChangePathwayResultRequest request); + + Task ProcessAdminChangeSpecialismResultAsync(ChangeSpecialismResultRequest request); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminPostResultsService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminPostResultsService.cs new file mode 100644 index 000000000..7d89fb49a --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Interfaces/IAdminPostResultsService.cs @@ -0,0 +1,12 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Application.Interfaces +{ + public interface IAdminPostResultsService + { + Task ProcessAdminOpenPathwayRommAsync(OpenPathwayRommRequest request); + + Task ProcessAdminOpenSpecialismRommAsync(OpenSpecialismRommRequest request); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/ChangeLogMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/ChangeLogMapper.cs new file mode 100644 index 000000000..b0882042b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Mappers/ChangeLogMapper.cs @@ -0,0 +1,34 @@ +using AutoMapper; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Application.Mappers +{ + public class ChangeLogMapper : Profile + { + public ChangeLogMapper() + { + _ = CreateMap() + .ForMember(d => d.ChangeLogId, opts => opts.MapFrom(s => s.Id)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.TqRegistrationPathwayId)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationProfile.UniqueLearnerNumber)) + .ForMember(d => d.FirstName, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationProfile.Firstname)) + .ForMember(d => d.LastName, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationProfile.Lastname)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom(s => s.CreatedBy)) + .ForMember(d => d.ChangeType, opts => opts.MapFrom(s => s.ChangeType)) + .ForMember(d => d.ChangeDetails, opts => opts.MapFrom(s => s.Details)) + .ForMember(d => d.ChangeRequestedBy, opts => opts.MapFrom(s => s.Name)) + .ForMember(d => d.ReasonForChange, opts => opts.MapFrom(s => s.ReasonForChange)) + .ForMember(d => d.ZendeskTicketID, opts => opts.MapFrom(s => s.ZendeskTicketID)) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqProvider.TqAwardingOrganisation.TlPathway.LarId)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqProvider.TqAwardingOrganisation.TlPathway.Name)) + .ForMember(d => d.CoreExamPeriod, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqPathwayAssessments.FirstOrDefault().AssessmentSeries.Name)) + .ForMember(d => d.SpecialismCode, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationSpecialisms.FirstOrDefault().TlSpecialism.LarId)) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationSpecialisms.FirstOrDefault().TlSpecialism.Name)) + .ForMember(d => d.SpecialismExamPeriod, opts => opts.MapFrom(s => s.TqRegistrationPathway.TqRegistrationSpecialisms.FirstOrDefault().TqSpecialismAssessments.FirstOrDefault().AssessmentSeries.Name)) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.DateOfRequest)) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => s.CreatedOn)); + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminChangeLogService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminChangeLogService.cs new file mode 100644 index 000000000..2a4508fc5 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminChangeLogService.cs @@ -0,0 +1,30 @@ +using AutoMapper; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Application.Services +{ + public class AdminChangeLogService : IAdminChangeLogService + { + private readonly IAdminChangeLogRepository _adminChangeLogRepository; + private readonly IMapper _mapper; + + public AdminChangeLogService(IAdminChangeLogRepository adminChangeLogRepository, IMapper mapper) + { + _adminChangeLogRepository = adminChangeLogRepository; + _mapper = mapper; + } + + public Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request) + => _adminChangeLogRepository.SearchChangeLogsAsync(request); + + public async Task GetChangeLogRecordAsync(int changeLogId) + { + var response = await _adminChangeLogRepository.GetChangeLogRecordAsync(changeLogId); + return _mapper.Map(response); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs index 28cd85dda..ad2543971 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminDashboardService.cs @@ -9,11 +9,13 @@ using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; +using ContractIP =Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; namespace Sfa.Tl.ResultsAndCertification.Application.Services { @@ -77,7 +79,6 @@ public async Task ProcessChangeStartYearAsync(ReviewChangeStartYearRequest return false; } - public async Task ProcessAddCoreAssessmentAsync(ReviewAddCoreAssessmentRequest request) { var tqRegistrationPathwayRepository = _repositoryFactory.GetRepository(); @@ -103,7 +104,7 @@ public async Task ProcessAddCoreAssessmentAsync(ReviewAddCoreAssessmentReq if (status > 0) { - + var changeLongRepository = _repositoryFactory.GetRepository(); var changeLog = CreateChangeLog(request, request.AddCoreAssessmentDetails); @@ -150,53 +151,99 @@ public async Task ProcessAddSpecialismAssessmentAsync(ReviewAddSpecialismA } - - - - public async Task ProcessChangeIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request) { - var industryPlacementRepository = _repositoryFactory.GetRepository(); + var industryPlacementRepository = _repositoryFactory.GetRepository(); + Domain.Models.IndustryPlacement industryPlacement = await industryPlacementRepository.GetSingleOrDefaultAsync(p => p.TqRegistrationPathwayId == request.RegistrationPathwayId); - var industryPlacement = await industryPlacementRepository.GetFirstOrDefaultAsync(p => p.TqRegistrationPathwayId == request.RegistrationPathwayId); - int status; + return industryPlacement == null + ? await CreateIndustryPlacementAsync(request, industryPlacementRepository) + : await UpdateIndustryPlacementAsync(request, industryPlacement, industryPlacementRepository); + } + + private async Task CreateIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request, IRepository industryPlacementRepository) + { + var newIndustryPlacement = new Domain.Models.IndustryPlacement + { + TqRegistrationPathwayId = request.RegistrationPathwayId, + Status = request.IndustryPlacementStatus, + Details = CreateIndustryPlacementDetails(request), + CreatedBy = request.CreatedBy + }; - if (industryPlacement == null) + bool industryPlacementCreated = await industryPlacementRepository.CreateAsync(newIndustryPlacement) > 0; + if (industryPlacementCreated) { - industryPlacement = new IndustryPlacement + var changeLogDetails = new ChangeIndustryPlacementRequest { - CreatedBy = request.CreatedBy, - TqRegistrationPathwayId = request.RegistrationPathwayId, - Status = request.ChangeIPDetails.IndustryPlacementStatusTo, - Details = request.ChangeIPDetails.IndustryPlacementStatusTo == Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration ? JsonConvert.SerializeObject(ConstructIndustryPlacementDetails(request.ChangeIPDetails)) : null + IndustryPlacementStatusFrom = IndustryPlacementStatus.NotSpecified, + IndustryPlacementStatusTo = request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = null, + HoursSpentOnPlacementTo = request.HoursSpentOnPlacement, + SpecialConsiderationReasonsFrom = null, + SpecialConsiderationReasonsTo = request.SpecialConsiderationReasons }; - status = await industryPlacementRepository.CreateAsync(industryPlacement); + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, changeLogDetails)) > 0; } - else + + return false; + } + + private async Task UpdateIndustryPlacementAsync(ReviewChangeIndustryPlacementRequest request, Domain.Models.IndustryPlacement existingIndustryPlacement, IRepository industryPlacementRepository) + { + IndustryPlacementDetails existingIndustryPlacementDetails = !string.IsNullOrEmpty(existingIndustryPlacement.Details) + ? JsonConvert.DeserializeObject(existingIndustryPlacement.Details) + : null; + + var changeLogDetails = new ChangeIndustryPlacementRequest { - industryPlacement.ModifiedBy = request.CreatedBy; - industryPlacement.ModifiedOn = _systemProvider.UtcNow; - industryPlacement.Status = request.ChangeIPDetails.IndustryPlacementStatusTo; - industryPlacement.Details = request.ChangeIPDetails.IndustryPlacementStatusTo == Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration ? JsonConvert.SerializeObject(ConstructIndustryPlacementDetails(request.ChangeIPDetails)) : null; + IndustryPlacementStatusFrom = existingIndustryPlacement.Status, + IndustryPlacementStatusTo = request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = existingIndustryPlacementDetails?.HoursSpentOnPlacement, + HoursSpentOnPlacementTo = request.HoursSpentOnPlacement, + SpecialConsiderationReasonsFrom = existingIndustryPlacementDetails?.SpecialConsiderationReasons, + SpecialConsiderationReasonsTo = request.SpecialConsiderationReasons + }; - status = await industryPlacementRepository.UpdateWithSpecifedColumnsOnlyAsync(industryPlacement, u => u.Status, u => u.Details, u => u.ModifiedBy, u => u.ModifiedOn); - } + existingIndustryPlacement.Status = request.IndustryPlacementStatus; + existingIndustryPlacement.Details = CreateIndustryPlacementDetails(request); + existingIndustryPlacement.ModifiedBy = request.CreatedBy; + existingIndustryPlacement.ModifiedOn = _systemProvider.UtcNow; - if (status > 0) + bool industryPlacementUpdated = await industryPlacementRepository.UpdateWithSpecifedColumnsOnlyAsync(existingIndustryPlacement, u => u.Status, u => u.Details, u => u.ModifiedBy, u => u.ModifiedOn) > 0; + if (industryPlacementUpdated) { var changeLongRepository = _repositoryFactory.GetRepository(); - return await changeLongRepository.CreateAsync(CreateChangeLog(request, request.ChangeIPDetails)) > 0; + return await changeLongRepository.CreateAsync(CreateChangeLog(request, changeLogDetails)) > 0; } return false; } - public async Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) + private string CreateIndustryPlacementDetails(ReviewChangeIndustryPlacementRequest request) + { + if (request.IndustryPlacementStatus != IndustryPlacementStatus.CompletedWithSpecialConsideration) + { + return null; + } + + var details = new IndustryPlacementDetails + { + IndustryPlacementStatus = request.IndustryPlacementStatus.ToString(), + HoursSpentOnPlacement = request.HoursSpentOnPlacement, + SpecialConsiderationReasons = !request.SpecialConsiderationReasons.IsNullOrEmpty() ? request.SpecialConsiderationReasons : new List() + }; + + return JsonConvert.SerializeObject(details); + } + + public async Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest model) { var pathwayAssessmentRepository = _repositoryFactory.GetRepository(); - var pathwayAssessment = await pathwayAssessmentRepository.GetFirstOrDefaultAsync(pa => pa.Id == model.AssessmentId && pa.IsOptedin + var pathwayAssessment = await pathwayAssessmentRepository.GetFirstOrDefaultAsync(pa => pa.Id == model.AssessmentId && pa.IsOptedin && !pa.TqPathwayResults.Any(x => x.IsOptedin && x.EndDate == null)); if (pathwayAssessment == null) return false; @@ -218,7 +265,7 @@ public async Task ProcessRemovePathwayAssessmentEntryAsync(ReviewRemoveAss return false; } - public async Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) + public async Task ProcessRemoveSpecialismAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest model) { var specialismAssessmentRepository = _repositoryFactory.GetRepository(); @@ -264,15 +311,20 @@ public async Task ProcessAdminAddPathwayResultAsync(AddPathwayResultReques StartDate = utcNow, EndDate = pathwayAssessment.EndDate.HasValue ? utcNow : null, IsBulkUpload = false, - CreatedBy = request.CreatedBy + CreatedBy = request.CreatedBy, + CreatedOn = utcNow }; bool created = await pathwayResultRepo.CreateAsync(pathwayResult) > 0; - + if (created) { var changeLongRepository = _repositoryFactory.GetRepository(); - return await changeLongRepository.CreateAsync(CreateChangeLog(request, new { PathwayResultId = pathwayResult.Id })) > 0; + return await changeLongRepository.CreateAsync(CreateChangeLog(request, new + { + PathwayResultId = pathwayResult.Id, + GradeTo = request.GradeTo + })) > 0; } return false; @@ -299,7 +351,8 @@ public async Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResult StartDate = utcNow, EndDate = specialismAssessment.EndDate.HasValue ? utcNow : null, IsBulkUpload = false, - CreatedBy = request.CreatedBy + CreatedBy = request.CreatedBy, + CreatedOn = utcNow }; bool created = await specialismResultRepo.CreateAsync(specialismResult) > 0; @@ -307,19 +360,119 @@ public async Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResult if (created) { var changeLongRepository = _repositoryFactory.GetRepository(); - return await changeLongRepository.CreateAsync(CreateChangeLog(request, new { SpecialismResultId = specialismResult.Id })) > 0; + return await changeLongRepository.CreateAsync(CreateChangeLog(request, new + { + SpecialismResultId = specialismResult.Id, + GradeTo = request.GradeTo + })) > 0; } return false; } + + public async Task ProcessAdminChangePathwayResultAsync(ChangePathwayResultRequest request) + { + var pathwayResultRepo = _repositoryFactory.GetRepository(); + TqPathwayResult pathwayResult = await pathwayResultRepo.GetSingleOrDefaultAsync(p => p.Id == request.ChangePathwayDetails.PathwayResultId); + + if (pathwayResult == null) + { + return false; + } + var hasEnddate = pathwayResult.EndDate.HasValue; + DateTime utcNow = _systemProvider.UtcNow; + pathwayResult.ModifiedBy = request.CreatedBy; + pathwayResult.ModifiedOn = utcNow; + pathwayResult.EndDate = utcNow; + pathwayResult.IsOptedin = false; + + + var updated = await pathwayResultRepo.UpdateWithSpecifedColumnsOnlyAsync(pathwayResult, u => u.ModifiedBy, u => u.ModifiedOn, u=>u.EndDate, u=>u.IsOptedin) > 0; + + if (request.SelectedGradeId > 0) + { + var createPathwayResult = new TqPathwayResult + { + TqPathwayAssessmentId = request.ChangePathwayDetails.PathwayAssessmentId, + TlLookupId = request.SelectedGradeId, + StartDate = utcNow, + IsOptedin = true, + IsBulkUpload = false, + CreatedBy = request.CreatedBy, + EndDate = hasEnddate ? utcNow : null, + + }; + + bool created = await pathwayResultRepo.CreateAsync(createPathwayResult) > 0; + request.ChangePathwayDetails.PathwayResultId = createPathwayResult.Id; + } + + + if (updated) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, request.ChangePathwayDetails)) > 0; + } + + return false; + } + + public async Task ProcessAdminChangeSpecialismResultAsync(ChangeSpecialismResultRequest request) + { + var specialismResultRepo = _repositoryFactory.GetRepository(); + + + TqSpecialismResult specialismResult = await specialismResultRepo.GetSingleOrDefaultAsync(p => p.Id == request.ChangeSpecialismDetails.SpecialismResultId); + var hasEnddate = specialismResult.EndDate.HasValue; + if (specialismResult == null) + { + return false; + } + DateTime utcNow = _systemProvider.UtcNow; + specialismResult.ModifiedBy = request.CreatedBy; + specialismResult.ModifiedOn = utcNow; + specialismResult.EndDate = utcNow; + specialismResult.IsOptedin = false; + + var updated = await specialismResultRepo.UpdateWithSpecifedColumnsOnlyAsync(specialismResult, u => u.ModifiedBy, u => u.ModifiedOn, u => u.EndDate, u => u.IsOptedin) > 0; + + if (request.SelectedGradeId > 0) + { + var createSpecialsimResult = new TqSpecialismResult + { + TqSpecialismAssessmentId = request.ChangeSpecialismDetails.SpecialismAssessmentId, + TlLookupId = request.SelectedGradeId, + StartDate = utcNow, + IsOptedin = true, + IsBulkUpload = false, + CreatedBy = request.CreatedBy, + EndDate = hasEnddate ? utcNow : null, + + }; + + bool created = await specialismResultRepo.CreateAsync(createSpecialsimResult) > 0; + request.ChangeSpecialismDetails.SpecialismResultId = createSpecialsimResult.Id; + } + + + if (updated) + { + var changeLongRepository = _repositoryFactory.GetRepository(); + return await changeLongRepository.CreateAsync(CreateChangeLog(request, request.ChangeSpecialismDetails)) > 0; + } + + return false; + } + + private ChangeLog CreateChangeLog(ReviewChangeRequest request, object details) { const string SystemUser = "System"; var changeLog = new ChangeLog { - ChangeType = (int)request.ChangeType, + ChangeType = request.ChangeType, ReasonForChange = request.ChangeReason, DateOfRequest = request.RequestDate, Details = JsonConvert.SerializeObject(details), @@ -331,15 +484,5 @@ private ChangeLog CreateChangeLog(ReviewChangeRequest request, object details) return changeLog; } - - private IndustryPlacementDetails ConstructIndustryPlacementDetails(ChangeIPDetails change) - { - return new IndustryPlacementDetails - { - IndustryPlacementStatus = change.IndustryPlacementStatusTo.ToString(), - HoursSpentOnPlacement = change.HoursSpentOnPlacementTo, - SpecialConsiderationReasons = !change.SpecialConsiderationReasonsTo.IsNullOrEmpty() ? change.SpecialConsiderationReasonsTo : new List() - }; - } } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminPostResultsService.cs b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminPostResultsService.cs new file mode 100644 index 000000000..febac9632 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Application/Services/AdminPostResultsService.cs @@ -0,0 +1,142 @@ +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Data.Factory; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Application.Services +{ + public class AdminPostResultsService : IAdminPostResultsService + { + private readonly IRepositoryFactory _repositoryFactory; + private readonly ISystemProvider _systemProvider; + + public AdminPostResultsService(IRepositoryFactory repositoryFactory, ISystemProvider systemProvider) + { + _repositoryFactory = repositoryFactory; + _systemProvider = systemProvider; + } + + public async Task ProcessAdminOpenPathwayRommAsync(OpenPathwayRommRequest request) + { + var pathwayResultRepo = _repositoryFactory.GetRepository(); + + TqPathwayResult existingPathwayResult = await pathwayResultRepo.GetFirstOrDefaultAsync(p => p.Id == request.PathwayResultId); + if (existingPathwayResult == null) + { + return false; + } + + DateTime utcNow = _systemProvider.UtcNow; + + existingPathwayResult.IsOptedin = false; + existingPathwayResult.EndDate = utcNow; + existingPathwayResult.ModifiedBy = request.CreatedBy; + existingPathwayResult.ModifiedOn = utcNow; + + bool updated = await pathwayResultRepo.UpdateWithSpecifedColumnsOnlyAsync(existingPathwayResult, + p => p.IsOptedin, + p => p.EndDate, + p => p.ModifiedBy, + p => p.ModifiedOn) > 0; + + if (!updated) + { + return false; + } + + var newPathwayResult = new TqPathwayResult + { + TqPathwayAssessmentId = existingPathwayResult.TqPathwayAssessmentId, + TlLookupId = existingPathwayResult.TlLookupId, + PrsStatus = PrsStatus.UnderReview, + IsOptedin = true, + StartDate = utcNow, + IsBulkUpload = false, + CreatedBy = request.CreatedBy, + CreatedOn = utcNow + }; + + bool created = await pathwayResultRepo.CreateAsync(newPathwayResult) > 0; + if (!created) + { + return false; + } + + var changeLongRepository = _repositoryFactory.GetRepository(); + + ChangeLog changeLog = CreateChangeLog(ChangeType.OpenPathwayRomm, request, new { PathwayResultId = newPathwayResult.Id }); + return await changeLongRepository.CreateAsync(changeLog) > 0; + } + + public async Task ProcessAdminOpenSpecialismRommAsync(OpenSpecialismRommRequest request) + { + var specialismResultRepo = _repositoryFactory.GetRepository(); + + TqSpecialismResult existingSpecialismResult = await specialismResultRepo.GetFirstOrDefaultAsync(p => p.Id == request.SpecialismResultId); + if (existingSpecialismResult == null) + { + return false; + } + + DateTime utcNow = _systemProvider.UtcNow; + + existingSpecialismResult.IsOptedin = false; + existingSpecialismResult.EndDate = utcNow; + existingSpecialismResult.ModifiedBy = request.CreatedBy; + existingSpecialismResult.ModifiedOn = utcNow; + + bool updated = await specialismResultRepo.UpdateWithSpecifedColumnsOnlyAsync(existingSpecialismResult, + p => p.IsOptedin, + p => p.EndDate, + p => p.ModifiedBy, + p => p.ModifiedOn) > 0; + + if (!updated) + { + return false; + } + + var newSpecialismResult = new TqSpecialismResult + { + TqSpecialismAssessmentId = existingSpecialismResult.TqSpecialismAssessmentId, + TlLookupId = existingSpecialismResult.TlLookupId, + PrsStatus = PrsStatus.UnderReview, + IsOptedin = true, + StartDate = utcNow, + IsBulkUpload = false, + CreatedBy = request.CreatedBy, + CreatedOn = utcNow + }; + + bool created = await specialismResultRepo.CreateAsync(newSpecialismResult) > 0; + + if (!created) + { + return false; + } + + var changeLongRepository = _repositoryFactory.GetRepository(); + + ChangeLog changeLog = CreateChangeLog(ChangeType.OpenSpecialismRomm, request, new { SpecialismResultId = newSpecialismResult.Id }); + return await changeLongRepository.CreateAsync(changeLog) > 0; + } + + private static ChangeLog CreateChangeLog(ChangeType changeType, AdminPostResultsRequest request, object details) + => new() + { + TqRegistrationPathwayId = request.RegistrationPathwayId, + ChangeType = changeType, + Details = JsonConvert.SerializeObject(details), + Name = request.ContactName, + DateOfRequest = request.DateOfRequest, + ReasonForChange = request.ChangeReason, + ZendeskTicketID = request.ZendeskTicketId, + CreatedBy = string.IsNullOrEmpty(request.CreatedBy) ? "System" : request.CreatedBy + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Constants/CacheConstants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Constants/CacheConstants.cs index ba0274fc9..b2535dfea 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Constants/CacheConstants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Constants/CacheConstants.cs @@ -17,5 +17,7 @@ public static class CacheConstants public const string IpCacheKey = "IndustryPlacement"; public const string AdminDashboardCacheKey = "AdminDashboard"; public const string AdminDashboardInformationCacheKey = "AdminDashboardInformation"; + public const string AdminChangeLogCacheKey = "AdminChangeLog"; + public const string AdminPostResultsCacheKey = "AdminPostResults"; } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs index 9d1fc3689..3250063d1 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Enum/ChangeType.cs @@ -4,9 +4,15 @@ public enum ChangeType { StartYear = 1, IndustryPlacement = 2, - AssessmentEntryAdd = 3, - AssessmentEntryRemove = 4, - AddPathwayResult = 5, - AddSpecialismResult = 6 + AddPathwayAssessment = 3, + AddSpecialismAssessment = 4, + RemovePathwayAssessment = 5, + RemoveSpecialismAssessment = 6, + AddPathwayResult = 7, + AddSpecialismResult = 8, + ChangePathwayResult = 9, + ChangeSpecialismResult = 10, + OpenPathwayRomm = 11, + OpenSpecialismRomm = 12 } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs index a017d3742..9cef6869a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/ApiConstants.cs @@ -76,7 +76,7 @@ public static class ApiConstants public const string FindSoaLearnerRecordUri = "/api/statementofachievement/FindSoaLearnerRecord/{0}/{1}"; public const string GetSoaLearnerRecordDetailsUri = "/api/statementofachievement/GetSoaLearnerRecordDetails/{0}/{1}"; public const string CreateSoaPrintingRequestUri = "/api/statementofachievement/CreateSoaPrintingRequest"; - public const string GetPrintRequestSnapshotUri = "/api/statementofachievement/GetPrintRequestSnapshot/{0}/{1}/{2}"; + public const string GetPrintRequestSnapshotUri = "/api/statementofachievement/GetPrintRequestSnapshot/{0}/{1}/{2}"; // Post Results Service Uri's public const string FindPrsLearnerRecordUri = "/api/postresultsservice/FindPrsLearnerRecord/{0}/{1}"; @@ -130,9 +130,23 @@ public static class ApiConstants public const string ProcessChangeIPUri = "/api/admindashboard/ProcessChangeIndustryPlacement"; public const string ProcessAddCoreAssessmentUri = "/api/admindashboard/ProcessAddCoreAssessmentRequest"; public const string ProcessAddSpecialismAssessmentUri = "/api/admindashboard/ProcessAddSpecialismAssessmentRequest"; - public const string ReviewRemoveAssessmentEntryUri = "/api/admindashboard/ReviewRemoveAssessmentEntry"; + public const string ReviewRemoveCoreAssessmentEntryUri = "/api/admindashboard/ReviewRemoveCoreAssessmentEntry"; + public const string ReviewRemoveSpecialismAssessmentEntryUri = "/api/admindashboard/ReviewRemoveSpecialismAssessmentEntry"; + public const string ProcessAdminAddPathwayResultUri = "/api/admindashboard/ProcessAdminAddPathwayResult"; + public const string ProcessAdminAddSpecialismResultUri = "/api/admindashboard/ProcessAdminAddSpecialismResult"; public const string ProcessAdminAddPathwayResult = "/api/admindashboard/ProcessAdminAddPathwayResult"; public const string ProcessAdminAddSpecialismResult = "/api/admindashboard/ProcessAdminAddSpecialismResult"; + + public const string ProcessAdminChangePathwayResult = "/api/admindashboard/ProcessAdminChangePathwayResult"; + public const string ProcessAdminChangeSpecialismResult = "/api/admindashboard/ProcessAdminChangeSpecialismResult"; + // Admin change log + public const string SearchChangeLogsUri = "/api/adminchangelog/SearchChangeLogs"; + public const string GetAdminChangeLogRecord = "/api/adminchangelog/GetAdminChangeLogRecord/{0}"; + + // Admin post results + public const string ProcessAdminOpenPathwayRomm = "/api/adminpostresults/ProcessAdminOpenPathwayRomm"; + public const string ProcessAdminOpenSpecialismRomm = "/api/adminpostresults/ProcessAdminOpenSpecialismRomm"; + } -} \ No newline at end of file +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/Constants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/Constants.cs index 6856041b0..91b7ad738 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/Constants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/Constants.cs @@ -115,6 +115,7 @@ public static class Constants public const string AcademicYear = "academicYear"; public const string RegistrationPathwayId = "registrationPathwayId"; public const string SpecialismsId = "specialismsId"; + public const string ChangeLogId = "changeLogId"; // Assessments public const int AssessmentEndInYears = 4; diff --git a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs index f746bd411..229454c2a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Common/Helpers/RouteConstants.cs @@ -432,7 +432,7 @@ public static class RouteConstants public const string SubmitCoreComponentAssessmentEntry = "SubmitCoreComponentAssessmentEntry"; public const string AdminOccupationalSpecialisAssessmentEntry = "AdminOccupationalSpecialisAssessmentEntry"; public const string SubmitOccupationalSpecialisAssessmentEntry = "SubmitOccupationalSpecialisAssessmentEntry"; - + public const string AdminReviewChangesCoreAssessmentEntry = "AdminReviewChangesCoreAssessmentEntry"; public const string SubmitReviewChangesCoreAssessmentEntry = "SubmitReviewChangesCoreAssessmentEntry"; public const string AdminReviewChangesSpecialismAssessmentEntry = "AdminReviewChangesSpecialismAssessmentEntry"; @@ -462,7 +462,60 @@ public static class RouteConstants public const string AdminChangeSpecialismResultClear = "AdminChangeSpecialismResultClear"; public const string SubmitAdminChangeSpecialismResult = "SubmitAdminChangeSpecialismResult"; public const string AdminChangeSpecialismResultReviewChanges = "AdminChangeSpecialismResultReviewChanges"; - public const string AdminChangePathwayResultReviewChanges = "AdminAddPathwayResultReviewChanges"; + public const string AdminChangePathwayResultReviewChanges = "AdminChangePathwayResultReviewChanges"; + public const string SubmitAdminChangePathwayResultReviewChanges = "SubmitAdminChangePathwayResultReviewChanges"; + public const string SubmitAdminChangeSpecialismResultReviewChanges = "SubmitAdminChangeSpecialismResultReviewChanges"; + + #endregion + + #region Change logs + + public const string AdminSearchChangeLogClear = "AdminSearchChangeLogClear"; + public const string AdminSearchChangeLog = "AdminSearchChangeLog"; + public const string SubmitAdminSearchChangeLogSearchKey = "SubmitAdminSearchChangeLogSearchKey"; + public const string SubmitAdminSearchChangeLogClearKey = "SubmitAdminSearchChangeLogClearKey"; + + public const string AdminViewChangeStartYearRecord = "AdminViewChangeStartYearRecord"; + public const string AdminViewChangeIPRecord = "AdminViewChangeIPRecord"; + public const string AdminViewChangeCoreAssessmentRecord = "AdminViewChangeCoreAssessmentRecord"; + public const string AdminViewChangeSpecialismAssessmentRecord = "AdminViewChangeSpecialismAssessmentRecord"; + public const string AdminViewChangeAddPathwayResultRecord = "AdminViewChangeAddPathwayResultRecord"; + public const string AdminViewChangeAddSpecialismResultRecord = "AdminViewChangeAddSpecialismResultRecord"; + public const string AdminViewChangeRemoveCoreAssessmentRecord = "AdminViewChangeRemoveCoreAssessmentRecord"; + public const string AdminViewChangeRemoveSpecialismAssessmentRecord = "AdminViewChangeRemoveSpecialismAssessmentRecord"; + + + #endregion + + #region Admin post results + + public const string AdminOpenPathwayRommClear = "AdminOpenPathwayRommClear"; + public const string AdminOpenPathwayRomm = "AdminOpenPathwayRomm"; + public const string SubmitAdminOpenPathwayRomm = "SubmitAdminOpenPathwayRomm"; + public const string AdminOpenPathwayRommReviewChanges = "AdminOpenPathwayRommReviewChanges"; + public const string SubmitAdminOpenPathwayRommReviewChanges = "SubmitAdminOpenPathwayRommReviewChanges"; + + public const string AdminOpenSpecialismRommClear = "AdminOpenSpecialismRommClear"; + public const string AdminOpenSpecialismRomm = "AdminOpenSpecialismRomm"; + public const string SubmitAdminOpenSpecialismRomm = "SubmitAdminOpenSpecialismRomm"; + public const string AdminOpenSpecialismRommReviewChanges = "AdminOpenSpecialismRommReviewChanges"; + public const string SubmitAdminOpenSpecialismRommReviewChanges = "SubmitAdminOpenSpecialismRommReviewChanges"; + + public const string AdminAddCoreRommOutcomeClear = "AdminAddCoreRommOutcomeClear"; + public const string AdminAddCoreRommOutcome = "AdminAddCoreRommOutcome"; + public const string SubmitAddCoreRommOutcome = "SubmitAddCoreRommOutcome"; + + public const string AdminAddSpecialismRommOutcomeClear = "AdminAddSpecialismRommOutcomeClear"; + public const string AdminAddSpecialismRommOutcome = "AdminAddSpecialismRommOutcome"; + public const string SubmitAddSpecialismRommOutcome = "SubmitAddSpecialismRommOutcome"; + + public const string AdminAddRommOutcomeChangeGradeCoreClear = "AdminAddRommOutcomeChangeGradeCoreClear"; + public const string AdminAddRommOutcomeChangeGradeCore = "AdminAddRommOutcomeChangeGradeCore"; + public const string SubmitAdminAddRommOutcomeChangeGradeCore = "SubmitAdminAddRommOutcomeChangeGradeCore"; + + public const string AdminAddRommOutcomeChangeGradeSpecialismClear = "AdminAddRommOutcomeChangeGradeSpecialismClear"; + public const string AdminAddRommOutcomeChangeGradeSpecialism = "AdminAddRommOutcomeChangeGradeSpecialism"; + public const string SubmitAdminAddRommOutcomeChangeGradeSpecialism = "SubmitAdminAddRommOutcomeChangeGradeSpecialism"; #endregion } diff --git a/src/Sfa.Tl.ResultsAndCertification.Data/Interfaces/IAdminChangeLogRepository.cs b/src/Sfa.Tl.ResultsAndCertification.Data/Interfaces/IAdminChangeLogRepository.cs new file mode 100644 index 000000000..3bfa191ab --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Data/Interfaces/IAdminChangeLogRepository.cs @@ -0,0 +1,14 @@ +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Data.Interfaces +{ + public interface IAdminChangeLogRepository + { + Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request); + + Task GetChangeLogRecordAsync(int changeLogId); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminChangeLogRepository.cs b/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminChangeLogRepository.cs new file mode 100644 index 000000000..107d8df2c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminChangeLogRepository.cs @@ -0,0 +1,94 @@ +using Microsoft.EntityFrameworkCore; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Data.Repositories +{ + public class AdminChangeLogRepository : IAdminChangeLogRepository + { + private readonly ResultsAndCertificationDbContext _dbContext; + + public AdminChangeLogRepository(ResultsAndCertificationDbContext dbContext) + { + _dbContext = dbContext; + } + + public async Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request) + { + IQueryable changeLogQueryable = _dbContext.ChangeLog + .Include(p => p.TqRegistrationPathway) + .ThenInclude(p => p.TqRegistrationProfile) + .Include(p => p.TqRegistrationPathway) + .ThenInclude(p => p.TqProvider) + .ThenInclude(p => p.TlProvider); + + int totalCount = changeLogQueryable.Count(); + + if (!string.IsNullOrWhiteSpace(request.SearchKey)) + { + Expression> queryExpression = + p => (request.SearchKey.IsLong() && p.TqRegistrationPathway.TqRegistrationProfile.UniqueLearnerNumber == request.SearchKey.ToLong()) + || EF.Functions.Like(p.TqRegistrationPathway.TqRegistrationProfile.Lastname.Trim(), request.SearchKey) + || EF.Functions.Like(p.ZendeskTicketID.Trim(), request.SearchKey); + + changeLogQueryable = changeLogQueryable.Where(queryExpression); + } + + int filteredRecordsCount = await changeLogQueryable.CountAsync(); + var pager = new Pager(filteredRecordsCount, request.PageNumber, 10); + + IQueryable searchChangeLogQueryable = changeLogQueryable + .Select(x => new AdminSearchChangeLog + { + ChangeLogId = x.Id, + ChangeType = x.ChangeType, + DateAndTimeOfChange = x.CreatedOn, + ZendeskTicketID = x.ZendeskTicketID, + LearnerFirstname = x.TqRegistrationPathway.TqRegistrationProfile.Firstname, + LearnerLastname = x.TqRegistrationPathway.TqRegistrationProfile.Lastname, + Uln = x.TqRegistrationPathway.TqRegistrationProfile.UniqueLearnerNumber, + ProviderName = x.TqRegistrationPathway.TqProvider.TlProvider.Name, + ProviderUkprn = x.TqRegistrationPathway.TqProvider.TlProvider.UkPrn, + LastUpdatedBy = x.Name + }) + .OrderByDescending(x => x.DateAndTimeOfChange) + .Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize); + + List changeLogs = await searchChangeLogQueryable.ToListAsync(); + return new PagedResponse { Records = changeLogs, TotalRecords = totalCount, PagerInfo = pager }; + } + + public async Task GetChangeLogRecordAsync(int changeLogId) + { + return await _dbContext.ChangeLog + .Include(p => p.TqRegistrationPathway) + .ThenInclude(p => p.TqPathwayAssessments.Where(pa => pa.IsOptedin)) + .ThenInclude(p => p.TqPathwayResults.Where(pr => pr.IsOptedin)) + .ThenInclude(p => p.TlLookup) + .Include(p => p.TqRegistrationPathway.TqPathwayAssessments.Where(pa => pa.IsOptedin)) + .ThenInclude(p => p.AssessmentSeries) + .Include(p => p.TqRegistrationPathway.TqRegistrationSpecialisms.Where(rs => rs.IsOptedin)) + .ThenInclude(p => p.TqSpecialismAssessments.Where(sa => sa.IsOptedin)) + .ThenInclude(p => p.TqSpecialismResults) + .ThenInclude(p => p.TlLookup) + .Include(p => p.TqRegistrationPathway.TqRegistrationSpecialisms.Where(rs => rs.IsOptedin)) + .ThenInclude(p => p.TqSpecialismAssessments.Where(sa => sa.IsOptedin)) + .ThenInclude(p => p.AssessmentSeries) + .Include(p => p.TqRegistrationPathway.TqRegistrationSpecialisms.Where(sa => sa.IsOptedin)) + .ThenInclude(p => p.TlSpecialism) + .Include(p => p.TqRegistrationPathway.TqRegistrationProfile) + .Include(p => p.TqRegistrationPathway.TqProvider) + .ThenInclude(p => p.TqAwardingOrganisation) + .ThenInclude(p => p.TlPathway) + .FirstOrDefaultAsync(p => p.Id == changeLogId); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminDashboardRepository.cs b/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminDashboardRepository.cs index f4aebb348..64cdad41b 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminDashboardRepository.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Data/Repositories/AdminDashboardRepository.cs @@ -5,7 +5,6 @@ using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; using System; using System.Collections.Generic; using System.Linq; @@ -110,7 +109,7 @@ public async Task> SearchLearnerDetailsA Expression> expression = isSearchKeyUln ? p => p.TqRegistrationProfile.UniqueLearnerNumber == request.SearchKey.ToLong() - : p => EF.Functions.Like(p.TqRegistrationProfile.Lastname.Trim(), request.SearchKey.ToLower()); + : p => EF.Functions.Like(p.TqRegistrationProfile.Lastname.Trim(), request.SearchKey); registrationPathwayQueryable = registrationPathwayQueryable.Where(expression); } diff --git a/src/Sfa.Tl.ResultsAndCertification.Domain/Models/ChangeLog.cs b/src/Sfa.Tl.ResultsAndCertification.Domain/Models/ChangeLog.cs index 88d9f6971..6a79eb1f5 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Domain/Models/ChangeLog.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Domain/Models/ChangeLog.cs @@ -1,25 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; namespace Sfa.Tl.ResultsAndCertification.Domain.Models { public partial class ChangeLog : BaseEntity { public int TqRegistrationPathwayId { get; set; } - public int ChangeType { get; set; } + + public ChangeType ChangeType { get; set; } public string Details { get; set; } - public string Name { get; set;} + public string Name { get; set; } public DateTime DateOfRequest { get; set; } - public string ReasonForChange { get; set;} + public string ReasonForChange { get; set; } public string ZendeskTicketID { get; set; } + public virtual TqRegistrationPathway TqRegistrationPathway { get; set; } } } diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminChangeLogController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminChangeLogController.cs new file mode 100644 index 000000000..37e32a034 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminChangeLogController.cs @@ -0,0 +1,30 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.InternalApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class AdminChangeLogController : ControllerBase + { + private readonly IAdminChangeLogService _adminChangeLogService; + + public AdminChangeLogController(IAdminChangeLogService adminChangeLogService) + { + _adminChangeLogService = adminChangeLogService; + } + + [HttpPost] + [Route("SearchChangeLogs")] + public Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request) + => _adminChangeLogService.SearchChangeLogsAsync(request); + + [HttpGet] + [Route("GetAdminChangeLogRecord/{changeLogId}")] + public Task GetAdminChangeLogRecord(int changeLogId) + => _adminChangeLogService.GetChangeLogRecordAsync(changeLogId); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs index d928c4f78..8210234eb 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminDashboardController.cs @@ -70,17 +70,14 @@ public async Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpec } [HttpPost] - [Route("ReviewRemoveAssessmentEntry")] - public async Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest model) - { - return model.ComponentType switch - { - ComponentType.Core => await _adminDashboardService.ProcessRemovePathwayAssessmentEntryAsync(model), - ComponentType.Specialism => await _adminDashboardService.ProcessRemoveSpecialismAssessmentEntryAsync(model), - ComponentType.NotSpecified => false, - _ => false - }; - } + [Route("ReviewRemoveCoreAssessmentEntry")] + public async Task RemoveCoreAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest model) + => await _adminDashboardService.ProcessRemovePathwayAssessmentEntryAsync(model); + + [HttpPost] + [Route("ReviewRemoveSpecialismAssessmentEntry")] + public async Task RemoveSpecialismAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest model) + => await _adminDashboardService.ProcessRemoveSpecialismAssessmentEntryAsync(model); [HttpPost] [Route("ProcessAdminAddPathwayResult")] @@ -91,5 +88,15 @@ public Task ProcessAdminAddPathwayResultAsync(AddPathwayResultRequest requ [Route("ProcessAdminAddSpecialismResult")] public Task ProcessAdminAddSpecialismResultAsync(AddSpecialismResultRequest request) => _adminDashboardService.ProcessAdminAddSpecialismResultAsync(request); + + [HttpPost] + [Route("ProcessAdminChangePathwayResult")] + public Task ProcessAdminChangePathwayResultAsync(ChangePathwayResultRequest request) + => _adminDashboardService.ProcessAdminChangePathwayResultAsync(request); + + [HttpPost] + [Route("ProcessAdminChangeSpecialismResult")] + public Task ProcessAdminChangeSpecialismResultAsync(ChangeSpecialismResultRequest request) + => _adminDashboardService.ProcessAdminChangeSpecialismResultAsync(request); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminPostResultsController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminPostResultsController.cs new file mode 100644 index 000000000..9c3f44f31 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Controllers/AdminPostResultsController.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.InternalApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class AdminPostResultsController : ControllerBase + { + private readonly IAdminPostResultsService _adminPostResultsService; + + public AdminPostResultsController(IAdminPostResultsService adminPostResultsService) + { + _adminPostResultsService = adminPostResultsService; + } + + [HttpPost] + [Route("ProcessAdminOpenPathwayRomm")] + public Task ProcessAdminOpenPathwayRommAsync(OpenPathwayRommRequest request) + => _adminPostResultsService.ProcessAdminOpenPathwayRommAsync(request); + + [HttpPost] + [Route("ProcessAdminOpenSpecialismRomm")] + public Task ProcessAdminOpenSpecialismRommAsync(OpenSpecialismRommRequest request) + => _adminPostResultsService.ProcessAdminOpenSpecialismRommAsync(request); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminChangeLogController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminChangeLogController.cs new file mode 100644 index 000000000..0db95c9ce --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminChangeLogController.cs @@ -0,0 +1,13 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.InternalApi.Interfaces +{ + public interface IAdminChangeLogController + { + Task> SearchChangeLogsAsync(AdminSearchChangeLogRequest request); + + Task GetAdminChangeLogRecord(int changeLogId); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs index 9840f6ed1..ddd8e0ec9 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Interfaces/IAdminDashboardController.cs @@ -13,6 +13,7 @@ public interface IAdminDashboardController Task ProcessAddCoreAssessmentRequestAsync(ReviewAddCoreAssessmentRequest request); Task ProcessAddSpecialismAssessmentRequestAsync(ReviewAddSpecialismAssessmentRequest request); - Task RemoveAssessmentEntryAsync(ReviewRemoveAssessmentEntryRequest request); + Task RemoveCoreAssessmentEntryAsync(ReviewRemoveCoreAssessmentEntryRequest request); + Task RemoveSpecialismAssessmentEntryAsync(ReviewRemoveSpecialismAssessmentEntryRequest request); } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Sfa.Tl.ResultsAndCertification.InternalApi.csproj b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Sfa.Tl.ResultsAndCertification.InternalApi.csproj index 205aaa56d..73b80994c 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Sfa.Tl.ResultsAndCertification.InternalApi.csproj +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Sfa.Tl.ResultsAndCertification.InternalApi.csproj @@ -10,6 +10,7 @@ + diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs index 48648859e..bb53fdceb 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs @@ -69,6 +69,7 @@ public void ConfigureServices(IServiceCollection services) services.AddApplicationInsightsTelemetry(); services.AddControllers(); + services.AddSwaggerGen(); services.Configure(options => { @@ -101,6 +102,9 @@ public void Configure(IApplicationBuilder app) if (_env.IsDevelopment()) { app.UseDeveloperExceptionPage(); + + app.UseSwagger(); + app.UseSwaggerUI(); } else { @@ -134,6 +138,7 @@ private void RegisterDependencies(IServiceCollection services) private void RegisterApplicationServices(IServiceCollection services) { + // Repositories services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -144,7 +149,11 @@ private void RegisterApplicationServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(typeof(IRepository<>), typeof(GenericRepository<>)); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -154,9 +163,7 @@ private void RegisterApplicationServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); - services.AddTransient(); // Bulk Registrations services.AddTransient, RegistrationParser>(); @@ -187,6 +194,8 @@ private void RegisterApplicationServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); // DataExports services.AddTransient(); diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminChangeLogRecord.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminChangeLogRecord.cs new file mode 100644 index 000000000..33d3ad4b7 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminChangeLogRecord.cs @@ -0,0 +1,46 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog +{ + public class AdminChangeLogRecord + { + public int ChangeLogId { get; set; } + + public int RegistrationPathwayId { get; set; } + + public string PathwayName { get; set; } + + public string CoreExamPeriod { get; set; } + + public string CoreCode { get; set; } + + public string SpecialismName { get; set; } + + public string SpecialismCode { get; set; } + + public string SpecialismExamPeriod { get; set; } + + public string FirstName { get; set; } + + public string LastName { get; set; } + + public long Uln { get; set; } + + public string CreatedBy { get; set; } + + public ChangeType ChangeType { get; set; } + + public string ChangeDetails { get; set; } + + public string ChangeRequestedBy { get; set; } + + public DateTime ChangeDateOfRequest { get; set; } + + public string ReasonForChange { get; set; } + + public string ZendeskTicketID { get; set; } + + public DateTime DateAndTimeOfChange { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLog.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLog.cs new file mode 100644 index 000000000..84c67ac82 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLog.cs @@ -0,0 +1,28 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog +{ + public class AdminSearchChangeLog + { + public int ChangeLogId { get; set; } + + public ChangeType ChangeType { get; set; } + + public DateTime DateAndTimeOfChange { get; set; } + + public string ZendeskTicketID { get; set; } + + public string LearnerFirstname { get; set; } + + public string LearnerLastname { get; set; } + + public long Uln { get; set; } + + public string ProviderName { get; set; } + + public long ProviderUkprn { get; set; } + + public string LastUpdatedBy { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLogRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLogRequest.cs new file mode 100644 index 000000000..bbcf056ed --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminChangeLog/AdminSearchChangeLogRequest.cs @@ -0,0 +1,9 @@ +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog +{ + public class AdminSearchChangeLogRequest + { + public string SearchKey { get; set; } + + public int? PageNumber { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs index 5a2d32501..30efa5562 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddCoreAssessmentDetails.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class AddCoreAssessmentDetails { diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs index eb0d891d4..81395396f 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddPathwayResultRequest.cs @@ -8,6 +8,8 @@ public class AddPathwayResultRequest : ReviewChangeRequest public int SelectedGradeId { get; set; } + public string GradeTo { get; set; } + public override ChangeType ChangeType => ChangeType.AddPathwayResult; } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs index b9be828f6..2ef0104d0 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismDetails.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class AddSpecialismDetails { diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs index fa608a7de..b3c975a88 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/AddSpecialismResultRequest.cs @@ -8,6 +8,8 @@ public class AddSpecialismResultRequest : ReviewChangeRequest public int SelectedGradeId { get; set; } + public string GradeTo { get; set; } + public override ChangeType ChangeType => ChangeType.AddSpecialismResult; } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIndustryPlacementRequest.cs similarity index 92% rename from src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs rename to src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIndustryPlacementRequest.cs index 0ed9ec8c9..defca08e5 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIPDetails.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeIndustryPlacementRequest.cs @@ -3,7 +3,7 @@ namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { - public class ChangeIPDetails + public class ChangeIndustryPlacementRequest { public IndustryPlacementStatus IndustryPlacementStatusFrom { get; set; } @@ -16,6 +16,5 @@ public class ChangeIPDetails public int? HoursSpentOnPlacementTo { get; set; } public List SpecialConsiderationReasonsTo { get; set; } - } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayDetails.cs new file mode 100644 index 000000000..fe3fda38e --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayDetails.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ChangePathwayDetails + { + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string SelectedGradeFrom { get; set; } + + public string SelectedGradeTo { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayResultRequest.cs new file mode 100644 index 000000000..0bf3c9283 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangePathwayResultRequest.cs @@ -0,0 +1,18 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ChangePathwayResultRequest : ReviewChangeRequest + { + public ChangePathwayDetails ChangePathwayDetails { get; set; } + public int SelectedGradeId { get; set; } + public int PathwayResultId { get; set; } + public override ChangeType ChangeType => ChangeType.ChangePathwayResult; + } +} + diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecialismDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecialismDetails.cs new file mode 100644 index 000000000..2aab7ee6e --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecialismDetails.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ChangeSpecialismDetails + { + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SelectedGradeFrom { get; set; } + + public string SelectedGradeTo { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecilalismResultRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecilalismResultRequest.cs new file mode 100644 index 000000000..5dccd6474 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeSpecilalismResultRequest.cs @@ -0,0 +1,13 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ChangeSpecialismResultRequest : ReviewChangeRequest + { + public ChangeSpecialismDetails ChangeSpecialismDetails { get; set; } + public int SelectedGradeId { get; set; } + public int SpecialismResultId { get; set; } + public override ChangeType ChangeType => ChangeType.ChangeSpecialismResult; + } +} + diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeStartYearDetails.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeStartYearDetails.cs index 78d0b5b9f..e66fafa8a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeStartYearDetails.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ChangeStartYearDetails.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class ChangeStartYearDetails { diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs index d5d4a4f33..ca580d081 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddCoreAssessmentRequest.cs @@ -1,15 +1,10 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class ReviewAddCoreAssessmentRequest: ReviewChangeRequest { public AddCoreAssessmentDetails AddCoreAssessmentDetails { get; set; } - public override ChangeType ChangeType => ChangeType.AssessmentEntryAdd; + public override ChangeType ChangeType => ChangeType.AddPathwayAssessment; } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs index 12f8aa02a..757ee6f51 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewAddSpecialismAssessmentRequest.cs @@ -1,16 +1,13 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class ReviewAddSpecialismAssessmentRequest:ReviewChangeRequest { public AddSpecialismDetails AddSpecialismDetails { get; set; } - public override ChangeType ChangeType => ChangeType.AssessmentEntryAdd; + + public override ChangeType ChangeType => ChangeType.AddSpecialismAssessment; + public int SpecialismId { get; set; } } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs index 896afd8aa..200bc0769 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewChangeIndustryPlacementRequest.cs @@ -1,10 +1,16 @@ using Sfa.Tl.ResultsAndCertification.Common.Enum; +using System.Collections.Generic; namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { public class ReviewChangeIndustryPlacementRequest : ReviewChangeRequest { - public ChangeIPDetails ChangeIPDetails { get; set; } + public IndustryPlacementStatus IndustryPlacementStatus { get; set; } + + public int? HoursSpentOnPlacement { get; set; } + + public List SpecialConsiderationReasons { get; set; } + public override ChangeType ChangeType => ChangeType.IndustryPlacement; } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs index 3bf6ce9be..8c9afb289 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveAssessmentEntryRequest.cs @@ -2,16 +2,14 @@ namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard { - public class ReviewRemoveAssessmentEntryRequest : ReviewChangeRequest + public class ReviewRemoveCoreAssessmentEntryRequest : ReviewChangeRequest { public int AssessmentId { get; set; } public DetailsChangeAssessmentRemove ChangeAssessmentDetails { get; set; } - public DetailsSpecialismAssessmentRemove ChangeSpecialismAssessmentDetails { get; set; } - public ComponentType ComponentType { get; set; } - public override ChangeType ChangeType => ChangeType.AssessmentEntryRemove; + public override ChangeType ChangeType => ChangeType.RemovePathwayAssessment; } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveSpecialismAssessmentEntryRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveSpecialismAssessmentEntryRequest.cs new file mode 100644 index 000000000..b166216c8 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminDashboard/ReviewRemoveSpecialismAssessmentEntryRequest.cs @@ -0,0 +1,15 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard +{ + public class ReviewRemoveSpecialismAssessmentEntryRequest : ReviewChangeRequest + { + public int AssessmentId { get; set; } + + public DetailsSpecialismAssessmentRemove ChangeSpecialismAssessmentDetails { get; set; } + + public ComponentType ComponentType { get; set; } + + public override ChangeType ChangeType => ChangeType.RemoveSpecialismAssessment; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/AdminPostResultsRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/AdminPostResultsRequest.cs new file mode 100644 index 000000000..954bd100e --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/AdminPostResultsRequest.cs @@ -0,0 +1,19 @@ +using System; + +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults +{ + public abstract class AdminPostResultsRequest + { + public int RegistrationPathwayId { get; set; } + + public string ContactName { get; set; } + + public DateTime DateOfRequest { get; set; } + + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + public string CreatedBy { get; set; } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenPathwayRommRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenPathwayRommRequest.cs new file mode 100644 index 000000000..a562437fd --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenPathwayRommRequest.cs @@ -0,0 +1,7 @@ +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults +{ + public class OpenPathwayRommRequest : AdminPostResultsRequest + { + public int PathwayResultId { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenSpecialismRommRequest.cs b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenSpecialismRommRequest.cs new file mode 100644 index 000000000..490a5428f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Models/Contracts/AdminPostResults/OpenSpecialismRommRequest.cs @@ -0,0 +1,7 @@ +namespace Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults +{ + public class OpenSpecialismRommRequest : AdminPostResultsRequest + { + public int SpecialismResultId { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.Designer.cs new file mode 100644 index 000000000..19ee35fe2 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.Designer.cs @@ -0,0 +1,207 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminSearchChangeLog { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminSearchChangeLog() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog.AdminSearchChangeLog", typeof(AdminSearchChangeLog).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Clear search. + /// + public static string Button_Clear_Search { + get { + return ResourceManager.GetString("Button_Clear_Search", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search. + /// + public static string Button_Search { + get { + return ResourceManager.GetString("Button_Search", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change log. + /// + public static string Heading_Change_Log { + get { + return ResourceManager.GetString("Heading_Change_Log", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no matching results. + /// + public static string Heading_No_Matching_Results { + get { + return ResourceManager.GetString("Heading_No_Matching_Results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to checking the spelling of last names. + /// + public static string List_Item_Checking_Lastnames_Spelling { + get { + return ResourceManager.GetString("List_Item_Checking_Lastnames_Spelling", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to checking the Zendesk ticket ID. + /// + public static string List_Item_Checking_Zendesk_Ticket_ID { + get { + return ResourceManager.GetString("List_Item_Checking_Zendesk_Ticket_ID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to entering a ULN with 10 digits. + /// + public static string List_Item_Enter_ULN { + get { + return ResourceManager.GetString("List_Item_Enter_ULN", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Improve your search results by:. + /// + public static string List_Title_Improve_Your_Search_By { + get { + return ResourceManager.GetString("List_Title_Improve_Your_Search_By", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change log – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Viewing {0} - {1} of {2} changes. + /// + public static string PaginationSummary_Text { + get { + return ResourceManager.GetString("PaginationSummary_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search by Zendesk ticket ID, ULN, or learner last name. + /// + public static string Search_By_Zendesk_TicketId_Uln_Or_Learner_Lastname { + get { + return ResourceManager.GetString("Search_By_Zendesk_TicketId_Uln_Or_Learner_Lastname", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date and time of change. + /// + public static string Table_Column_Date_And_Time_Of_Change { + get { + return ResourceManager.GetString("Table_Column_Date_And_Time_Of_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Last updated by. + /// + public static string Table_Column_Last_Updated_By { + get { + return ResourceManager.GetString("Table_Column_Last_Updated_By", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner (ULN). + /// + public static string Table_Column_Learner_Uln { + get { + return ResourceManager.GetString("Table_Column_Learner_Uln", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Table_Column_Provider_Ukprn { + get { + return ResourceManager.GetString("Table_Column_Provider_Ukprn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID. + /// + public static string Table_Column_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Table_Column_Zendesk_Ticket_Id", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.resx new file mode 100644 index 000000000..b50aa3a53 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminSearchChangeLog.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Clear search + + + Search + + + Change log + + + There are no matching results + + + checking the spelling of last names + + + checking the Zendesk ticket ID + + + entering a ULN with 10 digits + + + Improve your search results by: + + + Change log – Admin + + + Viewing {0} - {1} of {2} changes + + + Search by Zendesk ticket ID, ULN, or learner last name + + + Date and time of change + + + Last updated by + + + Learner (ULN) + + + Provider (UKPRN) + + + Zendesk ticket ID + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.Designer.cs new file mode 100644 index 000000000..b16da3c18 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.Designer.cs @@ -0,0 +1,486 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminViewChangeRecord { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminViewChangeRecord() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog.AdminViewChangeRecord", typeof(AdminViewChangeRecord).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to View learner record. + /// + public static string Action_Text_Link_Change { + get { + return ResourceManager.GetString("Action_Text_Link_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search again. + /// + public static string Button_Search_Again { + get { + return ResourceManager.GetString("Button_Search_Again", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core Component. + /// + public static string Core_Component { + get { + return ResourceManager.GetString("Core_Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change record for {0}. + /// + public static string Heading_Change_Record { + get { + return ResourceManager.GetString("Heading_Change_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner record. + /// + public static string Hidden_Action_Text_Learner_Record { + get { + return ResourceManager.GetString("Hidden_Action_Text_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to industryplacementstatus. + /// + public static string Industry_Placement_Status_Id { + get { + return ResourceManager.GetString("Industry_Placement_Status_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ipreasonslist. + /// + public static string IP_Reasons_List_Id { + get { + return ResourceManager.GetString("IP_Reasons_List_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change made by. + /// + public static string Label_Change_Made_By { + get { + return ResourceManager.GetString("Label_Change_Made_By", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Label_Contact_Name { + get { + return ResourceManager.GetString("Label_Contact_Name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Label_Core_Component { + get { + return ResourceManager.GetString("Label_Core_Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Label_Date_Of_Request { + get { + return ResourceManager.GetString("Label_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No assessment entry recorded for {0}. + /// + public static string Label_No_Assessment_Entry_Recorded { + get { + return ResourceManager.GetString("Label_No_Assessment_Entry_Recorded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Label_Occupational_Specialism { + get { + return ResourceManager.GetString("Label_Occupational_Specialism", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Label_Reason_For_Change { + get { + return ResourceManager.GetString("Label_Reason_For_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID. + /// + public static string Label_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Label_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to noofhours. + /// + public static string No_Of_Hours_Id { + get { + return ResourceManager.GetString("No_Of_Hours_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational Specialism. + /// + public static string Occupational_Specialism { + get { + return ResourceManager.GetString("Occupational_Specialism", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change record – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <p>{0}</p>. + /// + public static string Para_Item { + get { + return ResourceManager.GetString("Para_Item", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to academicyear. + /// + public static string Summary_Academic_Year_Id { + get { + return ResourceManager.GetString("Summary_Academic_Year_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to assessment. + /// + public static string Summary_Assessment_Id { + get { + return ResourceManager.GetString("Summary_Assessment_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to changemadeby. + /// + public static string Summary_CreatedBy_Id { + get { + return ResourceManager.GetString("Summary_CreatedBy_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change made by. + /// + public static string Summary_CreatedBy_Text { + get { + return ResourceManager.GetString("Summary_CreatedBy_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to selectedgradecode. + /// + public static string Summary_Selected_Grade_Id { + get { + return ResourceManager.GetString("Summary_Selected_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No assessment entry recorded for. + /// + public static string Text_No_Assement_Message { + get { + return ResourceManager.GetString("Text_No_Assement_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change { + get { + return ResourceManager.GetString("Title_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Title_Change_Summary { + get { + return ResourceManager.GetString("Title_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_From { + get { + return ResourceManager.GetString("Title_From", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Industry placement status. + /// + public static string Title_Industry_Placement_Status { + get { + return ResourceManager.GetString("Title_Industry_Placement_Status", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Log details. + /// + public static string Title_Log_Details { + get { + return ResourceManager.GetString("Title_Log_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of hours. + /// + public static string Title_Number_Of_Hours { + get { + return ResourceManager.GetString("Title_Number_Of_Hours", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reasons for reduced hours. + /// + public static string Title_Reasons_For_Reduced_Hours { + get { + return ResourceManager.GetString("Title_Reasons_For_Reduced_Hours", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Title_StartYear { + get { + return ResourceManager.GetString("Title_StartYear", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Status. + /// + public static string Title_Status_Text { + get { + return ResourceManager.GetString("Title_Status_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_To { + get { + return ResourceManager.GetString("Title_To", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who asked for this change?. + /// + public static string Title_Who_Asked_For_This_Change { + get { + return ResourceManager.GetString("Title_Who_Asked_For_This_Change", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.resx new file mode 100644 index 000000000..483455342 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminChangeLog/AdminViewChangeRecord.resx @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + View learner record + + + Search again + + + Core Component + + + Core component: {0} + + + Change record for {0} + + + learner record + + + industryplacementstatus + + + ipreasonslist + + + Change made by + + + Contact name + + + Core component: {0} + + + Date of request + + + No assessment entry recorded for {0} + + + Occupational specialism: {0} + + + Reason for change + + + Zendesk ticket ID + + + No grade entered + + + noofhours + + + Occupational Specialism + + + Change record – Admin + + + <p>{0}</p> + + + Occupational specialism: {0} + + + academicyear + + + assessment + + + changemadeby + + + Change made by + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + selectedgradecode + + + uln + + + ULN + + + No assessment entry recorded for + + + Change + + + Change summary + + + From + + + Industry placement status + + + Log details + + + Number of hours + + + Reasons for reduced hours + + + Start year + + + Status + + + To + + + Who asked for this change? + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs index f669f457f..cef7b9cc9 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.Designer.cs @@ -187,6 +187,33 @@ public static string Page_Title { } } + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + /// /// Looks up a localized string similar to Grade. /// @@ -196,6 +223,51 @@ public static string Summary_Grade_Text { } } + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text1 { + get { + return ResourceManager.GetString("Summary_Grade_Text1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to selectedgradecode. /// @@ -205,6 +277,60 @@ public static string Summary_Selected_Grade_Id { } } + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to Change. /// diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx index a9df98485..47c0951bf 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddPathwayResultReviewChanges.resx @@ -159,12 +159,54 @@ Review changes to assessment result – Admin + + examperiod + + + Exam period + + + grade + Grade + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + selectedgradecode + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + Change diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs index b29d3ccd8..be6841928 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.Designer.cs @@ -178,6 +178,42 @@ public static string Specialism_Heading_Text { } } + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text1 { + get { + return ResourceManager.GetString("Specialism_Heading_Text1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + /// /// Looks up a localized string similar to Grade. /// @@ -187,6 +223,51 @@ public static string Summary_Grade_Text { } } + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text1 { + get { + return ResourceManager.GetString("Summary_Grade_Text1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to selectedgradecode. /// @@ -196,6 +277,60 @@ public static string Summary_Selected_Grade_Id { } } + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + /// /// Looks up a localized string similar to Change. /// diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx index 99e076143..eaffc3111 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminAddSpecialismResultReviewChanges.resx @@ -156,12 +156,57 @@ Occupational specialism: {0} + + Occupational specialism: {0} + + + examperiod + + + Exam period + + + grade + Grade + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + selectedgradecode + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + Change diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.Designer.cs new file mode 100644 index 000000000..1b347a4b8 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.Designer.cs @@ -0,0 +1,343 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminChangePathwayResultReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminChangePathwayResultReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminChangePathwayResul" + + "tReviewChanges", typeof(AdminChangePathwayResultReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core Component. + /// + public static string Core_Component { + get { + return ResourceManager.GetString("Core_Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a problem. + /// + public static string Error_Summary_Header { + get { + return ResourceManager.GetString("Error_Summary_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the correct start year. + /// + public static string Error_Summary_Text { + get { + return ResourceManager.GetString("Error_Summary_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result. + /// + public static string Heading_Review_Changes_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Review_Changes_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An assessment result has been changed. + /// + public static string Notification_Message_Asessment_Result_Changed { + get { + return ResourceManager.GetString("Notification_Message_Asessment_Result_Changed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result - Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to selectedgradecode. + /// + public static string Summary_Selected_Grade_Id { + get { + return ResourceManager.GetString("Summary_Selected_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the name of the contact who requested this change. + /// + public static string Validation_Contact_Name_Blank_Text { + get { + return ResourceManager.GetString("Validation_Contact_Name_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the date when the change was requested. + /// + public static string Validation_Date_When_Change_Requested_Blank_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be today or in the past. + /// + public static string Validation_Date_When_Change_Requested_Future_Date_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Future_Date_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be a real date. + /// + public static string Validation_Date_When_Change_Requested_Invalid_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Invalid_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the reason why this change is needed. + /// + public static string Validation_Reason_For_Change_Blank_Text { + get { + return ResourceManager.GetString("Validation_Reason_For_Change_Blank_Text", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.resx new file mode 100644 index 000000000..a09bfdf80 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangePathwayResultReviewChanges.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Submit + + + Core Component + + + Core component: {0} + + + There is a problem + + + Select the correct start year + + + Change summary + + + Personal details + + + Review changes to assessment result + + + Who has asked for this change? + + + Change + + + An assessment result has been changed + + + No grade entered + + + Review changes to assessment result - Admin + + + Grade + + + selectedgradecode + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Enter the name of the contact who requested this change + + + Enter the date when the change was requested + + + Date must be today or in the past + + + Date must be a real date + + + Enter the reason why this change is needed + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.Designer.cs new file mode 100644 index 000000000..561ec66cd --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.Designer.cs @@ -0,0 +1,334 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminChangeSpecialismResultReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminChangeSpecialismResultReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard.AdminChangeSpecialismRe" + + "sultReviewChanges", typeof(AdminChangeSpecialismResultReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is a problem. + /// + public static string Error_Summary_Header { + get { + return ResourceManager.GetString("Error_Summary_Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the correct start year. + /// + public static string Error_Summary_Text { + get { + return ResourceManager.GetString("Error_Summary_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result. + /// + public static string Heading_Review_Changes_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Review_Changes_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to An assessment result has been updated. + /// + public static string Notification_Message_Asessment_Result_Updated { + get { + return ResourceManager.GetString("Notification_Message_Asessment_Result_Updated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to assessment result – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to selectedgradecode. + /// + public static string Summary_Selected_Grade_Id { + get { + return ResourceManager.GetString("Summary_Selected_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the name of the contact who requested this change. + /// + public static string Validation_Contact_Name_Blank_Text { + get { + return ResourceManager.GetString("Validation_Contact_Name_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the date when the change was requested. + /// + public static string Validation_Date_When_Change_Requested_Blank_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Blank_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be today or in the past. + /// + public static string Validation_Date_When_Change_Requested_Future_Date_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Future_Date_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date must be a real date. + /// + public static string Validation_Date_When_Change_Requested_Invalid_Text { + get { + return ResourceManager.GetString("Validation_Date_When_Change_Requested_Invalid_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enter the reason why this change is needed. + /// + public static string Validation_Reason_For_Change_Blank_Text { + get { + return ResourceManager.GetString("Validation_Reason_For_Change_Blank_Text", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.resx new file mode 100644 index 000000000..1cc1e7709 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminDashboard/AdminChangeSpecialismResultReviewChanges.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Submit + + + There is a problem + + + Select the correct start year + + + Change summary + + + Personal details + + + Review changes to assessment result + + + Who has asked for this change? + + + Change + + + An assessment result has been updated + + + No grade entered + + + Review changes to assessment result – Admin + + + Occupational specialism: {0} + + + Grade + + + selectedgradecode + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Enter the name of the contact who requested this change + + + Enter the date when the change was requested + + + Date must be today or in the past + + + Date must be a real date + + + Enter the reason why this change is needed + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.Designer.cs new file mode 100644 index 000000000..f27b60f92 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.Designer.cs @@ -0,0 +1,343 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddCoreRommOutcome { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddCoreRommOutcome() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminAddCoreRommOutco" + + "me", typeof(AdminAddCoreRommOutcome).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add a ROMM outcome. + /// + public static string Heading_Add_A_Romm_Outcome { + get { + return ResourceManager.GetString("Heading_Add_A_Romm_Outcome", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to What was the ROMM outcome?. + /// + public static string Heading_What_Was_The_Romm_Outcome { + get { + return ResourceManager.GetString("Heading_What_Was_The_Romm_Outcome", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add a ROMM outcome – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The grade has changed. + /// + public static string Radio_Button_Grade_Changed { + get { + return ResourceManager.GetString("Radio_Button_Grade_Changed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The grade is the same. + /// + public static string Radion_Button_Same_Grade { + get { + return ResourceManager.GetString("Radion_Button_Same_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade has changed if the outcome of the ROMM is different. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because there is no result.. + /// + public static string Validation_No_Result { + get { + return ResourceManager.GetString("Validation_No_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the result is still pending.. + /// + public static string Validation_Result_Pending { + get { + return ResourceManager.GetString("Validation_Result_Pending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the learner has been withdrawn.. + /// + public static string Validation_Widthdrawn { + get { + return ResourceManager.GetString("Validation_Widthdrawn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A ROMM outcome cannot be added. + /// + public static string Warning_Header_A_ROMM_outcome_Cannot_Be_Added { + get { + return ResourceManager.GetString("Warning_Header_A_ROMM_outcome_Cannot_Be_Added", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot add a ROMM outcome for this learner.. + /// + public static string Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner { + get { + return ResourceManager.GetString("Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.resx new file mode 100644 index 000000000..57ad74b62 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddCoreRommOutcome.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Core component: {0} + + + Add a ROMM outcome + + + Personal details + + + What was the ROMM outcome? + + + No grade entered + + + Add a ROMM outcome – Admin + + + The grade is the same + + + The grade has changed + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the grade has changed if the outcome of the ROMM is different + + + This is because there is no result. + + + This is because the result is still pending. + + + This is because the learner has been withdrawn. + + + A ROMM outcome cannot be added + + + You cannot add a ROMM outcome for this learner. + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.Designer.cs new file mode 100644 index 000000000..cba1f82e4 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.Designer.cs @@ -0,0 +1,280 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddRommOutcomeChangeGradeCore { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddRommOutcomeChangeGradeCore() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminAddRommOutcomeCh" + + "angeGradeCore", typeof(AdminAddRommOutcomeChangeGradeCore).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change the grade after a ROMM. + /// + public static string Heading_Change_Result_After_ROMM { + get { + return ResourceManager.GetString("Heading_Change_Result_After_ROMM", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change the grade after a ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.resx new file mode 100644 index 000000000..31f7e806b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Core component: {0} + + + Change the grade after a ROMM + + + Personal details + + + Select the new grade + + + No grade entered + + + Change the grade after a ROMM – Admin + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the new grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.Designer.cs new file mode 100644 index 000000000..6a19d28ee --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.Designer.cs @@ -0,0 +1,280 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddRommOutcomeChangeGradeSpecialism { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddRommOutcomeChangeGradeSpecialism() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminAddRommOutcomeCh" + + "angeGradeSpecialism", typeof(AdminAddRommOutcomeChangeGradeSpecialism).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change the grade after a ROMM. + /// + public static string Heading_Change_Result_After_ROMM { + get { + return ResourceManager.GetString("Heading_Change_Result_After_ROMM", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change the grade after a ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Specialism component: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the new grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.resx new file mode 100644 index 000000000..26090dd29 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Change the grade after a ROMM + + + Personal details + + + Select the new grade + + + No grade entered + + + Change the grade after a ROMM – Admin + + + Specialism component: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the new grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.Designer.cs new file mode 100644 index 000000000..77e9ae3ee --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.Designer.cs @@ -0,0 +1,343 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminAddSpecialismRommOutcome { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminAddSpecialismRommOutcome() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminAddSpecialismRom" + + "mOutcome", typeof(AdminAddSpecialismRommOutcome).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add a ROMM outcome. + /// + public static string Heading_Add_A_Romm_Outcome { + get { + return ResourceManager.GetString("Heading_Add_A_Romm_Outcome", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to What was the ROMM outcome?. + /// + public static string Heading_What_Was_The_Romm_Outcome { + get { + return ResourceManager.GetString("Heading_What_Was_The_Romm_Outcome", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add a ROMM outcome – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The grade has changed. + /// + public static string Radio_Button_Grade_Changed { + get { + return ResourceManager.GetString("Radio_Button_Grade_Changed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The grade is the same. + /// + public static string Radion_Button_Same_Grade { + get { + return ResourceManager.GetString("Radion_Button_Same_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Specialism component: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade has changed if the outcome of the ROMM is different. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because there is no result.. + /// + public static string Validation_No_Result { + get { + return ResourceManager.GetString("Validation_No_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the result is still pending.. + /// + public static string Validation_Result_Pending { + get { + return ResourceManager.GetString("Validation_Result_Pending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the learner has been withdrawn.. + /// + public static string Validation_Widthdrawn { + get { + return ResourceManager.GetString("Validation_Widthdrawn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A ROMM outcome cannot be added. + /// + public static string Warning_Header_A_ROMM_outcome_Cannot_Be_Added { + get { + return ResourceManager.GetString("Warning_Header_A_ROMM_outcome_Cannot_Be_Added", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot add a ROMM outcome for this learner.. + /// + public static string Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner { + get { + return ResourceManager.GetString("Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.resx new file mode 100644 index 000000000..a0898682f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminAddSpecialismRommOutcome.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Add a ROMM outcome + + + Personal details + + + What was the ROMM outcome? + + + No grade entered + + + Add a ROMM outcome – Admin + + + The grade is the same + + + The grade has changed + + + Specialism component: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select the grade has changed if the outcome of the ROMM is different + + + This is because there is no result. + + + This is because the result is still pending. + + + This is because the learner has been withdrawn. + + + A ROMM outcome cannot be added + + + You cannot add a ROMM outcome for this learner. + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.Designer.cs new file mode 100644 index 000000000..f8cba8e7b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.Designer.cs @@ -0,0 +1,333 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminOpenPathwayRomm { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminOpenPathwayRomm() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminOpenPathwayRomm", typeof(AdminOpenPathwayRomm).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you want to open a ROMM?. + /// + public static string Heading_Do_You_Want_To_Open_A_Romm { + get { + return ResourceManager.GetString("Heading_Do_You_Want_To_Open_A_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open a ROMM. + /// + public static string Heading_Open_A_Romm { + get { + return ResourceManager.GetString("Heading_Open_A_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open a ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string Radio_Button_No { + get { + return ResourceManager.GetString("Radio_Button_No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Radio_Button_Yes { + get { + return ResourceManager.GetString("Radio_Button_Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Yes to open a ROMM. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because there is no result.. + /// + public static string Validation_No_Result { + get { + return ResourceManager.GetString("Validation_No_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the result is still pending.. + /// + public static string Validation_Result_Pending { + get { + return ResourceManager.GetString("Validation_Result_Pending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the learner has been withdrawn.. + /// + public static string Validation_Widthdrawn { + get { + return ResourceManager.GetString("Validation_Widthdrawn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot open a ROMM for this learner.. + /// + public static string Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner { + get { + return ResourceManager.GetString("Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.resx new file mode 100644 index 000000000..424d362a3 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRomm.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Core component: {0} + + + Do you want to open a ROMM? + + + Open a ROMM + + + Personal details + + + No grade entered + + + Open a ROMM – Admin + + + No + + + Yes + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select Yes to open a ROMM + + + This is because there is no result. + + + This is because the result is still pending. + + + This is because the learner has been withdrawn. + + + You cannot open a ROMM for this learner. + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.Designer.cs new file mode 100644 index 000000000..82518304f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.Designer.cs @@ -0,0 +1,469 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminOpenPathwayRommReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminOpenPathwayRommReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminOpenPathwayRommR" + + "eviewChanges", typeof(AdminOpenPathwayRommReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ROMM. + /// + public static string Change_Summary_Change { + get { + return ResourceManager.GetString("Change_Summary_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ROMM. + /// + public static string Change_Summary_From { + get { + return ResourceManager.GetString("Change_Summary_From", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ROMM opened. + /// + public static string Change_Summary_To { + get { + return ResourceManager.GetString("Change_Summary_To", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to the ROMM. + /// + public static string Heading_Review_Changes_Romm { + get { + return ResourceManager.GetString("Heading_Review_Changes_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You can enter up to 2,000 characters. + /// + public static string Message_You_Can_Enter_Up_To_2000_Characters { + get { + return ResourceManager.GetString("Message_You_Can_Enter_Up_To_2000_Characters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A ROMM has been opened. + /// + public static string Notification_Message_A_Romm_Has_Been_Opened { + get { + return ResourceManager.GetString("Notification_Message_A_Romm_Has_Been_Opened", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to the ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to romm. + /// + public static string Summary_Romm_Id { + get { + return ResourceManager.GetString("Summary_Romm_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.resx new file mode 100644 index 000000000..281ca80a3 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenPathwayRommReviewChanges.resx @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Submit + + + ROMM + + + No ROMM + + + ROMM opened + + + Core component: {0} + + + Add assessment result + + + Change summary + + + Personal details + + + Review changes to the ROMM + + + Select the grade + + + Who has asked for this change? + + + Change + + + You can enter up to 2,000 characters + + + A ROMM has been opened + + + No grade entered + + + Review changes to the ROMM – Admin + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + romm + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Select the grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.Designer.cs new file mode 100644 index 000000000..4092b8474 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.Designer.cs @@ -0,0 +1,334 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminOpenSpecialismRomm { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminOpenSpecialismRomm() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminOpenSpecialismRo" + + "mm", typeof(AdminOpenSpecialismRomm).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you want to open a ROMM?. + /// + public static string Heading_Do_You_Want_To_Open_A_Romm { + get { + return ResourceManager.GetString("Heading_Do_You_Want_To_Open_A_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open a ROMM. + /// + public static string Heading_Open_A_Romm { + get { + return ResourceManager.GetString("Heading_Open_A_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Open a ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string Radio_Button_No { + get { + return ResourceManager.GetString("Radio_Button_No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Radio_Button_Yes { + get { + return ResourceManager.GetString("Radio_Button_Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select Yes to open a ROMM. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because there is no result.. + /// + public static string Validation_No_Result { + get { + return ResourceManager.GetString("Validation_No_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the result is still pending.. + /// + public static string Validation_Result_Pending { + get { + return ResourceManager.GetString("Validation_Result_Pending", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This is because the learner has been withdrawn.. + /// + public static string Validation_Widthdrawn { + get { + return ResourceManager.GetString("Validation_Widthdrawn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You cannot open a ROMM for this learner.. + /// + public static string Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner { + get { + return ResourceManager.GetString("Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.resx new file mode 100644 index 000000000..b72abd5c5 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRomm.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Do you want to open a ROMM? + + + Open a ROMM + + + Personal details + + + No grade entered + + + Open a ROMM – Admin + + + No + + + Yes + + + Occupational specialism: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Select Yes to open a ROMM + + + This is because there is no result. + + + This is because the result is still pending. + + + This is because the learner has been withdrawn. + + + You cannot open a ROMM for this learner. + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.Designer.cs new file mode 100644 index 000000000..8233153f4 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.Designer.cs @@ -0,0 +1,478 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class AdminOpenSpecialismRommReviewChanges { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AdminOpenSpecialismRommReviewChanges() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults.AdminOpenSpecialismRo" + + "mmReviewChanges", typeof(AdminOpenSpecialismRommReviewChanges).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Button_Cancel { + get { + return ResourceManager.GetString("Button_Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Continue. + /// + public static string Button_Continue { + get { + return ResourceManager.GetString("Button_Continue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Return to learner record. + /// + public static string Button_Return_To_Learner_Record { + get { + return ResourceManager.GetString("Button_Return_To_Learner_Record", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Submit. + /// + public static string Button_Submit { + get { + return ResourceManager.GetString("Button_Submit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ROMM. + /// + public static string Change_Summary_Change { + get { + return ResourceManager.GetString("Change_Summary_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ROMM. + /// + public static string Change_Summary_From { + get { + return ResourceManager.GetString("Change_Summary_From", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ROMM opened. + /// + public static string Change_Summary_To { + get { + return ResourceManager.GetString("Change_Summary_To", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Core component: {0}. + /// + public static string Core_Heading_Text { + get { + return ResourceManager.GetString("Core_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add assessment result. + /// + public static string Heading_Add_Assessment_Result { + get { + return ResourceManager.GetString("Heading_Add_Assessment_Result", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change summary. + /// + public static string Heading_Change_Summary { + get { + return ResourceManager.GetString("Heading_Change_Summary", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Personal details. + /// + public static string Heading_Personal_Details { + get { + return ResourceManager.GetString("Heading_Personal_Details", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to the ROMM. + /// + public static string Heading_Review_Changes_Romm { + get { + return ResourceManager.GetString("Heading_Review_Changes_Romm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Heading_Select_Grade { + get { + return ResourceManager.GetString("Heading_Select_Grade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Who has asked for this change?. + /// + public static string Heading_Who_Has_Asked_For_This_Change { + get { + return ResourceManager.GetString("Heading_Who_Has_Asked_For_This_Change", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Link_Change_Text { + get { + return ResourceManager.GetString("Link_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You can enter up to 2,000 characters. + /// + public static string Message_You_Can_Enter_Up_To_2000_Characters { + get { + return ResourceManager.GetString("Message_You_Can_Enter_Up_To_2000_Characters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No grade entered. + /// + public static string No_Grade_Entered { + get { + return ResourceManager.GetString("No_Grade_Entered", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A ROMM has been opened. + /// + public static string Notification_Message_A_Romm_Has_Been_Opened { + get { + return ResourceManager.GetString("Notification_Message_A_Romm_Has_Been_Opened", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Review changes to the ROMM – Admin. + /// + public static string Page_Title { + get { + return ResourceManager.GetString("Page_Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Occupational specialism: {0}. + /// + public static string Specialism_Heading_Text { + get { + return ResourceManager.GetString("Specialism_Heading_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to examperiod. + /// + public static string Summary_Exam_Period_Id { + get { + return ResourceManager.GetString("Summary_Exam_Period_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exam period. + /// + public static string Summary_Exam_Period_Text { + get { + return ResourceManager.GetString("Summary_Exam_Period_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to grade. + /// + public static string Summary_Grade_Id { + get { + return ResourceManager.GetString("Summary_Grade_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Grade. + /// + public static string Summary_Grade_Text { + get { + return ResourceManager.GetString("Summary_Grade_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to learner. + /// + public static string Summary_Learner_Id { + get { + return ResourceManager.GetString("Summary_Learner_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Learner. + /// + public static string Summary_Learner_Text { + get { + return ResourceManager.GetString("Summary_Learner_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to provider. + /// + public static string Summary_Provider_Id { + get { + return ResourceManager.GetString("Summary_Provider_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Provider (UKPRN). + /// + public static string Summary_Provider_Text { + get { + return ResourceManager.GetString("Summary_Provider_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to romm. + /// + public static string Summary_Romm_Id { + get { + return ResourceManager.GetString("Summary_Romm_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to startyear. + /// + public static string Summary_StartYear_Id { + get { + return ResourceManager.GetString("Summary_StartYear_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start year. + /// + public static string Summary_StartYear_Text { + get { + return ResourceManager.GetString("Summary_StartYear_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to tlevel. + /// + public static string Summary_TLevel_Id { + get { + return ResourceManager.GetString("Summary_TLevel_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T Level. + /// + public static string Summary_TLevel_Text { + get { + return ResourceManager.GetString("Summary_TLevel_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uln. + /// + public static string Summary_ULN_Id { + get { + return ResourceManager.GetString("Summary_ULN_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ULN. + /// + public static string Summary_ULN_Text { + get { + return ResourceManager.GetString("Summary_ULN_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change. + /// + public static string Title_Change_Summary_Change_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to From. + /// + public static string Title_Change_Summary_From_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_From_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To. + /// + public static string Title_Change_Summary_To_Text { + get { + return ResourceManager.GetString("Title_Change_Summary_To_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Contact name. + /// + public static string Title_Contact_Name_Text { + get { + return ResourceManager.GetString("Title_Contact_Name_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date of request. + /// + public static string Title_Date_Of_Request { + get { + return ResourceManager.GetString("Title_Date_Of_Request", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Day. + /// + public static string Title_Day_Text { + get { + return ResourceManager.GetString("Title_Day_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Month. + /// + public static string Title_Month_Text { + get { + return ResourceManager.GetString("Title_Month_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reason for change. + /// + public static string Title_Reason_For_Change_Text { + get { + return ResourceManager.GetString("Title_Reason_For_Change_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Year. + /// + public static string Title_Year_Text { + get { + return ResourceManager.GetString("Title_Year_Text", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Zendesk ticket ID (optional). + /// + public static string Title_Zendesk_Ticket_Id { + get { + return ResourceManager.GetString("Title_Zendesk_Ticket_Id", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select the grade. + /// + public static string Validation_Message { + get { + return ResourceManager.GetString("Validation_Message", resourceCulture); + } + } + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.resx new file mode 100644 index 000000000..8b3769601 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/AdminPostResults/AdminOpenSpecialismRommReviewChanges.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cancel + + + Continue + + + Return to learner record + + + Submit + + + ROMM + + + No ROMM + + + ROMM opened + + + Core component: {0} + + + Add assessment result + + + Change summary + + + Personal details + + + Review changes to the ROMM + + + Select the grade + + + Who has asked for this change? + + + Change + + + You can enter up to 2,000 characters + + + A ROMM has been opened + + + No grade entered + + + Review changes to the ROMM – Admin + + + Occupational specialism: {0} + + + examperiod + + + Exam period + + + grade + + + Grade + + + learner + + + Learner + + + provider + + + Provider (UKPRN) + + + romm + + + startyear + + + Start year + + + tlevel + + + T Level + + + uln + + + ULN + + + Change + + + From + + + To + + + Contact name + + + Date of request + + + Day + + + Month + + + Reason for change + + + Year + + + Zendesk ticket ID (optional) + + + Select the grade + + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.Designer.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.Designer.cs index f72eeb6f9..f0bd14b38 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.Designer.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.Designer.cs @@ -69,6 +69,15 @@ public static string Assessment_Dashboard { } } + /// + /// Looks up a localized string similar to Change log. + /// + public static string Change_Log { + get { + return ResourceManager.GetString("Change_Log", resourceCulture); + } + } + /// /// Looks up a localized string similar to Check the learner’s details. /// diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.resx b/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.resx index b065f9fe2..bb164b1ef 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.resx +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Content/ViewComponents/Breadcrumb.resx @@ -120,6 +120,9 @@ Assessments + + Change log + Check the learner’s details diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminChangeLogController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminChangeLogController.cs new file mode 100644 index 000000000..f4b7fc1ba --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminChangeLogController.cs @@ -0,0 +1,159 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Sfa.Tl.ResultsAndCertification.Common.Constants; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Controllers +{ + [Authorize(Policy = RolesExtensions.RequireAdminDashboardAccess)] + public class AdminChangeLogController : Controller + { + private readonly IAdminChangeLogLoader _loader; + private readonly ICacheService _cacheService; + private readonly ILogger _logger; + + private string CacheKey + => CacheKeyHelper.GetCacheKey(User.GetUserId(), CacheConstants.AdminChangeLogCacheKey); + + public AdminChangeLogController( + IAdminChangeLogLoader loader, + ICacheService cacheService, + ILogger logger) + { + _loader = loader; + _cacheService = cacheService; + _logger = logger; + } + + [HttpGet] + [Route("admin/change-log-clear", Name = RouteConstants.AdminSearchChangeLogClear)] + public async Task AdminSearchChangeLogClearAsync() + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminSearchChangeLog); + } + + [HttpGet] + [Route("admin/change-log/{pageNumber:int?}", Name = RouteConstants.AdminSearchChangeLog)] + public async Task AdminSearchChangeLogAsync(int? pageNumber = default) + { + var viewModel = await _cacheService.GetAsync(CacheKey); + if (viewModel == null) + { + AdminSearchChangeLogViewModel loadedViewModel = await _loader.SearchChangeLogsAsync(); + + await _cacheService.SetAsync(CacheKey, loadedViewModel); + return View(loadedViewModel); + } + + var searchCriteria = viewModel.SearchCriteriaViewModel; + searchCriteria.PageNumber = pageNumber; + + AdminSearchChangeLogViewModel adminSearchChangeLogViewModel = await _loader.SearchChangeLogsAsync(searchCriteria.SearchKey, pageNumber); + + await _cacheService.SetAsync(CacheKey, adminSearchChangeLogViewModel); + return View(adminSearchChangeLogViewModel); + } + + [HttpPost] + [Route("admin/change-log-search-key", Name = RouteConstants.SubmitAdminSearchChangeLogSearchKey)] + public Task AdminSearchChangeLogSearchKeyAsync(AdminSearchChangeLogCriteriaViewModel searchCriteriaViewModel) + => RunAsync(RouteConstants.SubmitAdminSearchChangeLogSearchKey, p => p.SetSearchKey(searchCriteriaViewModel.SearchKey)); + + [HttpPost] + [Route("admin/change-log-clear-key", Name = RouteConstants.SubmitAdminSearchChangeLogClearKey)] + public Task AdminSearchChangeLogClearKeyAsync() + => RunAsync(RouteConstants.SubmitAdminSearchChangeLogClearKey, p => p.ClearSearchKey()); + + private async Task RunAsync(string endpoint, Action action) + { + var viewModel = await _cacheService.GetAsync(CacheKey); + + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No AdminSearchChangeLogViewModel cache data found. Method: {endpoint}, User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + action(viewModel); + + await _cacheService.SetAsync(CacheKey, viewModel); + return RedirectToRoute(RouteConstants.AdminSearchChangeLog, new { pageNumber = viewModel.SearchCriteriaViewModel.PageNumber }); + } + + #region View change log + + [HttpGet] + [Route("admin/view-change-record/1/{changeLogId}", Name = RouteConstants.AdminViewChangeStartYearRecord)] + public async Task AdminViewChangeRecordStartYearAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeStartYearRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/2/{changeLogId}", Name = RouteConstants.AdminViewChangeIPRecord)] + public async Task AdminViewChangeRecordIPAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeIPRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/3/{changeLogId}", Name = RouteConstants.AdminViewChangeCoreAssessmentRecord)] + public async Task AdminViewChangeRecordCoreAssessmentAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeCoreAssessmentRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/4/{changeLogId}", Name = RouteConstants.AdminViewChangeSpecialismAssessmentRecord)] + public async Task AdminViewChangeRecordSpecialismAssessmentAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeSpecialismAssessmentRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/5/{changeLogId}", Name = RouteConstants.AdminViewChangeRemoveCoreAssessmentRecord)] + public async Task AdminViewChangeRecordRemoveCoreAssessmentAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeRemoveCoreAssessmentRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/6/{changeLogId}", Name = RouteConstants.AdminViewChangeRemoveSpecialismAssessmentRecord)] + public async Task AdminViewChangeRecordRemoveSpecialismAssessmentAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeRemoveSpecialismAssessmentRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/7/{changeLogId}", Name = RouteConstants.AdminViewChangeAddPathwayResultRecord)] + public async Task AdminViewChangeRecordAddPathwayResultAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeAddPathwayResultRecord(changeLogId); + return View(result); + } + + [HttpGet] + [Route("admin/view-change-record/8/{changeLogId}", Name = RouteConstants.AdminViewChangeAddSpecialismResultRecord)] + public async Task AdminViewChangeRecordAddSpecialismResultAsync(int changeLogId) + { + var result = await _loader.GetAdminViewChangeAddSpecialismResultRecord(changeLogId); + return View(result); + } + + #endregion View change log + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs index e4c0127ab..aae44c1af 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminDashboardController.cs @@ -1029,7 +1029,7 @@ public async Task AdminChangePathwayResultAsync(AdminChangePathwa } await _cacheService.SetAsync(CacheKey, model); - return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId });// need to change this + return RedirectToRoute(RouteConstants.AdminChangePathwayResultReviewChanges); } [HttpGet] @@ -1074,7 +1074,7 @@ public async Task AdminChangeSpecialismResultAsync(AdminChangeSpe } await _cacheService.SetAsync(CacheKey, model); - return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId });// need to change this + return RedirectToRoute(nameof(RouteConstants.AdminChangeSpecialismResultReviewChanges)); } [HttpGet] @@ -1087,5 +1087,84 @@ public async Task AdminChangeSpecialismResultClearAsync(int regis #endregion + + + #region Review Change Pathway Result + [HttpGet] + [Route("admin/change-assessment-result-core-review-changes", Name = RouteConstants.AdminChangePathwayResultReviewChanges)] + public async Task AdminChangePathwayResultReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminChangePathwayResultReviewChangesViewModel viewModel = _loader.CreateAdminChangePathwayResultReviewChanges(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/change-assessment-result-core-review-changes", Name = RouteConstants.SubmitAdminChangePathwayResultReviewChanges)] + public async Task AdminChangePathwayResultReviewChangesAsync(AdminChangePathwayResultReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessChangePathwayResultReviewChangesAsync(model); + if (!success) + { + return RedirectToAction(RouteConstants.ProblemWithService); + } + + var notificationBanner = new AdminNotificationBannerModel(AdminChangePathwayResultReviewChanges.Notification_Message_Asessment_Result_Changed); + await _cacheService.SetAsync(CacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + + #endregion + + + + [HttpGet] + [Route("admin/change-assessment-result-specialism-review-changes", Name = RouteConstants.AdminChangeSpecialismResultReviewChanges)] + public async Task AdminChangeSpecialismResultReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminChangeSpecialismResultReviewChangesViewModel viewModel = _loader.CreateAdminChangeSpecialismResultReviewChanges(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/change-assessment-result-specialism-review-changes", Name = RouteConstants.SubmitAdminChangeSpecialismResultReviewChanges)] + public async Task AdminChangeSpecialismResultReviewChangesAsync(AdminChangeSpecialismResultReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessChangeSpecialismResultReviewChangesAsync(model); + if (!success) + { + return RedirectToAction(RouteConstants.ProblemWithService); + } + + var notificationBanner = new AdminNotificationBannerModel(AdminChangeSpecialismResultReviewChanges.Notification_Message_Asessment_Result_Updated); + await _cacheService.SetAsync(CacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToAction(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminPostResultsController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminPostResultsController.cs new file mode 100644 index 000000000..43be9768f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/AdminPostResultsController.cs @@ -0,0 +1,385 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Sfa.Tl.ResultsAndCertification.Common.Constants; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Controllers +{ + [Authorize(Policy = RolesExtensions.RequireAdminDashboardAccess)] + public class AdminPostResultsController : Controller + { + private readonly IAdminPostResultsLoader _loader; + private readonly ICacheService _cacheService; + private readonly ILogger _logger; + + private string CacheKey + => CacheKeyHelper.GetCacheKey(User.GetUserId(), CacheConstants.AdminPostResultsCacheKey); + + public AdminPostResultsController( + IAdminPostResultsLoader loader, + ICacheService cacheService, + ILogger logger) + { + _loader = loader; + _cacheService = cacheService; + _logger = logger; + } + + [HttpGet] + [Route("admin/open-romm-core-clear", Name = RouteConstants.AdminOpenPathwayRommClear)] + public async Task AdminOpenPathwayRommClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminOpenPathwayRomm, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/open-romm-core", Name = RouteConstants.AdminOpenPathwayRomm)] + public async Task AdminOpenPathwayRommAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminOpenPathwayRommViewModel viewModel = await _loader.GetAdminOpenPathwayRommAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AdminOpenPathwayRommAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/open-romm-core", Name = RouteConstants.SubmitAdminOpenPathwayRomm)] + public async Task AdminOpenPathwayRommAsync(AdminOpenPathwayRommViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool noSelected = model.DoYouWantToOpenRomm.HasValue && model.DoYouWantToOpenRomm.Value == false; + if (noSelected) + { + return RedirectToRoute(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminOpenPathwayRommReviewChanges); + } + + [HttpGet] + [Route("admin/review-changes-romm-core", Name = RouteConstants.AdminOpenPathwayRommReviewChanges)] + public async Task AdminOpenPathwayRommReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminOpenPathwayRommReviewChangesViewModel viewModel = _loader.GetAdminOpenPathwayRommReviewChangesAsync(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/review-changes-romm-core", Name = RouteConstants.SubmitAdminOpenPathwayRommReviewChanges)] + public async Task AdminOpenPathwayRommReviewChangesAsync(AdminOpenPathwayRommReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessAdminOpenPathwayRommAsync(model); + if (!success) + { + return RedirectToRoute(RouteConstants.ProblemWithService); + } + + string adminDashboardCacheKey = CacheKeyHelper.GetCacheKey(User.GetUserId(), CacheConstants.AdminDashboardCacheKey); + + var notificationBanner = new AdminNotificationBannerModel(AdminOpenPathwayRommReviewChanges.Notification_Message_A_Romm_Has_Been_Opened); + await _cacheService.SetAsync(adminDashboardCacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToRoute(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + [HttpGet] + [Route("admin/open-romm-specialism-clear", Name = RouteConstants.AdminOpenSpecialismRommClear)] + public async Task AdminOpenSpecialismRommClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminOpenSpecialismRomm, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/open-romm-specialism", Name = RouteConstants.AdminOpenSpecialismRomm)] + public async Task AdminOpenSpecialismRommAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminOpenSpecialismRommViewModel viewModel = await _loader.GetAdminOpenSpecialismRommAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AdminOpenSpecialismRommAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/open-romm-specialism", Name = RouteConstants.SubmitAdminOpenSpecialismRomm)] + public async Task AdminOpenSpecialismRommAsync(AdminOpenSpecialismRommViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool noSelected = model.DoYouWantToOpenRomm.HasValue && model.DoYouWantToOpenRomm.Value == false; + if (noSelected) + { + return RedirectToRoute(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminOpenSpecialismRommReviewChanges); + } + + [HttpGet] + [Route("admin/review-changes-romm-specialism", Name = RouteConstants.AdminOpenSpecialismRommReviewChanges)] + public async Task AdminOpenSpecialismRommReviewChangesAsync() + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel == null) + { + return RedirectToRoute(RouteConstants.PageNotFound); + } + + AdminOpenSpecialismRommReviewChangesViewModel viewModel = _loader.GetAdminOpenSpecialismRommReviewChangesAsync(cachedModel); + return View(viewModel); + } + + [HttpPost] + [Route("admin/review-changes-romm-specialism", Name = RouteConstants.SubmitAdminOpenSpecialismRommReviewChanges)] + public async Task AdminOpenSpecialismRommReviewChangesAsync(AdminOpenSpecialismRommReviewChangesViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool success = await _loader.ProcessAdminOpenSpecialismRommAsync(model); + if (!success) + { + return RedirectToRoute(RouteConstants.ProblemWithService); + } + + string adminDashboardCacheKey = CacheKeyHelper.GetCacheKey(User.GetUserId(), CacheConstants.AdminDashboardCacheKey); + + var notificationBanner = new AdminNotificationBannerModel(AdminOpenSpecialismRommReviewChanges.Notification_Message_A_Romm_Has_Been_Opened); + await _cacheService.SetAsync(adminDashboardCacheKey, notificationBanner, CacheExpiryTime.XSmall); + + return RedirectToRoute(nameof(RouteConstants.AdminLearnerRecord), new { pathwayId = model.RegistrationPathwayId }); + } + + [HttpGet] + [Route("admin/add-romm-outcome-core-clear", Name = RouteConstants.AdminAddCoreRommOutcomeClear)] + public async Task AdminAddCoreRommOutcomeClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddCoreRommOutcome, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/add-romm-outcome-core", Name = RouteConstants.AdminAddCoreRommOutcome)] + public async Task AdminAddCoreRommOutcomeAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddCoreRommOutcomeViewModel viewModel = await _loader.GetAdminAddPathwayRommOutcomeAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AdminAddCoreRommOutcomeAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-romm-outcome-core", Name = RouteConstants.SubmitAddCoreRommOutcome)] + public async Task AdminAddCoreRommOutcomeAsync(AdminAddCoreRommOutcomeViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool hasGradeChanged = model.WhatIsRommOutcome.HasValue && model.WhatIsRommOutcome.Value == false; + + await _cacheService.SetAsync(CacheKey, model); + return !hasGradeChanged ? RedirectToRoute(RouteConstants.AdminAddRommOutcomeChangeGradeCoreClear, new { registrationPathwayId = model.RegistrationPathwayId, assessmentId = model.PathwayAssessmentId }) : + RedirectToRoute(RouteConstants.AdminLearnerRecord, new { pathwayId = model.RegistrationPathwayId }); //Todo re-direct to follow-up page. + } + + [HttpGet] + [Route("admin/add-romm-outcome-specialism-clear", Name = RouteConstants.AdminAddSpecialismRommOutcomeClear)] + public async Task AdminAddSpecialismRommOutcomeClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddSpecialismRommOutcome, new { registrationPathwayId, assessmentId }); + } + + [HttpGet] + [Route("admin/add-romm-outcome-specialism", Name = RouteConstants.AdminAddSpecialismRommOutcome)] + public async Task AdminAddSpecialismRommOutcomeAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddSpecialismRommOutcomeViewModel viewModel = await _loader.GetAdminAddSpecialismRommOutcomeAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AdminAddSpecialismRommOutcomeAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-romm-outcome-specialism", Name = RouteConstants.SubmitAddSpecialismRommOutcome)] + public async Task AdminAddSpecialismRommOutcomeAsync(AdminAddSpecialismRommOutcomeViewModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + bool hasGradeChanged = model.WhatIsRommOutcome.HasValue && model.WhatIsRommOutcome.Value == false; + + await _cacheService.SetAsync(CacheKey, model); + return !hasGradeChanged ? RedirectToRoute(RouteConstants.AdminAddRommOutcomeChangeGradeSpecialismClear, new { registrationPathwayId = model.RegistrationPathwayId, assessmentId = model.SpecialismAssessmentId }): + RedirectToRoute(RouteConstants.AdminLearnerRecord, new { pathwayId = model.RegistrationPathwayId }); //Todo re-direct to follow-up page. + } + + #region change romm + [HttpGet] + [Route("admin/add-romm-outcome-change-grade-core-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddRommOutcomeChangeGradeCoreClear)] + public async Task AdminAddRommOutcomeChangeGradeCoreClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddRommOutcomeChangeGradeCore, new { registrationPathwayId, assessmentId }); + } + + + [HttpGet] + [Route("admin/add-romm-outcome-change-grade-core/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddRommOutcomeChangeGradeCore)] + public async Task AdminAddRommOutcomeChangeGradeCoreAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddRommOutcomeChangeGradeCoreViewModel viewModel = await _loader.GetAdminAddRommOutcomeChangeGradeCoreAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AddResultCoreAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-romm-outcome-change-grade-core", Name = RouteConstants.SubmitAdminAddRommOutcomeChangeGradeCore)] + public async Task AdminAddRommOutcomeChangeGradeCoreAsync(AdminAddRommOutcomeChangeGradeCoreViewModel model) + { + await _loader.LoadAdminAddRommOutcomeChangeGradeCoreGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminLearnerRecord, new { pathwayId = model.RegistrationPathwayId }); + } + + [HttpGet] + [Route("admin/add-romm-outcome-change-grade-specialism-clear/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddRommOutcomeChangeGradeSpecialismClear)] + public async Task AdminAddRommOutcomeChangeGradeSpecialismClearAsync(int registrationPathwayId, int assessmentId) + { + await _cacheService.RemoveAsync(CacheKey); + return RedirectToRoute(RouteConstants.AdminAddRommOutcomeChangeGradeSpecialism, new { registrationPathwayId, assessmentId }); + } + + + [HttpGet] + [Route("admin/add-romm-outcome-change-grade-specialism/{registrationPathwayId}/{assessmentId}", Name = RouteConstants.AdminAddRommOutcomeChangeGradeSpecialism)] + public async Task AdminAddRommOutcomeChangeGradeSpecialismAsync(int registrationPathwayId, int assessmentId) + { + var cachedModel = await _cacheService.GetAsync(CacheKey); + if (cachedModel != null) + { + return View(cachedModel); + } + + AdminAddRommOutcomeChangeGradeSpecialismViewModel viewModel = await _loader.GetAdminAddRommOutcomeChangeGradeSpecialismAsync(registrationPathwayId, assessmentId); + if (viewModel == null) + { + _logger.LogWarning(LogEvent.NoDataFound, $"No core result details found. Method: AddResultCoreAsync({registrationPathwayId}, {assessmentId}), User: {User.GetUserEmail()}"); + return RedirectToRoute(RouteConstants.PageNotFound); + } + + return View(viewModel); + } + + [HttpPost] + [Route("admin/add-romm-outcome-change-grade-specialism", Name = RouteConstants.SubmitAdminAddRommOutcomeChangeGradeSpecialism)] + public async Task AdminAddRommOutcomeChangeGradeSpecialismAsync(AdminAddRommOutcomeChangeGradeSpecialismViewModel model) + { + await _loader.LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(model); + + if (!ModelState.IsValid) + { + return View(model); + } + + await _cacheService.SetAsync(CacheKey, model); + return RedirectToRoute(RouteConstants.AdminLearnerRecord, new { pathwayId = model.RegistrationPathwayId }); + } + + + + #endregion + + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/ErrorController.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/ErrorController.cs index f13eba238..3cce2d24e 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/ErrorController.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Controllers/ErrorController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Models.Configuration; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Error; @@ -35,7 +36,9 @@ public IActionResult AccessDenied() [Route("service-access-denied", Name = RouteConstants.ServiceAccessDenied)] public IActionResult ServiceAccessDenied() { - return View(); + return User.IsInFreezePeriod() + ? RedirectToAction(nameof(HelpController.ServiceUnavailable), Constants.HelpController) + : View(); } [AllowAnonymous] @@ -66,7 +69,7 @@ public IActionResult ProblemWithService() [AllowAnonymous] [Route("error/{statusCode}", Name = RouteConstants.Error)] public IActionResult HandleErrorCode(int statusCode) - { + { switch (statusCode) { case 404: diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminChangeLogLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminChangeLogLoader.cs new file mode 100644 index 000000000..8ee51f293 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminChangeLogLoader.cs @@ -0,0 +1,103 @@ +using AutoMapper; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Linq; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Loader +{ + public class AdminChangeLogLoader : IAdminChangeLogLoader + { + private readonly IResultsAndCertificationInternalApiClient _internalApiClient; + private readonly IIndustryPlacementLoader _industryPlacementLoader; + private readonly IMapper _mapper; + + public AdminChangeLogLoader( + IResultsAndCertificationInternalApiClient internalApiClient, + IIndustryPlacementLoader industryPlacementLoader, + IMapper mapper) + { + _internalApiClient = internalApiClient; + _industryPlacementLoader = industryPlacementLoader; + _mapper = mapper; + } + + public async Task SearchChangeLogsAsync(string searchKey = "", int? pageNumber = null) + { + AdminSearchChangeLogRequest request = new() + { + SearchKey = searchKey, + PageNumber = pageNumber + }; + + PagedResponse apiResponse = await _internalApiClient.SearchChangeLogsAsync(request); + return _mapper.Map(apiResponse, opt => + { + opt.Items["searchKey"] = searchKey; + opt.Items["pageNumber"] = pageNumber; + }); + + } + + public async Task GetAdminViewChangeStartYearRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeIPRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + var reasons = await _industryPlacementLoader.GetIpLookupDataAsync(IpLookupType.SpecialConsideration); + + var mappedChangeLogRecord = _mapper.Map(changeLogRecord); + + mappedChangeLogRecord.Reasons = reasons.Where(e => + mappedChangeLogRecord.ChangeIPDetails.SpecialConsiderationReasonsTo + .Contains(e.Id)) + .Select(e => e.Name) + .ToList(); + return mappedChangeLogRecord; + } + + public async Task GetAdminViewChangeCoreAssessmentRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeSpecialismAssessmentRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeRemoveCoreAssessmentRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeRemoveSpecialismAssessmentRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeAddPathwayResultRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + + public async Task GetAdminViewChangeAddSpecialismResultRecord(int changeLogId) + { + var changeLogRecord = await _internalApiClient.GetAdminChangeLogRecordAsync(changeLogId); + return _mapper.Map(changeLogRecord); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs index 193775cf6..cb339f0a0 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminDashboardLoader.cs @@ -1,4 +1,5 @@ using AutoMapper; +using Azure.Core; using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; using Sfa.Tl.ResultsAndCertification.Common.Enum; using Sfa.Tl.ResultsAndCertification.Common.Helpers; @@ -14,9 +15,8 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System; using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.Eventing.Reader; using System.Linq; using System.Threading.Tasks; @@ -170,13 +170,13 @@ public async Task ProcessAddSpecialismAssessmentRequestAsync(AdminReviewCh public async Task ProcessRemoveAssessmentEntry(AdminReviewRemoveCoreAssessmentEntryViewModel model) { - var reviewRemoveAssessmentEntryRequest = _mapper.Map(model); + var reviewRemoveAssessmentEntryRequest = _mapper.Map(model); return await _internalApiClient.RemoveAssessmentEntryAsync(reviewRemoveAssessmentEntryRequest); } public async Task ProcessRemoveSpecialismAssessmentEntryAsync(AdminReviewRemoveSpecialismAssessmentEntryViewModel model) { - var reviewRemoveSpecialismEntryRequest = _mapper.Map(model); + var reviewRemoveSpecialismEntryRequest = _mapper.Map(model); return await _internalApiClient.RemoveSpecialAssessmentEntryAsync(reviewRemoveSpecialismEntryRequest); } @@ -257,13 +257,13 @@ public Task ProcessAddSpecialismResultReviewChangesAsync(AdminAddSpecialis #endregion - #region change Result + #region Change result + public async Task GetAdminChangePathwayResultAsync(int registrationPathwayId, int assessmentId) { var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.PathwayComponentGrade, true); viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); return viewmodel; - } public async Task LoadAdminChangePathwayResultGrades(AdminChangePathwayResultViewModel model) @@ -283,13 +283,43 @@ public async Task GetAdminChangeSpecialism var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.SpecialismComponentGrade, true); viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); return viewmodel; - } public async Task LoadAdminChangeSpecialismResultGrades(AdminChangeSpecialismResultViewModel model) - => model.Grades = await GetAdminChangeResultGrades(LookupCategory.SpecialismComponentGrade, model.Grade); + => model.Grades = await GetAdminChangeResultGrades(LookupCategory.SpecialismComponentGrade, model.Grade); + + + public AdminChangePathwayResultReviewChangesViewModel CreateAdminChangePathwayResultReviewChanges(AdminChangePathwayResultViewModel model) + => _mapper.Map(model); + + public Task ProcessChangePathwayResultReviewChangesAsync(AdminChangePathwayResultReviewChangesViewModel model) + { + if (model == null) + { + return Task.FromResult(false); + } + + var request = _mapper.Map(model); + return _internalApiClient.ProcessAdminChangePathwayResultAsync(request); + } + + + public AdminChangeSpecialismResultReviewChangesViewModel CreateAdminChangeSpecialismResultReviewChanges(AdminChangeSpecialismResultViewModel model) + => _mapper.Map(model); + + + public Task ProcessChangeSpecialismResultReviewChangesAsync(AdminChangeSpecialismResultReviewChangesViewModel model) + { + if (model == null) + { + return Task.FromResult(false); + } + var request = _mapper.Map(model); + + return _internalApiClient.ProcessAdminChangeSpecialismResultAsync(request); + } #endregion } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminPostResultsLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminPostResultsLoader.cs new file mode 100644 index 000000000..b1b84f8cb --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/AdminPostResultsLoader.cs @@ -0,0 +1,144 @@ +using AutoMapper; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Loader +{ + public class AdminPostResultsLoader : IAdminPostResultsLoader + { + private readonly IResultsAndCertificationInternalApiClient _internalApiClient; + private readonly IMapper _mapper; + + public AdminPostResultsLoader( + IResultsAndCertificationInternalApiClient internalApiClient, + IMapper mapper) + { + _internalApiClient = internalApiClient; + _mapper = mapper; + } + + public Task GetAdminOpenPathwayRommAsync(int registrationPathwayId, int pathwayAssessmentId) + => GetAdminOpenRommAsync(registrationPathwayId, pathwayAssessmentId); + + public AdminOpenPathwayRommReviewChangesViewModel GetAdminOpenPathwayRommReviewChangesAsync(AdminOpenPathwayRommViewModel openPathwayRommViewModel) + => _mapper.Map(openPathwayRommViewModel); + + public Task ProcessAdminOpenPathwayRommAsync(AdminOpenPathwayRommReviewChangesViewModel openPathwayRommReviewChangesViewModel) + { + var request = _mapper.Map(openPathwayRommReviewChangesViewModel); + return _internalApiClient.ProcessAdminOpenPathwayRommAsync(request); + } + + public Task GetAdminOpenSpecialismRommAsync(int registrationPathwayId, int specialismAssessmentId) + => GetAdminOpenRommAsync(registrationPathwayId, specialismAssessmentId); + + public AdminOpenSpecialismRommReviewChangesViewModel GetAdminOpenSpecialismRommReviewChangesAsync(AdminOpenSpecialismRommViewModel openSpecialismRommViewModel) + => _mapper.Map(openSpecialismRommViewModel); + + public Task ProcessAdminOpenSpecialismRommAsync(AdminOpenSpecialismRommReviewChangesViewModel openSpecialismRommReviewChangesViewModel) + { + var request = _mapper.Map(openSpecialismRommReviewChangesViewModel); + return _internalApiClient.ProcessAdminOpenSpecialismRommAsync(request); + } + + private async Task GetAdminOpenRommAsync(int registrationPathwayId, int pathwayAssessmentId) + { + AdminLearnerRecord learnerRecord = await _internalApiClient.GetAdminLearnerRecordAsync(registrationPathwayId); + return _mapper.Map(learnerRecord, opt => + { + opt.Items[Constants.AssessmentId] = pathwayAssessmentId; + }); + } + + public Task GetAdminAddPathwayRommOutcomeAsync(int registrationPathwayId, int pathwayAssessmentId) + => GetAdminOpenRommAsync(registrationPathwayId, pathwayAssessmentId); + + public Task GetAdminAddSpecialismRommOutcomeAsync(int registrationPathwayId, int pathwayAssessmentId) + => GetAdminOpenRommAsync(registrationPathwayId, pathwayAssessmentId); + + + public async Task GetAdminAddRommOutcomeChangeGradeCoreAsync(int registrationPathwayId, int assessmentId) + { + var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.PathwayComponentGrade, false); + viewmodel.Grades = GetAdminAddRommOutcomeChangeGradeCoreGrades(viewmodel.Grades); + viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); + return viewmodel; + } + + public async Task LoadAdminAddRommOutcomeChangeGradeCoreGrades(AdminAddRommOutcomeChangeGradeCoreViewModel model) + => model.Grades = GetAdminAddRommOutcomeChangeGradeCoreGrades(await GetAdminChangeResultGrades(LookupCategory.PathwayComponentGrade, model.Grade, true)); + + private List GetAdminAddRommOutcomeChangeGradeCoreGrades(List Grades) + { + return Grades.Where(t => !t.Code.Equals(Constants.PathwayComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.PathwayComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)).ToList(); + } + + + public async Task GetAdminAddRommOutcomeChangeGradeSpecialismAsync(int registrationPathwayId, int assessmentId) + { + var viewmodel = await GetAdminAddResultAsync(registrationPathwayId, assessmentId, LookupCategory.SpecialismComponentGrade, false); + viewmodel.Grades = GetAdminAddRommOutcomeChangeGradeSpecialismGrades(viewmodel.Grades); + viewmodel.Grades.Remove(viewmodel.Grades.Where(t => t.Value == viewmodel.Grade).FirstOrDefault()); + return viewmodel; + } + + public async Task LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(AdminAddRommOutcomeChangeGradeSpecialismViewModel model) + => model.Grades = GetAdminAddRommOutcomeChangeGradeSpecialismGrades(await GetAdminChangeResultGrades(LookupCategory.SpecialismComponentGrade, model.Grade, true)); + + + private List GetAdminAddRommOutcomeChangeGradeSpecialismGrades(List Grades) + { + return Grades.Where(t => !t.Code.Equals(Constants.SpecialismComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.SpecialismComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)).ToList(); + } + + private async Task> GetAdminChangeResultGrades(LookupCategory lookupCategory, string grade, bool isRomm = false) + { + IList grades = await _internalApiClient.GetLookupDataAsync(lookupCategory); + grades.Remove(grades.FirstOrDefault((t => t.Value == grade))); + if (!isRomm) grades.Add(new LookupData { Code = Constants.NotReceived, Value = Content.Result.ManageSpecialismResult.Option_Remove_Result }); + return _mapper.Map>(grades); + } + + private async Task GetAdminAddResultAsync(int registrationPathwayId, int assessmentId, LookupCategory lookupCategory, bool ischange = false) + where TAddResultViewModel : class + { + Task learnerRecordTask = _internalApiClient.GetAdminLearnerRecordAsync(registrationPathwayId); + Task> gradesTask = _internalApiClient.GetLookupDataAsync(lookupCategory); + + await Task.WhenAll(learnerRecordTask, gradesTask); + + AdminLearnerRecord learnerRecord = learnerRecordTask.Result; + IList grades = gradesTask.Result; + if (learnerRecord == null || grades == null) + return null; + + if (ischange) + { + grades.Add(new LookupData { Code = Constants.NotReceived, Value = Content.Result.ManageSpecialismResult.Option_Remove_Result }); + } + + + return _mapper.Map(learnerRecord, opt => + { + opt.Items[Constants.AssessmentId] = assessmentId; + opt.Items["grades"] = grades; + }); + } + + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminChangeLogLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminChangeLogLoader.cs new file mode 100644 index 000000000..8d8dfedeb --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminChangeLogLoader.cs @@ -0,0 +1,26 @@ +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces +{ + public interface IAdminChangeLogLoader + { + Task SearchChangeLogsAsync(string searchKey = "", int? pageNumber = null); + + Task GetAdminViewChangeStartYearRecord(int changeLogId); + + Task GetAdminViewChangeIPRecord(int changeLogId); + + Task GetAdminViewChangeCoreAssessmentRecord(int changeLogId); + + Task GetAdminViewChangeSpecialismAssessmentRecord(int changeLogId); + + Task GetAdminViewChangeAddPathwayResultRecord(int changeLogId); + + Task GetAdminViewChangeAddSpecialismResultRecord(int changeLogId); + + Task GetAdminViewChangeRemoveCoreAssessmentRecord(int changeLogId); + + Task GetAdminViewChangeRemoveSpecialismAssessmentRecord(int changeLogId); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs index 68896c44d..e8c515d41 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminDashboardLoader.cs @@ -57,5 +57,13 @@ public interface IAdminDashboardLoader Task GetAdminChangeSpecialismResultAsync(int registrationPathwayId, int assessmentId); Task LoadAdminChangeSpecialismResultGrades(AdminChangeSpecialismResultViewModel model); + + AdminChangePathwayResultReviewChangesViewModel CreateAdminChangePathwayResultReviewChanges(AdminChangePathwayResultViewModel model); + + Task ProcessChangePathwayResultReviewChangesAsync(AdminChangePathwayResultReviewChangesViewModel model); + + AdminChangeSpecialismResultReviewChangesViewModel CreateAdminChangeSpecialismResultReviewChanges(AdminChangeSpecialismResultViewModel model); + Task ProcessChangeSpecialismResultReviewChangesAsync(AdminChangeSpecialismResultReviewChangesViewModel model); + } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminPostResultsLoader.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminPostResultsLoader.cs new file mode 100644 index 000000000..5496e7476 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Loader/Interfaces/IAdminPostResultsLoader.cs @@ -0,0 +1,30 @@ +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces +{ + public interface IAdminPostResultsLoader + { + Task GetAdminOpenPathwayRommAsync(int registrationPathwayId, int pathwayAssessmentId); + + AdminOpenPathwayRommReviewChangesViewModel GetAdminOpenPathwayRommReviewChangesAsync(AdminOpenPathwayRommViewModel openPathwayRommViewModel); + + Task ProcessAdminOpenPathwayRommAsync(AdminOpenPathwayRommReviewChangesViewModel openPathwayRommReviewChangesViewModel); + + Task GetAdminOpenSpecialismRommAsync(int registrationPathwayId, int specialismAssessmentId); + + AdminOpenSpecialismRommReviewChangesViewModel GetAdminOpenSpecialismRommReviewChangesAsync(AdminOpenSpecialismRommViewModel openSpecialismRommViewModel); + + Task ProcessAdminOpenSpecialismRommAsync(AdminOpenSpecialismRommReviewChangesViewModel openSpecialismRommReviewChangesViewModel); + + Task GetAdminAddPathwayRommOutcomeAsync(int registrationPathwayId, int pathwayAssessmentId); + + Task GetAdminAddSpecialismRommOutcomeAsync(int registrationPathwayId, int pathwayAssessmentId); + + Task GetAdminAddRommOutcomeChangeGradeCoreAsync(int registrationPathwayId, int assessmentId); + Task LoadAdminAddRommOutcomeChangeGradeCoreGrades(AdminAddRommOutcomeChangeGradeCoreViewModel model); + + Task GetAdminAddRommOutcomeChangeGradeSpecialismAsync(int registrationPathwayId, int assessmentId); + Task LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(AdminAddRommOutcomeChangeGradeSpecialismViewModel model); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminChangeLogMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminChangeLogMapper.cs new file mode 100644 index 000000000..7306110bd --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminChangeLogMapper.cs @@ -0,0 +1,149 @@ +using AutoMapper; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.ChangeRecordLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System; + +namespace Sfa.Tl.ResultsAndCertification.Web.Mapper +{ + public class AdminChangeLogMapper : Profile + { + public AdminChangeLogMapper() + { + CreateMap, AdminSearchChangeLogViewModel>() + .ForMember(d => d.TotalRecords, opts => opts.MapFrom(s => s.TotalRecords)) + .ForMember(d => d.ChangeLogDetails, opts => opts.MapFrom(s => s.Records)) + .ForMember(d => d.PagerInfo, opts => opts.MapFrom(s => s.PagerInfo)) + .ForMember(d => d.SearchCriteriaViewModel, opts => opts.MapFrom((src, dest, destMember, context) => + new AdminSearchChangeLogCriteriaViewModel + { + SearchKey = (string)context.Items["searchKey"], + PageNumber = (int?)context.Items["pageNumber"] + })); + + CreateMap() + .ForMember(d => d.ChangeLogId, opts => opts.MapFrom(s => s.ChangeLogId)) + .ForMember(d => d.ChangeType, opts => opts.MapFrom(s => s.ChangeType)) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeRecordLink, opts => opts.MapFrom(s => GetViewChangeRecordLink(s.DateAndTimeOfChange, s.ChangeLogId, (ChangeType)s.ChangeType))) + .ForMember(d => d.ZendeskTicketID, opts => opts.MapFrom(s => s.ZendeskTicketID)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.LearnerFirstname} {s.LearnerLastname} ({s.Uln})")) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.ProviderName} ({s.ProviderUkprn})")) + .ForMember(d => d.LastUpdatedBy, opts => opts.MapFrom(s => s.LastUpdatedBy)); + + + CreateMap() + .ForMember(d => d.ChangeLogId, opts => opts.MapFrom(s => s.ChangeLogId)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom(s => s.CreatedBy)) + .ForMember(d => d.ChangeType, opts => opts.MapFrom(s => s.ChangeType)) + .ForMember(d => d.ChangeDetails, opts => opts.MapFrom(s => s.ChangeDetails)) + .ForMember(d => d.ChangeRequestedBy, opts => opts.MapFrom(s => s.ChangeRequestedBy)) + .ForMember(d => d.ReasonForChange, opts => opts.MapFrom(s => s.ReasonForChange)) + .ForMember(d => d.ZendeskTicketID, opts => opts.MapFrom(s => s.ZendeskTicketID)); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.ChangeStartYearDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.ChangeIPDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.CoreCode)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.PathwayName} ({s.CoreCode})")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.CoreAssessmentDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.SpecialismCode, opts => opts.MapFrom(s => s.SpecialismCode)) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom(s => $"{s.SpecialismName} ({s.SpecialismCode})")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.SpecialismDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.CoreCode)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.CoreExamPeriod)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.PathwayName} ({s.CoreCode})")) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.PathwayResultDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.CoreCode)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.SpecialismExamPeriod)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.PathwayName} ({s.CoreCode})")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.SpecialismDetails, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.CoreCode)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.PathwayName} ({s.CoreCode})")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.DetailsChangeAssessment, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + + CreateMap() + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.FirstName} {s.LastName}")) + .ForMember(d => d.CoreCode, opts => opts.MapFrom(s => s.CoreCode)) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.PathwayName} ({s.CoreCode})")) + .ForMember(d => d.DateAndTimeOfChange, opts => opts.MapFrom(s => FormatDateTime2(s.DateAndTimeOfChange))) + .ForMember(d => d.ChangeDateOfRequest, opts => opts.MapFrom(s => s.ChangeDateOfRequest.ToDobFormat())) + .ForMember(d => d.DetailsChangeAssessment, opts => opts.MapFrom(s => GetDetails(s.ChangeDetails))); + } + + private T GetDetails(string details) + => JsonConvert.DeserializeObject(details); + + private static string FormatDateTime(DateTime dateTime) + => $"{dateTime:d MMMM yyyy h:mm}{dateTime.ToString("tt").ToLower()}"; + + private static string FormatDateTime2(DateTime dateTime) + => $"{dateTime:d MMMM yyyy, h:mm}{dateTime.ToString("tt").ToLower()}"; + + private ChangeRecordModel GetViewChangeRecordLink(DateTime text, int changeLogId, ChangeType changeType) => new ChangeRecordModel() + { + Text = FormatDateTime(text).ToString(), + Route = GetRoute(changeType), + RouteAttributes = new System.Collections.Generic.Dictionary() + { + { + Constants.ChangeLogId, changeLogId.ToString() + } + } + }; + + private string GetRoute(ChangeType changeType) => changeType switch + { + ChangeType.StartYear => RouteConstants.AdminViewChangeStartYearRecord, + ChangeType.IndustryPlacement => RouteConstants.AdminViewChangeIPRecord, + ChangeType.AddPathwayAssessment => RouteConstants.AdminViewChangeCoreAssessmentRecord, + ChangeType.AddSpecialismAssessment => RouteConstants.AdminViewChangeSpecialismAssessmentRecord, + ChangeType.RemovePathwayAssessment => RouteConstants.AdminViewChangeRemoveCoreAssessmentRecord, + ChangeType.RemoveSpecialismAssessment => RouteConstants.AdminViewChangeRemoveSpecialismAssessmentRecord, + ChangeType.AddPathwayResult => RouteConstants.AdminViewChangeAddPathwayResultRecord, + ChangeType.AddSpecialismResult => RouteConstants.AdminViewChangeAddSpecialismResultRecord, + _ => string.Empty + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs index 6f8f25862..a74a9875b 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminDashboardMapper.cs @@ -14,6 +14,7 @@ using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.IndustryPlacement; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.LearnerRecord; using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; using System; using System.Collections.Generic; using System.Linq; @@ -61,8 +62,8 @@ public AdminDashboardMapper() .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.SeriesName)) .ForMember(d => d.Grade, opts => opts.MapFrom(s => s.Result != null ? s.Result.Grade : null)) .ForMember(d => d.PrsDisplayText, opts => opts.MapFrom(s => GetPrsDisplayText(s))) - .ForMember(d => d.LastUpdated, opts => opts.MapFrom(s => s.LastUpdatedOn.ToDobFormat())) - .ForMember(d => d.UpdatedBy, opts => opts.MapFrom(s => s.LastUpdatedBy)) + .ForMember(d => d.LastUpdated, opts => opts.MapFrom(s => (s.Result != null ? s.Result.LastUpdatedOn : s.LastUpdatedOn).ToDobFormat())) + .ForMember(d => d.UpdatedBy, opts => opts.MapFrom(s => s.Result != null ? s.Result.LastUpdatedBy : s.LastUpdatedBy)) .ForMember(d => d.IsResultChangeAllowed, opt => opt.MapFrom()) .ForMember(d => d.ActionButton, opt => opt.MapFrom()) .ForMember(d => d.AddResultRouteName, opt => opt.MapFrom(s => @@ -157,23 +158,19 @@ public AdminDashboardMapper() .ForMember(d => d.StartYearFrom, opts => opts.MapFrom(s => s.AcademicYear)) .ForMember(d => d.StartYearTo, opts => opts.MapFrom(s => s.AcademicYearTo)); - CreateMap() + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.RegistrationPathwayId)) .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) - .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) - .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.RegistrationPathwayId)); - - CreateMap() - .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.RegistrationPathwayId)) .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()) - .ForMember(d => d.ChangeIPDetails, opts => opts.MapFrom(s => s)); - - CreateMap() - .ForMember(d => d.IndustryPlacementStatusFrom, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.IndustryPlacementStatus)) - .ForMember(d => d.IndustryPlacementStatusTo, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.IndustryPlacementStatusTo)) - .ForMember(d => d.HoursSpentOnPlacementTo, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.HoursViewModel.Hours)) - .ForMember(d => d.SpecialConsiderationReasonsTo, opts => opts.MapFrom(s => s.SelectedReasons)); + .ForMember(d => d.IndustryPlacementStatus, opts => opts.MapFrom(s => s.AdminChangeIpViewModel.AdminIpCompletion.IndustryPlacementStatusTo)) + .ForMember(d => d.HoursSpentOnPlacement, opts => opts.MapFrom(s => + string.IsNullOrWhiteSpace(s.AdminChangeIpViewModel.HoursViewModel.Hours) + ? null as int? + : int.Parse(s.AdminChangeIpViewModel.HoursViewModel.Hours))) + .ForMember(d => d.SpecialConsiderationReasons, opts => opts.MapFrom(s => s.SelectedReasons)); CreateMap() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) @@ -269,20 +266,6 @@ public AdminDashboardMapper() .ForMember(d => d.SpecialismAssessmentFrom, opts => opts.MapFrom(s => $"{ReviewChangeAssessment.No_Assessment_Recorded} {s.AdminOccupationalSpecialismViewModel.AssessmentYearTo.ToLower()}")) .ForMember(d => d.SpecialismAssessmentTo, opts => opts.MapFrom(s => s.AdminOccupationalSpecialismViewModel.AssessmentYearTo)); - - CreateMap() - .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) - .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayAssessmentId)) - .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Core)) - .ForPath(d => d.ChangeAssessmentDetails.PathwayName, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayName)) - .ForPath(d => d.ChangeAssessmentDetails.From, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.ExamPeriod)) - .ForPath(d => d.ChangeAssessmentDetails.To, opts => opts.MapFrom(s => string.Format(AdminReviewRemoveAssessmentEntry.Label_No_Assessment_Entry_Recorded, s.PathwayAssessmentViewModel.ExamPeriod))) - .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) - .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) - .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) - .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) - .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); - #region Add pathway result CreateMap() @@ -314,6 +297,7 @@ public AdminDashboardMapper() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.GradeTo, opts => opts.MapFrom(s => s.SelectedGradeValue)) .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) @@ -359,6 +343,7 @@ public AdminDashboardMapper() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.GradeTo, opts => opts.MapFrom(s => s.SelectedGradeValue)) .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) @@ -367,7 +352,7 @@ public AdminDashboardMapper() #endregion - CreateMap() + CreateMap() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.PathwayAssessmentId)) .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Core)) @@ -378,9 +363,9 @@ public AdminDashboardMapper() .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) - .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); - CreateMap() + CreateMap() .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.RegistrationPathwayId)) .ForMember(d => d.AssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentViewModel.SpecialismAssessmentId)) .ForMember(d => d.ComponentType, opts => opts.MapFrom(s => ComponentType.Specialism)) @@ -391,7 +376,7 @@ public AdminDashboardMapper() .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => s.RequestDate)) .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskId)) - .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); CreateMap() @@ -405,6 +390,7 @@ public AdminDashboardMapper() .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); CreateMap() @@ -424,7 +410,117 @@ public AdminDashboardMapper() .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + + #region change pathway result + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom(s => s.PathwayResultId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId.HasValue ? s.SelectedGradeId.Value : default)) + .ForMember(d => d.SelectedGradeValue, opts => opts.MapFrom(s => s.SelectedGradeValue)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.Grade, opts => opts.MapFrom(s => s.Grade)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.ChangePathwayDetails, opts => opts.MapFrom(s => s)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + CreateMap() + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom(s => s.PathwayResultId)) + .ForMember(d => d.SelectedGradeFrom, opts => opts.MapFrom(s => s.Grade)) + .ForMember(d => d.SelectedGradeTo, opts => opts.MapFrom(s => s.SelectedGradeValue)); + + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom(s => s.SpecialismResultId)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId.HasValue ? s.SelectedGradeId.Value : default)) + .ForMember(d => d.SelectedGradeValue, opts => opts.MapFrom(s => s.SelectedGradeValue)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.Grade, opts => opts.MapFrom(s => s.Grade)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.ChangeSpecialismDetails, opts => opts.MapFrom(s => s)) + .ForMember(d => d.SelectedGradeId, opts => opts.MapFrom(s => s.SelectedGradeId)) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom(s => s.SpecialismResultId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.RequestDate, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + CreateMap() + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom(s => s.SpecialismResultId)) + .ForMember(d => d.SelectedGradeFrom, opts => opts.MapFrom(s => s.Grade)) + .ForMember(d => d.SelectedGradeTo, opts => opts.MapFrom(s => s.SelectedGradeValue)); + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom((src, dest, destMember, context) => + { + int assessmentId = (int)context.Items[Constants.AssessmentId]; + Specialism specialism = src?.Pathway?.Specialisms?.SingleOrDefault(s => s.Assessments.Any(a => a.Id == assessmentId)); + + return $"{specialism?.Name} ({specialism.LarId})"; + + })).ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => GetDisplayAcademicYear(s.Pathway.AcademicYear))) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.Grades, opts => opts.MapFrom((src, dest, destMember, context) => (IList)context.Items["grades"])); + + + + #endregion + } private int? GetSelectedProviderId(AdminSearchLearnerCriteriaViewModel searchCriteria) @@ -508,5 +604,8 @@ private T GetSpecialismAssessmentPropertyValue(AdminLearnerRecord learnerReco Assessment specialismAssessment = learnerRecord?.Pathway?.Specialisms?.SelectMany(s => s.Assessments).SingleOrDefault(a => a.Id == assessmentId); return specialismAssessment == null ? default : getPropertyValue(specialismAssessment); } + + + } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminPostResultsMapper.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminPostResultsMapper.cs new file mode 100644 index 000000000..569289b9c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/AdminPostResultsMapper.cs @@ -0,0 +1,199 @@ +using AutoMapper; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Mapper.Resolver; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.Mapper +{ + public class AdminPostResultsMapper : Profile + { + public AdminPostResultsMapper() + { + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => $"{s.Pathway.AcademicYear} to {s.Pathway.AcademicYear + 1}")) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.ErrorMessage, opts => opts.MapFrom((src, dest, destMember, context) => + { + if (src.Pathway.Status == Common.Enum.RegistrationPathwayStatus.Withdrawn) + { + return AdminOpenPathwayRomm.Validation_Widthdrawn; + } + + int assessmentId = (int)context.Items[Constants.AssessmentId]; + string gradeCode = GetPathwayAssessmentPropertyValue(src, assessmentId, p => p?.Result?.GradeCode); + + return gradeCode switch + { + Constants.PathwayComponentGradeQpendingResultCode => AdminOpenPathwayRomm.Validation_Result_Pending, + Constants.PathwayComponentGradeXNoResultCode => AdminOpenPathwayRomm.Validation_No_Result, + _ => string.Empty + }; + })); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom(s => s.PathwayAssessmentId)) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom(s => s.PathwayResultId)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom(s => s.PathwayResultId)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.DateOfRequest, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskTicketId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom((src, dest, destMember, context) => + { + int assessmentId = (int)context.Items[Constants.AssessmentId]; + Specialism specialism = src?.Pathway?.Specialisms?.SingleOrDefault(s => s.Assessments.Any(a => a.Id == assessmentId)); + + return $"{specialism?.Name} ({specialism.LarId})"; + + })).ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => $"{s.Pathway.AcademicYear} to {s.Pathway.AcademicYear + 1}")) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.ErrorMessage, opts => opts.MapFrom((src, dest, destMember, context) => + { + if (src.Pathway.Status == Common.Enum.RegistrationPathwayStatus.Withdrawn) + { + return AdminOpenSpecialismRomm.Validation_Widthdrawn; + } + + int assessmentId = (int)context.Items[Constants.AssessmentId]; + string gradeCode = GetSpecialismAssessmentPropertyValue(src, assessmentId, p => p?.Result?.GradeCode); + + return gradeCode switch + { + Constants.SpecialismComponentGradeQpendingResultCode => AdminOpenSpecialismRomm.Validation_Result_Pending, + Constants.SpecialismComponentGradeXNoResultCode => AdminOpenSpecialismRomm.Validation_No_Result, + _ => string.Empty + }; + })); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom(s => s.SpecialismAssessmentId)) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom(s => s.SpecialismResultId)) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => s.Learner)) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => s.Provider)) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Tlevel)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => s.StartYear)) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom(s => s.ExamPeriod)); + + CreateMap() + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom(s => s.SpecialismResultId)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.ContactName, opts => opts.MapFrom(s => s.ContactName)) + .ForMember(d => d.DateOfRequest, opts => opts.MapFrom(s => Convert.ToDateTime(s.DateOfRequest))) + .ForMember(d => d.ChangeReason, opts => opts.MapFrom(s => s.ChangeReason)) + .ForMember(d => d.ZendeskTicketId, opts => opts.MapFrom(s => s.ZendeskTicketId)) + .ForMember(d => d.CreatedBy, opts => opts.MapFrom>()); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.PathwayAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.PathwayResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.PathwayName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => $"{s.Pathway.AcademicYear} to {s.Pathway.AcademicYear + 1}")) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetPathwayAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.ErrorMessage, opts => opts.MapFrom((src, dest, destMember, context) => + { + if (src.Pathway.Status == Common.Enum.RegistrationPathwayStatus.Withdrawn) + { + return AdminAddCoreRommOutcome.Validation_Widthdrawn; + } + + int assessmentId = (int)context.Items[Constants.AssessmentId]; + string gradeCode = GetSpecialismAssessmentPropertyValue(src, assessmentId, p => p?.Result?.GradeCode); + + return gradeCode switch + { + Constants.PathwayComponentGradeQpendingResultCode => AdminAddCoreRommOutcome.Validation_Result_Pending, + Constants.PathwayComponentGradeXNoResultCode => AdminAddCoreRommOutcome.Validation_No_Result, + _ => string.Empty + }; + })); + + CreateMap() + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.RegistrationPathwayId, opts => opts.MapFrom(s => s.RegistrationPathwayId)) + .ForMember(d => d.SpecialismAssessmentId, opts => opts.MapFrom((src, dest, destMember, context) => (int)context.Items[Constants.AssessmentId])) + .ForMember(d => d.SpecialismResultId, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Id))) + .ForMember(d => d.SpecialismName, opts => opts.MapFrom(s => $"{s.Pathway.Name} ({s.Pathway.LarId})")) + .ForMember(d => d.Learner, opts => opts.MapFrom(s => $"{s.Firstname} {s.Lastname}")) + .ForMember(d => d.Uln, opts => opts.MapFrom(s => s.Uln)) + .ForMember(d => d.Provider, opts => opts.MapFrom(s => $"{s.Pathway.Provider.Name} ({s.Pathway.Provider.Ukprn})")) + .ForMember(d => d.Tlevel, opts => opts.MapFrom(s => s.Pathway.Name)) + .ForMember(d => d.StartYear, opts => opts.MapFrom(s => $"{s.Pathway.AcademicYear} to {s.Pathway.AcademicYear + 1}")) + .ForMember(d => d.ExamPeriod, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.SeriesName))) + .ForMember(d => d.Grade, opts => opts.MapFrom((src, dest, destMember, context) => GetSpecialismAssessmentPropertyValue(src, (int)context.Items[Constants.AssessmentId], p => p?.Result?.Grade))) + .ForMember(d => d.ErrorMessage, opts => opts.MapFrom((src, dest, destMember, context) => + { + if (src.Pathway.Status == Common.Enum.RegistrationPathwayStatus.Withdrawn) + { + return AdminAddSpecialismRommOutcome.Validation_Widthdrawn; + } + + int assessmentId = (int)context.Items[Constants.AssessmentId]; + string gradeCode = GetSpecialismAssessmentPropertyValue(src, assessmentId, p => p?.Result?.GradeCode); + + return gradeCode switch + { + Constants.SpecialismComponentGradeQpendingResultCode => AdminAddSpecialismRommOutcome.Validation_Result_Pending, + Constants.SpecialismComponentGradeXNoResultCode => AdminAddSpecialismRommOutcome.Validation_No_Result, + _ => string.Empty + }; + })); + } + + private static T GetPathwayAssessmentPropertyValue(AdminLearnerRecord learnerRecord, int assessmentId, Func getPropertyValue) + { + var pathwayAssessment = learnerRecord?.Pathway?.PathwayAssessments?.SingleOrDefault(p => p.Id == assessmentId); + return pathwayAssessment == null ? default : getPropertyValue(pathwayAssessment); + } + + private static T GetSpecialismAssessmentPropertyValue(AdminLearnerRecord learnerRecord, int assessmentId, Func getPropertyValue) + { + Assessment specialismAssessment = learnerRecord?.Pathway?.Specialisms?.SelectMany(s => s.Assessments).SingleOrDefault(a => a.Id == assessmentId); + return specialismAssessment == null ? default : getPropertyValue(specialismAssessment); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/Resolver/AdminAssessmentResult/TableButtonResolver.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/Resolver/AdminAssessmentResult/TableButtonResolver.cs index b8ee021f6..415d14b1a 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/Resolver/AdminAssessmentResult/TableButtonResolver.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Mapper/Resolver/AdminAssessmentResult/TableButtonResolver.cs @@ -57,7 +57,11 @@ private static TableButtonModel CreateTableButton(int registrationPathwayId, int private static readonly Dictionary<(ComponentType, AdminAssessmentResultStatus), string> _routelookup = new() { [(ComponentType.Core, AdminAssessmentResultStatus.WithoutGrade)] = RouteConstants.RemoveAssessmentEntryCoreClear, - [(ComponentType.Specialism, AdminAssessmentResultStatus.WithoutGrade)] = RouteConstants.RemoveAssessmentSpecialismEntryClear + [(ComponentType.Specialism, AdminAssessmentResultStatus.WithoutGrade)] = RouteConstants.RemoveAssessmentSpecialismEntryClear, + [(ComponentType.Core, AdminAssessmentResultStatus.OpenRommAllowed)] = RouteConstants.AdminOpenPathwayRommClear, + [(ComponentType.Specialism, AdminAssessmentResultStatus.OpenRommAllowed)] = RouteConstants.AdminOpenSpecialismRommClear, + [(ComponentType.Core, AdminAssessmentResultStatus.AddRommOutcomeAllowed)] = RouteConstants.AdminAddCoreRommOutcomeClear, + [(ComponentType.Specialism, AdminAssessmentResultStatus.AddRommOutcomeAllowed)] = RouteConstants.AdminAddSpecialismRommOutcomeClear }; } } \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj b/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj index 35839dca4..f98ddca52 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Sfa.Tl.ResultsAndCertification.Web.csproj @@ -29,7 +29,6 @@ - @@ -42,6 +41,26 @@ + + AdminViewChangeRecord.resx + True + True + + + AdminSearchChangeLog.resx + True + True + + + AdminAddRommOutcomeChangeGradeSpecialism.resx + True + True + + + AdminAddRommOutcomeChangeGradeCore.resx + True + True + AdminChangeSpecialismResult.resx True @@ -152,6 +171,36 @@ True AdminSearchLearners.resx + + AdminAddSpecialismRommOutcome.resx + True + True + + + AdminAddCoreRommOutcome.resx + True + True + + + AdminOpenSpecialismRommReviewChanges.resx + True + True + + + AdminOpenPathwayRommReviewChanges.resx + True + True + + + AdminOpenSpecialismRomm.resx + True + True + + + AdminOpenPathwayRomm.resx + True + True + True True @@ -1131,6 +1180,22 @@ + + AdminViewChangeRecord.Designer.cs + PublicResXFileCodeGenerator + + + AdminSearchChangeLog.Designer.cs + PublicResXFileCodeGenerator + + + AdminAddRommOutcomeChangeGradeSpecialism.Designer.cs + PublicResXFileCodeGenerator + + + AdminAddRommOutcomeChangeGradeCore.Designer.cs + PublicResXFileCodeGenerator + AdminChangeSpecialismResult.Designer.cs PublicResXFileCodeGenerator @@ -1224,6 +1289,22 @@ PublicResXFileCodeGenerator + + AdminOpenSpecialismRommReviewChanges.Designer.cs + PublicResXFileCodeGenerator + + + AdminOpenPathwayRommReviewChanges.Designer.cs + PublicResXFileCodeGenerator + + + AdminOpenSpecialismRomm.Designer.cs + PublicResXFileCodeGenerator + + + AdminOpenPathwayRomm.Designer.cs + PublicResXFileCodeGenerator + PublicResXFileCodeGenerator AddCoreAssessmentEntry.Designer.cs diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs b/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs index 83fcb7c88..095b70b36 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Startup.cs @@ -215,6 +215,8 @@ private void RegisterDependencies(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); } } diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecord.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecord.cs new file mode 100644 index 000000000..c46e1339f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecord.cs @@ -0,0 +1,12 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewComponents.ChangeRecordLink +{ + public class ChangeRecord : ViewComponent + { + public IViewComponentResult Invoke(ChangeRecordModel model) + { + return View("~/ViewComponents/ChangeRecordLink/Default.cshtml", model); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecordModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecordModel.cs new file mode 100644 index 000000000..da4ad1ef3 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/ChangeRecordModel.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewComponents.ChangeRecordLink +{ + public class ChangeRecordModel + { + public ChangeRecordModel() + { + RouteAttributes = new Dictionary(); + } + + public string Text { get; set; } + + public string Route { get; set; } + + public Dictionary RouteAttributes { get; set; } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/Default.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/Default.cshtml new file mode 100644 index 000000000..6cfed97c7 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewComponents/ChangeRecordLink/Default.cshtml @@ -0,0 +1,10 @@ +@using Sfa.Tl.ResultsAndCertification.Web.Content.ViewComponents; +@model Sfa.Tl.ResultsAndCertification.Web.ViewComponents.ChangeRecordLink.ChangeRecordModel +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers + +@if (Model != null) +{ + + @Model.Text + +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogCriteriaViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogCriteriaViewModel.cs new file mode 100644 index 000000000..7b432be7c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogCriteriaViewModel.cs @@ -0,0 +1,12 @@ +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminSearchChangeLogCriteriaViewModel + { + public string SearchKey { get; set; } + + public int? PageNumber { get; set; } + + public bool IsSearchKeyApplied + => !string.IsNullOrWhiteSpace(SearchKey); + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogDetailsViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogDetailsViewModel.cs new file mode 100644 index 000000000..d35b93bb1 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogDetailsViewModel.cs @@ -0,0 +1,24 @@ +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.ChangeRecordLink; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminSearchChangeLogDetailsViewModel + { + public int ChangeLogId { get; set; } + + public int ChangeType { get; set; } + + public string DateAndTimeOfChange { get; set; } + + public string ZendeskTicketID { get; set; } + + public string Learner { get; set; } + + public string Provider { get; set; } + + public string LastUpdatedBy { get; set; } + + public ChangeRecordModel ChangeRecordLink { get; set; } + + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogViewModel.cs new file mode 100644 index 000000000..57a6490ac --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminSearchChangeLogViewModel.cs @@ -0,0 +1,58 @@ +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Breadcrumb; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Pagination; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using BreadcrumbContent = Sfa.Tl.ResultsAndCertification.Web.Content.ViewComponents.Breadcrumb; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminSearchChangeLogViewModel + { + private const int FirstPage = 1; + private const int PageSize = 10; + + public AdminSearchChangeLogCriteriaViewModel SearchCriteriaViewModel { get; set; } = new AdminSearchChangeLogCriteriaViewModel(); + + public IList ChangeLogDetails { get; set; } = new List(); + + public PagerViewModel PagerInfo { get; set; } + + public int TotalRecords { get; set; } + + public PaginationModel Pagination => new() + { + PagerInfo = PagerInfo, + RouteName = RouteConstants.AdminSearchChangeLog, + PaginationSummary = AdminSearchChangeLog.PaginationSummary_Text + }; + + public bool ContainsResults + => !ChangeLogDetails.IsNullOrEmpty() && ChangeLogDetails.Count > 0; + + public bool ContainsMultiplePages + => ContainsResults && Pagination?.PagerInfo?.TotalPages > 1; + + public void SetSearchKey(string searchKey) + { + SearchCriteriaViewModel ??= new AdminSearchChangeLogCriteriaViewModel(); + SearchCriteriaViewModel.SearchKey = searchKey; + SearchCriteriaViewModel.PageNumber = FirstPage; + } + + public void ClearSearchKey() + => SetSearchKey(string.Empty); + + public BreadcrumbModel Breadcrumb => new() + { + BreadcrumbItems = new List + { + new BreadcrumbItem { DisplayName = BreadcrumbContent.Home, RouteName = RouteConstants.AdminHome }, + new BreadcrumbItem { DisplayName = BreadcrumbContent.Change_Log } + } + }; + + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddPathwayResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddPathwayResultViewModel.cs new file mode 100644 index 000000000..53076f06f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddPathwayResultViewModel.cs @@ -0,0 +1,41 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordAddPathwayResultViewModel : AdminViewChangeRecordViewModel + { + public AddPathwayResultRequest PathwayResultDetails { get; set; } + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminViewChangeRecord.Summary_Exam_Period_Id, AdminViewChangeRecord.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminViewChangeRecord.Summary_Grade_Id, + AdminViewChangeRecord.Summary_Grade_Text, + AdminViewChangeRecord.No_Grade_Entered); + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminViewChangeRecord.Summary_Selected_Grade_Id, + Title = AdminViewChangeRecord.Summary_Grade_Text, + Value = AdminViewChangeRecord.No_Grade_Entered, + Value2 = PathwayResultDetails.GradeTo + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddSpecialismResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddSpecialismResultViewModel.cs new file mode 100644 index 000000000..95f7617bb --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordAddSpecialismResultViewModel.cs @@ -0,0 +1,41 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordAddSpecialismResultViewModel : AdminViewChangeRecordViewModel + { + public AddSpecialismResultRequest SpecialismDetails { get; set; } + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminViewChangeRecord.Summary_Exam_Period_Id, AdminViewChangeRecord.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminViewChangeRecord.Summary_Grade_Id, + AdminViewChangeRecord.Summary_Grade_Text, + AdminViewChangeRecord.No_Grade_Entered); + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminViewChangeRecord.Summary_Selected_Grade_Id, + Title = AdminViewChangeRecord.Summary_Grade_Text, + Value = AdminViewChangeRecord.No_Grade_Entered, + Value2 = SpecialismDetails.GradeTo + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordCoreAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordCoreAssessmentViewModel.cs new file mode 100644 index 000000000..c51691ed9 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordCoreAssessmentViewModel.cs @@ -0,0 +1,20 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordCoreAssessmentViewModel : AdminViewChangeRecordViewModel + { + public AddCoreAssessmentDetails CoreAssessmentDetails { get; set; } + + public SummaryItemModel SummaryAssessment => new() + { + Id = AdminViewChangeRecord.Summary_Assessment_Id, + Title = $"{AdminViewChangeRecord.Core_Component}: {PathwayName}", + Value = $"{AdminViewChangeRecord.Text_No_Assement_Message} {CoreAssessmentDetails.CoreAssessmentTo.ToLower()}", + Value2 = CoreAssessmentDetails.CoreAssessmentTo, + TitleCss = "govuk-summary-list__value", + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordIndustryPlacementViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordIndustryPlacementViewModel.cs new file mode 100644 index 000000000..49ef8c80c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordIndustryPlacementViewModel.cs @@ -0,0 +1,79 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.Linq; +using IpStatus = Sfa.Tl.ResultsAndCertification.Common.Enum.IndustryPlacementStatus; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordIndustryPlacementViewModel : AdminViewChangeRecordViewModel + { + public ChangeIndustryPlacementRequest ChangeIPDetails { get; set; } + + public IList Reasons { get; set; } + + public List GetIpSummaryDetailsList() + { + var detailsList = new List(); + + // Status Row + detailsList.Add(new() + { + Id = AdminViewChangeRecord.Industry_Placement_Status_Id, + Title = ChangeIPDetails.IndustryPlacementStatusTo == IpStatus.CompletedWithSpecialConsideration ? AdminViewChangeRecord.Title_Industry_Placement_Status : AdminViewChangeRecord.Title_Status_Text, + Value = GetIndustryPlacementDisplayText(ChangeIPDetails.IndustryPlacementStatusFrom), + Value2 = GetIndustryPlacementDisplayText(ChangeIPDetails.IndustryPlacementStatusTo), + TitleCss = ChangeIPDetails.IndustryPlacementStatusTo == IpStatus.CompletedWithSpecialConsideration ? "govuk-summary-list__value" : default + }); + + if (ChangeIPDetails.IndustryPlacementStatusTo == IpStatus.CompletedWithSpecialConsideration) + { + // SpecialConsideration Rows + AddSummaryItemForSpecialConsideration(detailsList); + } + + return detailsList; + } + + private bool AddSummaryItemForSpecialConsideration(List detailsList) + { + // Hours Row + detailsList.Add(new() + { + Id = AdminViewChangeRecord.No_Of_Hours_Id, + Title = AdminViewChangeRecord.Title_Number_Of_Hours, + Value = GetIndustryPlacementDisplayText(ChangeIPDetails.IndustryPlacementStatusFrom), + Value2 = ChangeIPDetails.HoursSpentOnPlacementTo.ToString(), + TitleCss = "govuk-summary-list__value" + }); + + // Reasons Row + detailsList.Add(new SummaryItemModel + { + Id = AdminViewChangeRecord.IP_Reasons_List_Id, + Title = AdminViewChangeRecord.Title_Reasons_For_Reduced_Hours, + Value = GetIndustryPlacementDisplayText(ChangeIPDetails.IndustryPlacementStatusTo), + Value2 = ConvertListToRawHtmlString(Reasons), + TitleCss = "govuk-summary-list__value" + }); + + return true; + } + private string GetIndustryPlacementDisplayText(IpStatus? status) => status switch + { + IpStatus.Completed => AdminChangeIndustryPlacement.Status_Placement_Completed_Text, + IpStatus.CompletedWithSpecialConsideration => AdminChangeIndustryPlacement.Status_Placement_Completed_With_Special_Consideration_Text, + IpStatus.NotCompleted => AdminChangeIndustryPlacement.Status_Still_To_Be_Completed_Text, + IpStatus.WillNotComplete => AdminChangeIndustryPlacement.Status_Placement_Will_Not_Be_Completed_Text, + _ => AdminChangeIndustryPlacement.Status_Not_Yet_Recieved_Text, + }; + + private static string ConvertListToRawHtmlString(IEnumerable selectedList) + { + var htmlRawList = selectedList.Select(x => string.Format(AdminViewChangeRecord.Para_Item, x)); + return string.Join(string.Empty, htmlRawList); + } + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessmentViewModel.cs new file mode 100644 index 000000000..1e998374c --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessmentViewModel.cs @@ -0,0 +1,20 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordRemoveCoreAssessmentViewModel : AdminViewChangeRecordViewModel + { + public DetailsChangeAssessmentRemove DetailsChangeAssessment { get; set; } + + public SummaryItemModel SummaryAssessmentYear => new() + { + Id = "assessmentyear", + Title = string.Format(AdminViewChangeRecord.Label_Core_Component, DetailsChangeAssessment.PathwayName), + Value = DetailsChangeAssessment.From, + Value2 = string.Format(AdminViewChangeRecord.Label_No_Assessment_Entry_Recorded, DetailsChangeAssessment.From), + TitleCss = "govuk-summary-list__value" + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessmentViewModel.cs new file mode 100644 index 000000000..b555c1653 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessmentViewModel.cs @@ -0,0 +1,21 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordRemoveSpecialismAssessmentViewModel : AdminViewChangeRecordViewModel + { + public DetailsSpecialismAssessmentRemove DetailsChangeAssessment { get; set; } + + public SummaryItemModel SummaryAssessmentYear => new() + { + Id = "assessmentyear", + Title = string.Format(AdminViewChangeRecord.Label_Occupational_Specialism, DetailsChangeAssessment.SpecialismName), + Value = DetailsChangeAssessment.From, + Value2 = string.Format(AdminViewChangeRecord.Label_No_Assessment_Entry_Recorded, DetailsChangeAssessment.From), + TitleCss = "govuk-summary-list__value" + }; + + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordSpecialismAssessmentViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordSpecialismAssessmentViewModel.cs new file mode 100644 index 000000000..0d08c77fb --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordSpecialismAssessmentViewModel.cs @@ -0,0 +1,20 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordSpecialismAssessmentViewModel : AdminViewChangeRecordViewModel + { + public AddSpecialismDetails SpecialismDetails { get; set; } + + public SummaryItemModel SummaryAssessment => new() + { + Id = AdminViewChangeRecord.Summary_Assessment_Id, + Title = $"{AdminViewChangeRecord.Occupational_Specialism}: {SpecialismName}", + Value = $"{AdminViewChangeRecord.Text_No_Assement_Message} {SpecialismDetails.SpecialismAssessmentTo.ToLower()}", + Value2 = SpecialismDetails.SpecialismAssessmentTo, + TitleCss = "govuk-summary-list__value" + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordStartYearViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordStartYearViewModel.cs new file mode 100644 index 000000000..1e722aa57 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordStartYearViewModel.cs @@ -0,0 +1,19 @@ +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordStartYearViewModel : AdminViewChangeRecordViewModel + { + public ChangeStartYearDetails ChangeStartYearDetails { get; set; } + + public SummaryItemModel SummaryAcademicYear => new() + { + Id = AdminViewChangeRecord.Summary_Academic_Year_Id, + Title = AdminViewChangeRecord.Title_StartYear, + Value = $"{ChangeStartYearDetails.StartYearFrom} to {ChangeStartYearDetails.StartYearFrom + 1}", + Value2 = $"{ChangeStartYearDetails.StartYearTo} to {ChangeStartYearDetails.StartYearTo + 1}" + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordViewModel.cs new file mode 100644 index 000000000..2ca2de7ec --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminChangeLog/AdminViewChangeRecordViewModel.cs @@ -0,0 +1,83 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog +{ + public class AdminViewChangeRecordViewModel + { + public int ChangeLogId { get; set; } + + #region Learner + + public int RegistrationPathwayId { get; set; } + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string PathwayName { get; set; } + + public string CoreCode { get; set; } + + public string SpecialismName { get; set; } + + public string SpecialismCode { get; set; } + + #endregion Learner + + #region Change log + + public string CreatedBy { get; set; } + + public ChangeType ChangeType { get; set; } + + public string ChangeDetails { get; set; } + + public string ChangeRequestedBy { get; set; } + + public string ChangeDateOfRequest { get; set; } + + public string ReasonForChange { get; set; } + + public string ZendeskTicketID { get; set; } + + public string DateAndTimeOfChange { get; set; } + + #endregion Change log + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminSearchChangeLog + }; + + public SummaryItemModel SummaryLearner => + new() + { + Id = AdminViewChangeRecord.Summary_Learner_Id, + Title = AdminViewChangeRecord.Summary_Learner_Text, + Value = Learner, + ActionText = AdminViewChangeRecord.Action_Text_Link_Change, + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } }, + HiddenActionText = AdminViewChangeRecord.Hidden_Action_Text_Learner_Record + }; + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminViewChangeRecord.Summary_ULN_Id, AdminViewChangeRecord.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryCreatedBy + => CreateSummaryItemModel(AdminViewChangeRecord.Summary_CreatedBy_Id, AdminViewChangeRecord.Summary_CreatedBy_Text, CreatedBy); + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + }; +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs index 3b753568f..194772f29 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddPathwayResultReviewChangesViewModel.cs @@ -33,19 +33,19 @@ public class AdminAddPathwayResultReviewChangesViewModel public string StartYear { get; set; } public SummaryItemModel SummaryLearner - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_Learner_Id, AdminAddPathwayResultReviewChanges.Summary_Learner_Text, Learner); public SummaryItemModel SummaryUln - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_ULN_Id, AdminAddPathwayResultReviewChanges.Summary_ULN_Text, Uln.ToString()); public SummaryItemModel SummaryProvider - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_Provider_Id, AdminAddPathwayResultReviewChanges.Summary_Provider_Text, Provider); public SummaryItemModel SummaryTlevel - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_TLevel_Id, AdminAddPathwayResultReviewChanges.Summary_TLevel_Text, Tlevel); public SummaryItemModel SummaryStartYear - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_StartYear_Id, AdminAddPathwayResultReviewChanges.Summary_StartYear_Text, StartYear); #endregion @@ -54,7 +54,7 @@ public SummaryItemModel SummaryStartYear public string ExamPeriod { get; set; } public SummaryItemModel SummaryExamPeriod - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Exam_Period_Id, AdminAddPathwayResult.Summary_Exam_Period_Text, ExamPeriod); + => CreateSummaryItemModel(AdminAddPathwayResultReviewChanges.Summary_Exam_Period_Id, AdminAddPathwayResultReviewChanges.Summary_Exam_Period_Text, ExamPeriod); public SummaryItemModel SummaryGrade => CreateSummaryItemModel( diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs index 56943290b..6bac55540 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminAddSpecialismResultReviewChangesViewModel.cs @@ -33,19 +33,19 @@ public class AdminAddSpecialismResultReviewChangesViewModel public string StartYear { get; set; } public SummaryItemModel SummaryLearner - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + => CreateSummaryItemModel(AdminAddSpecialismResultReviewChanges.Summary_Learner_Id, AdminAddSpecialismResultReviewChanges.Summary_Learner_Text, Learner); public SummaryItemModel SummaryUln - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + => CreateSummaryItemModel(AdminAddSpecialismResultReviewChanges.Summary_ULN_Id, AdminAddSpecialismResultReviewChanges.Summary_ULN_Text, Uln.ToString()); public SummaryItemModel SummaryProvider - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + => CreateSummaryItemModel(AdminAddSpecialismResultReviewChanges.Summary_Provider_Id, AdminAddSpecialismResultReviewChanges.Summary_Provider_Text, Provider); public SummaryItemModel SummaryTlevel - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + => CreateSummaryItemModel(AdminAddSpecialismResultReviewChanges.Summary_TLevel_Id, AdminAddSpecialismResultReviewChanges.Summary_TLevel_Text, Tlevel); public SummaryItemModel SummaryStartYear - => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + => CreateSummaryItemModel(AdminAddSpecialismResultReviewChanges.Summary_StartYear_Id, AdminAddSpecialismResultReviewChanges.Summary_StartYear_Text, StartYear); #endregion diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultReviewChangesViewModel.cs new file mode 100644 index 000000000..a684205f2 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultReviewChangesViewModel.cs @@ -0,0 +1,122 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminChangePathwayResultReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string PathwayName { get; set; } + + public int SelectedGradeId { get; set; } + + public string SelectedGradeValue { get; set; } + + public string Grade { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Learner_Id, AdminChangePathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_ULN_Id, AdminChangePathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Provider_Id, AdminChangePathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_TLevel_Id, AdminChangePathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_StartYear_Id, AdminChangePathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Exam_Period_Id, AdminChangePathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminChangePathwayResult.Summary_Grade_Id, + AdminChangePathwayResult.Summary_Grade_Text, + Grade); + + #endregion + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminChangePathwayResultReviewChanges.Summary_Selected_Grade_Id, + Title = AdminChangePathwayResultReviewChanges.Summary_Grade_Text, + Value = Grade, + Value2 = SelectedGradeValue, + ActionText = AdminChangePathwayResultReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminChangePathwayResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + [Required(ErrorMessageResourceType = typeof(AdminChangePathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminChangePathwayResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminChangePathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminChangePathwayResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs index cce08a8cb..3a647d969 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangePathwayResultViewModel.cs @@ -1,4 +1,5 @@ -using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using MessagePack; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; @@ -14,6 +15,8 @@ public class AdminChangePathwayResultViewModel public int PathwayAssessmentId { get; set; } + public int PathwayResultId { get; set; } + public string PathwayName { get; set; } #region Personal details @@ -53,6 +56,8 @@ public SummaryItemModel SummaryStartYear public string Grade { get; set; } + public string GradeCode { get; set; } + public SummaryItemModel SummaryExamPeriod => CreateSummaryItemModel(AdminChangePathwayResult.Summary_Exam_Period_Id, AdminChangePathwayResult.Summary_Exam_Period_Text, ExamPeriod); diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultReviewChangesViewModel.cs new file mode 100644 index 000000000..d80bd8347 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultReviewChangesViewModel.cs @@ -0,0 +1,121 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result +{ + public class AdminChangeSpecialismResultReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SpecialismName { get; set; } + + public int SelectedGradeId { get; set; } + + public string SelectedGradeValue { get; set; } + public string Grade { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Learner_Id, AdminAddPathwayResult.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_ULN_Id, AdminAddPathwayResult.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Provider_Id, AdminAddPathwayResult.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_TLevel_Id, AdminAddPathwayResult.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_StartYear_Id, AdminAddPathwayResult.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddPathwayResult.Summary_Exam_Period_Id, AdminAddPathwayResult.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddPathwayResult.Summary_Grade_Id, + AdminAddPathwayResult.Summary_Grade_Text, + Grade); + + #endregion + + public AdminReviewSummaryItemModel SummarySelectedGrade => new() + { + Id = AdminAddSpecialismResultReviewChanges.Summary_Selected_Grade_Id, + Title = AdminAddSpecialismResultReviewChanges.Summary_Grade_Text, + Value = Grade, + Value2 = SelectedGradeValue, + ActionText = AdminAddSpecialismResultReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminChangeSpecialismResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminAddSpecialismResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminChangeSpecialismResult, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs index a2eb9c3af..618134bc4 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminDashboard/Result/AdminChangeSpecialismResultViewModel.cs @@ -14,7 +14,7 @@ public class AdminChangeSpecialismResultViewModel public int RegistrationPathwayId { get; set; } public int SpecialismAssessmentId { get; set; } - + public int SpecialismResultId { get; set; } public string SpecialismName { get; set; } #region Personal details diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddCoreRommOutcomeViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddCoreRommOutcomeViewModel.cs new file mode 100644 index 000000000..8e6bd6f80 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddCoreRommOutcomeViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminAddCoreRommOutcomeViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string PathwayName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_Learner_Id, AdminAddCoreRommOutcome.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_ULN_Id, AdminAddCoreRommOutcome.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_Provider_Id, AdminAddCoreRommOutcome.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_TLevel_Id, AdminAddCoreRommOutcome.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_StartYear_Id, AdminAddCoreRommOutcome.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddCoreRommOutcome.Summary_Exam_Period_Id, AdminAddCoreRommOutcome.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddCoreRommOutcome.Summary_Grade_Id, + AdminAddCoreRommOutcome.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminAddCoreRommOutcome.No_Grade_Entered : Grade); + + #endregion + + public bool IsValid + => string.IsNullOrEmpty(ErrorMessage); + + public string ErrorMessage { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddCoreRommOutcome), ErrorMessageResourceName = "Validation_Message")] + public bool? WhatIsRommOutcome { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeCoreViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeCoreViewModel.cs new file mode 100644 index 000000000..2289dc326 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeCoreViewModel.cs @@ -0,0 +1,99 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminAddRommOutcomeChangeGradeCoreViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string PathwayName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public bool IsRemoveResult { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Learner_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_ULN_Id, AdminAddRommOutcomeChangeGradeCore.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Provider_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_TLevel_Id, AdminAddRommOutcomeChangeGradeCore.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_StartYear_Id, AdminAddRommOutcomeChangeGradeCore.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public string GradeCode { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Exam_Period_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddRommOutcomeChangeGradeCore.Summary_Grade_Id, + AdminAddRommOutcomeChangeGradeCore.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminAddRommOutcomeChangeGradeCore.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminAddRommOutcomeChangeGradeCore), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminAddCoreRommOutcome, + RouteAttributes = new Dictionary + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialismViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialismViewModel.cs new file mode 100644 index 000000000..f4c15ee64 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialismViewModel.cs @@ -0,0 +1,99 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminAddRommOutcomeChangeGradeSpecialismViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SpecialismName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public bool IsRemoveResult { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Learner_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_ULN_Id, AdminAddRommOutcomeChangeGradeCore.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Provider_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_TLevel_Id, AdminAddRommOutcomeChangeGradeCore.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_StartYear_Id, AdminAddRommOutcomeChangeGradeCore.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public string GradeCode { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminAddRommOutcomeChangeGradeCore.Summary_Exam_Period_Id, AdminAddRommOutcomeChangeGradeCore.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminAddRommOutcomeChangeGradeCore.Summary_Grade_Id, + AdminAddRommOutcomeChangeGradeCore.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminAddRommOutcomeChangeGradeCore.No_Grade_Entered : Grade); + + #endregion + + [Required(ErrorMessageResourceType = typeof(AdminAddRommOutcomeChangeGradeCore), ErrorMessageResourceName = "Validation_Message")] + public int? SelectedGradeId { get; set; } + + public string SelectedGradeValue + => Grades?.FirstOrDefault(g => g.Id == SelectedGradeId)?.Value; + + public List Grades { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminAddSpecialismRommOutcome, + RouteAttributes = new Dictionary + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddSpecialismRommOutcomeViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddSpecialismRommOutcomeViewModel.cs new file mode 100644 index 000000000..c73f8c594 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminAddSpecialismRommOutcomeViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminAddSpecialismRommOutcomeViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SpecialismName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Learner_Id, AdminOpenSpecialismRomm.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_ULN_Id, AdminOpenSpecialismRomm.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Provider_Id, AdminOpenSpecialismRomm.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_TLevel_Id, AdminOpenSpecialismRomm.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_StartYear_Id, AdminOpenSpecialismRomm.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Exam_Period_Id, AdminOpenSpecialismRomm.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminOpenSpecialismRomm.Summary_Grade_Id, + AdminOpenSpecialismRomm.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminOpenSpecialismRomm.No_Grade_Entered : Grade); + + #endregion + + public bool IsValid + => string.IsNullOrEmpty(ErrorMessage); + + public string ErrorMessage { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddSpecialismRommOutcome), ErrorMessageResourceName = "Validation_Message")] + public bool? WhatIsRommOutcome { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommReviewChangesViewModel.cs new file mode 100644 index 000000000..016bec73b --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommReviewChangesViewModel.cs @@ -0,0 +1,125 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminOpenPathwayRommReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string PathwayName { get; set; } + + public string Grade { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_Learner_Id, AdminOpenPathwayRommReviewChanges.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_ULN_Id, AdminOpenPathwayRommReviewChanges.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_Provider_Id, AdminOpenPathwayRommReviewChanges.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_TLevel_Id, AdminOpenPathwayRommReviewChanges.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_StartYear_Id, AdminOpenPathwayRommReviewChanges.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_Exam_Period_Id, AdminOpenPathwayRommReviewChanges.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel(AdminOpenPathwayRommReviewChanges.Summary_Grade_Id, AdminOpenPathwayRommReviewChanges.Summary_Grade_Text, Grade); + + #endregion + + #region Change summary + + public AdminReviewSummaryItemModel SummaryRomm + => new() + { + Id = AdminOpenPathwayRommReviewChanges.Summary_Romm_Id, + Title = AdminOpenPathwayRommReviewChanges.Change_Summary_Change, + Value = AdminOpenPathwayRommReviewChanges.Change_Summary_From, + Value2 = AdminOpenPathwayRommReviewChanges.Change_Summary_To, + ActionText = AdminOpenPathwayRommReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminOpenPathwayRomm, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + #endregion + + #region Who has asked for this change? + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminAddPathwayResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + #endregion + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminOpenPathwayRomm, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, PathwayAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommViewModel.cs new file mode 100644 index 000000000..f950c68de --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenPathwayRommViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminOpenPathwayRommViewModel + { + public int RegistrationPathwayId { get; set; } + + public int PathwayAssessmentId { get; set; } + + public int PathwayResultId { get; set; } + + public string PathwayName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_Learner_Id, AdminOpenPathwayRomm.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_ULN_Id, AdminOpenPathwayRomm.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_Provider_Id, AdminOpenPathwayRomm.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_TLevel_Id, AdminOpenPathwayRomm.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_StartYear_Id, AdminOpenPathwayRomm.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminOpenPathwayRomm.Summary_Exam_Period_Id, AdminOpenPathwayRomm.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminOpenPathwayRomm.Summary_Grade_Id, + AdminOpenPathwayRomm.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminOpenPathwayRomm.No_Grade_Entered : Grade); + + #endregion + + public bool IsValid + => string.IsNullOrEmpty(ErrorMessage); + + public string ErrorMessage { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminOpenPathwayRomm), ErrorMessageResourceName = "Validation_Message")] + public bool? DoYouWantToOpenRomm { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommReviewChangesViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommReviewChangesViewModel.cs new file mode 100644 index 000000000..f83f15c3e --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommReviewChangesViewModel.cs @@ -0,0 +1,125 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.Utilities.CustomValidations; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminOpenSpecialismRommReviewChangesViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SpecialismName { get; set; } + + public string Grade { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_Learner_Id, AdminOpenSpecialismRommReviewChanges.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_ULN_Id, AdminOpenSpecialismRommReviewChanges.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_Provider_Id, AdminOpenSpecialismRommReviewChanges.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_TLevel_Id, AdminOpenSpecialismRommReviewChanges.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_StartYear_Id, AdminOpenSpecialismRommReviewChanges.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_Exam_Period_Id, AdminOpenSpecialismRommReviewChanges.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel(AdminOpenSpecialismRommReviewChanges.Summary_Grade_Id, AdminOpenSpecialismRommReviewChanges.Summary_Grade_Text, Grade); + + #endregion + + #region Change summary + + public AdminReviewSummaryItemModel SummaryRomm + => new() + { + Id = AdminOpenSpecialismRommReviewChanges.Summary_Romm_Id, + Title = AdminOpenSpecialismRommReviewChanges.Change_Summary_Change, + Value = AdminOpenSpecialismRommReviewChanges.Change_Summary_From, + Value2 = AdminOpenSpecialismRommReviewChanges.Change_Summary_To, + ActionText = AdminOpenSpecialismRommReviewChanges.Link_Change_Text, + RouteName = RouteConstants.AdminOpenSpecialismRomm, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + #endregion + + #region Who has asked for this change? + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Contact_Name_Blank_Text")] + public string ContactName { get; set; } + + [DateValidator(Property = nameof(DateOfRequest), ErrorResourceType = typeof(AdminAddPathwayResultReviewChanges))] + public string DateOfRequest + => $"{Year}/{Month}/{Day}"; + + public string Day { get; set; } + + public string Month { get; set; } + + public string Year { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminAddPathwayResultReviewChanges), ErrorMessageResourceName = "Validation_Reason_For_Change_Blank_Text")] + public string ChangeReason { get; set; } + + public string ZendeskTicketId { get; set; } + + #endregion + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminOpenSpecialismRomm, + RouteAttributes = new Dictionary() + { + { Constants.RegistrationPathwayId, RegistrationPathwayId.ToString() }, + { Constants.AssessmentId, SpecialismAssessmentId.ToString() } + } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommViewModel.cs b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommViewModel.cs new file mode 100644 index 000000000..9618cf6d0 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/ViewModel/AdminPostResults/AdminOpenSpecialismRommViewModel.cs @@ -0,0 +1,88 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.Summary.SummaryItem; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults +{ + public class AdminOpenSpecialismRommViewModel + { + public int RegistrationPathwayId { get; set; } + + public int SpecialismAssessmentId { get; set; } + + public int SpecialismResultId { get; set; } + + public string SpecialismName { get; set; } + + #region Personal details + + public string Learner { get; set; } + + public long Uln { get; set; } + + public string Provider { get; set; } + + public string Tlevel { get; set; } + + public string StartYear { get; set; } + + public SummaryItemModel SummaryLearner + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Learner_Id, AdminOpenSpecialismRomm.Summary_Learner_Text, Learner); + + public SummaryItemModel SummaryUln + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_ULN_Id, AdminOpenSpecialismRomm.Summary_ULN_Text, Uln.ToString()); + + public SummaryItemModel SummaryProvider + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Provider_Id, AdminOpenSpecialismRomm.Summary_Provider_Text, Provider); + + public SummaryItemModel SummaryTlevel + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_TLevel_Id, AdminOpenSpecialismRomm.Summary_TLevel_Text, Tlevel); + + public SummaryItemModel SummaryStartYear + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_StartYear_Id, AdminOpenSpecialismRomm.Summary_StartYear_Text, StartYear); + + #endregion + + #region Assessment + + public string ExamPeriod { get; set; } + + public string Grade { get; set; } + + public SummaryItemModel SummaryExamPeriod + => CreateSummaryItemModel(AdminOpenSpecialismRomm.Summary_Exam_Period_Id, AdminOpenSpecialismRomm.Summary_Exam_Period_Text, ExamPeriod); + + public SummaryItemModel SummaryGrade + => CreateSummaryItemModel( + AdminOpenSpecialismRomm.Summary_Grade_Id, + AdminOpenSpecialismRomm.Summary_Grade_Text, + string.IsNullOrWhiteSpace(Grade) ? AdminOpenSpecialismRomm.No_Grade_Entered : Grade); + + #endregion + + public bool IsValid + => string.IsNullOrEmpty(ErrorMessage); + + public string ErrorMessage { get; set; } + + [Required(ErrorMessageResourceType = typeof(AdminOpenSpecialismRomm), ErrorMessageResourceName = "Validation_Message")] + public bool? DoYouWantToOpenRomm { get; set; } + + public BackLinkModel BackLink => new() + { + RouteName = RouteConstants.AdminLearnerRecord, + RouteAttributes = new Dictionary { { Constants.PathwayId, RegistrationPathwayId.ToString() } } + }; + + private static SummaryItemModel CreateSummaryItemModel(string id, string title, string value) + => new() + { + Id = id, + Title = title, + Value = value + }; + } +} \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminSearchChangeLog.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminSearchChangeLog.cshtml new file mode 100644 index 000000000..8b0816038 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminSearchChangeLog.cshtml @@ -0,0 +1,85 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminSearchChangeLogViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Enum +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminSearchChangeLog.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + +

@AdminSearchChangeLog.Heading_Change_Log

+ + + + + @if (!Model.ContainsResults) + { + +
+

@AdminSearchChangeLog.Heading_No_Matching_Results

+

@AdminSearchChangeLog.List_Title_Improve_Your_Search_By

+
    +
  • @AdminSearchChangeLog.List_Item_Checking_Zendesk_Ticket_ID
  • +
  • @AdminSearchChangeLog.List_Item_Enter_ULN
  • +
  • @AdminSearchChangeLog.List_Item_Checking_Lastnames_Spelling
  • +
+
+ } + else + { + @if (Model.ContainsMultiplePages) + { + +

@string.Format(Model.Pagination.PaginationSummary, @Model.PagerInfo.RecordFrom, @Model.PagerInfo.RecordTo, @Model.PagerInfo.TotalItems)

+ } + + + + + + + + + + + + + + @foreach (var changeLog in Model.ChangeLogDetails) + { + + + + + + + + } + +
@AdminSearchChangeLog.Table_Column_Date_And_Time_Of_Change@AdminSearchChangeLog.Table_Column_Zendesk_Ticket_Id@AdminSearchChangeLog.Table_Column_Learner_Uln@AdminSearchChangeLog.Table_Column_Provider_Ukprn@AdminSearchChangeLog.Table_Column_Last_Updated_By
+ + + @changeLog.ZendeskTicketID + + @changeLog.Learner + + @changeLog.Provider + + @changeLog.LastUpdatedBy +
+ + @if (Model.ContainsMultiplePages) + { + + } + } +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddPathwayResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddPathwayResult.cshtml new file mode 100644 index 000000000..e38a37a65 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddPathwayResult.cshtml @@ -0,0 +1,41 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordAddPathwayResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

+ @string.Format(AdminViewChangeRecord.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ +

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddSpecialismResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddSpecialismResult.cshtml new file mode 100644 index 000000000..125173338 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordAddSpecialismResult.cshtml @@ -0,0 +1,41 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordAddSpecialismResultViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

+ @string.Format(AdminViewChangeRecord.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ +

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordCoreAssessment.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordCoreAssessment.cshtml new file mode 100644 index 000000000..2e161ed54 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordCoreAssessment.cshtml @@ -0,0 +1,33 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordCoreAssessmentViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordIP.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordIP.cshtml new file mode 100644 index 000000000..457680ee5 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordIP.cshtml @@ -0,0 +1,36 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordIndustryPlacementViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ @foreach (var rowItem in Model.GetIpSummaryDetailsList()) + { + + } +
+
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessment.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessment.cshtml new file mode 100644 index 000000000..4301da037 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveCoreAssessment.cshtml @@ -0,0 +1,33 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordRemoveCoreAssessmentViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessment.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessment.cshtml new file mode 100644 index 000000000..e80ad1544 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordRemoveSpecialismAssessment.cshtml @@ -0,0 +1,33 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordRemoveSpecialismAssessmentViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordSpecialismAssessment.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordSpecialismAssessment.cshtml new file mode 100644 index 000000000..cfeed1af5 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordSpecialismAssessment.cshtml @@ -0,0 +1,32 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordSpecialismAssessmentViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+ + + +
+
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordStartYear.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordStartYear.cshtml new file mode 100644 index 000000000..66fc2922f --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/AdminViewChangeRecordStartYear.cshtml @@ -0,0 +1,33 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordStartYearViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog + +@{ + ViewData["Title"] = AdminViewChangeRecord.Page_Title; +} + +@section NavigationBar { + +} + +
+
+ + + +
+

@AdminViewChangeRecord.Title_Change_Summary

+
+
+
@AdminViewChangeRecord.Title_Change
+
@AdminViewChangeRecord.Title_From
+
@AdminViewChangeRecord.Title_To
+
+
+ +
+
+ + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_searchKey.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_searchKey.cshtml new file mode 100644 index 000000000..628c2ceb8 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_searchKey.cshtml @@ -0,0 +1,18 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminSearchChangeLogCriteriaViewModel +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog +@using Sfa.Tl.ResultsAndCertification.Common.Helpers + + +
+

+ +

+ +
+ + +
+
+ \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordChangeRequestedDetails.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordChangeRequestedDetails.cshtml new file mode 100644 index 000000000..9756eaed2 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordChangeRequestedDetails.cshtml @@ -0,0 +1,35 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordViewModel +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog +@using Sfa.Tl.ResultsAndCertification.Common.Helpers + +

+ @AdminViewChangeRecord.Title_Who_Asked_For_This_Change +

+ +
+
+

@AdminViewChangeRecord.Label_Contact_Name

+

@Model.ChangeRequestedBy

+
+ +
+

@AdminViewChangeRecord.Label_Date_Of_Request

+

@Model.ChangeDateOfRequest

+
+ +
+

@AdminViewChangeRecord.Label_Reason_For_Change

+

@Model.ReasonForChange

+
+ +
+

@AdminViewChangeRecord.Label_Zendesk_Ticket_Id

+

@Model.ZendeskTicketID

+
+ +

+

+

+
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordLogDetails.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordLogDetails.cshtml new file mode 100644 index 000000000..a271dc105 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminChangeLog/Partials/_viewRecordLogDetails.cshtml @@ -0,0 +1,16 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog.AdminViewChangeRecordViewModel +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog +@using Sfa.Tl.ResultsAndCertification.Common.Helpers + +
+

+ @string.Format(AdminViewChangeRecord.Heading_Change_Record, @Model.DateAndTimeOfChange) +

+
+ +

@AdminViewChangeRecord.Title_Log_Details

+
+ + + +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml index 4e69ed79d..5278dc95e 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResult.cshtml @@ -16,6 +16,8 @@ + +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResultReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResultReviewChanges.cshtml new file mode 100644 index 000000000..8465a2b02 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangePathwayResultReviewChanges.cshtml @@ -0,0 +1,143 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminChangePathwayResultReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminChangePathwayResultReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + + + +
+

+ @AdminChangePathwayResultReviewChanges.Heading_Review_Changes_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminChangePathwayResultReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + +
+

+ @string.Format(AdminChangePathwayResultReviewChanges.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + +

+ @AdminChangePathwayResultReviewChanges.Heading_Change_Summary +

+
+
+
@AdminChangePathwayResultReviewChanges.Title_Change_Summary_Change_Text
+
@AdminChangePathwayResultReviewChanges.Title_Change_Summary_From_Text
+
@AdminChangePathwayResultReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminChangePathwayResultReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + + +
+
+ + +
+ + +
+
+
+ +
+ + @AdminChangePathwayResultReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml index 59814696a..726945e46 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResult.cshtml @@ -16,6 +16,8 @@ + +
diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResultReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResultReviewChanges.cshtml new file mode 100644 index 000000000..217fe3ded --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminDashboard/AdminChangeSpecialismResultReviewChanges.cshtml @@ -0,0 +1,144 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result.AdminChangeSpecialismResultReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard + +@{ + ViewData["Title"] = AdminChangeSpecialismResultReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + + + +
+

+ @AdminChangeSpecialismResultReviewChanges.Heading_Review_Changes_Assessment_Result +

+
+ + + + + + + + + + +
+

+ @AdminChangeSpecialismResultReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminChangeSpecialismResultReviewChanges.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + +

+ @AdminChangeSpecialismResultReviewChanges.Heading_Change_Summary +

+
+
+
@AdminChangeSpecialismResultReviewChanges.Title_Change_Summary_Change_Text
+
@AdminChangeSpecialismResultReviewChanges.Title_Change_Summary_From_Text
+
@AdminChangeSpecialismResultReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminChangeSpecialismResultReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + + +
+
+ + +
+ + +
+
+
+ +
+ + @AdminChangeSpecialismResultReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddCoreRommOutcome.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddCoreRommOutcome.cshtml new file mode 100644 index 000000000..1ceda4978 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddCoreRommOutcome.cshtml @@ -0,0 +1,117 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminAddCoreRommOutcomeViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminAddCoreRommOutcome.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminAddCoreRommOutcome.Heading_Add_A_Romm_Outcome +

+
+ + + + + + + + + + +
+

+ @AdminAddCoreRommOutcome.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddCoreRommOutcome.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + + @if (Model.IsValid) + { + +
+
+ +

+ @AdminAddCoreRommOutcome.Heading_What_Was_The_Romm_Outcome +

+
+ +
+ +
+ + +
+
+ + +
+
+ +
+
+ + +
+ + @AdminAddCoreRommOutcome.Button_Cancel +
+ } + else + { + +
+

@AdminAddCoreRommOutcome.Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner

+

@Model.ErrorMessage

+ + +
+ } + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.cshtml new file mode 100644 index 000000000..ab2815274 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeCore.cshtml @@ -0,0 +1,102 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminAddRommOutcomeChangeGradeCoreViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminAddRommOutcomeChangeGradeCore.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + +
+

+ @AdminAddRommOutcomeChangeGradeCore.Heading_Change_Result_After_ROMM +

+
+ + + + + + + + + + +
+

+ @AdminAddRommOutcomeChangeGradeCore.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddRommOutcomeChangeGradeCore.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminAddRommOutcomeChangeGradeCore.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; + +
+ + +
+ } + + +
+
+ + +
+ + @AdminAddRommOutcomeChangeGradeCore.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.cshtml new file mode 100644 index 000000000..3cb94bd0d --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddRommOutcomeChangeGradeSpecialism.cshtml @@ -0,0 +1,102 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminAddRommOutcomeChangeGradeSpecialismViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminAddRommOutcomeChangeGradeSpecialism.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + + +
+

+ @AdminAddRommOutcomeChangeGradeSpecialism.Heading_Change_Result_After_ROMM +

+
+ + + + + + + + + + +
+

+ @AdminAddRommOutcomeChangeGradeSpecialism.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddRommOutcomeChangeGradeSpecialism.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + + +
+
+ +

+ @AdminAddRommOutcomeChangeGradeSpecialism.Heading_Select_Grade +

+
+ + + @foreach (var grade in Model?.Grades?.Select((value, i) => (value, i))) + { + + var elementId = (grade.i > 0) ? "selectedgradeid-" + grade.i : "selectedgradeid"; + +
+ + +
+ } + + +
+
+ + +
+ + @AdminAddRommOutcomeChangeGradeSpecialism.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddSpecialismRommOutcome.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddSpecialismRommOutcome.cshtml new file mode 100644 index 000000000..3dc4492ac --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminAddSpecialismRommOutcome.cshtml @@ -0,0 +1,117 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminAddSpecialismRommOutcomeViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminAddCoreRommOutcome.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminAddCoreRommOutcome.Heading_Add_A_Romm_Outcome +

+
+ + + + + + + + + + +
+

+ @AdminAddCoreRommOutcome.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminAddSpecialismRommOutcome.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + + @if (Model.IsValid) + { + +
+
+ +

+ @AdminAddCoreRommOutcome.Heading_What_Was_The_Romm_Outcome +

+
+ +
+ +
+ + +
+
+ + +
+
+ +
+
+ + +
+ + @AdminAddSpecialismRommOutcome.Button_Cancel +
+ } + else + { + +
+

@AdminAddCoreRommOutcome.Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner

+

@Model.ErrorMessage

+ + +
+ } + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRomm.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRomm.cshtml new file mode 100644 index 000000000..fdccec155 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRomm.cshtml @@ -0,0 +1,117 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminOpenPathwayRommViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminOpenPathwayRomm.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminOpenPathwayRomm.Heading_Open_A_Romm +

+
+ + + + + + + + + + +
+

+ @AdminOpenPathwayRomm.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminOpenPathwayRomm.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + + @if (Model.IsValid) + { + +
+
+ +

+ @AdminOpenPathwayRomm.Heading_Do_You_Want_To_Open_A_Romm +

+
+ +
+ +
+ + +
+
+ + +
+
+ +
+
+ + +
+ + @AdminOpenPathwayRomm.Button_Cancel +
+ } + else + { + +
+

@AdminOpenPathwayRomm.Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner

+

@Model.ErrorMessage

+ + +
+ } + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRommReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRommReviewChanges.cshtml new file mode 100644 index 000000000..73bdb4e21 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenPathwayRommReviewChanges.cshtml @@ -0,0 +1,145 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminOpenPathwayRommReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminOpenPathwayRommReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminOpenPathwayRommReviewChanges.Heading_Review_Changes_Romm +

+
+ + + + + + + + + + +
+

+ @AdminOpenPathwayRommReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + +
+

+ @string.Format(AdminOpenPathwayRommReviewChanges.Core_Heading_Text, Model.PathwayName) +

+
+ + +
+
+ + +

+ @AdminOpenPathwayRommReviewChanges.Heading_Change_Summary +

+
+
+
@AdminOpenPathwayRommReviewChanges.Title_Change_Summary_Change_Text
+
@AdminOpenPathwayRommReviewChanges.Title_Change_Summary_From_Text
+
@AdminOpenPathwayRommReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminOpenPathwayRommReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + +
+ +
+
+ + +
+ + +
+
+
+ +
+ + @AdminOpenPathwayRommReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRomm.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRomm.cshtml new file mode 100644 index 000000000..ae704cf90 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRomm.cshtml @@ -0,0 +1,116 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminOpenSpecialismRommViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminOpenSpecialismRomm.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminOpenSpecialismRomm.Heading_Open_A_Romm +

+
+ + + + + + + + + + +
+

+ @AdminOpenSpecialismRomm.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminOpenSpecialismRomm.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + @if (Model.IsValid) + { + +
+
+ +

+ @AdminOpenSpecialismRomm.Heading_Do_You_Want_To_Open_A_Romm +

+
+ +
+ +
+ + +
+
+ + +
+
+ +
+
+ + +
+ + @AdminOpenSpecialismRomm.Button_Cancel +
+ } + else + { + +
+

@AdminOpenSpecialismRomm.Warning_Header_You_Cannot_Open_A_Romm_For_This_Learner

+

@Model.ErrorMessage

+ + +
+ } + +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRommReviewChanges.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRommReviewChanges.cshtml new file mode 100644 index 000000000..56d48d4b0 --- /dev/null +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/AdminPostResults/AdminOpenSpecialismRommReviewChanges.cshtml @@ -0,0 +1,146 @@ +@model Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults.AdminOpenSpecialismRommReviewChangesViewModel +@using Sfa.Tl.ResultsAndCertification.Common.Helpers +@using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults + +@{ + ViewData["Title"] = AdminOpenSpecialismRommReviewChanges.Page_Title; +} + +@section NavigationBar { + +} + +
+
+
+ + + + + + +
+

+ @AdminOpenSpecialismRommReviewChanges.Heading_Review_Changes_Romm +

+
+ + + + + + + + + + +
+

+ @AdminOpenSpecialismRommReviewChanges.Heading_Personal_Details +

+ +
+ + + + + +
+
+ + + + + + +
+

+ @string.Format(AdminOpenSpecialismRommReviewChanges.Specialism_Heading_Text, Model.SpecialismName) +

+
+ + +
+
+ + +

+ @AdminOpenSpecialismRommReviewChanges.Heading_Change_Summary +

+
+
+
@AdminOpenSpecialismRommReviewChanges.Title_Change_Summary_Change_Text
+
@AdminOpenSpecialismRommReviewChanges.Title_Change_Summary_From_Text
+
@AdminOpenSpecialismRommReviewChanges.Title_Change_Summary_To_Text
+
+
+ +
+ + +
+
+ +

+ @AdminOpenSpecialismRommReviewChanges.Heading_Who_Has_Asked_For_This_Change +

+
+ + +
+ + +
+ + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + +
+ +
+
+ + +
+ + +
+
+
+ +
+ + @AdminOpenSpecialismRommReviewChanges.Button_Cancel +
+ +
+
\ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/Views/Dashboard/_adminDashboard.cshtml b/src/Sfa.Tl.ResultsAndCertification.Web/Views/Dashboard/_adminDashboard.cshtml index 437b726da..a28254cb8 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/Views/Dashboard/_adminDashboard.cshtml +++ b/src/Sfa.Tl.ResultsAndCertification.Web/Views/Dashboard/_adminDashboard.cshtml @@ -25,7 +25,7 @@
  • - @AdminDashboard.Tile_View_Change_Log + @AdminDashboard.Tile_View_Change_Log

    @AdminDashboard.Tile_View_Change_Log_View_Changes

    diff --git a/src/Sfa.Tl.ResultsAndCertification.Web/web.config b/src/Sfa.Tl.ResultsAndCertification.Web/web.config index 767eed424..dc20f2055 100644 --- a/src/Sfa.Tl.ResultsAndCertification.Web/web.config +++ b/src/Sfa.Tl.ResultsAndCertification.Web/web.config @@ -1,30 +1,25 @@  - - - - + + - - + - + - - - + \ No newline at end of file diff --git a/src/Sfa.Tl.ResultsAndCertification.sln b/src/Sfa.Tl.ResultsAndCertification.sln index e4c8100a2..8a902b745 100644 --- a/src/Sfa.Tl.ResultsAndCertification.sln +++ b/src/Sfa.Tl.ResultsAndCertification.sln @@ -43,7 +43,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sfa.Tl.ResultsAndCertificat EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sfa.Tl.ResultsAndCertification.Functions.UnitTests", "Tests\Sfa.Tl.ResultsAndCertification.Functions.UnitTests\Sfa.Tl.ResultsAndCertification.Functions.UnitTests.csproj", "{960FB856-86D0-4D4B-B38D-FAB5DC3DDF93}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sfa.Tl.ResultsAndCertification.Application.UnitTests", "Tests\Sfa.Tl.ResultsAndCertification.Application.UnitTests\Sfa.Tl.ResultsAndCertification.Application.UnitTests.csproj", "{7182B539-A781-4044-B44E-00E10566C915}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sfa.Tl.ResultsAndCertification.Application.UnitTests", "Tests\Sfa.Tl.ResultsAndCertification.Application.UnitTests\Sfa.Tl.ResultsAndCertification.Application.UnitTests.csproj", "{7182B539-A781-4044-B44E-00E10566C915}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminSearchLearnerDetails_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminSearchLearnerDetails_Called.cs index c6cb1053b..55691f5f7 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminSearchLearnerDetails_Called.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_GetAdminSearchLearnerDetails_Called.cs @@ -26,7 +26,7 @@ public class When_GetAdminSearchLearnerDetails_Called : BaseTest(_mockHttpResult, ApiConstants.ProcessAdminAddPathwayResult, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminAddPathwayResultUri, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); } diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs index ac515a677..19edef7dd 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminAddSpecialismResult_Called.cs @@ -49,7 +49,7 @@ public override void Setup() public override void Given() { - HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminAddSpecialismResult, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminAddSpecialismResultUri, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); } diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenPathwayRomm_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenPathwayRomm_Called.cs new file mode 100644 index 000000000..406fa7c98 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenPathwayRomm_Called.cs @@ -0,0 +1,66 @@ +using FluentAssertions; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Clients; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests.Clients.ResultsAndCertificationInternalApiClientTest +{ + public class When_ProcessAdminOpenPathwayRomm_Called : BaseTest + { + private ITokenServiceClient _tokenServiceClient; + private ResultsAndCertificationConfiguration _configuration; + private ResultsAndCertificationInternalApiClient _apiClient; + private readonly bool _mockHttpResult = true; + + private OpenPathwayRommRequest _model; + private bool _result; + + public override void Setup() + { + _tokenServiceClient = Substitute.For(); + + _configuration = new ResultsAndCertificationConfiguration + { + ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://tlevel.api.com" } + }; + + _model = new OpenPathwayRommRequest + { + RegistrationPathwayId = 1, + PathwayResultId = 1, + ContactName = "contact-name", + DateOfRequest = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskTicketId = "987654321", + CreatedBy = "created-by" + }; + } + + public override void Given() + { + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminOpenPathwayRomm, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); + _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); + } + + public async override Task When() + { + _result = await _apiClient.ProcessAdminOpenPathwayRommAsync(_model); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().Be(_mockHttpResult); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenSpecialismRomm_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenSpecialismRomm_Called.cs new file mode 100644 index 000000000..022bdb9bc --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_ProcessAdminOpenSpecialismRomm_Called.cs @@ -0,0 +1,66 @@ +using FluentAssertions; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Clients; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests.Clients.ResultsAndCertificationInternalApiClientTest +{ + public class When_ProcessAdminOpenSpecialismRomm_Called : BaseTest + { + private ITokenServiceClient _tokenServiceClient; + private ResultsAndCertificationConfiguration _configuration; + private ResultsAndCertificationInternalApiClient _apiClient; + private readonly bool _mockHttpResult = true; + + private OpenSpecialismRommRequest _model; + private bool _result; + + public override void Setup() + { + _tokenServiceClient = Substitute.For(); + + _configuration = new ResultsAndCertificationConfiguration + { + ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://tlevel.api.com" } + }; + + _model = new OpenSpecialismRommRequest + { + RegistrationPathwayId = 1, + SpecialismResultId = 10, + ContactName = "contact-name", + DateOfRequest = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskTicketId = "987654321", + CreatedBy = "created-by" + }; + } + + public override void Given() + { + HttpClient = new HttpClient(new MockHttpMessageHandler(_mockHttpResult, ApiConstants.ProcessAdminOpenSpecialismRomm, HttpStatusCode.OK, JsonConvert.SerializeObject(_model))); + _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); + } + + public async override Task When() + { + _result = await _apiClient.ProcessAdminOpenSpecialismRommAsync(_model); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().Be(_mockHttpResult); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_SearchChangeLogs_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_SearchChangeLogs_Called.cs new file mode 100644 index 000000000..1ba878b9f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests/Clients/ResultsAndCertificationInternalApiClientTest/When_SearchChangeLogs_Called.cs @@ -0,0 +1,79 @@ +using FluentAssertions; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Clients; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Api.Client.UnitTests.Clients.ResultsAndCertificationInternalApiClientTest +{ + public class When_SearchChangeLogs_Called : BaseTest + { + private PagedResponse _actualResult; + private PagedResponse _mockApiResponse; + + private ITokenServiceClient _tokenServiceClient; + private ResultsAndCertificationConfiguration _configuration; + private ResultsAndCertificationInternalApiClient _apiClient; + + private readonly AdminSearchChangeLogRequest _apiRequest = new() { SearchKey = "Johnson" }; + + public override void Setup() + { + _tokenServiceClient = Substitute.For(); + _configuration = new ResultsAndCertificationConfiguration + { + ResultsAndCertificationInternalApiSettings = new ResultsAndCertificationInternalApiSettings { Uri = "http://tlevel.api.com" } + }; + + _mockApiResponse = new PagedResponse + { + TotalRecords = 150, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + DateAndTimeOfChange = new DateTime(2024, 1, 1), + ZendeskTicketID = "1234567-AB", + LearnerFirstname = "Jessica", + LearnerLastname = "Johnson", + Uln = 1234567890, + ProviderName = "Barnsley College", + ProviderUkprn = 10000536, + LastUpdatedBy = "admin-user-01" + } + }, + PagerInfo = new Pager(1, 1, 10) + }; + } + + public override void Given() + { + HttpClient = new HttpClient(new MockHttpMessageHandler>(_mockApiResponse, ApiConstants.SearchChangeLogsUri, HttpStatusCode.OK, JsonConvert.SerializeObject(_apiRequest))); + _apiClient = new ResultsAndCertificationInternalApiClient(HttpClient, _tokenServiceClient, _configuration); + } + + public async override Task When() + { + _actualResult = await _apiClient.SearchChangeLogsAsync(_apiRequest); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _actualResult.Should().NotBeNull(); + _actualResult.Should().BeEquivalentTo(_mockApiResponse); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/AdminChangeLogServiceBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/AdminChangeLogServiceBaseTest.cs new file mode 100644 index 000000000..a77542bc0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/AdminChangeLogServiceBaseTest.cs @@ -0,0 +1,30 @@ +using AutoMapper; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Application.Mappers; +using Sfa.Tl.ResultsAndCertification.Application.Services; +using Sfa.Tl.ResultsAndCertification.Data.Interfaces; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminChangeLogServiceTests +{ + public abstract class AdminChangeLogServiceBaseTest : BaseTest + { + protected IAdminChangeLogRepository AdminChangeLogRepository; + protected AdminChangeLogService AdminChangeLogService; + protected IMapper Mapper; + + public override void Setup() + { + Mapper = CreateMapper(); + + AdminChangeLogRepository = Substitute.For(); + AdminChangeLogService = new AdminChangeLogService(AdminChangeLogRepository, Mapper); + } + + private static AutoMapper.Mapper CreateMapper() + { + var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(ChangeLogMapper).Assembly)); + return new AutoMapper.Mapper(mapperConfig); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_GetChangeLogRecordAsync_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_GetChangeLogRecordAsync_IsCalled.cs new file mode 100644 index 000000000..8a17e90e8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_GetChangeLogRecordAsync_IsCalled.cs @@ -0,0 +1,99 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminChangeLogServiceTests +{ + public class When_GetChangeLogRecordAsync_IsCalled : AdminChangeLogServiceBaseTest + { + ChangeLog _expectedResult; + AdminChangeLogRecord _actualResult; + + public override void Given() + { + TqRegistrationPathway _tqRegistrationPathway = new() + { + Id = 1, + TqRegistrationProfileId = 1, + TqRegistrationProfile = new() + { + Id = 1, + UniqueLearnerNumber = 1234567890, + Firstname = "John", + Lastname = "Wayne" + }, + TqPathwayAssessments = new List() + { + new TqPathwayAssessment() { + AssessmentSeries = new AssessmentSeries(){ + Id = 1, + ComponentType = ComponentType.Core, + Name="Summer 2023" + }, + IsOptedin = true, + TqRegistrationPathwayId = 1, + AssessmentSeriesId = 1 + } + }, + TqRegistrationSpecialisms = new List() + { + new TqRegistrationSpecialism() + { + TqSpecialismAssessments = new List() + { + new TqSpecialismAssessment() + { + TqSpecialismResults = new List() + { + new TqSpecialismResult() + { + Id = 1, + TqSpecialismAssessmentId = 1, + TlLookupId = 1, + } + }, + AssessmentSeries = new AssessmentSeries() + { + Id = 1, + ComponentType = ComponentType.Specialism, + Name = "Summer 2024" + } + } + } + } + } + }; + + _expectedResult = new ChangeLog() + { + TqRegistrationPathwayId = 1, + ChangeType = ChangeType.StartYear, + Details = "{\"StartYearFrom\":2023,\"StartYearTo\":2021}", + Name = "Martin Guptill", + DateOfRequest = new DateTime(2024, 01, 01), + ReasonForChange = "Change reason details", + ZendeskTicketID = "1234567890", + TqRegistrationPathway = _tqRegistrationPathway + }; + + AdminChangeLogRepository.GetChangeLogRecordAsync(Arg.Any()).Returns(_expectedResult); + } + + public override async Task When() + { + _actualResult = await AdminChangeLogService.GetChangeLogRecordAsync(_expectedResult.Id); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _actualResult.Should().NotBeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_SearchChangeLogs_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_SearchChangeLogs_IsCalled.cs new file mode 100644 index 000000000..1f64b12b0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Application.UnitTests/Services/AdminChangeLogServiceTests/When_SearchChangeLogs_IsCalled.cs @@ -0,0 +1,57 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Application.UnitTests.Services.AdminChangeLogServiceTests +{ + public class When_SearchChangeLogs_IsCalled : AdminChangeLogServiceBaseTest + { + private PagedResponse _expectedResult; + private PagedResponse _actualResult; + + private const string Surname = "Johnson"; + + public override void Given() + { + _expectedResult = new PagedResponse + { + TotalRecords = 150, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + DateAndTimeOfChange = new DateTime(2024, 1, 1), + ZendeskTicketID = "1234567-AB", + LearnerFirstname = "Jessica", + LearnerLastname = Surname, + Uln = 1234567890, + ProviderName = "Barnsley College", + ProviderUkprn = 10000536, + LastUpdatedBy = "admin-user-01" + } + }, + PagerInfo = new Pager(1, 1, 10) + }; + + AdminChangeLogRepository.SearchChangeLogsAsync(Arg.Is(r => r.SearchKey == Surname)).Returns(_expectedResult); + } + + public override async Task When() + { + var request = new AdminSearchChangeLogRequest { SearchKey = Surname }; + _actualResult = await AdminChangeLogService.SearchChangeLogsAsync(request); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _actualResult.Should().BeEquivalentTo(_expectedResult); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminChangeLogRepositoryTests/When_SearchChangeLogsAsync_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminChangeLogRepositoryTests/When_SearchChangeLogsAsync_IsCalled.cs new file mode 100644 index 000000000..8a184842e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminChangeLogRepositoryTests/When_SearchChangeLogsAsync_IsCalled.cs @@ -0,0 +1,385 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Data.Repositories; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Tests.Common.DataProvider; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Repositories.AdminChangeLogRepositoryTests +{ + public class When_SearchChangeLogsAsync_IsCalled : BaseTest + { + private AdminChangeLogRepository _adminchangeLogRepository; + private PagedResponse _actualResult; + + public override void Given() + { + SeedLearnerRegistrations(); + _adminchangeLogRepository = new AdminChangeLogRepository(DbContext); + } + + public override Task When() + { + return Task.CompletedTask; + } + + public async Task WhenAsync(AdminSearchChangeLogRequest request) + { + _actualResult = await _adminchangeLogRepository.SearchChangeLogsAsync(request); + } + + [Theory] + [MemberData(nameof(Data))] + public async Task Then_Returns_Expected_Results(AdminSearchChangeLogRequest request, PagedResponse expected) + { + await WhenAsync(request); + + _actualResult.TotalRecords.Should().Be(expected.TotalRecords); + _actualResult.PagerInfo.Should().BeEquivalentTo(expected.PagerInfo); + _actualResult.Records.Should().BeEquivalentTo(expected.Records); + } + + public static IEnumerable Data + { + get + { + return new[] + { + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = string.Empty + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + ChangeType = ChangeType.StartYear, + DateAndTimeOfChange = new DateTime(2024, 1, 1), + LearnerFirstname = "John", + LearnerLastname = "Smith", + Uln = 1100000000, + ProviderName = "pearson-provider-01", + ProviderUkprn = 1, + ZendeskTicketID = "zendesk-ticket-01", + LastUpdatedBy = "admin-user-01" + }, + new AdminSearchChangeLog + { + ChangeLogId = 2, + ChangeType = ChangeType.IndustryPlacement, + DateAndTimeOfChange = new DateTime(2024, 3, 1), + LearnerFirstname = "Jessica", + LearnerLastname = "Johnson", + Uln = 1200000000, + ProviderName = "pearson-provider-01", + ProviderUkprn = 1, + ZendeskTicketID = "zendesk-ticket-02", + LastUpdatedBy = "admin-user-02" + }, + new AdminSearchChangeLog + { + ChangeLogId = 3, + ChangeType = ChangeType.AddPathwayResult, + DateAndTimeOfChange = new DateTime(2022, 12, 31), + LearnerFirstname = "Peter", + LearnerLastname = "Smith", + Uln = 2100000000, + ProviderName = "pearson-provider-02", + ProviderUkprn = 2, + ZendeskTicketID = "zendesk-ticket-03", + LastUpdatedBy = "admin-user-03" + }, + new AdminSearchChangeLog + { + ChangeLogId = 4, + ChangeType = ChangeType.AddPathwayAssessment, + DateAndTimeOfChange = new DateTime(2020, 6, 15), + LearnerFirstname = "Eric", + LearnerLastname = "Johnson", + Uln = 3100000000, + ProviderName = "ncfe-provider-01", + ProviderUkprn = 3, + ZendeskTicketID = "zendesk-ticket-04", + LastUpdatedBy = "admin-user-04" + }, + new AdminSearchChangeLog + { + ChangeLogId = 5, + ChangeType = ChangeType.AddSpecialismResult, + DateAndTimeOfChange = new DateTime(2024, 4, 6), + LearnerFirstname = "Sue", + LearnerLastname = "Baker", + Uln = 3200000000, + ProviderName = "ncfe-provider-01", + ProviderUkprn = 3, + ZendeskTicketID = "1200000000", + LastUpdatedBy = "admin-user-05" + } + }, + PagerInfo = new Pager(5, 0, 10) + } + }, + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = "non-existing-key" + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List(), + PagerInfo = new Pager(0, 0, 10) + } + }, + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = "1100000000" + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + ChangeType = ChangeType.StartYear, + DateAndTimeOfChange = new DateTime(2024, 1, 1), + LearnerFirstname = "John", + LearnerLastname = "Smith", + Uln = 1100000000, + ProviderName = "pearson-provider-01", + ProviderUkprn = 1, + ZendeskTicketID = "zendesk-ticket-01", + LastUpdatedBy = "admin-user-01" + } + }, + PagerInfo = new Pager(1, 0, 10) + } + }, + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = "smith" + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + ChangeType = ChangeType.StartYear, + DateAndTimeOfChange = new DateTime(2024, 1, 1), + LearnerFirstname = "John", + LearnerLastname = "Smith", + Uln = 1100000000, + ProviderName = "pearson-provider-01", + ProviderUkprn = 1, + ZendeskTicketID = "zendesk-ticket-01", + LastUpdatedBy = "admin-user-01" + }, + new AdminSearchChangeLog + { + ChangeLogId = 3, + ChangeType = ChangeType.AddPathwayResult, + DateAndTimeOfChange = new DateTime(2022, 12, 31), + LearnerFirstname = "Peter", + LearnerLastname = "Smith", + Uln = 2100000000, + ProviderName = "pearson-provider-02", + ProviderUkprn = 2, + ZendeskTicketID = "zendesk-ticket-03", + LastUpdatedBy = "admin-user-03" + } + }, + PagerInfo = new Pager(2, 0, 10) + } + }, + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = "zendesk-ticket-04" + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 4, + ChangeType = ChangeType.AddPathwayAssessment, + DateAndTimeOfChange = new DateTime(2020, 6, 15), + LearnerFirstname = "Eric", + LearnerLastname = "Johnson", + Uln = 3100000000, + ProviderName = "ncfe-provider-01", + ProviderUkprn = 3, + ZendeskTicketID = "zendesk-ticket-04", + LastUpdatedBy = "admin-user-04" + } + }, + PagerInfo = new Pager(1, 0, 10) + } + }, + new object[] + { + new AdminSearchChangeLogRequest + { + SearchKey = "1200000000" + }, + new PagedResponse + { + TotalRecords = 5, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 2, + ChangeType = ChangeType.IndustryPlacement, + DateAndTimeOfChange = new DateTime(2024, 3, 1), + LearnerFirstname = "Jessica", + LearnerLastname = "Johnson", + Uln = 1200000000, + ProviderName = "pearson-provider-01", + ProviderUkprn = 1, + ZendeskTicketID = "zendesk-ticket-02", + LastUpdatedBy = "admin-user-02" + }, + new AdminSearchChangeLog + { + ChangeLogId = 5, + ChangeType = ChangeType.AddSpecialismResult, + DateAndTimeOfChange = new DateTime(2024, 4, 6), + LearnerFirstname = "Sue", + LearnerLastname = "Baker", + Uln = 3200000000, + ProviderName = "ncfe-provider-01", + ProviderUkprn = 3, + ZendeskTicketID = "1200000000", + LastUpdatedBy = "admin-user-05" + } + }, + PagerInfo = new Pager(2, 0, 10) + } + } + }; + } + } + + private void SeedLearnerRegistrations() + { + TqAwardingOrganisation pearson = SeedAwardingOrganisation(EnumAwardingOrganisation.Pearson); + + TqProvider pearsonProviderOne = SeedProvider(pearson, 1, "pearson-provider-01"); + TqProvider pearsonProviderTwo = SeedProvider(pearson, 2, "pearson-provider-02"); + + TqRegistrationProfile pearsonProviderOneLearnerOne = SeedRegistrationProfile(1100000000, "John", "Smith", new DateTime(2000, 1, 1)); + TqRegistrationPathway pearsonProviderOneLearnerOneRegPathway = SeedRegistrationPathway(pearsonProviderOneLearnerOne, pearsonProviderOne, 2020, RegistrationPathwayStatus.Active); + SeedChangeLog(pearsonProviderOneLearnerOneRegPathway, ChangeType.StartYear, "admin-user-01", new DateTime(2024, 1, 1), "zendesk-ticket-01"); + + TqRegistrationProfile pearsonProviderOneLearnerTwo = SeedRegistrationProfile(1200000000, "Jessica", "Johnson", new DateTime(2002, 5, 17)); + TqRegistrationPathway pearsonProviderOneLearnerTwoRegPathway = SeedRegistrationPathway(pearsonProviderOneLearnerTwo, pearsonProviderOne, 2021, RegistrationPathwayStatus.Withdrawn); + SeedChangeLog(pearsonProviderOneLearnerTwoRegPathway, ChangeType.IndustryPlacement, "admin-user-02", new DateTime(2024, 3, 1), "zendesk-ticket-02"); + + TqRegistrationProfile pearsonProviderTwoLearnerOne = SeedRegistrationProfile(2100000000, "Peter", "Smith", new DateTime(1999, 8, 6)); + TqRegistrationPathway pearsonProviderTwoLearnerOneRegPathway = SeedRegistrationPathway(pearsonProviderTwoLearnerOne, pearsonProviderTwo, 2022, RegistrationPathwayStatus.Active); + SeedChangeLog(pearsonProviderTwoLearnerOneRegPathway, ChangeType.AddPathwayResult, "admin-user-03", new DateTime(2022, 12, 31), "zendesk-ticket-03"); + + TqAwardingOrganisation ncfe = SeedAwardingOrganisation(EnumAwardingOrganisation.Ncfe); + TqProvider ncfeProviderOne = SeedProvider(ncfe, 3, "ncfe-provider-01"); + + TqRegistrationProfile ncfeProviderOneLearnerOne = SeedRegistrationProfile(3100000000, "Eric", "Johnson", new DateTime(2003, 3, 1)); + TqRegistrationPathway ncfeProviderOneLearnerOneRegPathway = SeedRegistrationPathway(ncfeProviderOneLearnerOne, ncfeProviderOne, 2021, RegistrationPathwayStatus.Withdrawn); + SeedChangeLog(ncfeProviderOneLearnerOneRegPathway, ChangeType.AddPathwayAssessment, "admin-user-04", new DateTime(2020, 6, 15), "zendesk-ticket-04"); + + TqRegistrationProfile ncfeProviderOneLearnerTwo = SeedRegistrationProfile(3200000000, "Sue", "Baker", new DateTime(2005, 11, 30)); + TqRegistrationPathway ncfeProviderOneLearnerTwoRegPathway = SeedRegistrationPathway(ncfeProviderOneLearnerTwo, ncfeProviderOne, 2023, RegistrationPathwayStatus.Active); + SeedChangeLog(ncfeProviderOneLearnerTwoRegPathway, ChangeType.AddSpecialismResult, "admin-user-05", new DateTime(2024, 4, 6), "1200000000"); + + DbContext.SaveChanges(); + } + + private TqAwardingOrganisation SeedAwardingOrganisation(EnumAwardingOrganisation awardingOrganisation) + { + TlAwardingOrganisation tlAwardingOrganisation = TlevelDataProvider.CreateTlAwardingOrganisation(DbContext, awardingOrganisation); + TlRoute route = TlevelDataProvider.CreateTlRoute(DbContext, awardingOrganisation); + TlPathway pathway = TlevelDataProvider.CreateTlPathway(DbContext, awardingOrganisation, route); + TqAwardingOrganisation tqAwardingOrganisation = TlevelDataProvider.CreateTqAwardingOrganisation(DbContext, pathway, tlAwardingOrganisation); + + return tqAwardingOrganisation; + } + + private TqProvider SeedProvider(TqAwardingOrganisation tqAwardingOrganisation, long providerUkprn, string providerName) + { + var tlProvider = ProviderDataProvider.CreateTlProvider(DbContext, providerUkprn, providerName, providerName); + var tqProvider = ProviderDataProvider.CreateTqProvider(DbContext, tqAwardingOrganisation, tlProvider); + + return tqProvider; + } + + private TqRegistrationProfile SeedRegistrationProfile(long uln, string firstName, string lastName, DateTime dob) + { + var tqRegistrationProfile = new TqRegistrationProfile + { + UniqueLearnerNumber = uln, + Firstname = firstName, + Lastname = lastName, + DateofBirth = dob + }; + + return RegistrationsDataProvider.CreateTqRegistrationProfile(DbContext, tqRegistrationProfile); + } + + private TqRegistrationPathway SeedRegistrationPathway(TqRegistrationProfile tqRegistrationProfile, TqProvider tqProvider, int academicYear, RegistrationPathwayStatus status) + { + var tqRegistrationPathway = new TqRegistrationPathway + { + TqRegistrationProfileId = tqRegistrationProfile.Id, + TqProviderId = tqProvider.Id, + AcademicYear = academicYear, + StartDate = new DateTime(2020, 1, 1), + EndDate = null, + Status = status + }; + + return RegistrationsDataProvider.CreateTqRegistrationPathway(DbContext, tqRegistrationPathway); + } + + private void SeedChangeLog(TqRegistrationPathway registrationPathway, ChangeType changeType, string name, DateTime createdOn, string zendeskTicketID) + { + var changeLog = new ChangeLog + { + TqRegistrationPathwayId = registrationPathway.Id, + ChangeType = changeType, + Details = string.Empty, + Name = name, + CreatedOn = createdOn, + ReasonForChange = string.Empty, + ZendeskTicketID = zendeskTicketID, + TqRegistrationPathway = registrationPathway + }; + + DbContext.Add(changeLog); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminDashboardRepositoryTests/When_SearchLearnerDetailsAsync_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminDashboardRepositoryTests/When_SearchLearnerDetailsAsync_IsCalled.cs index 047f1f1da..0eca487d3 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminDashboardRepositoryTests/When_SearchLearnerDetailsAsync_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Repositories/AdminDashboardRepositoryTests/When_SearchLearnerDetailsAsync_IsCalled.cs @@ -1,6 +1,5 @@ using FluentAssertions; using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; @@ -22,6 +21,7 @@ public class When_SearchLearnerDetailsAsync_IsCalled : BaseTest ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); - changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ChangeType.Should().Be(_request.ChangeType); changeLog.ReasonForChange.Should().Be(_request.ChangeReason); changeLog.DateOfRequest.Should().Be(_request.RequestDate); - changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id })); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id, _request.GradeTo })); changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); changeLog.Name.Should().Be(_request.ContactName); changeLog.CreatedBy.Should().Be(_request.CreatedBy); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs index 8977efa40..b9a93a52c 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddPathwayResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs @@ -42,13 +42,14 @@ public async Task Then_Should_Return_True() pathwayResult.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); pathwayResult.IsBulkUpload.Should().BeFalse(); pathwayResult.CreatedBy.Should().Be(_request.CreatedBy); + pathwayResult.CreatedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); - changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ChangeType.Should().Be(_request.ChangeType); changeLog.ReasonForChange.Should().Be(_request.ChangeReason); changeLog.DateOfRequest.Should().Be(_request.RequestDate); - changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id })); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = pathwayResult.Id, GradeTo = _request.GradeTo })); changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); changeLog.Name.Should().Be(_request.ContactName); changeLog.CreatedBy.Should().Be(_request.CreatedBy); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs index 826f6522f..89850f4e3 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Active_Learner.cs @@ -43,13 +43,14 @@ public async Task Then_Should_Return_True() specialismResult.EndDate.Should().BeNull(); specialismResult.IsBulkUpload.Should().BeFalse(); specialismResult.CreatedBy.Should().Be(_request.CreatedBy); + specialismResult.CreatedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); - changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ChangeType.Should().Be(_request.ChangeType); changeLog.ReasonForChange.Should().Be(_request.ChangeReason); changeLog.DateOfRequest.Should().Be(_request.RequestDate); - changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id })); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id, GradeTo = _request.GradeTo })); changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); changeLog.Name.Should().Be(_request.ContactName); changeLog.CreatedBy.Should().Be(_request.CreatedBy); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs index ecd6f5b25..4635d1922 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessAdminAddSpecialismResultTests/When_Assessment_Is_From_Withdrawn_Learner.cs @@ -43,13 +43,14 @@ public async Task Then_Should_Return_True() specialismResult.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); specialismResult.IsBulkUpload.Should().BeFalse(); specialismResult.CreatedBy.Should().Be(_request.CreatedBy); + specialismResult.CreatedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); - changeLog.ChangeType.Should().Be((int)_request.ChangeType); + changeLog.ChangeType.Should().Be(_request.ChangeType); changeLog.ReasonForChange.Should().Be(_request.ChangeReason); changeLog.DateOfRequest.Should().Be(_request.RequestDate); - changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id })); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = specialismResult.Id, GradeTo = _request.GradeTo })); changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); changeLog.Name.Should().Be(_request.ContactName); changeLog.CreatedBy.Should().Be(_request.CreatedBy); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/ProcessChangeIndustryPlacementTestsBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/ProcessChangeIndustryPlacementTestsBase.cs new file mode 100644 index 000000000..cb15f67b5 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/ProcessChangeIndustryPlacementTestsBase.cs @@ -0,0 +1,62 @@ +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; +using System; +using System.Linq; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessChangeIndustryPlacementTests +{ + public abstract class ProcessChangeIndustryPlacementTestsBase : AdminDashboardServiceBaseTest + { + protected static ReviewChangeIndustryPlacementRequest CreateRequest( + int registrationPathwayId, + IndustryPlacementStatus industryPlacementStatus, + int? hoursSpentOnPlacement = null, + params int?[] specialConsiderationReasonIds) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + IndustryPlacementStatus = industryPlacementStatus, + HoursSpentOnPlacement = hoursSpentOnPlacement, + SpecialConsiderationReasons = specialConsiderationReasonIds.Length > 0 ? specialConsiderationReasonIds.ToList() : null, + ContactName = "contact-name", + RequestDate = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskId = "1234567890", + CreatedBy = "created-by" + }; + } + + + protected int CreateAndSaveIndustryPlacement( + int registrationPathwayId, + IndustryPlacementStatus industryPlacementStatus, + int? hoursSpentOnPlacement = null, + params int?[] specialConsiderationReasonIds) + { + string details = industryPlacementStatus == IndustryPlacementStatus.CompletedWithSpecialConsideration + ? JsonConvert.SerializeObject(new IndustryPlacementDetails + { + IndustryPlacementStatus = industryPlacementStatus.ToString(), + HoursSpentOnPlacement = hoursSpentOnPlacement, + SpecialConsiderationReasons = specialConsiderationReasonIds.ToList() + }) + : null; + + var industryPlacement = new IndustryPlacement + { + TqRegistrationPathwayId = registrationPathwayId, + Status = industryPlacementStatus, + Details = details + }; + + DbContext.Add(industryPlacement); + DbContext.SaveChanges(); + + return industryPlacement.Id; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_Not_SpecialConsideration.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_Not_SpecialConsideration.cs new file mode 100644 index 000000000..26688d186 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_Not_SpecialConsideration.cs @@ -0,0 +1,62 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessChangeIndustryPlacementTests +{ + public class When_IndustryPlacement_Doesnt_Exist_And_Not_SpecialConsideration : ProcessChangeIndustryPlacementTestsBase + { + private const int RegistrationPathwayId = 1; + + private ReviewChangeIndustryPlacementRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, IndustryPlacementStatus.Completed); + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessChangeIndustryPlacementAsync(_request); + } + + [Fact] + public async void Then_Should_Save_Expected_And_Return_True() + { + _result.Should().BeTrue(); + + IndustryPlacement industryPlacement = await DbContext.IndustryPlacement.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId); + industryPlacement.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + industryPlacement.Status.Should().Be(_request.IndustryPlacementStatus); + industryPlacement.Details.Should().BeNull(); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId && p.ChangeType == _request.ChangeType); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + + var changeLogDetails = new ChangeIndustryPlacementRequest + { + IndustryPlacementStatusFrom = IndustryPlacementStatus.NotSpecified, + IndustryPlacementStatusTo = _request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = null, + HoursSpentOnPlacementTo = null, + SpecialConsiderationReasonsFrom = null, + SpecialConsiderationReasonsTo = null + }; + + changeLog.Details.Should().Be(JsonConvert.SerializeObject(changeLogDetails)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_SpecialConsideration.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_SpecialConsideration.cs new file mode 100644 index 000000000..d3a887a27 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Doesnt_Exist_And_SpecialConsideration.cs @@ -0,0 +1,71 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessChangeIndustryPlacementTests +{ + public class When_IndustryPlacement_Doesnt_Exist_And_SpecialConsiderations : ProcessChangeIndustryPlacementTestsBase + { + private const int RegistrationPathwayId = 1; + + private ReviewChangeIndustryPlacementRequest _request; + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, IndustryPlacementStatus.CompletedWithSpecialConsideration, 150, 1, 2, 3); + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessChangeIndustryPlacementAsync(_request); + } + + [Fact] + public async void Then_Should_Save_Expected_And_Return_True() + { + _result.Should().BeTrue(); + + IndustryPlacement industryPlacement = await DbContext.IndustryPlacement.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId); + industryPlacement.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + industryPlacement.Status.Should().Be(_request.IndustryPlacementStatus); + + var industryPlacementDetails = new IndustryPlacementDetails + { + IndustryPlacementStatus = _request.IndustryPlacementStatus.ToString(), + HoursSpentOnPlacement = _request.HoursSpentOnPlacement, + SpecialConsiderationReasons = _request.SpecialConsiderationReasons + }; + + industryPlacement.Details.Should().Be(JsonConvert.SerializeObject(industryPlacementDetails)); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId && p.ChangeType == _request.ChangeType); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + + var changeLogDetails = new ChangeIndustryPlacementRequest + { + IndustryPlacementStatusFrom = IndustryPlacementStatus.NotSpecified, + IndustryPlacementStatusTo = _request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = null, + HoursSpentOnPlacementTo = _request.HoursSpentOnPlacement, + SpecialConsiderationReasonsFrom = null, + SpecialConsiderationReasonsTo = _request.SpecialConsiderationReasons + }; + + changeLog.Details.Should().Be(JsonConvert.SerializeObject(changeLogDetails)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_Not_SpecialConsideration.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_Not_SpecialConsideration.cs new file mode 100644 index 000000000..99854ddfc --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_Not_SpecialConsideration.cs @@ -0,0 +1,66 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessChangeIndustryPlacementTests +{ + public class When_IndustryPlacement_Exist_And_Not_SpecialConsideration : ProcessChangeIndustryPlacementTestsBase + { + private const int RegistrationPathwayId = 1; + + private ReviewChangeIndustryPlacementRequest _request; + private bool _result; + + private int _industryPlacementId; + + public override void Given() + { + _industryPlacementId = CreateAndSaveIndustryPlacement(RegistrationPathwayId, IndustryPlacementStatus.NotCompleted); + _request = CreateRequest(RegistrationPathwayId, IndustryPlacementStatus.Completed); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessChangeIndustryPlacementAsync(_request); + } + + [Fact] + public async void Then_Should_Save_Expected_And_Return_True() + { + _result.Should().BeTrue(); + + IndustryPlacement industryPlacement = await DbContext.IndustryPlacement.SingleAsync(p => p.Id == _industryPlacementId); + industryPlacement.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + industryPlacement.Status.Should().Be(_request.IndustryPlacementStatus); + industryPlacement.Details.Should().BeNull(); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId && p.ChangeType == _request.ChangeType); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + + var changeLogDetails = new ChangeIndustryPlacementRequest + { + IndustryPlacementStatusFrom = IndustryPlacementStatus.NotCompleted, + IndustryPlacementStatusTo = _request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = null, + HoursSpentOnPlacementTo = null, + SpecialConsiderationReasonsFrom = null, + SpecialConsiderationReasonsTo = null + }; + + changeLog.Details.Should().Be(JsonConvert.SerializeObject(changeLogDetails)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_SpecialConsideration.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_SpecialConsideration.cs new file mode 100644 index 000000000..af0f33cad --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/ProcessChangeIndustryPlacementTests/When_IndustryPlacement_Exist_And_SpecialConsideration.cs @@ -0,0 +1,76 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests.ProcessChangeIndustryPlacementTests +{ + public class When_IndustryPlacement_Exist_And_SpecialConsideration : ProcessChangeIndustryPlacementTestsBase + { + private const int RegistrationPathwayId = 1; + + private ReviewChangeIndustryPlacementRequest _request; + private bool _result; + + private int _industryPlacementId; + + public override void Given() + { + _industryPlacementId = CreateAndSaveIndustryPlacement(RegistrationPathwayId, IndustryPlacementStatus.CompletedWithSpecialConsideration, 500, 1, 2, 3); + _request = CreateRequest(RegistrationPathwayId, IndustryPlacementStatus.CompletedWithSpecialConsideration, 999, 1, 4, 5, 6); + + CreateAdminDasboardService(); + } + + public override async Task When() + { + _result = await AdminDashboardService.ProcessChangeIndustryPlacementAsync(_request); + } + + [Fact] + public async void Then_Should_Save_Expected_And_Return_True() + { + _result.Should().BeTrue(); + + IndustryPlacement industryPlacement = await DbContext.IndustryPlacement.SingleAsync(p => p.Id == _industryPlacementId); + industryPlacement.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + industryPlacement.Status.Should().Be(_request.IndustryPlacementStatus); + + var industryPlacementDetails = new IndustryPlacementDetails + { + IndustryPlacementStatus = _request.IndustryPlacementStatus.ToString(), + HoursSpentOnPlacement = _request.HoursSpentOnPlacement, + SpecialConsiderationReasons = _request.SpecialConsiderationReasons + }; + + industryPlacement.Details.Should().Be(JsonConvert.SerializeObject(industryPlacementDetails)); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(p => p.TqRegistrationPathwayId == _request.RegistrationPathwayId && p.ChangeType == _request.ChangeType); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(_request.ChangeType); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.RequestDate); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + + var changeLogDetails = new ChangeIndustryPlacementRequest + { + IndustryPlacementStatusFrom = IndustryPlacementStatus.CompletedWithSpecialConsideration, + IndustryPlacementStatusTo = _request.IndustryPlacementStatus, + HoursSpentOnPlacementFrom = 500, + HoursSpentOnPlacementTo = _request.HoursSpentOnPlacement, + SpecialConsiderationReasonsFrom = new List { 1, 2, 3 }, + SpecialConsiderationReasonsTo = _request.SpecialConsiderationReasons + }; + + changeLog.Details.Should().Be(JsonConvert.SerializeObject(changeLogDetails)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs index 64a1c83ce..a5922d166 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveAssessmentEntry_IsCalled.cs @@ -1,14 +1,6 @@ using FluentAssertions; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; using Newtonsoft.Json; -using NSubstitute; -using Sfa.Tl.ResultsAndCertification.Application.Services; using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Common.Extensions; -using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; -using Sfa.Tl.ResultsAndCertification.Data.Interfaces; -using Sfa.Tl.ResultsAndCertification.Data.Repositories; using Sfa.Tl.ResultsAndCertification.Domain.Models; using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; @@ -23,7 +15,7 @@ namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboar public class When_ProcessRemoveAssessmentEntry_IsCalled : AdminDashboardServiceBaseTest { private Dictionary _ulns; - private ReviewRemoveAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; + private ReviewRemoveCoreAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; private List _registrations; private List _pathwayAssessments; @@ -92,7 +84,7 @@ public async Task WhenAsync() AssessmentId = assessment.Id; RegistrationPathwayId = assessment.TqRegistrationPathwayId; - ReviewRemoveAssessmentEntryRequest = new ReviewRemoveAssessmentEntryRequest + ReviewRemoveAssessmentEntryRequest = new ReviewRemoveCoreAssessmentEntryRequest { AssessmentId = AssessmentId, ComponentType = ComponentType.Core, @@ -130,7 +122,7 @@ public async Task Then_Expected_Results_Are_Returned() actualPathwayAssessment.ModifiedOn.Should().NotBeNull(); actualChangeLog.Should().NotBeNull(); - actualChangeLog.ChangeType.Should().Be((int)ReviewRemoveAssessmentEntryRequest.ChangeType); + actualChangeLog.ChangeType.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeType); actualChangeLog.Name.Should().Be(ReviewRemoveAssessmentEntryRequest.ContactName); actualChangeLog.CreatedBy.Should().Be(ReviewRemoveAssessmentEntryRequest.CreatedBy); actualChangeLog.ReasonForChange.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeReason); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs index 3c8f27b50..13766021f 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessRemoveSpecialismAssessmentEntry_IsCalled.cs @@ -15,7 +15,7 @@ namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboar public class When_ProcessRemoveSpecialismAssessmentEntry_IsCalled : AdminDashboardServiceBaseTest { private Dictionary _ulns; - private ReviewRemoveAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; + private ReviewRemoveSpecialismAssessmentEntryRequest ReviewRemoveAssessmentEntryRequest; private List _registrations; private List _specialismAssessments; @@ -90,7 +90,7 @@ public async Task WhenAsync() AssessmentId = specialismAssessment.Id; RegistrationPathwayId = specialismAssessment.TqRegistrationSpecialism.TqRegistrationPathwayId; - ReviewRemoveAssessmentEntryRequest = new ReviewRemoveAssessmentEntryRequest + ReviewRemoveAssessmentEntryRequest = new ReviewRemoveSpecialismAssessmentEntryRequest { AssessmentId = AssessmentId, ComponentType = ComponentType.Specialism, @@ -128,7 +128,7 @@ public async Task Then_Expected_Results_Are_Returned() actualPathwayAssessment.ModifiedOn.Should().NotBeNull(); actualChangeLog.Should().NotBeNull(); - actualChangeLog.ChangeType.Should().Be((int)ReviewRemoveAssessmentEntryRequest.ChangeType); + actualChangeLog.ChangeType.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeType); actualChangeLog.Name.Should().Be(ReviewRemoveAssessmentEntryRequest.ContactName); actualChangeLog.CreatedBy.Should().Be(ReviewRemoveAssessmentEntryRequest.CreatedBy); actualChangeLog.ReasonForChange.Should().Be(ReviewRemoveAssessmentEntryRequest.ChangeReason); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs deleted file mode 100644 index 695276609..000000000 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminDashboardServiceTests/When_ProcessReviewIndustryPlacement_IsCalled.cs +++ /dev/null @@ -1,176 +0,0 @@ -using FluentAssertions; -using Newtonsoft.Json; -using Sfa.Tl.ResultsAndCertification.Common.Enum; -using Sfa.Tl.ResultsAndCertification.Domain.Models; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; -using Sfa.Tl.ResultsAndCertification.Models.Contracts.IndustryPlacement; -using Sfa.Tl.ResultsAndCertification.Tests.Common.DataProvider; -using Sfa.Tl.ResultsAndCertification.Tests.Common.Enum; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Xunit; - -namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminDashboardServiceTests -{ - public class When_ProcessReviewIndustryPlacement_IsCalled : AdminDashboardServiceBaseTest - { - private Dictionary _ulns; - private List _industryPlacementDatas; - private IList _profiles; - - public override void Given() - { - // Registrations seed - SeedTestData(EnumAwardingOrganisation.Pearson, true); - - _ulns = new Dictionary - { - { 1111111111, RegistrationPathwayStatus.Active }, - { 1111111112, RegistrationPathwayStatus.Withdrawn }, - { 1111111113, RegistrationPathwayStatus.Active }, - { 1111111114, RegistrationPathwayStatus.Active }, - { 1111111115, RegistrationPathwayStatus.Active }, - { 1111111116, RegistrationPathwayStatus.Active }, - }; - - // Registrations seed - SeedTestData(EnumAwardingOrganisation.Pearson, true); - SeedSpecialConsiderationsLookupData(); - - _profiles = SeedRegistrationsData(_ulns, TqProvider); - - _industryPlacementDatas = new List - { - new IndustryPlacementData { Uln = 1111111111, IndustryPlacementStatus = IndustryPlacementStatus.NotCompleted, Details = null }, - new IndustryPlacementData { Uln = 1111111114, IndustryPlacementStatus = IndustryPlacementStatus.Completed, Details = null }, - new IndustryPlacementData { Uln = 1111111115, IndustryPlacementStatus = IndustryPlacementStatus.CompletedWithSpecialConsideration, Details = new IndustryPlacementDetails { HoursSpentOnPlacement = 100, SpecialConsiderationReasons = new List { 1, 2 } } }, - }; - - SeedIndustyPlacementData(_industryPlacementDatas); - - DbContext.SaveChanges(); - DetachAll(); - - CreateAdminDasboardService(); - } - - private bool _actualResult; - - public override Task When() - { - return Task.CompletedTask; - } - - public async Task WhenAsync(ReviewChangeIndustryPlacementRequest request) - { - _actualResult = await AdminDashboardService.ProcessChangeIndustryPlacementAsync(request); - } - - [Theory()] - [MemberData(nameof(Data))] - public async Task Then_Expected_Results_Are_Returned(ReviewChangeIndustryPlacementRequest request, bool expectedResponse) - { - await WhenAsync(request); - - if (expectedResponse == false) - { - _actualResult.Should().BeFalse(); - return; - } - - var actualIndustryPlacement = DbContext.IndustryPlacement.FirstOrDefault(ip => ip.Id == request.RegistrationPathwayId); - - request.RegistrationPathwayId.Should().Be(actualIndustryPlacement.Id); - if (request.ChangeIPDetails.IndustryPlacementStatusTo == IndustryPlacementStatus.Completed || request.ChangeIPDetails.IndustryPlacementStatusTo == IndustryPlacementStatus.NotCompleted) - { - actualIndustryPlacement.Details.Should().BeNull(); - } - request.ChangeIPDetails.IndustryPlacementStatusTo.ToString().Should().Be(actualIndustryPlacement.Status.ToString()); - - if (actualIndustryPlacement.Status == IndustryPlacementStatus.CompletedWithSpecialConsideration) - { - var actualDetails = JsonConvert.DeserializeObject(actualIndustryPlacement.Details); - request.ChangeIPDetails.HoursSpentOnPlacementTo.Should().Be(actualDetails.HoursSpentOnPlacement); - } - } - - public static IEnumerable Data - { - get - { - return new[] - { - new object[] - { - new ReviewChangeIndustryPlacementRequest - { - ChangeReason = "Test Reason", - ContactName = "Test User", - RegistrationPathwayId = 1, - ChangeIPDetails = new ChangeIPDetails - { - IndustryPlacementStatusTo = IndustryPlacementStatus.NotCompleted - }, - RequestDate = DateTime.Now, - ZendeskId = "1234567890", - CreatedBy = "System" - }, - true }, - new object[] - { - new ReviewChangeIndustryPlacementRequest - { - ChangeReason = "Test Reason1", - ContactName = "Test User1", - RegistrationPathwayId = 2, - ChangeIPDetails = new ChangeIPDetails - { - IndustryPlacementStatusTo = IndustryPlacementStatus.Completed - }, - RequestDate = DateTime.Now, - ZendeskId = "768568909", - CreatedBy = "System" - }, - true }, - new object[] - { - new ReviewChangeIndustryPlacementRequest - { - ChangeReason = "Test Reason1", - ContactName = "Test User1", - RegistrationPathwayId = 3, - ChangeIPDetails = new ChangeIPDetails - { - IndustryPlacementStatusTo = IndustryPlacementStatus.CompletedWithSpecialConsideration, - HoursSpentOnPlacementTo=100, - SpecialConsiderationReasonsTo = new List{ 1, 2 } - }, - RequestDate = DateTime.Now, - ZendeskId = "768568909", - CreatedBy = "System" - }, - true - } - }; - } - } - - private void SeedIndustyPlacementData(List ipDatas) - { - foreach (var ipData in ipDatas) - { - var pathway = _profiles.FirstOrDefault(x => x.UniqueLearnerNumber == ipData.Uln).TqRegistrationPathways.FirstOrDefault(); - IndustryPlacementProvider.CreateIndustryPlacement(DbContext, pathway.Id, ipData.IndustryPlacementStatus, ipData.Details != null ? JsonConvert.SerializeObject(ipData.Details) : null); - } - } - - public class IndustryPlacementData - { - public long Uln { get; set; } - public IndustryPlacementStatus IndustryPlacementStatus { get; set; } - public IndustryPlacementDetails Details { get; set; } - } - } -} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/AdminPostResultsServiceBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/AdminPostResultsServiceBaseTest.cs new file mode 100644 index 000000000..6d413ae10 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/AdminPostResultsServiceBaseTest.cs @@ -0,0 +1,21 @@ +using Microsoft.Extensions.Logging.Abstractions; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Application.Services; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Interface; +using Sfa.Tl.ResultsAndCertification.Common.Services.System.Service; +using Sfa.Tl.ResultsAndCertification.Data.Factory; +using Sfa.Tl.ResultsAndCertification.Domain.Models; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests +{ + public abstract class AdminPostResultsServiceBaseTest : BaseTest + { + protected IAdminPostResultsService CreateAdminPostResultsService() + { + IRepositoryFactory repositoryFactory = new RepositoryFactory(new NullLoggerFactory(), DbContext); + ISystemProvider systemProvider = new SystemProvider(); + + return new AdminPostResultsService(repositoryFactory, systemProvider); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/ProcessAdminOpenPathwayRommBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/ProcessAdminOpenPathwayRommBaseTest.cs new file mode 100644 index 000000000..411a8d0e3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/ProcessAdminOpenPathwayRommBaseTest.cs @@ -0,0 +1,89 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using System; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenPathwayRommTests +{ + public abstract class ProcessAdminOpenPathwayRommBaseTest : AdminPostResultsServiceBaseTest + { + protected static OpenPathwayRommRequest CreateRequest(int registrationPathwayId, int pathwayResultId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + PathwayResultId = pathwayResultId, + ContactName = "contact-name", + DateOfRequest = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskTicketId = "1234567890", + CreatedBy = "created-by" + }; + } + + protected TqPathwayResult CreateAndSavePathwayResult(int registrationPathwayId, int tlLookupId) + { + AssessmentSeries assessmentSeries = CreateAssessmentSeries(); + DbContext.Add(assessmentSeries); + DbContext.SaveChanges(); + + TqPathwayAssessment assessment = CreatePathwayAssessment(registrationPathwayId, assessmentSeries.Id); + DbContext.Add(assessment); + DbContext.SaveChanges(); + + TqPathwayResult result = CreatePathwayResult(assessment.Id, tlLookupId); + DbContext.Add(result); + DbContext.SaveChanges(); + + return result; + } + + private static AssessmentSeries CreateAssessmentSeries() + { + DateTime currentDate = new(2020, 11, 25); + + return new() + { + ComponentType = ComponentType.Core, + Name = "Summer 2021", + Description = "Summer 2021", + Year = 2021, + StartDate = currentDate, + EndDate = currentDate.AddMonths(3), + RommEndDate = currentDate.AddMonths(4), + AppealEndDate = currentDate.AddMonths(5), + ResultCalculationYear = 2020, + ResultPublishDate = currentDate.AddMonths(6), + PrintAvailableDate = currentDate.AddMonths(7), + CreatedBy = Constants.CreatedByUser, + CreatedOn = Constants.CreatedOn, + ModifiedBy = Constants.ModifiedByUser, + ModifiedOn = Constants.ModifiedOn + }; + } + + private static TqPathwayAssessment CreatePathwayAssessment(int registrationPathwayId, int assessmentSeriesId) + => new() + { + TqRegistrationPathwayId = registrationPathwayId, + StartDate = new DateTime(2021, 1, 1), + EndDate = null, + IsOptedin = true, + IsBulkUpload = false, + AssessmentSeriesId = assessmentSeriesId + }; + + private static TqPathwayResult CreatePathwayResult(int pathwayAssessmentId, int tlLookupId) + => new() + { + TqPathwayAssessmentId = pathwayAssessmentId, + TlLookupId = tlLookupId, + StartDate = new(2021, 1, 10), + EndDate = null, + PrsStatus = null, + IsOptedin = true, + IsBulkUpload = false + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Doesnt_Exist.cs new file mode 100644 index 000000000..0a46ef6de --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Doesnt_Exist.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenPathwayRommTests +{ + public class When_Result_Doesnt_Exist : ProcessAdminOpenPathwayRommBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayResultId = 1; + + private OpenPathwayRommRequest _request; + private IAdminPostResultsService _service; + + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayResultId); + _service = CreateAdminPostResultsService(); + } + + public override async Task When() + { + _result = await _service.ProcessAdminOpenPathwayRommAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Exists.cs new file mode 100644 index 000000000..093bad31a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenPathwayRommTests/When_Result_Exists.cs @@ -0,0 +1,81 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenPathwayRommTests +{ + public class When_Result_Exists : ProcessAdminOpenPathwayRommBaseTest + { + private const int RegistrationPathwayId = 1; + private const int TlLookupId = 1; + + private TqPathwayResult _existingPathwayResult; + + private OpenPathwayRommRequest _request; + private IAdminPostResultsService _service; + + private bool _result; + + public override void Given() + { + _existingPathwayResult = CreateAndSavePathwayResult(RegistrationPathwayId, TlLookupId); + + _service = CreateAdminPostResultsService(); + _request = CreateRequest(RegistrationPathwayId, _existingPathwayResult.Id); + } + + public override async Task When() + { + _result = await _service.ProcessAdminOpenPathwayRommAsync(_request); + } + + [Fact] + public async void Then_Should_Return_False() + { + _result.Should().BeTrue(); + + TqPathwayResult existingPathwayResultDb = await DbContext.TqPathwayResult.SingleAsync(ip => ip.Id == _existingPathwayResult.Id); + existingPathwayResultDb.TqPathwayAssessmentId.Should().Be(_existingPathwayResult.TqPathwayAssessmentId); + existingPathwayResultDb.TlLookupId.Should().Be(_existingPathwayResult.TlLookupId); + existingPathwayResultDb.PrsStatus.Should().Be(_existingPathwayResult.PrsStatus); + existingPathwayResultDb.IsOptedin.Should().BeFalse(); + existingPathwayResultDb.StartDate.Should().Be(_existingPathwayResult.StartDate); + existingPathwayResultDb.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + existingPathwayResultDb.IsBulkUpload.Should().Be(_existingPathwayResult.IsBulkUpload); + existingPathwayResultDb.CreatedBy.Should().Be(_existingPathwayResult.CreatedBy); + existingPathwayResultDb.CreatedOn.Should().Be(_existingPathwayResult.CreatedOn); + existingPathwayResultDb.ModifiedBy.Should().Be(_request.CreatedBy); + existingPathwayResultDb.ModifiedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + + TqPathwayResult newPathwayResultDb = await DbContext.TqPathwayResult.SingleAsync(ip => ip.TqPathwayAssessmentId == existingPathwayResultDb.TqPathwayAssessmentId && ip.IsOptedin); + newPathwayResultDb.TqPathwayAssessmentId.Should().Be(_existingPathwayResult.TqPathwayAssessmentId); + newPathwayResultDb.TlLookupId.Should().Be(_existingPathwayResult.TlLookupId); + newPathwayResultDb.PrsStatus.Should().Be(PrsStatus.UnderReview); + newPathwayResultDb.IsOptedin.Should().BeTrue(); + newPathwayResultDb.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + newPathwayResultDb.EndDate.Should().BeNull(); + newPathwayResultDb.IsBulkUpload.Should().BeFalse(); + newPathwayResultDb.CreatedBy.Should().Be(_request.CreatedBy); + newPathwayResultDb.CreatedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + newPathwayResultDb.ModifiedBy.Should().BeNull(); + newPathwayResultDb.ModifiedOn.Should().NotHaveValue(); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(ChangeType.OpenPathwayRomm); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.DateOfRequest); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { PathwayResultId = newPathwayResultDb.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskTicketId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/ProcessAdminOpenSpecialismRommBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/ProcessAdminOpenSpecialismRommBaseTest.cs new file mode 100644 index 000000000..e8ec5564e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/ProcessAdminOpenSpecialismRommBaseTest.cs @@ -0,0 +1,91 @@ +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using System; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenSpecialismRommTests +{ + public abstract class ProcessAdminOpenSpecialismRommBaseTest : AdminPostResultsServiceBaseTest + { + protected static OpenSpecialismRommRequest CreateRequest(int registrationPathwayId, int specialismResultId) + { + return new() + { + RegistrationPathwayId = registrationPathwayId, + SpecialismResultId = specialismResultId, + ContactName = "contact-name", + DateOfRequest = new DateTime(2024, 1, 1), + ChangeReason = "change-reason", + ZendeskTicketId = "1234567890", + CreatedBy = "created-by" + }; + } + + protected TqSpecialismResult CreateAndSaveSpecialismResult(int registrationSpecialismId, int tlLookupId) + { + AssessmentSeries assessmentSeries = CreateAssessmentSeries(); + DbContext.Add(assessmentSeries); + DbContext.SaveChanges(); + + TqSpecialismAssessment assessment = CreateSpecialismAssessment(registrationSpecialismId, assessmentSeries.Id); + DbContext.Add(assessment); + DbContext.SaveChanges(); + + TqSpecialismResult result = CreateSpecialismResult(assessment.Id, tlLookupId); + DbContext.Add(result); + DbContext.SaveChanges(); + + return result; + } + + private static AssessmentSeries CreateAssessmentSeries() + { + DateTime currentDate = new(2020, 11, 25); + + return new() + { + ComponentType = ComponentType.Core, + Name = "Summer 2021", + Description = "Summer 2021", + Year = 2021, + StartDate = currentDate, + EndDate = currentDate.AddMonths(3), + RommEndDate = currentDate.AddMonths(4), + AppealEndDate = currentDate.AddMonths(5), + ResultCalculationYear = 2020, + ResultPublishDate = currentDate.AddMonths(6), + PrintAvailableDate = currentDate.AddMonths(7), + CreatedBy = Constants.CreatedByUser, + CreatedOn = Constants.CreatedOn, + ModifiedBy = Constants.ModifiedByUser, + ModifiedOn = Constants.ModifiedOn + }; + } + + private static TqSpecialismAssessment CreateSpecialismAssessment(int registrationSpecialismId, int assessmentSeriesId) + { + return new() + { + TqRegistrationSpecialismId = registrationSpecialismId, + AssessmentSeriesId = assessmentSeriesId, + StartDate = new DateTime(2021, 1, 1), + EndDate = null, + IsOptedin = true, + IsBulkUpload = false + }; + } + + private static TqSpecialismResult CreateSpecialismResult(int specialismAssessmentId, int tlLookupId) + => new() + { + TqSpecialismAssessmentId = specialismAssessmentId, + TlLookupId = tlLookupId, + StartDate = new(2021, 1, 10), + EndDate = null, + PrsStatus = null, + IsOptedin = true, + IsBulkUpload = false + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Doesnt_Exist.cs new file mode 100644 index 000000000..b1f62f5db --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Doesnt_Exist.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenSpecialismRommTests +{ + public class When_Result_Doesnt_Exist : ProcessAdminOpenSpecialismRommBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayResultId = 1; + + private OpenSpecialismRommRequest _request; + private IAdminPostResultsService _service; + + private bool _result; + + public override void Given() + { + _request = CreateRequest(RegistrationPathwayId, PathwayResultId); + _service = CreateAdminPostResultsService(); + } + + public override async Task When() + { + _result = await _service.ProcessAdminOpenSpecialismRommAsync(_request); + } + + [Fact] + public void Then_Should_Return_False() + { + _result.Should().BeFalse(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Exists.cs new file mode 100644 index 000000000..0431d2210 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.IntegrationTests/Services/AdminPostResultsServiceTests/ProcessAdminOpenSpecialismRommTests/When_Result_Exists.cs @@ -0,0 +1,81 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using Newtonsoft.Json; +using Sfa.Tl.ResultsAndCertification.Application.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Domain.Models; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminPostResults; +using System; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.IntegrationTests.Services.AdminPostResultsServiceTests.ProcessAdminOpenSpecialismRommTests +{ + public class When_Result_Exists : ProcessAdminOpenSpecialismRommBaseTest + { + private const int RegistrationPathwayId = 1; + private const int TlLookupId = 10; + + private TqSpecialismResult _existingSpecialismResult; + + private OpenSpecialismRommRequest _request; + private IAdminPostResultsService _service; + + private bool _result; + + public override void Given() + { + _existingSpecialismResult = CreateAndSaveSpecialismResult(RegistrationPathwayId, TlLookupId); + + _service = CreateAdminPostResultsService(); + _request = CreateRequest(RegistrationPathwayId, _existingSpecialismResult.Id); + } + + public override async Task When() + { + _result = await _service.ProcessAdminOpenSpecialismRommAsync(_request); + } + + [Fact] + public async void Then_Should_Return_False() + { + _result.Should().BeTrue(); + + TqSpecialismResult existingSpecialismResultDb = await DbContext.TqSpecialismResult.SingleAsync(ip => ip.Id == _existingSpecialismResult.Id); + existingSpecialismResultDb.TqSpecialismAssessmentId.Should().Be(_existingSpecialismResult.TqSpecialismAssessmentId); + existingSpecialismResultDb.TlLookupId.Should().Be(_existingSpecialismResult.TlLookupId); + existingSpecialismResultDb.PrsStatus.Should().Be(_existingSpecialismResult.PrsStatus); + existingSpecialismResultDb.IsOptedin.Should().BeFalse(); + existingSpecialismResultDb.StartDate.Should().Be(_existingSpecialismResult.StartDate); + existingSpecialismResultDb.EndDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + existingSpecialismResultDb.IsBulkUpload.Should().Be(_existingSpecialismResult.IsBulkUpload); + existingSpecialismResultDb.CreatedBy.Should().Be(_existingSpecialismResult.CreatedBy); + existingSpecialismResultDb.CreatedOn.Should().Be(_existingSpecialismResult.CreatedOn); + existingSpecialismResultDb.ModifiedBy.Should().Be(_request.CreatedBy); + existingSpecialismResultDb.ModifiedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + + TqSpecialismResult newSpecialismResultDb = await DbContext.TqSpecialismResult.SingleAsync(ip => ip.TqSpecialismAssessmentId == existingSpecialismResultDb.TqSpecialismAssessmentId && ip.IsOptedin); + newSpecialismResultDb.TqSpecialismAssessmentId.Should().Be(_existingSpecialismResult.TqSpecialismAssessmentId); + newSpecialismResultDb.TlLookupId.Should().Be(_existingSpecialismResult.TlLookupId); + newSpecialismResultDb.PrsStatus.Should().Be(PrsStatus.UnderReview); + newSpecialismResultDb.IsOptedin.Should().BeTrue(); + newSpecialismResultDb.StartDate.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + newSpecialismResultDb.EndDate.Should().BeNull(); + newSpecialismResultDb.IsBulkUpload.Should().BeFalse(); + newSpecialismResultDb.CreatedBy.Should().Be(_request.CreatedBy); + newSpecialismResultDb.CreatedOn.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(15)); + newSpecialismResultDb.ModifiedBy.Should().BeNull(); + newSpecialismResultDb.ModifiedOn.Should().NotHaveValue(); + + ChangeLog changeLog = await DbContext.ChangeLog.SingleAsync(ip => ip.TqRegistrationPathwayId == _request.RegistrationPathwayId); + changeLog.TqRegistrationPathwayId.Should().Be(_request.RegistrationPathwayId); + changeLog.ChangeType.Should().Be(ChangeType.OpenSpecialismRomm); + changeLog.ReasonForChange.Should().Be(_request.ChangeReason); + changeLog.DateOfRequest.Should().Be(_request.DateOfRequest); + changeLog.Details.Should().Be(JsonConvert.SerializeObject(new { SpecialismResultId = newSpecialismResultDb.Id })); + changeLog.ZendeskTicketID.Should().Be(_request.ZendeskTicketId); + changeLog.Name.Should().Be(_request.ContactName); + changeLog.CreatedBy.Should().Be(_request.CreatedBy); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_Authenticated_In_FreezePeriod.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_Authenticated_In_FreezePeriod.cs new file mode 100644 index 000000000..d51d13514 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_Authenticated_In_FreezePeriod.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using System.Security.Claims; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AccountControllerTests.PostSignIn +{ + public class When_User_Authenticated_In_FreezePeriod : TestSetup + { + public override void Given() + { + HttpContext.User.Identity.IsAuthenticated.Returns(true); + HttpContext.User.Claims.Returns(new Claim[] + { + new Claim(CustomClaimTypes.HasAccessToService, "false"), + new Claim(CustomClaimTypes.InFreezePeriod, "true") + }); + + Controller.ControllerContext = new ControllerContext + { + HttpContext = HttpContext, + RouteData = new Microsoft.AspNetCore.Routing.RouteData() + }; + } + + [Fact] + public void Then_Redirected_To_ServiceUnavailable() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.ServiceUnavailable); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAcess.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAccess.cs similarity index 95% rename from src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAcess.cs rename to src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAccess.cs index 64867e283..7c10bb2a0 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAcess.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AccountControllerTests/PostSignIn/When_User_WithNoServiceAccess.cs @@ -10,7 +10,7 @@ namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AccountControllerTests.PostSignIn { - public class When_User_WithNoServiceAcess : TestSetup + public class When_User_WithNoServiceAccess : TestSetup { public override void Given() { diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminChangeLogControllerTestBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminChangeLogControllerTestBase.cs new file mode 100644 index 000000000..177265ff2 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminChangeLogControllerTestBase.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Constants; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Controllers; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests +{ + public abstract class AdminChangeLogControllerTestBase : BaseTest + { + // Dependencies + protected IAdminChangeLogLoader AdminChangeLogLoader; + protected ICacheService CacheService; + protected ILogger Logger; + + protected string CacheKey; + protected AdminChangeLogController Controller; + + internal readonly int ChangeLogId = 1; + + public override void Setup() + { + AdminChangeLogLoader = Substitute.For(); + CacheService = Substitute.For(); + Logger = Substitute.For>(); + Controller = new AdminChangeLogController(AdminChangeLogLoader, CacheService, Logger); + + var httpContext = new ClaimsIdentityBuilder(Controller) + .Add(CustomClaimTypes.Ukprn, "1234567890") + .Add(CustomClaimTypes.UserId, "82bbe986-d264-460c-ab89-d241c1025f12") + .Build() + .HttpContext; + + IHttpContextAccessor httpContextAccessor = Substitute.For(); + httpContextAccessor.HttpContext.Returns(httpContext); + + CacheKey = CacheKeyHelper.GetCacheKey(httpContext.User.GetUserId(), CacheConstants.AdminChangeLogCacheKey); + } + + public override void Given() + { + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearGet/When_Called.cs new file mode 100644 index 000000000..1feda4a20 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearGet/When_Called.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogClearGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult _result; + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogClearAsync(); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminSearchChangeLog() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.AdminSearchChangeLog); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Empty.cs new file mode 100644 index 000000000..745b89ff6 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Empty.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using NSubstitute.ReturnsExtensions; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogClearKeyPost +{ + public class When_Cache_Empty : AdminChangeLogControllerTestBase + { + private IActionResult _result; + + public override void Given() + { + CacheService.GetAsync(CacheKey).ReturnsNull(); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogClearKeyAsync(); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + CacheService.DidNotReceive().SetAsync(Arg.Any(), Arg.Any()); + + AdminChangeLogLoader.ReceivedCalls().Should().BeEmpty(); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + _result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..7698a819c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogClearKeyPost/When_Cache_Not_Empty.cs @@ -0,0 +1,89 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogClearKeyPost +{ + public class When_Cache_Not_Empty : AdminChangeLogControllerTestBase + { + private readonly AdminSearchChangeLogViewModel _cachedViewModel = new() + { + SearchCriteriaViewModel = new AdminSearchChangeLogCriteriaViewModel + { + SearchKey = "", + PageNumber = 1 + }, + ChangeLogDetails = new List + { + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 1, + DateAndTimeOfChange = "31 August 2024 9:30am", + Learner = "John Smith (1234567890)", + Provider = "Bath College (10001465)", + ZendeskTicketID = "1234567-AB", + LastUpdatedBy = "DfE Admin 01" + }, + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 154, + DateAndTimeOfChange = "1 April 2021 5:15pm", + Learner = "Sue Baker (1122334455)", + Provider = "St Thomas More Catholic School Blaydon (10036413)", + ZendeskTicketID = "1726354-ZX", + LastUpdatedBy = "DfE Admin 02" + } + }, + TotalRecords = 1540, + PagerInfo = new PagerViewModel + { + CurrentPage = 5, + PageSize = 10, + RecordFrom = 1539, + RecordTo = 1540, + StartPage = 1, + TotalItems = 2, + TotalPages = 5 + } + }; + + private IActionResult _result; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_cachedViewModel); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogClearKeyAsync(); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + CacheService.Received(1).SetAsync(CacheKey, Arg.Is(p => + p == _cachedViewModel + && p.SearchCriteriaViewModel.SearchKey == string.Empty + && p.SearchCriteriaViewModel.PageNumber == _cachedViewModel.SearchCriteriaViewModel.PageNumber)); + + + AdminChangeLogLoader.ReceivedCalls().Should().BeEmpty(); + } + + [Fact] + public void Then_Redirected_To_AdminSearchChangeLog() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.AdminSearchChangeLog, ("pageNumber", _cachedViewModel.SearchCriteriaViewModel.PageNumber)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Empty.cs new file mode 100644 index 000000000..e7c2fa73b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Empty.cs @@ -0,0 +1,99 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using NSubstitute.ReturnsExtensions; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogGet +{ + public class When_Cache_Empty : AdminChangeLogControllerTestBase + { + private AdminSearchChangeLogViewModel _viewModel; + private IActionResult _result; + + public override void Given() + { + string _dateAndTimeOfChange = "31 August 2024 9:30am"; + int _changeLogId = 1; + + _viewModel = new() + { + SearchCriteriaViewModel = new AdminSearchChangeLogCriteriaViewModel + { + PageNumber = 1, + SearchKey = string.Empty + }, + ChangeLogDetails = new List + { + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = _changeLogId, + ChangeType = (int)ChangeType.StartYear, + DateAndTimeOfChange = _dateAndTimeOfChange, + Learner = "John Smith (1234567890)", + Provider = "Bath College (10001465)", + ZendeskTicketID = "1234567-AB", + LastUpdatedBy = "DfE Admin", + ChangeRecordLink = new ViewComponents.ChangeRecordLink.ChangeRecordModel(){ + Text = _dateAndTimeOfChange, + Route = RouteConstants.AdminViewChangeStartYearRecord, + RouteAttributes = new Dictionary(){ { Constants.ChangeLogId, _changeLogId.ToString() } }, + + } + } + }, + TotalRecords = 1, + PagerInfo = new PagerViewModel + { + CurrentPage = 1, + PageSize = 10, + RecordFrom = 1, + RecordTo = 1, + StartPage = 1, + TotalItems = 1, + TotalPages = 1 + } + }; + + CacheService.GetAsync(CacheKey).ReturnsNull(); + AdminChangeLogLoader.SearchChangeLogsAsync().Returns(_viewModel); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogAsync(); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminChangeLogLoader.Received(1).SearchChangeLogsAsync(); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = _result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + var changelog = model.ChangeLogDetails.FirstOrDefault(); + KeyValuePair routeAttributes = new KeyValuePair(Constants.ChangeLogId, changelog.ChangeLogId.ToString()); + + changelog.ChangeRecordLink.Route.Should().Be(RouteConstants.AdminViewChangeStartYearRecord); + changelog.ChangeRecordLink.Text.Should().Be(changelog.DateAndTimeOfChange); + changelog.ChangeRecordLink.RouteAttributes.Should().NotBeEmpty(); + changelog.ChangeRecordLink.RouteAttributes.Should().Contain(routeAttributes); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..9c949b6d3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogGet/When_Cache_Not_Empty.cs @@ -0,0 +1,99 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogGet +{ + public class When_Cache_Not_Empty : AdminChangeLogControllerTestBase + { + private const int PageNumber = 5; + + private AdminSearchChangeLogViewModel _cachedViewModel; + private AdminSearchChangeLogViewModel _viewModel; + + private IActionResult _result; + + public override void Given() + { + _cachedViewModel = new() + { + SearchCriteriaViewModel = new AdminSearchChangeLogCriteriaViewModel + { + PageNumber = PageNumber, + SearchKey = "smith" + } + }; + + _viewModel = new() + { + SearchCriteriaViewModel = _cachedViewModel.SearchCriteriaViewModel, + ChangeLogDetails = new List + { + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 1, + DateAndTimeOfChange = "31 August 2024 9:30am", + Learner = "John Smith (1234567890)", + Provider = "Bath College (10001465)", + ZendeskTicketID = "1234567-AB", + LastUpdatedBy = "DfE Admin 01" + }, + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 154, + DateAndTimeOfChange = "1 April 2021 5:15pm", + Learner = "Sue Baker (1122334455)", + Provider = "St Thomas More Catholic School Blaydon (10036413)", + ZendeskTicketID = "1726354-ZX", + LastUpdatedBy = "DfE Admin 02" + } + }, + TotalRecords = 1540, + PagerInfo = new PagerViewModel + { + CurrentPage = PageNumber, + PageSize = 10, + RecordFrom = 1539, + RecordTo = 1540, + StartPage = 1, + TotalItems = 2, + TotalPages = 5 + } + }; + + AdminSearchChangeLogCriteriaViewModel criteria = _viewModel.SearchCriteriaViewModel; + + CacheService.GetAsync(CacheKey).Returns(_cachedViewModel); + AdminChangeLogLoader.SearchChangeLogsAsync(criteria.SearchKey, criteria.PageNumber).Returns(_viewModel); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogAsync(PageNumber); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminSearchChangeLogCriteriaViewModel criteria = _cachedViewModel.SearchCriteriaViewModel; + + CacheService.Received(1).GetAsync(CacheKey); + AdminChangeLogLoader.Received(1).SearchChangeLogsAsync(criteria.SearchKey, criteria.PageNumber); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = _result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Empty.cs new file mode 100644 index 000000000..0b51c5f45 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Empty.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using NSubstitute.ReturnsExtensions; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogSearchKeyPost +{ + public class When_Cache_Empty : AdminChangeLogControllerTestBase + { + private readonly AdminSearchChangeLogCriteriaViewModel _viewModel = new() + { + SearchKey = "smith", + PageNumber = 1 + }; + + private IActionResult _result; + + public override void Given() + { + CacheService.GetAsync(CacheKey).ReturnsNull(); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogSearchKeyAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + CacheService.DidNotReceive().SetAsync(Arg.Any(), Arg.Any()); + + AdminChangeLogLoader.ReceivedCalls().Should().BeEmpty(); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + _result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..463842bcd --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminSearchChangeLogSearchKeyPost/When_Cache_Not_Empty.cs @@ -0,0 +1,94 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminSearchChangeLogSearchKeyPost +{ + public class When_Cache_Not_Empty : AdminChangeLogControllerTestBase + { + private readonly AdminSearchChangeLogViewModel _cachedViewModel = new() + { + SearchCriteriaViewModel = new AdminSearchChangeLogCriteriaViewModel + { + SearchKey = "", + PageNumber = 1 + }, + ChangeLogDetails = new List + { + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 1, + DateAndTimeOfChange = "31 August 2024 9:30am", + Learner = "John Smith (1234567890)", + Provider = "Bath College (10001465)", + ZendeskTicketID = "1234567-AB", + LastUpdatedBy = "DfE Admin 01" + }, + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 154, + DateAndTimeOfChange = "1 April 2021 5:15pm", + Learner = "Sue Baker (1122334455)", + Provider = "St Thomas More Catholic School Blaydon (10036413)", + ZendeskTicketID = "1726354-ZX", + LastUpdatedBy = "DfE Admin 02" + } + }, + TotalRecords = 1540, + PagerInfo = new PagerViewModel + { + CurrentPage = 5, + PageSize = 10, + RecordFrom = 1539, + RecordTo = 1540, + StartPage = 1, + TotalItems = 2, + TotalPages = 5 + } + }; + + private readonly AdminSearchChangeLogCriteriaViewModel _viewModel = new() + { + SearchKey = "smith", + PageNumber = 1 + }; + + private IActionResult _result; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_cachedViewModel); + } + + public override async Task When() + { + _result = await Controller.AdminSearchChangeLogSearchKeyAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + CacheService.Received(1).SetAsync(CacheKey, Arg.Is(p => + p == _cachedViewModel + && p.SearchCriteriaViewModel.SearchKey == _viewModel.SearchKey + && p.SearchCriteriaViewModel.PageNumber == _viewModel.PageNumber)); + + AdminChangeLogLoader.ReceivedCalls().Should().BeEmpty(); + } + + [Fact] + public void Then_Redirected_To_AdminSearchChangeLog() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.AdminSearchChangeLog, ("pageNumber", _cachedViewModel.SearchCriteriaViewModel.PageNumber)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddPathwayResultGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddPathwayResultGet/When_Called.cs new file mode 100644 index 000000000..1f09d8e1c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddPathwayResultGet/When_Called.cs @@ -0,0 +1,96 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordAddPathwayResultGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordAddPathwayResultViewModel Mockresult; + private AddPathwayResultRequest details; + + public override void Given() + { + details = new() + { + PathwayAssessmentId = 1, + GradeTo = "A*" + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeAddPathwayResultRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordAddPathwayResultAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeAddPathwayResultRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordAddPathwayResultViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.PathwayResultDetails.PathwayAssessmentId.Should().Be(Mockresult.PathwayResultDetails.PathwayAssessmentId); + model.PathwayResultDetails.GradeTo.Should().Be(Mockresult.PathwayResultDetails.GradeTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordAddPathwayResultViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + PathwayResultDetails = details, + ChangeType = Common.Enum.ChangeType.AddPathwayResult + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddSpecialismResultGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddSpecialismResultGet/When_Called.cs new file mode 100644 index 000000000..fa635a3d3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordAddSpecialismResultGet/When_Called.cs @@ -0,0 +1,96 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordAddSpecialismResultGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordAddSpecialismResultViewModel Mockresult; + private AddSpecialismResultRequest details; + + public override void Given() + { + details = new() + { + SpecialismAssessmentId = 1, + GradeTo = "Merit" + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeAddSpecialismResultRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordAddSpecialismResultAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeAddSpecialismResultRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordAddSpecialismResultViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.SpecialismDetails.SpecialismAssessmentId.Should().Be(Mockresult.SpecialismDetails.SpecialismAssessmentId); + model.SpecialismDetails.GradeTo.Should().Be(Mockresult.SpecialismDetails.GradeTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordAddSpecialismResultViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + SpecialismDetails = details, + ChangeType = Common.Enum.ChangeType.AddSpecialismResult + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordCoreAssessmentGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordCoreAssessmentGet/When_Called.cs new file mode 100644 index 000000000..9a726f78d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordCoreAssessmentGet/When_Called.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordCoreAssessmentGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordCoreAssessmentViewModel Mockresult; + private AddCoreAssessmentDetails details; + + public override void Given() + { + details = new() + { + AssessmentSeriesId = 1, + CoreAssessmentFrom = "No assessment entry recorded for autumn 2023", + CoreAssessmentTo = "Autumn 2023", + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeCoreAssessmentRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordCoreAssessmentAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeCoreAssessmentRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordCoreAssessmentViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.CoreAssessmentDetails.AssessmentSeriesId.Should().Be(Mockresult.CoreAssessmentDetails.AssessmentSeriesId); + model.CoreAssessmentDetails.CoreAssessmentFrom.Should().Be(Mockresult.CoreAssessmentDetails.CoreAssessmentFrom); + model.CoreAssessmentDetails.CoreAssessmentTo.Should().Be(Mockresult.CoreAssessmentDetails.CoreAssessmentTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordCoreAssessmentViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + CoreAssessmentDetails = details, + ChangeType = Common.Enum.ChangeType.AddPathwayAssessment + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordIPGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordIPGet/When_Called.cs new file mode 100644 index 000000000..5ce6ed005 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordIPGet/When_Called.cs @@ -0,0 +1,101 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordIPGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordIndustryPlacementViewModel Mockresult; + private ChangeIndustryPlacementRequest details; + + public override void Given() + { + details = new() + { + IndustryPlacementStatusTo = Common.Enum.IndustryPlacementStatus.CompletedWithSpecialConsideration, + HoursSpentOnPlacementTo = 10, + SpecialConsiderationReasonsTo = new List() { 6, 7 } + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeIPRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordIPAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeIPRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordIndustryPlacementViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.ChangeIPDetails.IndustryPlacementStatusTo.Should().Be(Mockresult.ChangeIPDetails.IndustryPlacementStatusTo); + model.ChangeIPDetails.HoursSpentOnPlacementTo.Should().Be(Mockresult.ChangeIPDetails.HoursSpentOnPlacementTo); + + model.ChangeIPDetails.SpecialConsiderationReasonsTo.Count.Should().Be(2); + model.ChangeIPDetails.SpecialConsiderationReasonsTo.Should().Equal(Mockresult.ChangeIPDetails.SpecialConsiderationReasonsTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordIndustryPlacementViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + ChangeIPDetails = details, + ChangeType = Common.Enum.ChangeType.IndustryPlacement + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveCoreAssessmentGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveCoreAssessmentGet/When_Called.cs new file mode 100644 index 000000000..face4bd68 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveCoreAssessmentGet/When_Called.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordRemoveCoreAssessmentGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordRemoveCoreAssessmentViewModel Mockresult; + private DetailsChangeAssessmentRemove details; + + public override void Given() + { + details = new() + { + PathwayName = "Digital Business Services (60369024)", + From = "Summer 2023", + To = "No assessment entry recorded for Summer 2023" + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeRemoveCoreAssessmentRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordRemoveCoreAssessmentAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeRemoveCoreAssessmentRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordRemoveCoreAssessmentViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.DetailsChangeAssessment.PathwayName.Should().Be(Mockresult.DetailsChangeAssessment.PathwayName); + model.DetailsChangeAssessment.From.Should().Be(Mockresult.DetailsChangeAssessment.From); + model.DetailsChangeAssessment.To.Should().Be(Mockresult.DetailsChangeAssessment.To); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordRemoveCoreAssessmentViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + DetailsChangeAssessment = details, + ChangeType = Common.Enum.ChangeType.RemovePathwayAssessment, + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveSpecialismAssessmentGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveSpecialismAssessmentGet/When_Called.cs new file mode 100644 index 000000000..213f8c51a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordRemoveSpecialismAssessmentGet/When_Called.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordRemoveSpecialismAssessmentGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordRemoveSpecialismAssessmentViewModel Mockresult; + private DetailsSpecialismAssessmentRemove details; + + public override void Given() + { + details = new() + { + SpecialismName = "Data Technician (ZTLOS009)", + From = "Summer 2023", + To = "No assessment entry recorded for Summer 2023" + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeRemoveSpecialismAssessmentRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordRemoveSpecialismAssessmentAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeRemoveSpecialismAssessmentRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordRemoveSpecialismAssessmentViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.DetailsChangeAssessment.SpecialismName.Should().Be(Mockresult.DetailsChangeAssessment.SpecialismName); + model.DetailsChangeAssessment.From.Should().Be(Mockresult.DetailsChangeAssessment.From); + model.DetailsChangeAssessment.To.Should().Be(Mockresult.DetailsChangeAssessment.To); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordRemoveSpecialismAssessmentViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + DetailsChangeAssessment = details, + ChangeType = Common.Enum.ChangeType.RemoveSpecialismAssessment, + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordSpecialismAssessmentGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordSpecialismAssessmentGet/When_Called.cs new file mode 100644 index 000000000..a72486c71 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordSpecialismAssessmentGet/When_Called.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordSpecialismAssessmentGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + + private AdminViewChangeRecordSpecialismAssessmentViewModel Mockresult; + private AddSpecialismDetails details; + + public override void Given() + { + details = new() + { + AssessmentSeriesId = 1, + SpecialismAssessmentFrom = "No assessment entry recorded for summer 2023", + SpecialismAssessmentTo = "Summer 2023", + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeSpecialismAssessmentRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + => Result = await Controller.AdminViewChangeRecordSpecialismAssessmentAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminChangeLogLoader.Received(1).GetAdminViewChangeSpecialismAssessmentRecord(ChangeLogId); + } + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordSpecialismAssessmentViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.SpecialismDetails.AssessmentSeriesId.Should().Be(Mockresult.SpecialismDetails.AssessmentSeriesId); + model.SpecialismDetails.SpecialismAssessmentFrom.Should().Be(Mockresult.SpecialismDetails.SpecialismAssessmentFrom); + model.SpecialismDetails.SpecialismAssessmentTo.Should().Be(Mockresult.SpecialismDetails.SpecialismAssessmentTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + protected AdminViewChangeRecordSpecialismAssessmentViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + SpecialismDetails = details, + ChangeType = Common.Enum.ChangeType.AddSpecialismAssessment + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordStartYearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordStartYearGet/When_Called.cs new file mode 100644 index 000000000..f59376c89 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminChangeLogControllerTests/AdminViewChangeRecordStartYearGet/When_Called.cs @@ -0,0 +1,98 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminChangeLogControllerTests.AdminViewChangeRecordStartYearGet +{ + public class When_Called : AdminChangeLogControllerTestBase + { + private IActionResult Result; + private AdminViewChangeRecordStartYearViewModel Mockresult; + private ChangeStartYearDetails details; + + public override void Given() + { + details = new() + { + StartYearFrom = 2020, + StartYearTo = 2021 + }; + + Mockresult = CreateViewModel(); + + AdminChangeLogLoader.GetAdminViewChangeStartYearRecord(ChangeLogId).Returns(Mockresult); + } + + public override async Task When() + { + Result = await Controller.AdminViewChangeRecordStartYearAsync(ChangeLogId); + } + + //public override async Task When() + //=> Result = await Controller.AdminViewChangeRecordStartYearAsync(ChangeLogId); + + [Fact] + public void Then_Expected_Methods_AreCalled() + => AdminChangeLogLoader.Received(1).GetAdminViewChangeStartYearRecord(ChangeLogId); + + [Fact] + public void Then_Return_Expected_Results() + { + Result.Should().NotBeNull(); + (Result as ViewResult).Model.Should().NotBeNull(); + + var model = (Result as ViewResult).Model as AdminViewChangeRecordStartYearViewModel; + + model.ChangeLogId.Should().Be(Mockresult.ChangeLogId); + model.RegistrationPathwayId.Should().Be(Mockresult.RegistrationPathwayId); + + model.Learner.Should().Be(Mockresult.Learner); + model.Uln.Should().Be(Mockresult.Uln); + model.CreatedBy.Should().Be(Mockresult.CreatedBy); + + model.ChangeDetails.Should().Be(Mockresult.ChangeDetails); + model.ChangeStartYearDetails.StartYearFrom.Should().Be(Mockresult.ChangeStartYearDetails.StartYearFrom); + model.ChangeStartYearDetails.StartYearTo.Should().Be(Mockresult.ChangeStartYearDetails.StartYearTo); + + model.SummaryLearner.Title.Should().Be(AdminViewChangeRecord.Summary_Learner_Text); + model.SummaryLearner.Value.Should().Be(Mockresult.SummaryLearner.Value); + + model.SummaryUln.Title.Should().Be(AdminViewChangeRecord.Summary_ULN_Text); + model.SummaryUln.Value.Should().Be(Mockresult.SummaryUln.Value); + + model.SummaryCreatedBy.Title.Should().Be(AdminViewChangeRecord.Summary_CreatedBy_Text); + model.SummaryCreatedBy.Value.Should().Be(Mockresult.SummaryCreatedBy.Value); + + model.ChangeRequestedBy.Should().Be(Mockresult.ChangeRequestedBy); + model.ChangeDateOfRequest.Should().Be(Mockresult.ChangeDateOfRequest); + model.ReasonForChange.Should().Be(Mockresult.ReasonForChange); + model.ZendeskTicketID.Should().Be(Mockresult.ZendeskTicketID); + + model.BackLink.Should().NotBeNull(); + model.BackLink.RouteName.Should().Be(RouteConstants.AdminSearchChangeLog); + } + + private AdminViewChangeRecordStartYearViewModel CreateViewModel() => new() + { + ChangeLogId = ChangeLogId, + RegistrationPathwayId = 1, + Learner = "John Wick", + Uln = 1234567890, + CreatedBy = "steve vaugh", + ChangeRequestedBy = "Mark Jacob", + ReasonForChange = "Change reason", + ZendeskTicketID = "ZenDesk-1234", + DateAndTimeOfChange = "1 Jan, 2024", + ChangeDetails = JsonConvert.SerializeObject(details), + ChangeStartYearDetails = details, + ChangeType = Common.Enum.ChangeType.StartYear + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs index 85e90a3dd..1ecb1a498 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultPost/When_Grade_Selected.cs @@ -31,7 +31,7 @@ public void Then_Expected_Methods_AreCalled() [Fact] public void Then_Redirected_To_ReviewChangePathwayResult() { - Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord); + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminChangePathwayResultReviewChanges); } } } \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..e2dbebb89 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultReviewChangesAsync(); + } + + protected static AdminChangePathwayResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..63e0a23c6 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,30 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + AdminChangePathwayResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().CreateAdminChangePathwayResultReviewChanges(Arg.Any()); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..96dc475bc --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private readonly AdminChangePathwayResultViewModel _model = ViewModel; + private readonly AdminChangePathwayResultReviewChangesViewModel _reviewChangesModel = new(); + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_model); + AdminDashboardLoader.CreateAdminChangePathwayResultReviewChanges(_model).Returns(_reviewChangesModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).CreateAdminChangePathwayResultReviewChanges(_model); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_reviewChangesModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..06d7a859c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/TestSetup.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminChangePathwayResultReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..d83aa0275 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private readonly AdminChangePathwayResultReviewChangesViewModel _viewModel = CreateViewModel(); + private const string ErrorKey = "AdminChangePathwayResultReviewChanges"; + + public override void Given() + { + Controller.ModelState.AddModelError(ErrorKey, AdminChangePathwayResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.DidNotReceive().ProcessChangePathwayResultReviewChangesAsync(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, Arg.Any(), CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminChangePathwayResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Valid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Valid.cs new file mode 100644 index 000000000..f8737ab8e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangePathwayResultReviewChangesPost/When_ModelState_Valid.cs @@ -0,0 +1,43 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangePathwayResultReviewChangesPost +{ + public class When_ModelState_Valid : TestSetup + { + private readonly AdminChangePathwayResultReviewChangesViewModel _viewModel = CreateViewModel(); + + public override void Given() + { + AdminDashboardLoader.ProcessChangePathwayResultReviewChangesAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + Result = await Controller.AdminChangePathwayResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessChangePathwayResultReviewChangesAsync(_viewModel); + CacheService.Received(1).SetAsync( + CacheKey, + Arg.Is(p => p.Message.Contains(AdminChangePathwayResultReviewChanges.Notification_Message_Asessment_Result_Changed)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord, (Constants.PathwayId, _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs index 9f8a2ae77..a125bbdc6 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultPost/When_Grade_Selected.cs @@ -31,7 +31,7 @@ public void Then_Expected_Methods_AreCalled() [Fact] public void Then_Redirected_To_ReviewChangeSpecialismResult() { - Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord); + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminChangeSpecialismResultReviewChanges); } } } \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..ed3b7be94 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/TestSetup.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesGet +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultReviewChangesAsync(); + } + + protected static AdminChangeSpecialismResultViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1, + SpecialismResultId = 1, + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..710b711e0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,30 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + AdminChangeSpecialismResultViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.DidNotReceive().CreateAdminChangeSpecialismResultReviewChanges(Arg.Any()); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..8b10bdbc3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private readonly AdminChangeSpecialismResultViewModel _model = ViewModel; + private readonly AdminChangeSpecialismResultReviewChangesViewModel _reviewChangesModel = new(); + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(_model); + AdminDashboardLoader.CreateAdminChangeSpecialismResultReviewChanges(_model).Returns(_reviewChangesModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminDashboardLoader.Received(1).CreateAdminChangeSpecialismResultReviewChanges(_model); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_reviewChangesModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..4b95684b3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/TestSetup.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesPost +{ + public abstract class TestSetup : AdminDashboardControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminChangeSpecialismResultReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + SelectedGradeId = 1, + SpecialismResultId=1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..c7825838e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private readonly AdminChangeSpecialismResultReviewChangesViewModel _viewModel = CreateViewModel(); + private const string ErrorKey = "AdminChangeSpecialismResultReviewChanges"; + + public override void Given() + { + Controller.ModelState.AddModelError(ErrorKey, AdminChangeSpecialismResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.DidNotReceive().ProcessChangeSpecialismResultReviewChangesAsync(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, Arg.Any(), CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminChangeSpecialismResultReviewChanges.Validation_Contact_Name_Blank_Text); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Valid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Valid.cs new file mode 100644 index 000000000..d7cdb4cf1 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminDashboardControllerTests/AdminChangeSpecialismResultReviewChangesPost/When_ModelState_Valid.cs @@ -0,0 +1,43 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminDashboard.Result; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests.AdminChangeSpecialismResultReviewChangesPost +{ + public class When_ModelState_Valid : TestSetup + { + private readonly AdminChangeSpecialismResultReviewChangesViewModel _viewModel = CreateViewModel(); + + public override void Given() + { + AdminDashboardLoader.ProcessChangeSpecialismResultReviewChangesAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + Result = await Controller.AdminChangeSpecialismResultReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminDashboardLoader.Received(1).ProcessChangeSpecialismResultReviewChangesAsync(_viewModel); + CacheService.Received(1).SetAsync( + CacheKey, + Arg.Is(p => p.Message.Contains(AdminChangeSpecialismResultReviewChanges.Notification_Message_Asessment_Result_Updated)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.AdminLearnerRecord, (Constants.PathwayId, _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeClearGet/When_Called.cs new file mode 100644 index 000000000..77e5a7862 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeClearGet/When_Called.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomeClearGet +{ + public class When_Called : AdminPostResultsControllerTestBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private IActionResult _result; + + public override async Task When() + { + _result = await Controller.AdminAddCoreRommOutcomeClearAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminAddCoreRommOutcome() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminAddCoreRommOutcome, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, PathwayAssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/TestSetup.cs new file mode 100644 index 000000000..7179f608f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomeAsync +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, PathwayAssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminAddCoreRommOutcomeAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + protected static AdminAddCoreRommOutcomeViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*", + WhatIsRommOutcome = null + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs new file mode 100644 index 000000000..ab9ae37d7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomeAsync +{ + public class When_Cache_Empty_And_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddCoreRommOutcomeViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminAddPathwayRommOutcomeAsync(RegistrationPathwayId, PathwayAssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddPathwayRommOutcomeAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs new file mode 100644 index 000000000..0b675dcca --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomeAsync +{ + public class When_Cache_Empty_And_Valid_Data : TestSetup + { + private AdminAddCoreRommOutcomeViewModel _viewModel; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddCoreRommOutcomeViewModel); + + _viewModel = CreateViewModel(); + AdminPostResultsLoader.GetAdminAddPathwayRommOutcomeAsync(RegistrationPathwayId, PathwayAssessmentId).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddPathwayRommOutcomeAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..14dc59ca8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomeGet/When_Cache_Not_Empty.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomeAsync +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminAddCoreRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminAddPathwayRommOutcomeAsync(Arg.Any(), Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/TestSetup.cs new file mode 100644 index 000000000..7525c7c5c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomePost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1, PathwayResultId = 100; + protected IActionResult Result; + + protected static AdminAddCoreRommOutcomeViewModel CreateViewModel(bool? whatIsRommOutcome = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayResultId = PathwayResultId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + WhatIsRommOutcome = whatIsRommOutcome + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeHasChanged_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeHasChanged_Selected.cs new file mode 100644 index 000000000..285b799fb --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeHasChanged_Selected.cs @@ -0,0 +1,36 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomePost +{ + public class When_GradeHasChanged_Selected : TestSetup + { + private AdminAddCoreRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(whatIsRommOutcome: true); + } + + public async override Task When() + { + Result = await Controller.AdminAddCoreRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminAddRommOutcomeChangeGradeCoreClear)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeIsSame_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeIsSame_Selected.cs new file mode 100644 index 000000000..8b96b5c58 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_GradeIsSame_Selected.cs @@ -0,0 +1,29 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomePost +{ + public class When_GradeIsSame_Selected : TestSetup + { + private AdminAddCoreRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(whatIsRommOutcome: false); + } + + public async override Task When() + { + Result = await Controller.AdminAddCoreRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminLearnerRecord), (("pathwayId", _viewModel.RegistrationPathwayId))); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..dd9c186ef --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddCoreRommOutcomePost/When_ModelState_Invalid.cs @@ -0,0 +1,39 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddCoreRommOutcomePost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddCoreRommOutcomeViewModel _viewModel; + private const string ErrorKey = "AdminAddCoreRommOutcome"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddCoreRommOutcome.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddCoreRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddCoreRommOutcome.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/TestSetup.cs new file mode 100644 index 000000000..4eeff53fe --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/TestSetup.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCoreGet + +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminAddRommOutcomeChangeGradeCoreViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 1 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..b0ef83166 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCoreGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..ab4a78892 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCoreGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddRommOutcomeChangeGradeCoreViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..c5bd6c89e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCoreGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCoreGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddRommOutcomeChangeGradeCoreViewModel); + AdminPostResultsLoader.GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/TestSetup.cs new file mode 100644 index 000000000..c694f027f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCorePost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddRommOutcomeChangeGradeCoreViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_Grade_Selected.cs new file mode 100644 index 000000000..d21958466 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCorePost +{ + public class When_Grade_Selected : TestSetup + { + private AdminAddRommOutcomeChangeGradeCoreViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeCoreAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminPostResultsLoader.Received(1).LoadAdminAddRommOutcomeChangeGradeCoreGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_ReviewChangePathwayResult() + { + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminLearnerRecord); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..ffa4582f8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeCorePost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeCorePost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddRommOutcomeChangeGradeCoreViewModel _viewModel; + private const string ErrorKey = "AdminAddRommOutcomeCore"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddRommOutcomeChangeGradeCore.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeCoreAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminPostResultsLoader.Received(1).LoadAdminAddRommOutcomeChangeGradeCoreGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddRommOutcomeChangeGradeCore.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/TestSetup.cs new file mode 100644 index 000000000..26311824c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/TestSetup.cs @@ -0,0 +1,36 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismGet + +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId); + } + + protected static AdminAddRommOutcomeChangeGradeSpecialismViewModel ViewModel + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Plastering (ZTLOS025)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = 10 + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..92934ac44 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Cache_Not_Empty.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismGet +{ + public class When_Cache_Not_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..c5ddba4c7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismGet +{ + public class When_Called_With_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddRommOutcomeChangeGradeSpecialismViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..47210a66f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismGet/When_Called_With_Valid_Data.cs @@ -0,0 +1,31 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismGet +{ + public class When_Called_With_Valid_Data : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddRommOutcomeChangeGradeSpecialismViewModel); + AdminPostResultsLoader.GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId).Returns(ViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, AssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(ViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/TestSetup.cs new file mode 100644 index 000000000..1f283048c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminDashboardControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismPost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1; + protected IActionResult Result; + + protected static AdminAddRommOutcomeChangeGradeSpecialismViewModel CreateViewModel(int? selectedGradeId = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismName = "Plastering (ZTLOS025)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + SelectedGradeId = selectedGradeId + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_Grade_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_Grade_Selected.cs new file mode 100644 index 000000000..724719476 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_Grade_Selected.cs @@ -0,0 +1,37 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismPost +{ + public class When_Grade_Selected : TestSetup + { + private AdminAddRommOutcomeChangeGradeSpecialismViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(selectedGradeId: 1); + } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeSpecialismAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminPostResultsLoader.Received(1).LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(_viewModel); + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Redirected_To_ReviewChangePathwayResult() + { + Result.ShouldBeRedirectToRouteResult(RouteConstants.AdminLearnerRecord); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..10d68ebc0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddRommOutcomeChangeGradeSpecialismPost/When_ModelState_Invalid.cs @@ -0,0 +1,47 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddRommOutcomeChangeGradeSpecialismPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddRommOutcomeChangeGradeSpecialismViewModel _viewModel; + private const string ErrorKey = "AdminAddRommOutcomeSpecialism"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddRommOutcomeChangeGradeSpecialism.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddRommOutcomeChangeGradeSpecialismAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + AdminPostResultsLoader.Received(1).LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(_viewModel); + CacheService.DidNotReceive().SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddRommOutcomeChangeGradeSpecialism.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeClearGet/When_Called.cs new file mode 100644 index 000000000..a0c2b844b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeClearGet/When_Called.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomeClearGet +{ + public class When_Called : AdminPostResultsControllerTestBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private IActionResult _result; + + public override async Task When() + { + _result = await Controller.AdminAddSpecialismRommOutcomeClearAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminAddCoreRommOutcome() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminAddSpecialismRommOutcome, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, PathwayAssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/TestSetup.cs new file mode 100644 index 000000000..87597d0c0 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomeGet +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, SpecialismAssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminAddSpecialismRommOutcomeAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + protected static AdminAddSpecialismRommOutcomeViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId, + SpecialismName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*", + WhatIsRommOutcome = null + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs new file mode 100644 index 000000000..31a85db6c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomeGet +{ + public class When_Cache_Empty_And_Invalid_Data : TestSetup + { + public override void Given() + { + AdminAddSpecialismRommOutcomeViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminAddSpecialismRommOutcomeAsync(RegistrationPathwayId, SpecialismAssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddSpecialismRommOutcomeAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs new file mode 100644 index 000000000..1c53a4f07 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Empty_And_Valid_Data.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomeGet +{ + public class When_Cache_Empty_And_Valid_Data : TestSetup + { + private AdminAddSpecialismRommOutcomeViewModel _viewModel; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminAddSpecialismRommOutcomeViewModel); + + _viewModel = CreateViewModel(); + AdminPostResultsLoader.GetAdminAddSpecialismRommOutcomeAsync(RegistrationPathwayId, SpecialismAssessmentId).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminAddSpecialismRommOutcomeAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..c665a8540 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomeGet/When_Cache_Not_Empty.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomeGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminAddSpecialismRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminAddSpecialismRommOutcomeAsync(Arg.Any(), Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/TestSetup.cs new file mode 100644 index 000000000..794b7ef66 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomePost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1, SpecialismResultId = 100; + protected IActionResult Result; + + protected static AdminAddSpecialismRommOutcomeViewModel CreateViewModel(bool? whatIsRommOutcome = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismResultId = SpecialismResultId, + SpecialismName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + WhatIsRommOutcome = whatIsRommOutcome + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeHasChanged_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeHasChanged_Selected.cs new file mode 100644 index 000000000..62c1ed9d4 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeHasChanged_Selected.cs @@ -0,0 +1,36 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomePost +{ + public class When_GradeHasChanged_Selected : TestSetup + { + private AdminAddSpecialismRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(whatIsRommOutcome: true); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminAddRommOutcomeChangeGradeSpecialismClear)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeIsSame_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeIsSame_Selected.cs new file mode 100644 index 000000000..79ea0c81d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_GradeIsSame_Selected.cs @@ -0,0 +1,29 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomePost +{ + public class When_GradeIsSame_Selected : TestSetup + { + private AdminAddSpecialismRommOutcomeViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(whatIsRommOutcome: false); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminLearnerRecord), ("pathwayId", _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..5796a077c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminAddSpecialismRommOutcomePost/When_ModelState_Invalid.cs @@ -0,0 +1,39 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminAddSpecialismRommOutcomePost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminAddSpecialismRommOutcomeViewModel _viewModel; + private const string ErrorKey = "AdminAddSpecialismRommOutcome"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminAddSpecialismRommOutcome.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminAddSpecialismRommOutcomeAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminAddSpecialismRommOutcome.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommClearGet/When_Called.cs new file mode 100644 index 000000000..7d664003d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommClearGet/When_Called.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommClearGet +{ + public class When_Called : AdminPostResultsControllerTestBase + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 1; + + private IActionResult _result; + + public override async Task When() + { + _result = await Controller.AdminOpenPathwayRommClearAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminOpenPathwayRomm() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminOpenPathwayRomm, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, PathwayAssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/TestSetup.cs new file mode 100644 index 000000000..0fe53d35d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommGet +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, PathwayAssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + protected static AdminOpenPathwayRommViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*", + DoYouWantToOpenRomm = null + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Invalid_Data.cs new file mode 100644 index 000000000..f7088a217 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommGet +{ + public class When_Cache_Empty_And_Invalid_Data : TestSetup + { + public override void Given() + { + AdminOpenPathwayRommViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Valid_Data.cs new file mode 100644 index 000000000..ab4f55626 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Empty_And_Valid_Data.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommGet +{ + public class When_Cache_Empty_And_Valid_Data : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminOpenPathwayRommViewModel); + + _viewModel = CreateViewModel(); + AdminPostResultsLoader.GetAdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..f98f04655 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommGet/When_Cache_Not_Empty.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminOpenPathwayRommAsync(Arg.Any(), Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/TestSetup.cs new file mode 100644 index 000000000..6b3341814 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommPost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1, PathwayResultId = 100; + protected IActionResult Result; + + protected static AdminOpenPathwayRommViewModel CreateViewModel(bool? doYouWantToOpenRomm = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = AssessmentId, + PathwayResultId = PathwayResultId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + DoYouWantToOpenRomm = doYouWantToOpenRomm + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..ae6d83639 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_ModelState_Invalid.cs @@ -0,0 +1,39 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + private const string ErrorKey = "AdminOpenPathwayRomm"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminOpenPathwayRomm.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminOpenPathwayRommAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminOpenPathwayRomm.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_No_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_No_Selected.cs new file mode 100644 index 000000000..e06556c56 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_No_Selected.cs @@ -0,0 +1,29 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommPost +{ + public class When_No_Selected : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(doYouWantToOpenRomm: false); + } + + public async override Task When() + { + Result = await Controller.AdminOpenPathwayRommAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminLearnerRecord), ("pathwayId", _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_Yes_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_Yes_Selected.cs new file mode 100644 index 000000000..5b803196d --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommPost/When_Yes_Selected.cs @@ -0,0 +1,36 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommPost +{ + public class When_Yes_Selected : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(doYouWantToOpenRomm: true); + } + + public async override Task When() + { + Result = await Controller.AdminOpenPathwayRommAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminOpenPathwayRommReviewChanges)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..486d1ddbc --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/TestSetup.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesGet +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, PathwayAssessmentId = 1, PathwayResultId = 146; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminOpenPathwayRommReviewChangesAsync(); + } + + protected static AdminOpenPathwayRommViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId, + PathwayResultId = PathwayResultId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*", + DoYouWantToOpenRomm = null + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..6b5a2927e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,21 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminOpenPathwayRommViewModel); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..b9d9224cd --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,44 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminOpenPathwayRommViewModel _viewModel; + private AdminOpenPathwayRommReviewChangesViewModel _reviewViewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + + _reviewViewModel = new() + { + RegistrationPathwayId = _viewModel.RegistrationPathwayId, + PathwayAssessmentId = _viewModel.PathwayAssessmentId, + PathwayResultId = _viewModel.PathwayResultId, + Grade = _viewModel.Grade + }; + + AdminPostResultsLoader.GetAdminOpenPathwayRommReviewChangesAsync(_viewModel).Returns(_reviewViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenPathwayRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().Be(_reviewViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..3ccac5641 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/TestSetup.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesPost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, PathwayAssessmentId = 1, PathwayResultId = 146; + + protected static AdminOpenPathwayRommReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId, + PathwayResultId = PathwayResultId, + PathwayName = "Healthcare Science (6037083X)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*" + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..d256bf226 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminOpenPathwayRommReviewChangesViewModel _viewModel; + private const string ErrorKey = "AdminOpenPathwayRommReviewChanges"; + + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminOpenPathwayRommReviewChanges.Validation_Message); + } + + public async override Task When() + { + _result = await Controller.AdminOpenPathwayRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = _result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminOpenPathwayRommReviewChanges.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Fails.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Fails.cs new file mode 100644 index 000000000..2adb18fa7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Fails.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesPost +{ + public class When_Process_Fails : TestSetup + { + private AdminOpenPathwayRommReviewChangesViewModel _viewModel; + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + AdminPostResultsLoader.ProcessAdminOpenPathwayRommAsync(_viewModel).Returns(false); + } + + public async override Task When() + { + _result = await Controller.AdminOpenPathwayRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.ProblemWithService); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Ok.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Ok.cs new file mode 100644 index 000000000..69aed1d60 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenPathwayRommReviewChangesPost/When_Process_Ok.cs @@ -0,0 +1,45 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenPathwayRommReviewChangesPost +{ + public class When_Process_Ok : TestSetup + { + private AdminOpenPathwayRommReviewChangesViewModel _viewModel; + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + AdminPostResultsLoader.ProcessAdminOpenPathwayRommAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + _result = await Controller.AdminOpenPathwayRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync( + AdminDashboardCacheKey, + Arg.Is(p => p.Message.Contains(AdminOpenPathwayRommReviewChanges.Notification_Message_A_Romm_Has_Been_Opened)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.AdminLearnerRecord, ("pathwayId", _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommClearGet/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommClearGet/When_Called.cs new file mode 100644 index 000000000..4943df491 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommClearGet/When_Called.cs @@ -0,0 +1,38 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommClearGet +{ + public class When_Called : AdminPostResultsControllerTestBase + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 1; + + private IActionResult _result; + + public override async Task When() + { + _result = await Controller.AdminOpenSpecialismRommClearAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).RemoveAsync(CacheKey); + } + + [Fact] + public void Then_Redirected_To_AdminOpenPathwayRomm() + { + _result.ShouldBeRedirectToRouteResult( + RouteConstants.AdminOpenSpecialismRomm, + (Constants.RegistrationPathwayId, RegistrationPathwayId), + (Constants.AssessmentId, SpecialismAssessmentId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/TestSetup.cs new file mode 100644 index 000000000..133701c21 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommGet +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, SpecialismAssessmentId = 1; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + protected static AdminOpenSpecialismRommViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId, + SpecialismName = "Plastering (ZTLOS025)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "A*", + DoYouWantToOpenRomm = null + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Invalid_Data.cs new file mode 100644 index 000000000..39b067198 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Invalid_Data.cs @@ -0,0 +1,31 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommGet +{ + public class When_Cache_Empty_And_Invalid_Data : TestSetup + { + public override void Given() + { + AdminOpenSpecialismRommViewModel nullModel = null; + + CacheService.GetAsync(CacheKey).Returns(nullModel); + AdminPostResultsLoader.GetAdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId).Returns(nullModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Valid_Data.cs new file mode 100644 index 000000000..f8403f731 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Empty_And_Valid_Data.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommGet +{ + public class When_Cache_Empty_And_Valid_Data : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminOpenSpecialismRommViewModel); + + _viewModel = CreateViewModel(); + AdminPostResultsLoader.GetAdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..c8400c71c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommGet/When_Cache_Not_Empty.cs @@ -0,0 +1,33 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.DidNotReceive().GetAdminOpenSpecialismRommAsync(Arg.Any(), Arg.Any()); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().BeEquivalentTo(_viewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/TestSetup.cs new file mode 100644 index 000000000..f4f4fad9f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/TestSetup.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommPost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, AssessmentId = 1, SpecialismResultId = 1876; + protected IActionResult Result; + + protected static AdminOpenSpecialismRommViewModel CreateViewModel(bool? doYouWantToOpenRomm = null) + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = AssessmentId, + SpecialismResultId = SpecialismResultId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = string.Empty, + DoYouWantToOpenRomm = doYouWantToOpenRomm + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..83162971e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_ModelState_Invalid.cs @@ -0,0 +1,39 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + private const string ErrorKey = "AdminOpenSpecialismRomm"; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminOpenSpecialismRomm.Validation_Message); + } + + public async override Task When() + { + Result = await Controller.AdminOpenSpecialismRommAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = Result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminOpenSpecialismRomm.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_No_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_No_Selected.cs new file mode 100644 index 000000000..5cfbe74de --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_No_Selected.cs @@ -0,0 +1,29 @@ +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommPost +{ + public class When_No_Selected : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(doYouWantToOpenRomm: false); + } + + public async override Task When() + { + Result = await Controller.AdminOpenSpecialismRommAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminLearnerRecord), ("pathwayId", _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_Yes_Selected.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_Yes_Selected.cs new file mode 100644 index 000000000..c98dda764 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommPost/When_Yes_Selected.cs @@ -0,0 +1,36 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommPost +{ + public class When_Yes_Selected : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + + public override void Given() + { + _viewModel = CreateViewModel(doYouWantToOpenRomm: true); + } + + public async override Task When() + { + Result = await Controller.AdminOpenSpecialismRommAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync(CacheKey, _viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + Result.ShouldBeRedirectToRouteResult(nameof(RouteConstants.AdminOpenSpecialismRommReviewChanges)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/TestSetup.cs new file mode 100644 index 000000000..728bf6913 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/TestSetup.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesGet +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, SpecialismAssessmentId = 1, SpecialismResultId = 1876; + + protected IActionResult Result { get; private set; } + + public override async Task When() + { + Result = await Controller.AdminOpenSpecialismRommReviewChangesAsync(); + } + + protected static AdminOpenSpecialismRommViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId, + SpecialismResultId = SpecialismResultId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "Merit" + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Empty.cs new file mode 100644 index 000000000..ea5067351 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Empty.cs @@ -0,0 +1,21 @@ +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesGet +{ + public class When_Cache_Empty : TestSetup + { + public override void Given() + { + CacheService.GetAsync(CacheKey).Returns(null as AdminOpenSpecialismRommViewModel); + } + + [Fact] + public void Then_Redirected_To_PageNotFound() + { + Result.ShouldBeRedirectPageNotFound(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Not_Empty.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Not_Empty.cs new file mode 100644 index 000000000..bb8bf8610 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesGet/When_Cache_Not_Empty.cs @@ -0,0 +1,44 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesGet +{ + public class When_Cache_Not_Empty : TestSetup + { + private AdminOpenSpecialismRommViewModel _viewModel; + private AdminOpenSpecialismRommReviewChangesViewModel _reviewViewModel; + + public override void Given() + { + _viewModel = CreateViewModel(); + CacheService.GetAsync(CacheKey).Returns(_viewModel); + + _reviewViewModel = new() + { + RegistrationPathwayId = _viewModel.RegistrationPathwayId, + SpecialismAssessmentId = _viewModel.SpecialismAssessmentId, + SpecialismResultId = _viewModel.SpecialismResultId, + Grade = _viewModel.Grade + }; + + AdminPostResultsLoader.GetAdminOpenSpecialismRommReviewChangesAsync(_viewModel).Returns(_reviewViewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).GetAsync(CacheKey); + AdminPostResultsLoader.Received(1).GetAdminOpenSpecialismRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var result = Result.ShouldBeViewResult(); + result.Should().Be(_reviewViewModel); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/TestSetup.cs new file mode 100644 index 000000000..35cd27441 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/TestSetup.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesPost +{ + public abstract class TestSetup : AdminPostResultsControllerTestBase + { + protected const int RegistrationPathwayId = 1, SpecialismAssessmentId = 1, SpecialismResultId = 146; + + protected static AdminOpenSpecialismRommReviewChangesViewModel CreateViewModel() + => new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId, + SpecialismResultId = SpecialismResultId, + SpecialismName = "Assisting with Healthcare Science (ZTLOS018)", + Learner = "John Smith", + Uln = 1080808080, + Provider = "Barnsley College (10000536)", + Tlevel = "Healthcare Science", + StartYear = "2023 to 2024", + ExamPeriod = "Summer 2024", + Grade = "Merit" + }; + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_ModelState_Invalid.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_ModelState_Invalid.cs new file mode 100644 index 000000000..638d796e3 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_ModelState_Invalid.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesPost +{ + public class When_ModelState_Invalid : TestSetup + { + private AdminOpenSpecialismRommReviewChangesViewModel _viewModel; + private const string ErrorKey = "AdminOpenSpecialismRommReviewChanges"; + + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + Controller.ModelState.AddModelError(ErrorKey, AdminOpenSpecialismRommReviewChanges.Validation_Message); + } + + public async override Task When() + { + _result = await Controller.AdminOpenSpecialismRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + var model = _result.ShouldBeViewResult(); + model.Should().BeEquivalentTo(_viewModel); + + ModelStateDictionary modelState = Controller.ViewData.ModelState; + modelState.Should().HaveCount(1); + modelState.Should().ContainKey(ErrorKey); + modelState[ErrorKey].Errors[0].ErrorMessage.Should().Be(AdminOpenSpecialismRommReviewChanges.Validation_Message); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Fails.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Fails.cs new file mode 100644 index 000000000..73f19197a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Fails.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesPost +{ + public class When_Process_Fails : TestSetup + { + private AdminOpenSpecialismRommReviewChangesViewModel _viewModel; + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + AdminPostResultsLoader.ProcessAdminOpenSpecialismRommAsync(_viewModel).Returns(false); + } + + public async override Task When() + { + _result = await Controller.AdminOpenSpecialismRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Returns_Expected() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.ProblemWithService); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Ok.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Ok.cs new file mode 100644 index 000000000..fd3abaa92 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminOpenSpecialismRommReviewChangesPost/When_Process_Ok.cs @@ -0,0 +1,45 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.NotificationBanner; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests.AdminOpenSpecialismRommReviewChangesPost +{ + public class When_Process_Ok : TestSetup + { + private AdminOpenSpecialismRommReviewChangesViewModel _viewModel; + private IActionResult _result; + + public override void Given() + { + _viewModel = CreateViewModel(); + AdminPostResultsLoader.ProcessAdminOpenSpecialismRommAsync(_viewModel).Returns(true); + } + + public async override Task When() + { + _result = await Controller.AdminOpenSpecialismRommReviewChangesAsync(_viewModel); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + CacheService.Received(1).SetAsync( + AdminDashboardCacheKey, + Arg.Is(p => p.Message.Contains(AdminOpenSpecialismRommReviewChanges.Notification_Message_A_Romm_Has_Been_Opened)), + CacheExpiryTime.XSmall); + } + + [Fact] + public void Then_Returns_Expected() + { + _result.ShouldBeRedirectToRouteResult(RouteConstants.AdminLearnerRecord, ("pathwayId", _viewModel.RegistrationPathwayId)); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminPostResultsControllerTestBase.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminPostResultsControllerTestBase.cs new file mode 100644 index 000000000..b280d1e43 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/AdminPostResultsControllerTests/AdminPostResultsControllerTestBase.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Constants; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Common.Services.Cache; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Tests.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.Controllers; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests +{ + public abstract class AdminPostResultsControllerTestBase : BaseTest + { + protected IAdminPostResultsLoader AdminPostResultsLoader; + protected ICacheService CacheService; + protected ILogger Logger; + + protected string CacheKey; + protected string AdminDashboardCacheKey; + protected AdminPostResultsController Controller; + + public override void Setup() + { + AdminPostResultsLoader = Substitute.For(); + CacheService = Substitute.For(); + Logger = Substitute.For>(); + Controller = new AdminPostResultsController(AdminPostResultsLoader, CacheService, Logger); + + var httpContext = new ClaimsIdentityBuilder(Controller) + .Add(CustomClaimTypes.Ukprn, "1234567890") + .Add(CustomClaimTypes.UserId, "82bbe986-d264-460c-ab89-d241c1025f12") + .Build() + .HttpContext; + + IHttpContextAccessor httpContextAccessor = Substitute.For(); + httpContextAccessor.HttpContext.Returns(httpContext); + + string userId = httpContext.User.GetUserId(); + CacheKey = CacheKeyHelper.GetCacheKey(userId, CacheConstants.AdminPostResultsCacheKey); + AdminDashboardCacheKey = CacheKeyHelper.GetCacheKey(userId, CacheConstants.AdminDashboardCacheKey); + } + + public override void Given() + { + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/TestSetup.cs new file mode 100644 index 000000000..d6d4999d8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/TestSetup.cs @@ -0,0 +1,46 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Routing; +using Microsoft.AspNetCore.Mvc.ViewFeatures; +using Microsoft.Extensions.Logging; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Configuration; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Controllers; +using System; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.ErrorControllerTests +{ + public abstract class TestSetup : BaseTest + { + protected ErrorController Controller; + protected IActionResult Result; + protected ILogger Logger; + protected HttpContext HttpContext; + protected IServiceProvider ServiceProvider; + + private readonly ITempDataProvider _tempDataProvider = Substitute.For(); + + public ResultsAndCertificationConfiguration Configuration { get; set; } + + public override void Setup() + { + HttpContext = Substitute.For(); + ServiceProvider = Substitute.For(); + ServiceProvider.GetService(typeof(IUrlHelperFactory)).Returns(new UrlHelperFactory()); + HttpContext.RequestServices = ServiceProvider; + Logger = Substitute.For>(); + Controller = new ErrorController(Configuration, Logger); + + var tempDataDictionary = new TempDataDictionary(HttpContext, _tempDataProvider); + Controller.TempData = tempDataDictionary; + } + + public override Task When() + { + Result = Controller.ServiceAccessDenied(); + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_In_FreezePeriod.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_In_FreezePeriod.cs new file mode 100644 index 000000000..b5df38df7 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_In_FreezePeriod.cs @@ -0,0 +1,34 @@ +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Extensions; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Helpers; +using System.Security.Claims; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.ErrorControllerTests.ServiceAccessDenied +{ + public class When_User_In_FreezePeriod : TestSetup + { + public override void Given() + { + HttpContext.User.Identity.IsAuthenticated.Returns(true); + HttpContext.User.Claims.Returns(new Claim[] + { + new Claim(CustomClaimTypes.InFreezePeriod, "true") + }); + + Controller.ControllerContext = new ControllerContext + { + HttpContext = HttpContext, + RouteData = new Microsoft.AspNetCore.Routing.RouteData() + }; + } + + [Fact] + public void Then_Redirected_To_ServiceUnavailable() + { + Result.ShouldBeRedirectToActionResult(RouteConstants.ServiceUnavailable); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_Not_In_FreezePeriod.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_Not_In_FreezePeriod.cs new file mode 100644 index 000000000..0f95c3f92 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Controllers/ErrorControllerTests/ServiceAccessDenied/When_User_Not_In_FreezePeriod.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using NSubstitute; +using System.Linq; +using System.Security.Claims; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.ErrorControllerTests.ServiceAccessDenied +{ + public class When_User_Not_In_FreezePeriod : TestSetup + { + public override void Given() + { + HttpContext.User.Identity.IsAuthenticated.Returns(true); + HttpContext.User.Claims.Returns(Enumerable.Empty()); + + Controller.ControllerContext = new ControllerContext + { + HttpContext = HttpContext, + RouteData = new Microsoft.AspNetCore.Routing.RouteData() + }; + } + + [Fact] + public void Then_Redirected_To_ServiceUnavailable() + { + Result.Should().NotBeNull().And.BeOfType(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/AdminChangeLogLoaderBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/AdminChangeLogLoaderBaseTest.cs new file mode 100644 index 000000000..96ef8b752 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/AdminChangeLogLoaderBaseTest.cs @@ -0,0 +1,27 @@ +using AutoMapper; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.Loader.Interfaces; +using Sfa.Tl.ResultsAndCertification.Web.Mapper; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminChangeLogLoaderTests +{ + public abstract class AdminChangeLogLoaderBaseTest : BaseTest + { + protected IResultsAndCertificationInternalApiClient ApiClient; + protected IIndustryPlacementLoader IndustryPlacementLoader; + protected AdminChangeLogLoader Loader; + + public override void Setup() + { + ApiClient = Substitute.For(); + + var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(AdminChangeLogMapper).Assembly)); + var mapper = new AutoMapper.Mapper(mapperConfig); + + Loader = new AdminChangeLogLoader(ApiClient, IndustryPlacementLoader, mapper); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/When_SearchChangeLogs_IsCalled.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/When_SearchChangeLogs_IsCalled.cs new file mode 100644 index 000000000..c81fa0a2a --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminChangeLogLoaderTests/When_SearchChangeLogs_IsCalled.cs @@ -0,0 +1,97 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminChangeLog; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.Common; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminChangeLogLoaderTests +{ + public class When_SearchChangeLogs_IsCalled : AdminChangeLogLoaderBaseTest + { + private AdminSearchChangeLogViewModel _expectedResult; + private AdminSearchChangeLogViewModel _actualResult; + + public override void Given() + { + var expectedApiResult = new PagedResponse + { + TotalRecords = 150, + Records = new List + { + new AdminSearchChangeLog + { + ChangeLogId = 1, + ChangeType = ChangeType.StartYear, + DateAndTimeOfChange = new DateTime(2023, 8, 31, 9, 31, 0), + ZendeskTicketID = "1234567-AB", + LearnerFirstname = "Jessica", + LearnerLastname = "Johnson", + Uln = 1234567890, + ProviderName = "Barnsley College", + ProviderUkprn = 10000536, + LastUpdatedBy = "admin-user-01" + } + }, + PagerInfo = new Pager(1, 1, 10) + }; + + ApiClient.SearchChangeLogsAsync(Arg.Is(r => r.SearchKey == "Johnson")).Returns(expectedApiResult); + + _expectedResult = new AdminSearchChangeLogViewModel + { + TotalRecords = 150, + PagerInfo = new PagerViewModel + { + CurrentPage = 1, + PageSize = 10, + RecordFrom = 1, + RecordTo = 1, + StartPage = 1, + TotalItems = 1, + TotalPages = 1 + }, + ChangeLogDetails = new List + { + new AdminSearchChangeLogDetailsViewModel + { + ChangeLogId = 1, + DateAndTimeOfChange = "31 August 2023 9:31am", + ChangeType = (int)ChangeType.StartYear, + ChangeRecordLink = new(){ + Route = RouteConstants.AdminViewChangeStartYearRecord, + RouteAttributes = new Dictionary(){ { Constants.ChangeLogId, "1" } }, + Text = "31 August 2023 9:31am" + }, + ZendeskTicketID = "1234567-AB", + Learner = "Jessica Johnson (1234567890)", + Provider = "Barnsley College (10000536)", + LastUpdatedBy = "admin-user-01" + } + }, + SearchCriteriaViewModel = new AdminSearchChangeLogCriteriaViewModel + { + SearchKey = "Johnson", + PageNumber = 1 + } + }; + } + + public override async Task When() + { + _actualResult = await Loader.SearchChangeLogsAsync(searchKey: "Johnson", pageNumber: 1); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _actualResult.Should().BeEquivalentTo(_expectedResult); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs index d22fa50cb..f771aeda5 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddCoreAssessmentEntry/When_Called_With_Valid_Data.cs @@ -47,7 +47,7 @@ public override void Given() .ProcessAddCoreAssessmentRequestAsync(Arg.Is( x => x.RegistrationPathwayId == ViewModel.AdminCoreComponentViewModel.RegistrationPathwayId && x.ChangeReason == ViewModel.ChangeReason && - x.ChangeType == Common.Enum.ChangeType.AssessmentEntryAdd && + x.ChangeType == Common.Enum.ChangeType.AddPathwayAssessment && x.ContactName == ViewModel.ContactName && x.RequestDate == Convert.ToDateTime(ViewModel.RequestDate) && x.ZendeskId == ViewModel.ZendeskId && diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs index 4d0083bb9..5dd99e0bf 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminDashboardLoaderTests/AdminAddSpecialismAssessmentEntry/When_Called_With_Valid_Data.cs @@ -44,7 +44,7 @@ public override void Given() .ProcessAddSpecialismAssessmentRequestAsync(Arg.Is( x => x.RegistrationPathwayId == ViewModel.AdminOccupationalSpecialismViewModel.RegistrationPathwayId && x.ChangeReason == ViewModel.ChangeReason && - x.ChangeType == Common.Enum.ChangeType.AssessmentEntryAdd && + x.ChangeType == Common.Enum.ChangeType.AddSpecialismAssessment && x.ContactName == ViewModel.ContactName && x.RequestDate == Convert.ToDateTime(ViewModel.RequestDate) && x.ZendeskId == ViewModel.ZendeskId && diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..3a9017285 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Invalid_Data.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.AdminAddRommOutcomeChangeGradeCore +{ + public class When_Called_With_Invalid_Data : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private List _grades; + private AdminAddRommOutcomeChangeGradeCoreViewModel _result; + + public override void Given() + { + _grades = CreatePathwayGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..f387547ae --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeCore/When_Called_With_Valid_Data.cs @@ -0,0 +1,107 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.AdminAddRommOutcomeChangeGradeCore +{ + public class When_Called_With_Valid_Data : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private AdminLearnerRecord _apiResult; + private List _grades; + + private AdminAddRommOutcomeChangeGradeCoreViewModel _result; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId); + _grades = CreatePathwayGrades(); + _grades = _grades.Where(t => !t.Code.Equals(Constants.PathwayComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.PathwayComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)).ToList(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddRommOutcomeChangeGradeCoreAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + + Assessment pathwayAssessment = _apiResult.Pathway.PathwayAssessments.First(); + Provider provider = _apiResult.Pathway.Provider; + + _result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + _result.PathwayAssessmentId.Should().Be(pathwayAssessment.Id); + _result.PathwayName.Should().Be($"{_apiResult.Pathway.Name} ({_apiResult.Pathway.LarId})"); + + _result.Learner.Should().Be($"{_apiResult.Firstname} {_apiResult.Lastname}"); + _result.Uln.Should().Be(_apiResult.Uln); + _result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + _result.Tlevel.Should().Be(_apiResult.Pathway.Name); + _result.StartYear.Should().Be($"{_apiResult.Pathway.AcademicYear} to {_apiResult.Pathway.AcademicYear + 1}"); + + _result.SummaryLearner.Id.Should().Be(AdminAddPathwayResult.Summary_Learner_Id); + _result.SummaryLearner.Title.Should().Be(AdminAddPathwayResult.Summary_Learner_Text); + _result.SummaryLearner.Value.Should().Be(_result.Learner); + + _result.SummaryUln.Id.Should().Be(AdminAddPathwayResult.Summary_ULN_Id); + _result.SummaryUln.Title.Should().Be(AdminAddPathwayResult.Summary_ULN_Text); + _result.SummaryUln.Value.Should().Be(_result.Uln.ToString()); + + _result.SummaryProvider.Id.Should().Be(AdminAddPathwayResult.Summary_Provider_Id); + _result.SummaryProvider.Title.Should().Be(AdminAddPathwayResult.Summary_Provider_Text); + _result.SummaryProvider.Value.Should().Be(_result.Provider); + + _result.SummaryTlevel.Id.Should().Be(AdminAddPathwayResult.Summary_TLevel_Id); + _result.SummaryTlevel.Title.Should().Be(AdminAddPathwayResult.Summary_TLevel_Text); + _result.SummaryTlevel.Value.Should().Be(_result.Tlevel); + + _result.SummaryStartYear.Id.Should().Be(AdminAddPathwayResult.Summary_StartYear_Id); + _result.SummaryStartYear.Title.Should().Be(AdminAddPathwayResult.Summary_StartYear_Text); + _result.SummaryStartYear.Value.Should().Be(_result.StartYear); + + _result.ExamPeriod.Should().Be(pathwayAssessment.SeriesName); + _result.Grade.Should().BeNull(); + + _result.SelectedGradeId.Should().BeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + + BackLinkModel backLink = _result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminAddCoreRommOutcome); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.RegistrationPathwayId] = RegistrationPathwayId.ToString(), + [Constants.AssessmentId] = PathwayAssessmentId.ToString() + }); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Invalid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Invalid_Data.cs new file mode 100644 index 000000000..0b01dde8f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Invalid_Data.cs @@ -0,0 +1,48 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminDashboardLoaderTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.AdminAddRommOutcomeChangeGradeSpecialism +{ + public class When_Called_With_Invalid_Data : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private List _grades; + private AdminAddRommOutcomeChangeGradeSpecialismViewModel _result; + + public override void Given() + { + _grades = CreatePathwayGrades(); + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Valid_Data.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Valid_Data.cs new file mode 100644 index 000000000..aed69d980 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminAddRommOutcomeChangeGradeSpecialism/When_Called_With_Valid_Data.cs @@ -0,0 +1,110 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Controllers.AdminPostResultsControllerTests; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.AdminAddRommOutcomeChangeGradeSpecialism +{ + public class When_Called_With_Valid_Data : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 888; + + private AdminLearnerRecord _apiResult; + private List _grades; + + private AdminAddRommOutcomeChangeGradeSpecialismViewModel _result; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId); + _grades = CreateSpecialismGrades(); + _grades = _grades.Where(t => !t.Code.Equals(Constants.SpecialismComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.SpecialismComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)).ToList(); + + + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + ApiClient.GetLookupDataAsync(LookupCategory.SpecialismComponentGrade).Returns(_grades); + } + + public async override Task When() + { + _result = await Loader.GetAdminAddRommOutcomeChangeGradeSpecialismAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + + Specialism specialism = _apiResult.Pathway.Specialisms.First(p => p.Assessments.Any(a => a.Id == SpecialismAssessmentId)); + Assessment specialismAssessment = specialism.Assessments.First(a => a.Id == SpecialismAssessmentId); + Provider provider = _apiResult.Pathway.Provider; + + _result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + _result.SpecialismAssessmentId.Should().Be(SpecialismAssessmentId); + _result.SpecialismName.Should().Be($"{specialism.Name} ({specialism.LarId})"); + + _result.Learner.Should().Be($"{_apiResult.Firstname} {_apiResult.Lastname}"); + _result.Uln.Should().Be(_apiResult.Uln); + _result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + _result.Tlevel.Should().Be(_apiResult.Pathway.Name); + _result.StartYear.Should().Be($"{_apiResult.Pathway.AcademicYear} to {_apiResult.Pathway.AcademicYear + 1}"); + + _result.SummaryLearner.Id.Should().Be(AdminAddPathwayResult.Summary_Learner_Id); + _result.SummaryLearner.Title.Should().Be(AdminAddPathwayResult.Summary_Learner_Text); + _result.SummaryLearner.Value.Should().Be(_result.Learner); + + _result.SummaryUln.Id.Should().Be(AdminAddPathwayResult.Summary_ULN_Id); + _result.SummaryUln.Title.Should().Be(AdminAddPathwayResult.Summary_ULN_Text); + _result.SummaryUln.Value.Should().Be(_result.Uln.ToString()); + + _result.SummaryProvider.Id.Should().Be(AdminAddPathwayResult.Summary_Provider_Id); + _result.SummaryProvider.Title.Should().Be(AdminAddPathwayResult.Summary_Provider_Text); + _result.SummaryProvider.Value.Should().Be(_result.Provider); + + _result.SummaryTlevel.Id.Should().Be(AdminAddPathwayResult.Summary_TLevel_Id); + _result.SummaryTlevel.Title.Should().Be(AdminAddPathwayResult.Summary_TLevel_Text); + _result.SummaryTlevel.Value.Should().Be(_result.Tlevel); + + _result.SummaryStartYear.Id.Should().Be(AdminAddPathwayResult.Summary_StartYear_Id); + _result.SummaryStartYear.Title.Should().Be(AdminAddPathwayResult.Summary_StartYear_Text); + _result.SummaryStartYear.Value.Should().Be(_result.StartYear); + + _result.ExamPeriod.Should().Be(specialismAssessment.SeriesName); + _result.Grade.Should().BeNull(); + + _result.SelectedGradeId.Should().BeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + + BackLinkModel backLink = _result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminAddSpecialismRommOutcome); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.RegistrationPathwayId] = RegistrationPathwayId.ToString(), + [Constants.AssessmentId] = SpecialismAssessmentId.ToString() + }); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminPostResultsLoaderBaseTest.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminPostResultsLoaderBaseTest.cs new file mode 100644 index 000000000..7c1723255 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/AdminPostResultsLoaderBaseTest.cs @@ -0,0 +1,284 @@ +using AutoMapper; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Api.Client.Interfaces; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Tests.Common.BaseTest; +using Sfa.Tl.ResultsAndCertification.Web.Loader; +using Sfa.Tl.ResultsAndCertification.Web.Mapper; +using System; +using System.Collections.Generic; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests +{ + public abstract class AdminPostResultsLoaderBaseTest : BaseTest + { + protected IResultsAndCertificationInternalApiClient ApiClient; + protected AdminPostResultsLoader Loader; + + public override void Setup() + { + ApiClient = Substitute.For(); + + var mapperConfig = new MapperConfiguration(c => c.AddMaps(typeof(AdminChangeLogMapper).Assembly)); + var mapper = new AutoMapper.Mapper(mapperConfig); + + Loader = new AdminPostResultsLoader(ApiClient, mapper); + } + + protected AdminLearnerRecord CreateAdminLearnerRecord(int registrationPathwayId, RegistrationPathwayStatus status) + { + return new AdminLearnerRecord + { + RegistrationPathwayId = registrationPathwayId, + Uln = 1234567890, + Firstname = "John", + Lastname = "Smith", + DateofBirth = new DateTime(2008, 1, 6), + MathsStatus = SubjectStatus.Achieved, + EnglishStatus = SubjectStatus.Achieved, + OverallCalculationStatus = CalculationStatus.Completed, + AwardingOrganisation = new AwardingOrganisation + { + Id = 1, + Ukprn = 10009696, + Name = "Ncfe", + DisplayName = "NCFE" + }, + Pathway = new Pathway + { + Id = 4, + LarId = "60358294", + Title = "T Level in Education and Early Years", + Name = "Education and Early Years", + StartYear = 2020, + AcademicYear = 2023, + Status = status, + Provider = new Provider + { + Id = 2, + Ukprn = 10000536, + Name = "Barnsley College", + DisplayName = "Barnsley College" + }, + IndustryPlacements = new IndustryPlacement[] + { + new IndustryPlacement + { + Id= 250, + Status = IndustryPlacementStatus.Completed + } + } + } + }; + } + + protected List CreatePathwayGrades() + { + return new List + { + new LookupData + { + Id = 1, + Code = "PCG1", + Value = "A*" + }, + new LookupData + { + Id = 2, + Code = "PCG2", + Value = "A" + }, + new LookupData + { + Id = 3, + Code = "PCG3", + Value = "B" + }, + new LookupData + { + Id = 4, + Code = "PCG4", + Value = "C" + }, + new LookupData + { + Id = 5, + Code = "PCG5", + Value = "D" + }, + new LookupData + { + Id = 6, + Code = "PCG6", + Value = "E" + }, + new LookupData + { + Id = 7, + Code = "PCG7", + Value = "Unclassified" + }, + new LookupData + { + Id = 25, + Code = "PCG8", + Value = "Q - pending result" + }, + new LookupData + { + Id = 26, + Code = "PCG9", + Value = "X - no result" + } + }; + } + + protected List CreateSpecialismGrades() + { + return new List + { + new LookupData + { + Id = 10, + Code = "SCG1", + Value = "Distinction" + }, + new LookupData + { + Id = 11, + Code = "SCG2", + Value = "Merit" + }, + new LookupData + { + Id = 12, + Code = "SCG3", + Value = "Pass" + }, + new LookupData + { + Id = 13, + Code = "SCG4", + Value = "Unclassified" + }, + new LookupData + { + Id = 14, + Code = "SCG5", + Value = "Q - pending result" + }, + new LookupData + { + Id = 15, + Code = "SCG6", + Value = "X - no result" + } + }; + } + + protected AdminLearnerRecord CreateAdminLearnerRecordWithPathwayAssessment(int registrationPathwayId, int pathwayAssessmentId) + { + var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId); + + learnerRecord.Pathway.PathwayAssessments = new Assessment[] + { + new Assessment + { + Id = pathwayAssessmentId, + SeriesId = 1, + SeriesName = "Autum 2023", + ResultEndDate = new DateTime(2024, 1, 1), + RommEndDate = new DateTime(2024, 2, 1), + AppealEndDate = new DateTime(2024, 3, 1), + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user", + ComponentType = ComponentType.Core + } + }; + + return learnerRecord; + } + + protected AdminLearnerRecord CreateAdminLearnerRecordWithSpecialismAssessment(int registrationPathwayId, int specialismAssessmentId) + { + var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId); + + learnerRecord.Pathway.Specialisms = new[] + { + new Specialism + { + Id = 1, + LarId = "ZTLOS001", + Name = "Surveying and Design for Construction and the Built Environment", + Assessments = new[] + { + new Assessment + { + Id = specialismAssessmentId, + SeriesId = 1, + SeriesName = "Autum 2023", + ResultEndDate = new DateTime(2024, 1, 1), + RommEndDate = new DateTime(2024, 2, 1), + AppealEndDate = new DateTime(2024, 3, 1), + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user", + ComponentType = ComponentType.Core + } + } + } + }; + + return learnerRecord; + } + + protected AdminLearnerRecord CreateAdminLearnerRecord(int registrationPathwayId) + { + return new AdminLearnerRecord + { + RegistrationPathwayId = registrationPathwayId, + Uln = 1234567890, + Firstname = "John", + Lastname = "Smith", + DateofBirth = new DateTime(2008, 1, 6), + MathsStatus = SubjectStatus.Achieved, + EnglishStatus = SubjectStatus.Achieved, + OverallCalculationStatus = CalculationStatus.Completed, + AwardingOrganisation = new AwardingOrganisation + { + Id = 1, + Ukprn = 10009696, + Name = "Ncfe", + DisplayName = "NCFE" + }, + Pathway = new Pathway + { + Id = 4, + LarId = "60358294", + Title = "T Level in Education and Early Years", + Name = "Education and Early Years", + StartYear = 2020, + AcademicYear = 2023, + Status = RegistrationPathwayStatus.Active, + Provider = new Provider + { + Id = 2, + Ukprn = 10000536, + Name = "Barnsley College", + DisplayName = "Barnsley College" + }, + IndustryPlacements = new IndustryPlacement[] + { + new IndustryPlacement + { + Id= 250, + Status = IndustryPlacementStatus.Completed + } + } + } + }; + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/TestSetup.cs new file mode 100644 index 000000000..b46368520 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/TestSetup.cs @@ -0,0 +1,123 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public abstract class TestSetup : AdminPostResultsLoaderBaseTest + { + protected const int RegistrationPathwayId = 1; + protected const int PathwayAssessmentId = 125; + + protected AdminOpenPathwayRommViewModel Result { get; private set; } + + public override async Task When() + { + Result = await Loader.GetAdminOpenPathwayRommAsync(RegistrationPathwayId, PathwayAssessmentId); + } + + protected AdminLearnerRecord CreateAdminLearnerRecordWithPathwayAssessment( + int registrationPathwayId, + int pathwayAssessmentId, + RegistrationPathwayStatus status, + string grade, + string gradeCode) + { + var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId, status); + + learnerRecord.Pathway.PathwayAssessments = new Assessment[] + { + new Assessment + { + Id = pathwayAssessmentId, + SeriesId = 1, + SeriesName = "Autum 2023", + ResultEndDate = new DateTime(2024, 1, 1), + RommEndDate = new DateTime(2024, 2, 1), + AppealEndDate = new DateTime(2024, 3, 1), + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user", + ComponentType = ComponentType.Core, + Result = new Result + { + Id = 1, + Grade = grade, + GradeCode = gradeCode, + PrsStatus = PrsStatus.NotSpecified, + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user" + } + } + }; + + return learnerRecord; + } + + protected void AssertResult(AdminLearnerRecord apiResult) + { + Result.Should().NotBeNull(); + + Assessment pathwayAssessment = apiResult.Pathway.PathwayAssessments.First(); + Provider provider = apiResult.Pathway.Provider; + + Result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + Result.PathwayAssessmentId.Should().Be(pathwayAssessment.Id); + Result.PathwayName.Should().Be($"{apiResult.Pathway.Name} ({apiResult.Pathway.LarId})"); + + Result.Learner.Should().Be($"{apiResult.Firstname} {apiResult.Lastname}"); + Result.Uln.Should().Be(apiResult.Uln); + Result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + Result.Tlevel.Should().Be(apiResult.Pathway.Name); + Result.StartYear.Should().Be($"{apiResult.Pathway.AcademicYear} to {apiResult.Pathway.AcademicYear + 1}"); + + Result.SummaryLearner.Id.Should().Be(AdminOpenPathwayRomm.Summary_Learner_Id); + Result.SummaryLearner.Title.Should().Be(AdminOpenPathwayRomm.Summary_Learner_Text); + Result.SummaryLearner.Value.Should().Be(Result.Learner); + + Result.SummaryUln.Id.Should().Be(AdminOpenPathwayRomm.Summary_ULN_Id); + Result.SummaryUln.Title.Should().Be(AdminOpenPathwayRomm.Summary_ULN_Text); + Result.SummaryUln.Value.Should().Be(Result.Uln.ToString()); + + Result.SummaryProvider.Id.Should().Be(AdminOpenPathwayRomm.Summary_Provider_Id); + Result.SummaryProvider.Title.Should().Be(AdminOpenPathwayRomm.Summary_Provider_Text); + Result.SummaryProvider.Value.Should().Be(Result.Provider); + + Result.SummaryTlevel.Id.Should().Be(AdminOpenPathwayRomm.Summary_TLevel_Id); + Result.SummaryTlevel.Title.Should().Be(AdminOpenPathwayRomm.Summary_TLevel_Text); + Result.SummaryTlevel.Value.Should().Be(Result.Tlevel); + + Result.SummaryStartYear.Id.Should().Be(AdminOpenPathwayRomm.Summary_StartYear_Id); + Result.SummaryStartYear.Title.Should().Be(AdminOpenPathwayRomm.Summary_StartYear_Text); + Result.SummaryStartYear.Value.Should().Be(Result.StartYear); + + Result.ExamPeriod.Should().Be(pathwayAssessment.SeriesName); + Result.Grade.Should().Be(pathwayAssessment.Result.Grade); + + Result.SummaryExamPeriod.Id.Should().Be(AdminOpenPathwayRomm.Summary_Exam_Period_Id); + Result.SummaryExamPeriod.Title.Should().Be(AdminOpenPathwayRomm.Summary_Exam_Period_Text); + Result.SummaryExamPeriod.Value.Should().Be(Result.ExamPeriod); + + Result.SummaryGrade.Id.Should().Be(AdminOpenPathwayRomm.Summary_Grade_Id); + Result.SummaryGrade.Title.Should().Be(AdminOpenPathwayRomm.Summary_Grade_Text); + Result.SummaryGrade.Value.Should().Be(Result.Grade); + + Result.DoYouWantToOpenRomm.Should().NotHaveValue(); + + BackLinkModel backLink = Result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminLearnerRecord); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.PathwayId] = RegistrationPathwayId.ToString() + }); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Doesnt_Exist.cs new file mode 100644 index 000000000..19614efcd --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Doesnt_Exist.cs @@ -0,0 +1,27 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public class When_Learner_Doesnt_Exist : TestSetup + { + public override void Given() + { + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + Result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Exists.cs new file mode 100644 index 000000000..4f338d31e --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Exists.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public class When_Learner_Exists : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId, RegistrationPathwayStatus.Active, "A", "PCG2"); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeTrue(); + Result.ErrorMessage.Should().BeEmpty(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_QPending.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_QPending.cs new file mode 100644 index 000000000..760fc148f --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_QPending.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public class When_Learner_Result_QPending : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId, RegistrationPathwayStatus.Active, "Q - pending result", Constants.PathwayComponentGradeQpendingResultCode); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenPathwayRomm.Validation_Result_Pending); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_XNoResult.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_XNoResult.cs new file mode 100644 index 000000000..7a6516f1b --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Result_XNoResult.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public class When_Learner_Result_XNoResult : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId, RegistrationPathwayStatus.Active, "X - no result", Constants.PathwayComponentGradeXNoResultCode); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenPathwayRomm.Validation_No_Result); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Widthdrawn.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Widthdrawn.cs new file mode 100644 index 000000000..3bc429af2 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenPathwayRomm/When_Learner_Widthdrawn.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenPathwayRomm +{ + public class When_Learner_Widthdrawn : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithPathwayAssessment(RegistrationPathwayId, PathwayAssessmentId, RegistrationPathwayStatus.Withdrawn, "A", "PCG2"); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenPathwayRomm.Validation_Widthdrawn); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/TestSetup.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/TestSetup.cs new file mode 100644 index 000000000..7e07e5904 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/TestSetup.cs @@ -0,0 +1,133 @@ +using FluentAssertions; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Learner; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Sfa.Tl.ResultsAndCertification.Web.ViewComponents.BackLink; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public abstract class TestSetup : AdminPostResultsLoaderBaseTest + { + protected const int RegistrationPathwayId = 1; + protected const int SpecialismAssessmentId = 125; + + protected AdminOpenSpecialismRommViewModel Result { get; private set; } + + public override async Task When() + { + Result = await Loader.GetAdminOpenSpecialismRommAsync(RegistrationPathwayId, SpecialismAssessmentId); + } + + protected AdminLearnerRecord CreateAdminLearnerRecordWithSpecialismAssessment( + int registrationPathwayId, + int specialismAssessmentId, + RegistrationPathwayStatus status, + string grade, + string gradeCode) + { + var learnerRecord = CreateAdminLearnerRecord(registrationPathwayId, status); + + learnerRecord.Pathway.Specialisms = new[] + { + new Specialism + { + Id = 1, + LarId = "ZTLOS001", + Name = "Surveying and Design for Construction and the Built Environment", + Assessments = new[] + { + new Assessment + { + Id = specialismAssessmentId, + SeriesId = 1, + SeriesName = "Autum 2023", + ResultEndDate = new DateTime(2024, 1, 1), + RommEndDate = new DateTime(2024, 2, 1), + AppealEndDate = new DateTime(2024, 3, 1), + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user", + ComponentType = ComponentType.Core, + Result = new Result + { + Id = 1, + Grade = grade, + GradeCode = gradeCode, + PrsStatus = PrsStatus.NotSpecified, + LastUpdatedOn = new DateTime(2023, 9, 15), + LastUpdatedBy = "test-user" + } + } + } + } + }; + + return learnerRecord; + } + + protected void AssertResult(AdminLearnerRecord apiResult) + { + Result.Should().NotBeNull(); + + Specialism specialism = apiResult.Pathway.Specialisms.First(p => p.Assessments.Any(a => a.Id == SpecialismAssessmentId)); + Assessment specialismAssessment = specialism.Assessments.First(a => a.Id == SpecialismAssessmentId); + Provider provider = apiResult.Pathway.Provider; + + Result.RegistrationPathwayId.Should().Be(RegistrationPathwayId); + Result.SpecialismAssessmentId.Should().Be(SpecialismAssessmentId); + Result.SpecialismName.Should().Be($"{specialism.Name} ({specialism.LarId})"); + + Result.Learner.Should().Be($"{apiResult.Firstname} {apiResult.Lastname}"); + Result.Uln.Should().Be(apiResult.Uln); + Result.Provider.Should().Be($"{provider.Name} ({provider.Ukprn})"); + Result.Tlevel.Should().Be(apiResult.Pathway.Name); + Result.StartYear.Should().Be($"{apiResult.Pathway.AcademicYear} to {apiResult.Pathway.AcademicYear + 1}"); + + Result.SummaryLearner.Id.Should().Be(AdminOpenSpecialismRomm.Summary_Learner_Id); + Result.SummaryLearner.Title.Should().Be(AdminOpenSpecialismRomm.Summary_Learner_Text); + Result.SummaryLearner.Value.Should().Be(Result.Learner); + + Result.SummaryUln.Id.Should().Be(AdminOpenSpecialismRomm.Summary_ULN_Id); + Result.SummaryUln.Title.Should().Be(AdminOpenSpecialismRomm.Summary_ULN_Text); + Result.SummaryUln.Value.Should().Be(Result.Uln.ToString()); + + Result.SummaryProvider.Id.Should().Be(AdminOpenSpecialismRomm.Summary_Provider_Id); + Result.SummaryProvider.Title.Should().Be(AdminOpenSpecialismRomm.Summary_Provider_Text); + Result.SummaryProvider.Value.Should().Be(Result.Provider); + + Result.SummaryTlevel.Id.Should().Be(AdminOpenSpecialismRomm.Summary_TLevel_Id); + Result.SummaryTlevel.Title.Should().Be(AdminOpenSpecialismRomm.Summary_TLevel_Text); + Result.SummaryTlevel.Value.Should().Be(Result.Tlevel); + + Result.SummaryStartYear.Id.Should().Be(AdminOpenSpecialismRomm.Summary_StartYear_Id); + Result.SummaryStartYear.Title.Should().Be(AdminOpenSpecialismRomm.Summary_StartYear_Text); + Result.SummaryStartYear.Value.Should().Be(Result.StartYear); + + Result.ExamPeriod.Should().Be(specialismAssessment.SeriesName); + Result.Grade.Should().Be(specialismAssessment.Result.Grade); + + Result.SummaryExamPeriod.Id.Should().Be(AdminOpenSpecialismRomm.Summary_Exam_Period_Id); + Result.SummaryExamPeriod.Title.Should().Be(AdminOpenSpecialismRomm.Summary_Exam_Period_Text); + Result.SummaryExamPeriod.Value.Should().Be(Result.ExamPeriod); + + Result.SummaryGrade.Id.Should().Be(AdminOpenSpecialismRomm.Summary_Grade_Id); + Result.SummaryGrade.Title.Should().Be(AdminOpenSpecialismRomm.Summary_Grade_Text); + Result.SummaryGrade.Value.Should().Be(Result.Grade); + + Result.DoYouWantToOpenRomm.Should().NotHaveValue(); + + BackLinkModel backLink = Result.BackLink; + backLink.RouteName.Should().Be(RouteConstants.AdminLearnerRecord); + backLink.RouteAttributes.Should().BeEquivalentTo(new Dictionary + { + [Constants.PathwayId] = RegistrationPathwayId.ToString() + }); + } + } +} diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Doesnt_Exist.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Doesnt_Exist.cs new file mode 100644 index 000000000..85c3c1b9c --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Doesnt_Exist.cs @@ -0,0 +1,27 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public class When_Learner_Doesnt_Exist : TestSetup + { + public override void Given() + { + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(null as AdminLearnerRecord); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + Result.Should().BeNull(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Exists.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Exists.cs new file mode 100644 index 000000000..58fa57906 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Exists.cs @@ -0,0 +1,34 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public class When_Learner_Exists : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId, RegistrationPathwayStatus.Active, "Pass", "SCG3"); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeTrue(); + Result.ErrorMessage.Should().BeEmpty(); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_QPending.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_QPending.cs new file mode 100644 index 000000000..7b3600201 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_QPending.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public class When_Learner_Result_QPending : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId, RegistrationPathwayStatus.Active, "Q - pending result", Constants.SpecialismComponentGradeQpendingResultCode); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenSpecialismRomm.Validation_Result_Pending); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_XNoResult.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_XNoResult.cs new file mode 100644 index 000000000..6ec10dad8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Result_XNoResult.cs @@ -0,0 +1,36 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public class When_Learner_Result_XNoResult : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId, RegistrationPathwayStatus.Active, "X - no result", Constants.SpecialismComponentGradeXNoResultCode); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenSpecialismRomm.Validation_No_Result); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Widthdrawn.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Widthdrawn.cs new file mode 100644 index 000000000..e1f961355 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/GetAdminOpenSpecialismRomm/When_Learner_Widthdrawn.cs @@ -0,0 +1,35 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.AdminDashboard; +using Sfa.Tl.ResultsAndCertification.Web.Content.AdminPostResults; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.GetAdminOpenSpecialismRomm +{ + public class When_Learner_Widthdrawn : TestSetup + { + private AdminLearnerRecord _apiResult; + + public override void Given() + { + _apiResult = CreateAdminLearnerRecordWithSpecialismAssessment(RegistrationPathwayId, SpecialismAssessmentId, RegistrationPathwayStatus.Withdrawn, "Pass", "SCG3"); + ApiClient.GetAdminLearnerRecordAsync(RegistrationPathwayId).Returns(_apiResult); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetAdminLearnerRecordAsync(RegistrationPathwayId); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + AssertResult(_apiResult); + + Result.IsValid.Should().BeFalse(); + Result.ErrorMessage.Should().Be(AdminOpenSpecialismRomm.Validation_Widthdrawn); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeCoreGrades/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeCoreGrades/When_Called.cs new file mode 100644 index 000000000..973e865b8 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeCoreGrades/When_Called.cs @@ -0,0 +1,57 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.LoadAdminAddRommOutcomeChangeCoreGrades +{ + public class When_Called : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int PathwayAssessmentId = 125; + + private List _grades; + + private readonly AdminAddRommOutcomeChangeGradeCoreViewModel _result = new() + { + RegistrationPathwayId = RegistrationPathwayId, + PathwayAssessmentId = PathwayAssessmentId + }; + + public override void Given() + { + _grades = CreatePathwayGrades(); + _grades = _grades.Where(t => !t.Code.Equals(Constants.PathwayComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.PathwayComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase) + ).ToList(); + ApiClient.GetLookupDataAsync(LookupCategory.PathwayComponentGrade).Returns(_grades); + } + + public async override Task When() + { + await Loader.LoadAdminAddRommOutcomeChangeGradeCoreGrades(_result); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.PathwayComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeSpecialismGrades/When_Called.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeSpecialismGrades/When_Called.cs new file mode 100644 index 000000000..bb7cd3208 --- /dev/null +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Loader/AdminPostResultsLoaderTests/LoadAdminAddRommOutcomeChangeSpecialismGrades/When_Called.cs @@ -0,0 +1,55 @@ +using FluentAssertions; +using NSubstitute; +using Sfa.Tl.ResultsAndCertification.Common.Enum; +using Sfa.Tl.ResultsAndCertification.Common.Helpers; +using Sfa.Tl.ResultsAndCertification.Models.Contracts.Common; +using Sfa.Tl.ResultsAndCertification.Web.ViewModel.AdminPostResults; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Xunit; + +namespace Sfa.Tl.ResultsAndCertification.Web.UnitTests.Loader.AdminPostResultsLoaderTests.LoadAdminAddRommOutcomeChangeSpecialismGrades +{ + public class When_Called : AdminPostResultsLoaderBaseTest + { + private const int RegistrationPathwayId = 1; + private const int SpecialismAssessmentId = 125; + + private List _grades; + + private readonly AdminAddRommOutcomeChangeGradeSpecialismViewModel _result = new() + { + RegistrationPathwayId = RegistrationPathwayId, + SpecialismAssessmentId = SpecialismAssessmentId + }; + + public override void Given() + { + _grades = CreatePathwayGrades(); + _grades = _grades.Where(t => !t.Code.Equals(Constants.SpecialismComponentGradeQpendingResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.SpecialismComponentGradeXNoResultCode, StringComparison.InvariantCultureIgnoreCase) + && !t.Code.Equals(Constants.NotReceived, StringComparison.InvariantCultureIgnoreCase)).ToList(); + ApiClient.GetLookupDataAsync(LookupCategory.SpecialismComponentGrade).Returns(_grades); + } + + public async override Task When() + { + await Loader.LoadAdminAddRommOutcomeChangeGradeSpecialismGrades(_result); + } + + [Fact] + public void Then_Expected_Methods_AreCalled() + { + ApiClient.Received(1).GetLookupDataAsync(LookupCategory.SpecialismComponentGrade); + } + + [Fact] + public void Then_Returns_Expected_Results() + { + _result.Should().NotBeNull(); + _result.Grades.Should().BeEquivalentTo(_grades); + } + } +} \ No newline at end of file diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Add_Romm_Outcome_Before_Appeal_End_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Add_Romm_Outcome_Before_Appeal_End_Date.cs index 672fc8d74..4472177ba 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Add_Romm_Outcome_Before_Appeal_End_Date.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Add_Romm_Outcome_Before_Appeal_End_Date.cs @@ -28,7 +28,9 @@ public class When_Result_Add_Romm_Outcome_Before_Appeal_End_Date : AdminDashboar Id = 1, Grade = "A", GradeCode = "PCG2", - PrsStatus = PrsStatus.UnderReview + PrsStatus = PrsStatus.UnderReview, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -46,8 +48,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().Be(_assessment.Result.Grade); Result.PrsDisplayText.Should().ContainAll(new[] { Constants.BlueTagClassName, PrsStatusContent.Under_Review_Display_Text }); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeFalse(); Result.ActionButton.Should().NotBeNull(); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Doesnt_Have_Grade.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Doesnt_Have_Grade.cs index ca55fcd24..89ba8933f 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Doesnt_Have_Grade.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Doesnt_Have_Grade.cs @@ -24,7 +24,9 @@ public class When_Result_Doesnt_Have_Grade : AdminDashboardMapperTestBase Id = 1, Grade = string.Empty, GradeCode = string.Empty, - PrsStatus = PrsStatus.NotSpecified + PrsStatus = PrsStatus.NotSpecified, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -42,8 +44,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().BeEmpty(); Result.PrsDisplayText.Should().BeEmpty(); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeFalse(); Result.ActionButton.Should().NotBeNull(); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Before_Appeal_End_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Before_Appeal_End_Date.cs index 518ddd24b..892902d57 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Before_Appeal_End_Date.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Before_Appeal_End_Date.cs @@ -28,7 +28,9 @@ public class When_Result_Open_Appeal_Before_Appeal_End_Date : AdminDashboardMapp Id = 1, Grade = "A", GradeCode = "PCG2", - PrsStatus = PrsStatus.Reviewed + PrsStatus = PrsStatus.Reviewed, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -46,8 +48,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().Be(_assessment.Result.Grade); Result.PrsDisplayText.Should().ContainAll(new[] { Constants.RedTagClassName, PrsStatusContent.Final_Display_Text }); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeTrue(); Result.ActionButton.Should().NotBeNull(); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Outcome_Before_Appeal_End_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Outcome_Before_Appeal_End_Date.cs index b01553327..82eaea31b 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Outcome_Before_Appeal_End_Date.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Appeal_Outcome_Before_Appeal_End_Date.cs @@ -28,7 +28,9 @@ public class When_Result_Open_Appeal_Outcome_Before_Appeal_End_Date : AdminDashb Id = 1, Grade = "A", GradeCode = "PCG2", - PrsStatus = PrsStatus.BeingAppealed + PrsStatus = PrsStatus.BeingAppealed, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -46,8 +48,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().Be(_assessment.Result.Grade); Result.PrsDisplayText.Should().ContainAll(new[] { Constants.PurpleTagClassName, PrsStatusContent.Being_Appealed_Display_Text }); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeFalse(); Result.ActionButton.Should().NotBeNull(); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_After_Romm_End_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_After_Romm_End_Date.cs index 2aa22f5c9..865e9a1a1 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_After_Romm_End_Date.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_After_Romm_End_Date.cs @@ -28,7 +28,9 @@ public class When_Result_Open_Romm_After_Romm_End_Date : AdminDashboardMapperTes Id = 1, Grade = "A", GradeCode = "PCG2", - PrsStatus = PrsStatus.NotSpecified + PrsStatus = PrsStatus.NotSpecified, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -46,8 +48,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().Be(_assessment.Result.Grade); Result.PrsDisplayText.Should().ContainAll(new[] { Constants.RedTagClassName, PrsStatusContent.Final_Display_Text }); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeTrue(); Result.ActionButton.Should().NotBeNull(); diff --git a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_Before_Romm_End_Date.cs b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_Before_Romm_End_Date.cs index cfc7d2f30..f110b2d94 100644 --- a/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_Before_Romm_End_Date.cs +++ b/src/Tests/Sfa.Tl.ResultsAndCertification.Web.UnitTests/Mapper/AssessmentToAdminAssessmentViewModel/When_Result_Open_Romm_Before_Romm_End_Date.cs @@ -29,7 +29,9 @@ public class When_Result_Open_Romm_Before_Romm_End_Date : AdminDashboardMapperTe Id = 1, Grade = "A", GradeCode = "PCG2", - PrsStatus = PrsStatus.NotSpecified + PrsStatus = PrsStatus.NotSpecified, + LastUpdatedOn = new DateTime(2024, 1, 10), + LastUpdatedBy = "John Smith" } }; @@ -47,8 +49,8 @@ public void Then_Returns_Expected_Results() Result.ExamPeriod.Should().Be(_assessment.SeriesName); Result.Grade.Should().Be(_assessment.Result.Grade); Result.PrsDisplayText.Should().ContainAll(new[] { Constants.RedTagClassName, PrsStatusContent.Final_Display_Text }); - Result.LastUpdated.Should().Be(_assessment.LastUpdatedOn.ToDobFormat()); - Result.UpdatedBy.Should().Be(_assessment.LastUpdatedBy); + Result.LastUpdated.Should().Be(_assessment.Result.LastUpdatedOn.ToDobFormat()); + Result.UpdatedBy.Should().Be(_assessment.Result.LastUpdatedBy); Result.IsResultChangeAllowed.Should().BeTrue(); Result.ActionButton.Should().NotBeNull(); From 202faa9b7d529d57203b5801f1cce7b5341e89fd Mon Sep 17 00:00:00 2001 From: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:10:48 +0100 Subject: [PATCH 5/6] Master to dev (#668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Merge Release 20.6 to develop (#642) (#643) Merge develop to master for Release 20.6 * Service maintenance page (#657) * Fix and unit tests (#650) * Scheduled maintenance page * Remove unused properties * Dev to master 20.7 (#667) * Merge Release 20.6 to develop (#642) * Tl2023-329 (#617) * Feature/tl2023 200 (#591) * TL2023-120 (#557) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Add filters and refactor * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Fixes * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * Changes * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Feature/tl2023 129 (#553) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Caching added in the controller * Tests * Tests * Merge fix * Fix * Merge fixes * Remove unused content --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#558) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/tl2023 106 latest (#559) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * Accessibility issues addressed * Remove id * TL2023-118 (#534) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * TL2023-118 (#535) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * TL2023-72 (#536) * Changes * Page changes * Remove unused content * Correction * TL2023-163 (#537) * Changes * Page changes * Remove unused content * Correction * Breadcrum fix * TL2023-118 (#538) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Refector models * Repo filter method * Refactor * Changes * Changes * Search learner and validations * Fixes * Tests * Code change * Fixes * Update tests due to server errors * Display generic message when validation occurs * Design updates * Generic no matches messege updated * TL2023-163 (#540) * Breadcrumbs fix * Remove page * Link added (#542) * Feature/tl2023 105 (#541) * Implemented Learner Record * Implemented unit test cases * removed unused constants * Revert the web.config and launchsettings * parameter name change * update route constant * Restore old govuk-frontend library (#544) * Fixed the provider name and awarding organisation going to two lines (#545) * Feature/tl2023 168 (#546) * Fixed the provider name and awarding organisation going to two lines * updated unit test * Feature/tl2023 169 (#547) * removed unsued code * update the unit test * TL2023-174 (#549) * Trim last name lookup * Providers journey lastname with extra space * Remove cache when first enter page (#550) * Changes from develop to Release20.3 (#548) * updated seed script (#473) (#474) * Develop (#480) * updated seed script (#473) * Release 19.12 chg0073773 (#479) * TLRC-9595 Added StartDate to certification * TLRC-9598 Refactored the test methods * TLRC-9836 Refactored the code to add EndDate is null for registration specialism * Tlrc 9947 (#477) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content (#470) * Removed specilims ZTLOS061 and ZTLOS008 * Content update --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik * Feature/tlrc 9894 (#478) * TLRC-9955 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * Script updated * Script updated (#465) * Made specialism inactive * TLRC-9950 Removed Assistant from ZTLOS062 and ZTLOS063 specialism * iactive specialism * Specialism name update * fixed issue which is considering inactive specialisms * Updated IP status content --------- Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Mustafa JAWAD Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Ibai Gonzalez Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> * added missing parameters * added missing parameters * Release20.1 (#502) (#503) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed linked ARM deployment temaplate base URL modified linked template name * Added storage account kind modified deployment template branch Revert "modified deployment template branch" This reverts commit d193f38ae99d0879cfcd01d5fffc6dcd62f8bb6a. * working sql firewall rules * Develop (#518) * Release20.1 (#502) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Remove filter (#499) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Release20.2 (#517) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Using the sql firewall restrictions yaml variable * added replica sql server * reworked sql firewall rules to loop on sql servers count * enabled sql auditing on replica server * added sql database to replica server * added condition to toggle deployment of replica * deployed replica as a secondary db * added key vault secrets and updated variable name --------- Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Title update (#552) * Feature/tl2023-129 Admin dashboard: Change start year (#551) * Added functionality to change start year * Merge with Release20.3 updates * Added functionality to change start year * Code refactor and added validation * Updated unit tests * Added validation messages in resource file * Merge latest * Test * Implemented change start year link * merge issues fixed * Changed the message format. --------- Co-authored-by: ibai-gonzalez <131773078+ibai-gonzalez@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> * Feature/Tl2023-108 (#560) * TL2023-128 (#520) * TL2023 46 (#504) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Hide break line --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * changed the content in the footer (#505) * TL2023 44 (#506) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Cookies message updated --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Feature/tl2023 45 (#508) * changed the content in the footer * updated content * Updated request SOA and search page (#509) * TL2023 41 (#511) * Link text updated (#481) * Filter by active specialisms (#482) * provider address implementation (#483) * Filter inactive courses (#484) * Tl2023 24 (#485) * provider address implementation * Name change * Make it fail when an inactive specialism is sent in the CSV file (#486) * Prevent users from uploading inactive course registrations (#487) * Tl2023 24 (#488) * provider address implementation * Name change * update the mapping * Tl2023 24 (#489) * provider address implementation * Name change * update the mapping * add missing mapping * Updated text (#491) * Tl2023 24 (#490) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * Remove h3 tag (#492) * Filter inactive pathways (#494) * Tl2023 24 (#495) * provider address implementation * Name change * update the mapping * add missing mapping * Mapping trigger * getting only isactive addresses * Change headers (#496) * Page updated * Updated request SOA and search page * Remove breadcrumbs --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Update page header text (#513) * Feature/tl2023 45 (#514) * changed the content in the footer * updated content * updated content * Remove label (#515) * Get dates from configuration --------- Co-authored-by: Sajid Shafique Malik Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> * Change order (#521) * Remove time from current date (#522) * Admin dashboard (#524) * Implemented Admin user access (#525) * Implemented Admin user access * Addressed comments * Addressed comments * TL2023-104 (#527) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * TL2023-104 (#528) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * TL2023-104 (#529) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page * Constant updated * Small changes * Remove unused namespaces * Restrict admin pages access * Look and feel changes * Alignment fix * TL2023-104 (#530) * Add controller/service/repos * Tests * Service tests (unfinished) * Search learners page … --------- Co-authored-by: Calum Rees <81469431+calumrees99@users.noreply.github.com> Co-authored-by: Santhosh <111443660+Skumarhpa@users.noreply.github.com> Co-authored-by: Sajid Shafique Malik Co-authored-by: mustafajawad786 <132081861+mustafajawad786@users.noreply.github.com> Co-authored-by: Mustafa JAWAD Co-authored-by: REES Co-authored-by: Calum Rees Co-authored-by: Sam H <97249915+sam-hiscox@users.noreply.github.com> Co-authored-by: skumarhpa --- src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs index bb53fdceb..c920feec8 100644 --- a/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs +++ b/src/Sfa.Tl.ResultsAndCertification.InternalApi/Startup.cs @@ -164,6 +164,7 @@ private void RegisterApplicationServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); // Bulk Registrations services.AddTransient, RegistrationParser>(); From b5523e59d7f722c976fb51533cc7f2686640a8d6 Mon Sep 17 00:00:00 2001 From: Sam Hiscox Date: Mon, 8 Apr 2024 13:22:31 +0100 Subject: [PATCH 6/6] Update outputs to support access key rotations --- azure/tlevels-environment.json | 8 ++++---- azure/tlevels-shared.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/azure/tlevels-environment.json b/azure/tlevels-environment.json index 9d82ffe1a..4efd422bc 100644 --- a/azure/tlevels-environment.json +++ b/azure/tlevels-environment.json @@ -476,15 +476,15 @@ }, { "name": "BlobStorageConnectionString", - "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" }, { "name": "AzureWebJobsStorage", - "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" }, { "name": "AzureWebJobsDashboard", - "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('storage-account','-',parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" }, { "name": "WEBSITE_TIME_ZONE", @@ -731,7 +731,7 @@ }, "BlobStorageConnectionString": { "type": "string", - "value": "[reference(concat('storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" } } } \ No newline at end of file diff --git a/azure/tlevels-shared.json b/azure/tlevels-shared.json index d92249930..a39924a9c 100644 --- a/azure/tlevels-shared.json +++ b/azure/tlevels-shared.json @@ -465,11 +465,11 @@ }, "sharedStorageConnectionString": { "type": "string", - "value": "[reference(concat('shared-storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('shared-storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" }, "configStorageConnectionString": { "type": "string", - "value": "[reference(concat('config-storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionString.value]" + "value": "[reference(concat('config-storage-account','-', parameters('environmentNameAbbreviation'))).outputs.storageConnectionStringKey2.value]" }, "ConfigStorageAccountName": { "type": "string",