Simple Chat Application

Job ID: 33377655

Budget: ₹1,500 – ₹12,500 INR

I need someone who can help me in creating a simple chat application using python/Django and Celery. we will discuss and implement the database based on the complexity. Usecase is given below:


Create a Django REST API that exposes the following endpoints with support for CRUD operations:

- `/conversations/`
- `/conversations/<id>/`
- `/chats/`
- `/chats/<id>/`

The application should implement at least the following data structure

**Store**
- name
- timezone
- phone number

**Discount**
- store
- discount code

**Operator**
- ****user
- operator group

**Client**
- user
- timezone
- phone number

**Conversation**
- store
- client
- operator
- status

**Chat**
- conversation
- payload
- discount
- created date
- status

**Schedule**
- chat
- sending_date

### `/chats/` and `/chats/<id>/`

`JSON` data:
{
"id": 1,
"payload": "Hello {{ client.user.first_name }}. This is {{ [operator.user.](http://operator.name/)full_name }}.\nHow can I help you?",
"conversation_id": 1,
"created_date": "2021-09-01T12:15:30-05:00",
"status": "SENT"
}

- `GET` `/chats/<id>` - return the details of a chat following the JSON structure
- `POST` `/chats/` - create a new chat for the specified conversation

Payload of the chat should be validated to contain only characters from the list *`aA-zZ1234567890{}$%_-\/~@#$%^&*()!?` and shouldn't be longer than 300 characters.

Payload should support the following keywords: `{{ operator.user.full_name }}`, `{{ client.user.first_name }}`, `{{ discount.discount_code }}` and should be replaced with real data when the chat message is actually sent.

### `/conversations/` and `/conversations/<id>`

`JSON` data
{
"id": 1,
"store_id": 2,
"operator_id": 3,
"operator_group": "sales",
"client_id": 4,
"status": "RESOLVED",
"chats": [
# list of conversation's chats JSON data
]
}

- `GET` `/conversations/<id>` - return details of a conversation following the JSON structure
- `POST` `/conversations/` - create a new conversation

With each chat that is added, create a new entry in `Schedule` table so that sending (by email/SMS) `NEW` chat messages follows this simple rule: no more than 90 (configurable number) messages are sent in a single hour.

Scheduling should take into consideration the timezone of the client, or as a fallback, the store's timezone, so that messages cannot be sent between 20:00PM - 09:00AM time interval for that specific timezone.

All chat messages are created with the `NEW` status. When they are sent by the scheduler the status will change to `SENT`.