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

Test task | Maksym Perekhodko | [email protected] #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kinqbert
Copy link

@kinqbert kinqbert commented Jul 16, 2024

@vkryvytskyy

Hi, I’m Maksym Perekhodko!

Here is my task solution:

According to the task, I've added a new nullable city column of type character varying(255) to the recruiter_profiles table using Sequelize migrations. Updated the RecruiterProfile model and GraphQL schema to include the new city field. Seeded the database with random Ukrainian city names for existing profiles. Modified the UI to display the city data in the recruiter profile view.

Videos:


for (const profile of profiles) {
const city = cities[Math.floor(Math.random() * cities.length)];
await queryInterface.bulkUpdate(
Copy link
Contributor

Choose a reason for hiding this comment

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

was it required to update all profiles in the database?


@AllowNull(true)
@Column
city: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

field is nullable

@@ -19,11 +19,13 @@ export const RecruiterProfileSchema = gql`
userId: Int!
position: String!
companyName: String!
city: String!
Copy link
Contributor

Choose a reason for hiding this comment

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

field is nullable in db but required in graphql schema, why?

Copy link
Author

Choose a reason for hiding this comment

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

thanks for the catch! will fix in the next commit

GetAdminUserOptions,
GetAdminUserResult,
} from '@/modules/user/user.useCases/GetAdminUser.useCase';
GetAdminUserUseCaseOptions,
Copy link
Contributor

Choose a reason for hiding this comment

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

why are these changes here?

Copy link
Author

Choose a reason for hiding this comment

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

TS compilation have been failing due to missing GetAdminUserOptions and other imports

@@ -17,6 +19,7 @@ export const RecruiterProfileMeta = React.memo<Props>((props) => {
className={cn(styles.recruiterMetaItem, typography.smallHeading)}
key={item.name}
>
{item.name === RecruiterProfileMetaItems.City && <IconLocation />}
Copy link
Contributor

Choose a reason for hiding this comment

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

what if we need an icon for another item? can we somehow modify the incoming array?

Copy link
Author

Choose a reason for hiding this comment

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

thanks! will fix in the next commit

Comment on lines 24 to 32
for (const profile of profiles) {
const city = cities[Math.floor(Math.random() * cities.length)];
await queryInterface.bulkUpdate(
'recruiter_profiles',
{ city },
{ id: profile.id },
{ transaction: t }
);
}
Copy link

@alex-shepel alex-shepel Jul 17, 2024

Choose a reason for hiding this comment

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

can we make a single request to the DB instead of profiles.length requests?

Choose a reason for hiding this comment

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

What is better: single or multiple?

Copy link
Author

Choose a reason for hiding this comment

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

we can generate a single query or just make a single bulkUpdate request and this way make a single request to a database.

thanks for the notice! will fix in the next commit

Copy link

@alex-shepel alex-shepel left a comment

Choose a reason for hiding this comment

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

Good job

@kinqbert
Copy link
Author

  • Fixed GraphQL schemes for recruiter
  • Seeder improved (now making one update request instead of N)
  • Now you can add icons for recruiter meta items are universal

Unfortunately, I am currently unable to provide a video of the seeder work due to some hardware issues. I apologize for the inconvenience and will provide the video as soon as the problem is resolved.

@kinqbert kinqbert requested review from ivadimko and alex-shepel July 18, 2024 17:19
@ivadimko
Copy link
Contributor

ivadimko commented Sep 5, 2024

.

Copy link
Contributor

@ivadimko ivadimko left a comment

Choose a reason for hiding this comment

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

.

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.

3 participants