Class ModelController
java.lang.Object
app.valuationcontrol.webservice.model.ModelController
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionModelController(ModelRepository modelRepository, VariableRepository variableRepository, XLHandleManager xlHandleManager, EntityService entityService, UserRepository userRepository, Events events, EninAPIService eninAPIService, OpenAiServiceImplementation openAiServiceImplementation) Initializes the model controller and establish link to database Creator function that ensures that the model is connected to a document -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Long> addModel(@Valid ModelData modelData, Long templateId, boolean copyVariableValues, Principal principal) org.springframework.http.ResponseEntity<Long> createModelFromEnin(@Valid CompanyNameRecord companyNameRecord, Integer startYear, String modelName, boolean doImportGroupFigures, Integer unitDivider, Principal principal) Printing code for an entire model to use in FullModelTestdebug()org.springframework.http.ResponseEntity<Void> deleteModel(Model model, Principal principal) org.springframework.http.ResponseEntity<CalculationData> getCalculation(Model model, Integer scenarioNumber) org.springframework.http.ResponseEntity<ScenarioComparison> getComparison(Model model) org.springframework.http.ResponseEntity<CalculationData> getMetadata(Model model, Integer scenarioNumber) voidinitiateFormulas(Model model) org.springframework.http.ResponseEntity<String> org.springframework.http.ResponseEntity<String> unlockModel(Model model, Principal principal) org.springframework.http.ResponseEntity<String> updateKeyParam(Model model, @Valid KeyParam keyParam, Principal principal) org.springframework.http.ResponseEntity<String> updateModel(Model model, @Valid ModelData modelData, Principal principal)
-
Field Details
-
MODEL_ID
- See Also:
-
MODEL_ID_DESCRIPTION
- See Also:
-
-
Constructor Details
-
ModelController
public ModelController(ModelRepository modelRepository, VariableRepository variableRepository, XLHandleManager xlHandleManager, EntityService entityService, UserRepository userRepository, Events events, EninAPIService eninAPIService, OpenAiServiceImplementation openAiServiceImplementation) Initializes the model controller and establish link to database Creator function that ensures that the model is connected to a document
-
-
Method Details
-
cypress
@GetMapping("/api/cypress/{modelId}") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<List<String>> cypress(@PathVariable("modelId") Model model) Printing code for an entire model to use in FullModelTest -
createModelFromEnin
@PostMapping("/api/modelenin") public org.springframework.http.ResponseEntity<Long> createModelFromEnin(@RequestBody @Valid @Valid CompanyNameRecord companyNameRecord, @RequestParam Integer startYear, @RequestParam(defaultValue="Valuation model") String modelName, @RequestParam(defaultValue="false") boolean doImportGroupFigures, @RequestParam(defaultValue="1000") Integer unitDivider, Principal principal) -
addModel
@PostMapping("/api/model") @PreAuthorize("authentication.principal.hasAccessToTemplate(#templateId)") public org.springframework.http.ResponseEntity<Long> addModel(@RequestBody @Valid @Valid ModelData modelData, @RequestParam(required=false,defaultValue="-1") Long templateId, @RequestParam(required=false,defaultValue="true") boolean copyVariableValues, Principal principal) -
lockModel
-
unlockModel
-
updateModel
-
initiateFormulas
-
deleteModel
-
updateKeyParam
-
getMetadata
@GetMapping("/api/model/{modelId}/metadata") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<CalculationData> getMetadata(@PathVariable("modelId") Model model, @RequestParam(defaultValue="0") Integer scenarioNumber) - Returns:
- an object that contains all the metadata of the model
-
getCalculation
@GetMapping("/api/model/{modelId}/calculation") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<CalculationData> getCalculation(@PathVariable("modelId") Model model, @RequestParam(defaultValue="0") Integer scenarioNumber) - Returns:
- an object that contains all the processed data in the spreadsheet
-
debug
-
getComparison
@GetMapping("/api/model/{modelId}/comparison") @PreAuthorize("authentication.principal.hasModelRole(#model,\'READER\')") public org.springframework.http.ResponseEntity<ScenarioComparison> getComparison(@PathVariable("modelId") Model model) - Returns:
- an object that contains all the data in the spreadsheet
-