Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RSN-37] - Created services #42

Merged
merged 65 commits into from
Jun 17, 2024
Merged

[RSN-37] - Created services #42

merged 65 commits into from
Jun 17, 2024

Conversation

bilimig
Copy link
Collaborator

@bilimig bilimig commented May 27, 2024

Description

Created CRUD services for:
TagService
ParameterService
IntrestService
ImageService
EventService

Created Tests for
TagService
ParameterService
IntrestService
ImageService

Related issue and/or ticket

RSN-37

@bilimig bilimig self-assigned this May 27, 2024
@bilimig bilimig requested a review from wzarek May 27, 2024 13:09
@bilimig bilimig added the scope: backend Indicates that PR relates to backend changes. label May 27, 2024
@bilimig bilimig changed the title Rsn 37 cp [RSN-37] - Created services May 27, 2024
@bilimig bilimig marked this pull request as ready for review June 6, 2024 14:26
@bilimig bilimig added the status: ready for review Determines that PR is ready for review. label Jun 6, 2024
@bilimig bilimig requested a review from raczu June 6, 2024 14:27
Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so:

  • format
  • do mappers
  • throw errors

@raczu please check if I did not miss anything. Don't know what about interest/tags/parameter since we only create it on assigning to some event/user and delete only with detaching from event/user, am I right?

Server/ReasnAPI/ReasnAPI/Models/Database/ReasnContext.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Models/Database/ReasnContext.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Models/Database/Event.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Models/DTOs/InterestDto.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Program.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/ImageService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/InterestService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/InterestService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/InterestService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/ParameterService.cs Outdated Show resolved Hide resolved
@bilimig bilimig requested a review from wzarek June 10, 2024 15:06
Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, please test it before you request a review and as discussed split the logic of parameters, tags in event service

Server/ReasnAPI/ReasnAPI.Tests/Services/FakeDbSet.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI.Tests/Services/TagServiceTests.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/ImageService.cs Outdated Show resolved Hide resolved
@wzarek
Copy link
Owner

wzarek commented Jun 10, 2024

@bilimig Resolve conflicts
And you can get rid of those changes like i. to e. or so while resolving since they are unwanted i suppose

Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bilimig please properly format files and for me ready to go, @raczu needs to check it then

@bilimig bilimig requested a review from raczu June 13, 2024 11:37
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
@wzarek wzarek added status: require changes Determines that PR requires changes to be approved. and removed status: ready for review Determines that PR is ready for review. labels Jun 13, 2024
@wzarek wzarek added the type: feature PR's categorised as feature. label Jun 13, 2024
@bilimig bilimig requested a review from wzarek June 13, 2024 22:15
@bilimig bilimig added status: ready for review Determines that PR is ready for review. and removed status: require changes Determines that PR requires changes to be approved. labels Jun 14, 2024
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
Server/ReasnAPI/ReasnAPI/Services/EventService.cs Outdated Show resolved Hide resolved
@bilimig bilimig requested a review from wzarek June 15, 2024 15:39
Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if tags and params attaching works - lgtm

@bilimig bilimig merged commit 3599d87 into RSN-14 Jun 17, 2024
7 checks passed
mkoper02 added a commit that referenced this pull request Jun 18, 2024
* Created CRUD services for Parameter, Status, Tag and C&U for Event

* created CRUD Image, Interest, Event and Parameter Services

Also added geting all elements and by filter(not done properly yet)

* changed delete services to void isnted of bool

* Fixed GetByFilter service in Event, Image, Intrest, Parameter, Status and Tag Services

* little changes

* fixing build issue and changing list to ienumerable

* Fixing EventServices and standardizing syntax issues

* created test for interest status parameter and tag

* Created ImageServicesTests

* Updated Parameter, Tag, Status services

Checked if any of Parameters, Tags or Statuses are used before delating/updating.

* fixed bug in imageservicetest

* one more fix

* Updated services and tests

Changed delete methods to bool, updated mocks on tests.

* Updated services

* Updates after scafoled nr 1

* Updated services

Changed using bridge tables to using colections in EF.

* Updated EventService

added a logic for parameters in event

* working event services

* created mappers and small fixes

* finished mappers

* Added exceptions in services

* fixed mappers according to our convension

* Changed exceptions directory location

* fixed build error

* Exceptions changes

* Unit tests fix

* updated services

* Slug creating method updated

* Update ImageService.cs

* Update ImageService.cs

* updated image services and tests also updated slug method for event services

* event service delete method updated

* refactor and fixes

* refactor

* Update EventService.cs

* last refactor

* removing spaces

* added geteventbyslug method to eventservice

* Update ImageService.cs

* refactor

* changed list to Enumerable

* changed list to enumerable

* folder refactor

* updated services

* Update EventService.cs

* changes

* Update EventServicesTest.cs

* updates

* Update EventService.cs

* Update EventService.cs

* Update ImageService.cs

* Updates

* Update EventMapper.cs

* changes

* Update ImageServiceTests.cs

* changes

* Formating

* Update EventService.cs

* Update EventService.cs

* changes

* Created AddEventComment method

* Update EventService.cs

* fixed updating and creating event

* Update EventService.cs

* changed create slug and text for event

---------

Co-authored-by: Maciej Koperdowski <[email protected]>
mkoper02 added a commit that referenced this pull request Jun 19, 2024
* Created services classes and added TODO methods for each class

* [RSN-38] - Create services (address, comment, objecttype, participant, role, user*) (#19)

* Created services classes and added TODO methods for each class

* Created basic CRUD methods

* Changed methods returing types, checks for null

* Checks if user already exists in db etc., created tests for services

* Fixed unit test

* Changed type taken by the services, new, improved tests for services

* Final fixes and changed unit tests for methods with foreign keys

* Changed delete method to return bool, fixed typos and other problems based on PR review

* Added brackets one line ifs and added delete method for ObjectTypeService

* Revert "Added brackets to one line ifs, updated delete method in ObjectTypeService"

This reverts commit 1c69f11, reversing
changes made to 1a58a27.

* Created services classes and added TODO methods for each class

* Created basic CRUD methods

* Changed methods returing types, checks for null

* Checks if user already exists in db etc., created tests for services

* Fixed unit test

* Changed type taken by the services, new, improved tests for services

* Final fixes and changed unit tests for methods with foreign keys

* Changed delete method to return bool, fixed typos and other problems based on PR review

* Added brackets one line ifs and added delete method for ObjectTypeService

* Updated services after scaffold

Updated services and tests, User service not finished, enums not working

* Workflow fixes

* Unit test fix

* Working user service

* Deleted test controller

* Transaction for user update service

* Updated services and created mappers

* Services throw errors

Services now throw errors if something is not right (dto null, data not found in db), updated unit tests and created custom exception classes

* Mappers function name change

* Update based on review

* Added GetUserByUsername function

* Changed exceptions directory location

* [RSN-37] - Created services for Event Tag Parameter Interest Image (#42)

* Created CRUD services for Parameter, Status, Tag and C&U for Event

* created CRUD Image, Interest, Event and Parameter Services

Also added geting all elements and by filter(not done properly yet)

* changed delete services to void isnted of bool

* Fixed GetByFilter service in Event, Image, Intrest, Parameter, Status and Tag Services

* little changes

* fixing build issue and changing list to ienumerable

* Fixing EventServices and standardizing syntax issues

* created test for interest status parameter and tag

* Created ImageServicesTests

* Updated Parameter, Tag, Status services

Checked if any of Parameters, Tags or Statuses are used before delating/updating.

* fixed bug in imageservicetest

* one more fix

* Updated services and tests

Changed delete methods to bool, updated mocks on tests.

* Updated services

* Updates after scafoled nr 1

* Updated services

Changed using bridge tables to using colections in EF.

* Updated EventService

added a logic for parameters in event

* working event services

* created mappers and small fixes

* finished mappers

* Added exceptions in services

* fixed mappers according to our convension

* Changed exceptions directory location

* fixed build error

* Exceptions changes

* Unit tests fix

* updated services

* Slug creating method updated

* Update ImageService.cs

* Update ImageService.cs

* updated image services and tests also updated slug method for event services

* event service delete method updated

* refactor and fixes

* refactor

* Update EventService.cs

* last refactor

* removing spaces

* added geteventbyslug method to eventservice

* Update ImageService.cs

* refactor

* changed list to Enumerable

* changed list to enumerable

* folder refactor

* updated services

* Update EventService.cs

* changes

* Update EventServicesTest.cs

* updates

* Update EventService.cs

* Update EventService.cs

* Update ImageService.cs

* Updates

* Update EventMapper.cs

* changes

* Update ImageServiceTests.cs

* changes

* Formating

* Update EventService.cs

* Update EventService.cs

* changes

* Created AddEventComment method

* Update EventService.cs

* fixed updating and creating event

* Update EventService.cs

* changed create slug and text for event

---------

Co-authored-by: Maciej Koperdowski <[email protected]>

* Update Entity Framework version

* Changed exceptions location

* ReasnContext update

---------

Co-authored-by: Owczarek Kamil <[email protected]>
@wzarek wzarek deleted the RSN-37-cp branch June 23, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: backend Indicates that PR relates to backend changes. status: ready for review Determines that PR is ready for review. type: feature PR's categorised as feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants