GSG-G10 / GSG-G10/PSJobs

POST| /signin

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
Backend To-Do
Dominant language
JavaScript
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## Route: POST api/v1/signin/employee
## Route: POST api/v1/signin/company

### Acceptance Criteria
- [ ] Validation
- [ ] DB query
- [ ] Response
----------------------------------------------

### Validation
```js
{
email: joi.string().email().required(),
password: joi.string().alphanum().min(6).required()
}
```
### DB query
```sql
select (id, password, first_name, last_name) from user where email = $1
select (id, password, name) from company where email = $1
```
### Response
**Success**
- company
```js
{
statusCode:200,
data : [{
id: 1,
name: 'full name',
password: 'password',
}]
}‏
```

- user
```js
{
statusCode:200,
data : [{
id: 1,
first_name: 'first',
last_name: 'last',
password: 'password',
}]
}‏
```

**Failed**
- email not exists
```js
{
statusCode:409,
message:"Email is not found!"
}
```
- password wrong
```js
{
statusCode:409,
message:"Password is wrong"
}
```

- validation error
```js
{
statusCode:400,
message : "Bad request"
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the existing API route and entry points for POST api/v1/signin/employee and POST api/v1/signin/company, then review nearby validation and database-query patterns. Done means both routes handle the listed validation, queries, success response, and failure status messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sql
Domain
api, authentication, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.