Social Meal - social application - Add searching method and change database structure
In this contribution I focused in:
Change event domain model and database structure. Because of one user can participate in many events and events can have multiple participated users, what is more event must have one owner. I decided to change structure of database. I changed relationship between these tables to many to many and one to many, thanks this changes next part of development will be much easier and faster.
Added a new feature connected with searching events by users. User have possibility to search events. This contribution allow users to search events by:
- food type
- dates (from, to)
- owner, price
- members number
I also added a sample data for testing.
screenshot from swagger with new searching method:
details from searching by price:
Response from request: searching by price from Postman:
Implementation is divided into several parts. This is quite big change and new feature so I had to add some new classes, services, controllers and more.
- screen with commits in Github
As you can see in commits implementation contains:
- add new domain model for eventUser table, change fluentAPI, new migrations for EntityFrameworkCore, and new ErrorCodes
- add new resources and mapping it with domain models for request response
- adaptation based event methods for add new event and edit existing to new database schema
- add sample data for testing new features and refactor mapping
- add new methods for searching events - changes in controllers, services and repositories
Posted on Utopian.io - Rewarding Open Source Contributors