diff --git a/REZ/AddAccountModal.xaml.cs b/REZ/AddAccountModal.xaml.cs index 59940a4..7697c42 100644 --- a/REZ/AddAccountModal.xaml.cs +++ b/REZ/AddAccountModal.xaml.cs @@ -100,12 +100,12 @@ private void CPFNumber_TextChange(object sender, TextChangedEventArgs e) ErrorMessage_CPF.Text = CPF.Text + "Please type in another CPF number."; IsCPFInputValid = false; } - //else if (!ValidateCPF(CPF.Text)) - //{ - // ErrorMessage_CPF.Visibility = Visibility.Visible; - // ErrorMessage_CPF.Text = CPF.Text + " não é um CPF válido. Por favor insira um número de CPF."; - // IsCPFInputValid = false; - //} + else if (!ValidateCPF(CPF.Text)) + { + ErrorMessage_CPF.Visibility = Visibility.Visible; + ErrorMessage_CPF.Text = CPF.Text + " não é um CPF válido. Por favor insira um número de CPF."; + IsCPFInputValid = false; + } else { ErrorMessage_CPF.Visibility = Visibility.Collapsed; diff --git a/REZ/Properties/Products.json b/REZ/Properties/Products.json index 9b8b5c0..179053c 100644 --- a/REZ/Properties/Products.json +++ b/REZ/Properties/Products.json @@ -168,7 +168,7 @@ "ImageSource": "../Assets/DrinkImages/Margarita.jpeg" }, { - "Name": "House Water", + "Name": "Glass of Water", "Category": "Drinks", "SubCategory": "Soft Drinks", "Description": "Glass of filtered water.", diff --git a/doc/dev/BUILD.md b/doc/dev/BUILD.md index 081d788..3d7ec93 100644 --- a/doc/dev/BUILD.md +++ b/doc/dev/BUILD.md @@ -2,17 +2,26 @@ REZ uses .NET Framework with WinUI as User Interface Layer (Windows only) and Visual Studio as build system. To be able to build this project properly, it is necessary to have [Visual Studio 2022 17.1 and later](https://visualstudio.microsoft.com/pt-br/) installed and running. 1. After setting up Visual Studio, make sure to check the workloads you have installed under `Visual Studio Installer`. -For this project it is necessary to have the `.NET Desktop Development` workload installed, as well as the [`Tools for Windows App SDK`](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/set-up-your-development-environment?tabs=cs-vs-community%2Ccpp-vs-community%2Cvs-2022-17-1-a%2Cvs-2022-17-1-b) and `Windows App SDK C# Templates`. +For this project it is necessary to have the `.NET Desktop Development` workload installed and `Windows App SDK C# Templates` in the installation details sidebar: -![Alt text](./assets/image.png) +![Alt text](./assets/VisualStudioInstaller.jpg) -2. For this stage of the project, is also important to install the NuGet package [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json/13.0.3?_src=template) if you want to run it properly with the Json product catalog. +#### Other dependencies: +##### Fonts: +- [Segoe UI Variable Font](https://aka.ms/SegoeUIVariable); +- [Segoe Fluent Icons](https://aka.ms/SegoeFluentIcon); +##### Nuget Packages: +- [Microsoft.UI.Xaml](https://github.com/microsoft/microsoft-ui-xaml); +- [Microsoft.Widnows.SDK.BuildTools](https://aka.ms/WinSDKProjectURL); +- [Microsoft.WindowsAppSDK](https://github.com/microsoft/windowsappsdk); +- [Newtonsoft.Json](https://www.newtonsoft.com/json); +- [System.Data.SqlClient](https://github.com/dotnet/corefx); -3. Download the source code of this project by forking (if you want to work on your own features) or by cloning this repository. +2. Download the source code of this project by forking (if you want to work on your own features) or by cloning this repository. ```bash git clone https://github.com/lknknm/REZ-menu-app.git ``` -4. On Visual Studio go to `File > Open > Open Project/Solution` and select `./REZ/REZ.sln` to open the project. +3. In Visual Studio go to `File > Open > Open Project/Solution` and select `./REZ/REZ.sln` to open the project. -5. Now you can Build Solution (Ctrl+B) and execute it normaly with Visual Studio debug features. \ No newline at end of file +4. Now you can Build Solution (Ctrl+B) and execute it normally with Visual Studio debug features. \ No newline at end of file diff --git a/doc/dev/DevelopmentReport.md b/doc/dev/DevelopmentReport.md index 512c70b..590f60e 100644 --- a/doc/dev/DevelopmentReport.md +++ b/doc/dev/DevelopmentReport.md @@ -1,4 +1,4 @@ -## REZ Development Report (INF-0999) +# REZ Development Report (INF-0999) Provided this is the Final Project of the training course in Microsoft technologies at the Institute of Computing at the State University of Campinas (UNICAMP), it is important that the students follow some base criteria about each subject taught during the course. For that reason, the following topics were considered during development: - C# Programming Language and known software architecture patterns; @@ -9,8 +9,25 @@ Provided this is the Final Project of the training course in Microsoft technolog - User Interface Programming; - Safe Programming; -### Programming and Architecture Pattern -### Code Versioning +## Programming and Architecture Pattern + +#### Architecture pattern: +This is a .NET Core 7.0 program that uses WinUI 3.0 as User Interface Layer. Due to WinUI's nature, this app uses the MVVM pattern. The structure of this project for the MVVM pattern goes as follows: + +- `*.xaml` files as View, which contains the bindings to the corresponding code-behind, Front-End and in-line component styling; +- `*.xaml.cs` (code-behind) files as ViewModel, which will handle the logic behind bindings through `DataContext`, as well as Validation and coordination between View and Model; +- `*xaml.cs` and `*.cs` files as Model, which will coordinate the Event State Change using interfaces such as `INotifyPropertyChanged` or `INotifyCollectionChanged`. The Model will also handle and provide the Data fed to the application passing it to the ViewModel, which in turn will pass it to the View. + +#### Code Style: +We made a code style guide for the development process. This helped us to maintain the code readable and understandable for any collaborator. Since this is a student project, we are also open to improvements and suggestions. + +- For more information: [REZ-CodeStyle Guide](./styleguide.md). + +#### Build +To build the software, there is a list of dependencies to install and configure inside Visual Studio. We made a quick-start guide for this: +- For more information: [REZ Build Quick-Start Guide](BUILD.md). + +## Code Versioning For code versioning we used the Git + GitHub remote repository workflow. Branch names are specific for a feature (or set of features) that the developers are currently working, so Pull Requests can be concise and easy to read. They can also be attached to an specific issue so both are closed after a merge. For this project we have been using the [Shared Repository Model](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models#shared-repository-model), in which all collaborators are granted access to the single shared repository. Each branch is created to meet an specific issue requirements so we can merge the code via a PR with code review. @@ -44,7 +61,7 @@ On the GitHub repository, we have been opening and tracking issues for each feat - You can see Open and Closed Issues [here](https://github.com/lknknm/REZ-menu-app/issues); - You can see the Open and Merged Pull Requests with discussion [here](https://github.com/lknknm/REZ-menu-app/pulls). -### Project Management +## Project Management We managed the project with GitHub Projects by applying the `Agile/Scrum` methodology. This way we can track issues, assign them to each member of the project group and also track the development status. The `Agile/Scrum` methodology was used so the group could discuss the current open issues, understand each problem together and organize new sprints to solve them. Features or bugfixes could be suggested by any member of the group (in an ideal case, we could also include users feedback), as long as they provide clear information about the problems they are encountering during the development process. @@ -59,12 +76,12 @@ After tracking each issue and organizing them by `Priority`, we add them to the - You can see Open and Closed Issues [here](https://github.com/lknknm/REZ-menu-app/issues); - You can see the Open and Merged Pull Requests with discussion [here](https://github.com/lknknm/REZ-menu-app/pulls). -### Hosting +## Hosting Since this application is a desktop/tablet application that will be deployed for Surface and other Windows tablet devices, hosting it isn't necessary. It is also worth mentioning that this software is designed for a specific form-factor and screen resolution of `1920x1080`, so the experience could be as fast, fluid and simple as possible. In this stage, unfortunately, database Hosting was not possible due to Azure subscription limitations. For this reason we used a mock database Json file as part of Model design. -### Continuous Integration and Testing +## Continuous Integration and Testing We deployed a very simple pipeline for testing — that can also be scalable and improved further — using [GitHub Actions](https://github.com/features/actions). It will simply build the Unpackaged WinUI 3.0 application with given dependencies and specified nuget packages for each commit and PR. This way we can start testing if the software is correctly building for any Windows platform while commiting changes and submitting PRs. @@ -75,7 +92,7 @@ It will simply build the Unpackaged WinUI 3.0 application with given dependencie - You can see the `main.yaml` file for CI Testing [here](https://github.com/lknknm/REZ-menu-app/blob/main/.github/workflows/main.yml). -### User Experience +## User Experience #### Project ideation To be able to better understand User Experience decisions yet to be made for the application, we took a step back and evaluated the project criteria we needed for it to be functional and visually clean/engaging, as well as possible problems we could come accross during the development process. @@ -96,7 +113,7 @@ To understand WinUI components, behaviors and code, we used the [WinUI 3.0 Galle The overall process was straightforward with few difficulties to understand a bit more about the WinUI behavior and XAML/Code-behind intricacies. Their Figma components library is very close to what they offer inside the WinUI Gallery application, so the "translation" between the two was seamless, besides some few limitations regarding XAML development using their current libraries. -### Safe Programming +## Safe Programming To avoid Injection Attacks through inputs of this application, we implemented a basic input validation layer to forms. This layer of protection can prevent SQL injection attacks to a Database connected to the ViewModel. Unexpected inputs will block the `Send` buttons as well as not be accepted by the Back-End. It is important to mention, though, that if a more robust Back-End/Model is to be implemented, potentially malitious requests should also be rejected by the Back-End in `Model` code. diff --git a/doc/dev/assets/VisualStudioInstaller.jpg b/doc/dev/assets/VisualStudioInstaller.jpg new file mode 100644 index 0000000..1add17c Binary files /dev/null and b/doc/dev/assets/VisualStudioInstaller.jpg differ diff --git a/doc/dev/assets/image.png b/doc/dev/assets/image.png deleted file mode 100644 index c6119be..0000000 Binary files a/doc/dev/assets/image.png and /dev/null differ