Skip to content

dungnh3/skool-mn

Repository files navigation

skool-mn

Overview

Coding Challenge

Table of Contents

State machine

Project Image

Getting Started

Installation

Prerequisites

Usage

Initialize database

Use the following command to init an instance database, and create tables

make init-db
make migrate-up
  • MySQL as our database, the schema will be stored in migrations
  • We use migrate read migrations from sources and apply them in correct order to a database.

Migration database

Migration Contents

Schema database

Schema database

Starting the Server

To start the SampleService Server, use the following command:

go run main.go server

API Endpoints

  • GET /parents/:id/students: List all students of parent, base on parent_id
  • POST /parents/register: Register a new schedule pick up
{
  "parent_id": "1BX7NAJ",
  "student_ids": [
    "17E8ZIN",
    "1YZB7F4"
  ],
  "register_time": "2024-01-20 16:00:00"
}
  • PUT /parents/registers/:id/waiting: Confirm that parents is ready for pik up
  • PUT /parents/registers/:id/cancel: Confirm that parents want to cancel register
  • PUT /parents/registers/{id}/confirm: Confirm that parents have completed pick up
  • PUT /teachers/registers/{id}/confirm: Confirm that their student has left the class
  • PUT /teachers/registers/{id}/reject: Confirm that this teacher want to reject the register schedule
  • PUT /teachers/registers/{id}/reject: Confirm that this teacher want to reject the register schedule
  • PUT /students/:id/leave: Confirm that this student left this class
  • PUT /students/:id/out: Confirm that this student left this school

Configuration

Contributing

We welcome contributions. To contribute to this project, please follow these steps:

- Fork the repository
- Create a new branch for your feature: git checkout -b feature/your-feature-name
- Commit your changes: git commit -m 'Added a new feature'
- Push to the branch: git push origin feature/your-feature-name
- Create a pull request

Please follow our code of conduct and coding style guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published