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

POST | /kindergarten #18

Closed
4 tasks done
Osama-you opened this issue Feb 1, 2021 · 0 comments · Fixed by #103
Closed
4 tasks done

POST | /kindergarten #18

Osama-you opened this issue Feb 1, 2021 · 0 comments · Fixed by #103
Assignees
Labels

Comments

@Osama-you
Copy link
Member

Osama-you commented Feb 1, 2021

relates #5

Route: POST api/v1/kindergarten

Acceptance Criteria

  • DB query
  • Response
  • Testing
  • Validation

DB query

INSERT INTO kindergarten (kindergarten_name,cover_image,description,phone_number,latitude,longitude,min_price,max_price,periods,images_gallery)
    VALUES (kindergarten_name,cover_image,description,phone_number,latitude,longitude,min_price,max_price,periods,images_gallery)

Response

  • Success
{ 
    StatusCode: 200,
    message: 'Kindergarten has been added successfully',
}
  • Failed
{statusCode:400, message:"Bad Request"}

Testing

to be a successful test

  • status === 200
  • typeof(data) === 'object'
  • message === 'Kindergarten has been added successfully'

Validation

{
  kindergartenName: yup.string().required(),
  coverImage: yup.string().url().required(),
  description: yup.string().required(),
  phoneNumber: yup.number().required(),
  periods: yup.string(),
  latitude: yup.number(),
  longitude: yup.number(),
  minPrice: yup.number(),
  maxPrice: yup.number(),
  imagesGallery: yup.string(),
}
@alaa-sahloub alaa-sahloub linked a pull request Feb 15, 2021 that will close this issue
alaa-sahloub pushed a commit that referenced this issue Feb 15, 2021
alaa-sahloub pushed a commit that referenced this issue Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants