Messages
Crucial connection
The following file is crucial for the proper functioning of the project, if this file is damaged the project may not work as it should.
But... what is it about?
Well to explain it roughly the file makes the queries with supabase to see if the buckets and tables are created correctly.
We will explain in detail each function below:
The verifyPolicy and verifyBucket functions are in charge of verifying that the previously mentioned policies in Bucket Storage and Table Chats are created correctly.
Front-end functions
Then the following functions will be in charge of carrying out the procedures to take the information to the api and to be able to access by means of a front-end if we wanted to do so
getMessage It is in charge of obtaining the messages of all the users.
getMessagesOfNumber Gets the messages of each user in particular (very useful when accessing to see the chat of a particular user).
saveMessage Stores all messages received from the user.
GetUsername It is in charge of getting the username of the whatsapp client but it does not assign the phone number (this feature is not very useful but I put it because I had another idea in mind).
saveMessageSendedUser Its function is to save the messages that are sent to the user, both the bot and the seller if so desired with the corresponding implementation.
verifyStatusMessage Verifies if the status of the message is already in the database.
updateStatusMessage Once the status is verified and updated, this function will publish it in the database.
And that's all for this file, which is of utmost importance for the bucket as well as the creation of policies.
Última actualización