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

Feature/company profile #207

Merged
merged 8 commits into from
Mar 21, 2023
Merged

Feature/company profile #207

merged 8 commits into from
Mar 21, 2023

Conversation

toni-santos
Copy link
Contributor

Closes #9

@BrunoRosendo
Copy link
Member

Is this ready for review?

@toni-santos
Copy link
Contributor Author

I think so, I'm not sure why the audit is failing, but the goals of the issue are all met!

Copy link
Member

@BrunoRosendo BrunoRosendo left a comment

Choose a reason for hiding this comment

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

This is already looking good, nice job!

Something related to this but for another issue:
@imnotteixeira @DoStini Will the company profile also have infinite scrolling or will the offers just be limited? We already have an endpoint to return all the company offer, we could adapt that to return with a offset/limit (or using the same strategy as in the future new search). What do you think?

src/api/routes/company.js Outdated Show resolved Hide resolved
src/api/routes/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
@imnotteixeira
Copy link
Collaborator

This is already looking good, nice job!

Something related to this but for another issue: @imnotteixeira @DoStini Will the company profile also have infinite scrolling or will the offers just be limited? We already have an endpoint to return all the company offer, we could adapt that to return with a offset/limit (or using the same strategy as in the future new search). What do you think?

Let's not insist on the offset/limit strategy, especially since we are implementing #129 with cursors.

I'd say we should not have infinite scrolling, but rather an explicit "load more" button which the user would click, but for the backend it would work the same way so it doesn't matter.

src/api/routes/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
src/api/middleware/validators/company.js Show resolved Hide resolved
src/api/routes/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
@toni-santos
Copy link
Contributor Author

I believe the changes that were discussed previously have all been implemented, taking into account the restrictions and difficulties imposed by how the mongoose queries are currently working. Please alert me to any changes that should be made!

src/api/routes/offer.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
test/end-to-end/company.js Outdated Show resolved Hide resolved
src/api/middleware/company.js Outdated Show resolved Hide resolved
src/api/middleware/company.js Outdated Show resolved Hide resolved
@Naapperas
Copy link
Member

Also, be aware of the file conflicts due to this branch not being "up-to-date"

@BrunoRosendo
Copy link
Member

The assignee will change

src/api/routes/company.js Outdated Show resolved Hide resolved
@ttoino
Copy link
Member

ttoino commented Nov 16, 2022

The tests should now align with the implementation goals, right now the following restrictions are in place:

  • When the company is disabled, blocked or has not finished registration, the same error as when the company does not exist is returned;
  • When the company is disabled and the user is the owner, admin or god it succeeds;
  • When the company is blocked and the user is the owner an error is returned;
  • When the company is blocked and the user is an admin or god it succeeds;
  • When the company has not finished registration and the user is the owner, admin or god an error is returned (not sure about this one).

If any of these don't make sense please let me know.

@Naapperas
Copy link
Member

The tests should now align with the implementation goals, right now the following restrictions are in place:

* When the company is disabled, blocked or has not finished registration, the same error as when the company does not exist is returned;

* When the company is disabled and the user is the owner, admin or god it succeeds;

* When the company is blocked and the user is the owner an error is returned;

* When the company is blocked and the user is an admin or god it succeeds;

* When the company has not finished registration and the user is the owner, admin or god an error is returned (not sure about this one).

If any of these don't make sense please let me know.

I think that not having finnished its registratio should not be a restriction on company fetching. What do you think @BrunoRosendo @DoStini ?

@BrunoRosendo
Copy link
Member

The tests should now align with the implementation goals, right now the following restrictions are in place:

* When the company is disabled, blocked or has not finished registration, the same error as when the company does not exist is returned;

* When the company is disabled and the user is the owner, admin or god it succeeds;

* When the company is blocked and the user is the owner an error is returned;

* When the company is blocked and the user is an admin or god it succeeds;

* When the company has not finished registration and the user is the owner, admin or god an error is returned (not sure about this one).

If any of these don't make sense please let me know.

I think that not having finnished its registratio should not be a restriction on company fetching. What do you think @BrunoRosendo @DoStini ?

What information would we have in that case? Not sure if it's useful for a company profile but, either way, we should have the same restriction as in the "get all companies" endpoint

@DoStini
Copy link
Member

DoStini commented Nov 17, 2022

Im my opinion, if a company didnt finish their registration, is like of they do not exist in the platform at all. So I think we should 404 Not Found for hidden companies and not finished

Copy link
Member

@Naapperas Naapperas left a comment

Choose a reason for hiding this comment

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

Besides the comments I made, this looks good to me. Just be careful to rebase this branch with develop.

src/api/middleware/company.js Show resolved Hide resolved
test/end-to-end/company.js Show resolved Hide resolved
@ttoino
Copy link
Member

ttoino commented Dec 11, 2022

I decided to leave the implementation as is and created a new issue to deal with the inconsistent http statuses (#282).

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.18 🎉

Comparison is base (fd829d7) 90.33% compared to head (1b4ac39) 90.51%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #207      +/-   ##
===========================================
+ Coverage    90.33%   90.51%   +0.18%     
===========================================
  Files           54       54              
  Lines         1417     1444      +27     
  Branches       232      242      +10     
===========================================
+ Hits          1280     1307      +27     
  Misses         132      132              
  Partials         5        5              
Impacted Files Coverage Δ
src/api/middleware/company.js 95.38% <100.00%> (+1.63%) ⬆️
src/api/middleware/validators/company.js 100.00% <100.00%> (ø)
src/api/routes/company.js 88.23% <100.00%> (+0.89%) ⬆️
src/api/routes/offer.js 77.63% <100.00%> (ø)
src/services/offer.js 99.16% <100.00%> (+0.02%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Naapperas
Naapperas previously approved these changes Feb 1, 2023
Copy link
Member

@Naapperas Naapperas left a comment

Choose a reason for hiding this comment

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

Other than the pointed out code, this looks good to me.

test/end-to-end/company.js Show resolved Hide resolved
@render
Copy link

render bot commented Mar 7, 2023

BrunoRosendo
BrunoRosendo previously approved these changes Mar 7, 2023
Naapperas
Naapperas previously approved these changes Mar 9, 2023
DoStini
DoStini previously approved these changes Mar 14, 2023
@BrunoRosendo BrunoRosendo merged commit b6e70aa into develop Mar 21, 2023
@BrunoRosendo BrunoRosendo deleted the feature/company-profile branch March 21, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Company profile getting
7 participants