tables
tables
Entity
Administrator:
A detailed documentation for a class within the com.abaudit.rest.app package of the iaudits-
app submodule,
Package: com.abaudit.rest.app
Submodule: iaudits-app
Type: REST Controller
The AuditorAppRest class is a Spring @RestController that manages HTTP requests related
to auditors and their projects. This controller provides functionality for:
@RestController: Marks the class as a REST controller, ensuring that each method returns
data.
@RequestMapping(value = "/api/auditor"): Sets the base path for all endpoints defined in
this controller.
Methods
1. getAppProjectsByAuditorService
putAppAuditorService
3. postAppAuditorAvatarService
REST API :
GET /api/auditor/project
Controller: AuditorAppRest
Validator Called:
Service Called:
Service: GetAppProjectsByAuditorService:
@Service("getAppProjectsByAuditorService")
public class GetAppProjectsByAuditorService implements GetService {
REST API :
PUT /api/auditor
Controller Called:
Controller: AuditorAppRest
Controller Method: putAppAuditorService
Validator Called:
Validator: AuditorServiceValidator
Validator Method: validatePut
Service Called:
Service: PutAppAuditorService
Service Method: process
REST API :
POST /api/auditor/avatar
Controller Called:
Controller: AuditorAppRest
Controller Method: postAppAuditorAvatarService
Validator Called:
Validator: AuditorServiceValidator
Validator Method: validatePost
Service Called:
Service: PostAppAuditorAvatarService
Service Method: process
public Object
Method called: getAppProjectsByAuditorService(@RequestHeade
getAppProjectsByAuditorService r HttpHeaders headers, HttpServletRequest
request,
HttpServletResponse
response) {
@Service("auditorProjectServiceValidator")
Validator Impl: public class
AuditorProjectServiceValidatorI
AuditorProjectServiceValidatorImpl extends
mpl
AbstractValidator implements
AuditorProjectServiceValidator {
Interface called :
public interface RestValidator {
RestValidator
Method called : boolean validateGet(HttpServletRequest
validateGet request, Map<String, String> pathParamsMap)
throws Exception;
Service called : @Autowired
GetService @Qualifier("getAdministratorService")
protected GetService
getAdministratorService;
@Service("auditorProjectServiceValidator")
Validator Impl: public class
AuditorProjectServiceValidatorI
AuditorProjectServiceValidatorImpl extends
mpl
AbstractValidator implements
AuditorProjectServiceValidator {
Interface called :
public interface RestValidator {
RestValidator
Method called : boolean validatePost(HttpServletRequest
validateGet request, Map<String, String> pathParamsMap)
throws Exception;
Service called : @Autowired
PostService @Qualifier("postAdministratorService")
protected PostService
postAdministratorService;
@Service("auditorProjectServiceValidator")
Validator Impl: public class
AuditorProjectServiceValidatorI
AuditorProjectServiceValidatorImpl extends
mpl
AbstractValidator implements
AuditorProjectServiceValidator {
Interface called :
RestValidator public interface RestValidator {
4. Deleting administrators.
API Endpoint /api/admin/administrator
HTTP Method DELETE
Description Updating existing administrator details.
Controller called : AuditorAppRest @RestController
@RequestMapping(value = "/api/auditor")
public class AuditorAppRest {
@Service("auditorProjectServiceValidator")
Validator Impl: public class
AuditorProjectServiceValidatorI
AuditorProjectServiceValidatorImpl extends
mpl
AbstractValidator implements
AuditorProjectServiceValidator {
Interface called :
RestValidator public interface RestValidator {
boolean validateDelete(HttpServletRequest
Method called : request, Map<String, String> pathParamsMap)
validateDelete
throws Exception;
Service called : @Autowired
DeleteService
@Qualifier("deleteAdministratorService")
protected DeleteService
deleteAdministratorService;
Method called :
process @Override
public Object process(HttpHeaders
header, HttpServletRequest request,
HttpServletResponse response,
Map<String, String>
pathParamsMap) {
Detailed Flow
Controller (AuditorAppRest):
Each method in this controller calls a respective validator (via dependency injection) to
validate the request parameters before delegating processing to the appropriate service.
Validator (AuditorServiceValidator):
Service (GetAppProjectsByAuditorService):
Handles GET requests for retrieving projects by auditor, accessing the DAO to fetch
the data.
Service (PutAppAuditorService):
Handles adding an auditor's avatar through the process method, which processes and
saves files to a specific directory.
The FindingAppRest controller handles HTTP requests for managing findings in the audit
application. The controller provides functionality for:
@RequestMapping(value = "/api/finding"): Sets the base path for all the endpoints defined
in this controller.
Methods
1. postFinding
2. getFindingById
3. putFinding
1. GET /api/finding/test/init
Controller Called:
o Controller: FindingAppRest
o Controller Method: getAppFindingTestInitService
Validator Called:
o Validator: FindingTestInitServiceValidator
o Validator Method: validateGet
Service Called:
o Service: GetAppFindingTestInitService
o Service Method: process
2. GET /api/finding
Controller Called:
o Controller: FindingAppRest
o Controller Method: getAppFindingService
Validator Called:
o Validator: FindingServiceValidator
o Validator Method: validateGet
Service Called:
o Service: GetAppFindingService
o Service Method: process
3. POST /api/finding
Controller Called:
o Controller: FindingAppRest
o Controller Method: postAppFindingService
Validator Called:
o Validator: FindingServiceValidator
o Validator Method: validatePost
Service Called:
o Service: PostAppFindingService
o Service Method: process
4. PUT /api/finding/auditor
Controller Called:
o Controller: FindingAppRest
o Controller Method: putAppFindingAuditorService
Validator Called:
o Validator: FindingAuditorServiceValidator
o Validator Method: validatePut
Service Called:
o Service: PutAppFindingAuditorService
o Service Method: process
5. PUT /api/finding
Controller Called:
o Controller: FindingAppRest
o Controller Method: putAppFindingService
Validator Called:
o Validator: FindingServiceValidator
o Validator Method: validatePut
Service Called:
o Service: PutAppFindingService
o Service Method: process
6. DELETE /api/finding
Controller Called:
o Controller: FindingAppRest
o Controller Method: deleteAppFindingService
Validator Called:
o Validator: FindingServiceValidator
o Validator Method: validateDelete
Service Called:
o Service: DeleteAppFindingService
o Service Method: process
Detailed Flow
@RestController: Marks the class as a REST controller, ensuring that each method
returns data, typically in JSON format.
@RequestMapping(value = "/api/finding/comment"): Sets the base path for all
endpoints defined
in this controller.
Methods
1. postAppFindingCommentService
o Endpoint: POST /api/finding/comment
o Handles the creation of new comments.
2. deleteAppFindingCommentService
o Endpoint: DELETE /api/finding/comment
o Manages the deletion of existing comments.
The FindingContactAppRest class is a Spring @RestController that manages HTTP
requests related to finding contacts. This controller provides functionality for :
Methods
1. getAppFindingContactInitService
o Endpoint: GET /api/finding/contact/init
o Description: Retrieves initial contact data for findings.
2. postAppFindingContactService
o Endpoint: POST /api/finding/contact
o Description: Handles the creation of new contacts. Validates the incoming
request and processes the contact creation if valid.
3. putAppFindingContactService
o Endpoint: PUT /api/finding/contact
o Description: Manages the updating of existing contacts. Validates the request
and processes the update if valid.
4. deleteAppFindingContactService
o Endpoint: DELETE /api/finding/contact
o Description: Handles the deletion of existing contacts. Validates the request
and processes the deletion if valid.
REST API:
GET /api/finding/contact/init
Controller Called:
o Controller: FindingContactAppRest
o Controller Method: getAppFindingContactInitService
Validator Called:
o Validator: FindingContactInitServiceValidator
o Validator Method: validateGet
Service Called:
o Service: GetAppFindingContactInitService
o Service Method: process
REST API:
POST /api/finding/contact
Controller Called:
o Controller: FindingContactAppRest
o Controller Method: postAppFindingContactService
Validator Called:
o Validator: FindingContactServiceValidator
o Validator Method: validatePost
Service Called:
o Service: PostAppFindingContactService
o Service Method: process
REST API
PUT /api/finding/contact
Controller Called:
o Controller: FindingContactAppRest
o Controller Method: putAppFindingContactService
Validator Called:
o Validator: FindingContactServiceValidator
o Validator Method: validatePut
Service Called:
o Service: PutAppFindingContactService
o Service Method: process
REST API
DELETE /api/finding/contact
Controller Called:
o Controller: FindingContactAppRest
o Controller Method: deleteAppFindingContactService
Validator Called:
o Validator: FindingContactServiceValidator
o Validator Method: validateDelete
Service Called:
o Service: DeleteAppFindingContactService
o Service Method: process
Detailed Flow
Controller (FindingContactAppRest): Manages requests related to finding contacts.
Validators:
Services:
1. Finding Table: This table represents audit findings. Each finding is linked to various
workflows, categories, and classifications. It contains critical information such as
labels, descriptions, recommendations, and deadlines. It also references various
entities like contacts, workflow steps, and classifications.
o Attributes:
findingKey (Primary Key): Unique identifier for the finding.
label: A description or title for the finding.
recommendation, response, resume: Different fields related to the
finding’s details.
findingCategoryKey (Foreign Key): References the FindingCategory
table.
findingClassificationLevelKey (Foreign Key): References the
FindingClassificationLevel table.
auditorKey (Foreign Key): References the Contact table.
progress: An integer to track the progress of the finding.
2. FindingWorkflowStep Table: Represents the workflow steps related to a finding.
This table is essential for tracking the various stages a finding goes through in the
audit process.
o Attributes:
findingWorkflowStepKey (Primary Key): Unique identifier for a
workflow step.
findingKey (Foreign Key): References the Finding table.
status: Status of the workflow step.
3. FindingResponseWorkflowStep Table: Handles the response workflows for each
finding, providing a detailed track of how the audit team and other stakeholders
respond to each finding.
o Attributes:
findingResponseWorkflowStepKey (Primary Key).
findingKey (Foreign Key): Links to the corresponding finding.
responseDetails: Information on the response.
4. Contact Table: Represents people or roles that are responsible for the findings, such
as auditors, managers, or any stakeholders involved in the process.
o Attributes:
contactKey (Primary Key): Unique identifier for each contact.
name, role: Details of the person or role.
5. FindingCategory Table: This table stores the different categories that each finding
can be classified under.
o Attributes:
findingCategoryKey (Primary Key).
categoryName: The name of the category.
6. FindingClassificationLevel Table: Stores classification levels (e.g., critical, major,
minor) for findings, which help in prioritizing the audit findings.
o Attributes:
findingClassificationLevelKey (Primary Key).
classificationLevel: Level of classification.
7. FindingComment Table: Stores comments related to a finding.
o Attributes:
findingCommentKey (Primary Key).
findingKey (Foreign Key).
commentText: Content of the comment.
8. FindingResponseComment Table: Stores the comments related to the response
workflow of the finding.
o Attributes:
findingResponseCommentKey (Primary Key).
findingResponseWorkflowStepKey (Foreign Key).
responseCommentText: Text of the response comment.
ER Diagram Overview
One-to-Many:
o A finding can have multiple workflow steps (FindingWorkflowStep).
o A finding can have multiple response workflow steps
(FindingResponseWorkflowStep).
o A finding can have multiple contacts and comments (FindingComment,
Contact).
Many-to-One:
o Multiple findings can belong to one category (FindingCategory).
o Multiple findings can be classified under one classification level
(FindingClassificationLevel).