This project is a simplified system for managing user availability in a service marketplace. Each user provides services and sets their availability based on weekdays, and buyers can view this availability in their local timezone.
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd <project-directory>
-
Install the dependencies:
composer install
-
Set up the environment file:
cp .env.example .env
-
Generate the application key:
php artisan key:generate
php artisan key:generate --env=testing
-
Set up your database credentials in the
phpunit.xml
file. -
Run the test case:
php artisan test
To set a user's weekly availability, make a POST request to /api/availability
with the following JSON payload:
{
"availability": [
{
"day": "monday",
"start": "09:00",
"end": "12:00"
},
{
"day": "monday",
"start": "13:00",
"end": "17:00"
},
{
"day": "tuesday",
"start": "10:00",
"end": "14:00"
}
]
}
- Environment Setup: Ensure the environment variables for the test database in
phpunit.xml
match your local test database setup. - Database: Make sure to create a separate test database and configure it accordingly in the
phpunit.xml
file to avoid any data conflicts.
This should cover all necessary instructions for running the tests along with your project's setup and usage details.