Get all messages of an order
Add a new message to an order
Use the last message_id to mark messages as read.
The order message model is composed of the following attributes:
The author Id, user who add the item
The order id
show the change in a json with
A file to add (Now working only for image)
The type of message:
contains levels of user which can see the messages separated by comma
If type 2
The text for the message
The driver id, if driver assigned to an order
The IP where the message is sent from, must be a valid IP.
Order messages restrictions
- User level 0 (Type: administrator) can write and read messages of any order.
- Users level 2 (Type: business owner) can write and read messages of all orders related to his businesses.
- Users level 3 and 4 (Type: customer and Driver) can write and read messages of orders related to this user.
- users level 0, 2 and 4, can use mode dashboard to get message as their roll
- Only users 0 an 2 can get private data which are "can_see", "ip", "user_agent" and "location"