I have started a flutter app and want to apply clean architecture to it. The first use case i have is the following:
"A user provides file(s)via "open file" dialogue. The provided files should be analyzed in first step. After this, a summary with different statistics should be displayed. For example how many files were provided, whats the name of the files. Are the files valid. How many elements were found in the files etc."
A user provides file(s)via "open file" dialogue. The provided files should be analyzed in first step. After this, a summary with different statistics should be displayed. For example how many files were provided, what's the name of the files? Are the files valid? How many elements were found in the files etc?
Later on, the content in these files should be saved into database, but that would be the next use case.
My idea is to create a use case called "AnalyzeFilesUseCase" which returns a "AnalyzeReport" Entity in the end to the UI.
But here starts the trouble. Every implementation i found has a repository connected to the use case, where models are loaded from an identifier like ID first. But i get the data from the UI passed to the use case as input, so i don't have something from which i load it from the repository. Or should i pass the content from the provided files to the repository and return a entity out of it?
Also: were do i put all the validation logic? Where to create the Report model etc? Is this everything in the use case class?
Some tipps for getting the right direction would be awesome
Thanks