This is a Django Rest Framework (DRF) application for managing invoices and their details. The application provides APIs for creating, retrieving, updating, and deleting invoices along with their associated invoice details.
-
Clone the repository from GitHub:
git clone https://github.com/kiranrokkam09/Invoice_Management.git cd Invoice_Management
-
Set up a virtual environment and install the dependencies:
python -m virtualenv venv cd venv/scripts cd ./activate.ps1 cd .. cd .. pip install -r requirements.txt
-
Run the database migrations and create a superuser:
python manage.py migrate python manage.py createsuperuser
To start the Django development server, run the following command:
python manage.py runserver
The server will start at http://127.0.0.1:8000/
. You can access the Django admin panel at http://127.0.0.1:8000/admin/
and use the superuser credentials to log in.
The application provides the following API endpoints:
-
POST /api/invoices/: Create a new invoice along with its associated invoice details. The payload should include the invoice details as a nested array.
-
Example: { "CustomerName": "John Doe", "invoice_details": [ { "description": "Item 1", "quantity": 2, "unit_price": 10.0, "price": 20.0 }, { "description": "Item 2", "quantity": 1, "unit_price": 15.0, "price": 15.0 } ] }
-
Screenshot
-
GET /api/invoices/{invoice_id}/: Retrieve details of a specific invoice.
-
Screenshot
-
PUT /api/invoices/{invoice_id}/: Update details of a specific invoice.
-
Screenshot
Note: For the POST and PUT requests, the payload should be in JSON format.
For testing the api end points you can use the command.
```bash
python manage.py test
```