Giter Site home page Giter Site logo

glific / glific Goto Github PK

View Code? Open in Web Editor NEW
165.0 12.0 66.0 17.34 MB

The Main application that provides the core interface via the glific APIs

Home Page: https://glific.org

License: GNU Affero General Public License v3.0

Elixir 91.07% CSS 0.41% JavaScript 0.18% HTML 1.90% Shell 0.07% Lua 0.02% Dockerfile 0.05% Procfile 0.01% PLpgSQL 6.29%
elixir postgres graphql whatsapp-business-api

glific's Issues

Add unread tag to message

Is your feature request related to a problem? Please describe.
We will tag every incoming message as unread.
The frontend team will make a query to remove this tag from the message.

Expose COUNT method on `Tags` table

Is your feature request related to a problem? Please describe.
I would love to be able to get a quick totalCount for a query to tags, or to the entire tag table itself, so that I can present to the user that we have X amount of tags without actually loading all the tags on the client-side (maybe there's 1000 objects, wouldn't want to load all 1000 objects into the table when I can just load the number 1000 and then load 10 at a time).

Describe the solution you'd like
If there could be a count parameter or a way to get the totalCount from a potential GraphQL query without having to necessarily run the entire query, that would be great!

Add conversations API to glific

Is your feature request related to a problem? Please describe.
Conversations are the bedrock of the application. The frontend displays conversations, and needs to be able to retrieve them quickly

Describe the solution you'd like
Create an API that we can expose via GraphQL

  • Give me the conversations filtered and parameterized with
    • limit to N most recent conversations
    • Each conversation has a limit of M messages
    • Filter by tag on the message
    • Filter by tag on the contact
    • Filter by a set of contact IDs

Expose badges on glific repository

Is your feature request related to a problem? Please describe.
We need to expose: Build passing. code coverage, doc coverage and other badges to our github repository

This gives the project a lot of credibility and looks good :)

Tag Search for Glific

Is your feature request related to a problem? Please describe.
Allow user to search on all tags in glific

Once the above is done, add filter for language and parent tag

Cache contact_id in messages table

This avoids us writing conditional code in a bunch of places to see whether it was a sent or received message and makes some queries a lot simpler and easier to read

At some point, we might also want to add a counter to each message specific to a contact to optimize the queries even more

Add support for keywords in Glific Tags

Is your feature request related to a problem? Please describe.

(revising this from my first idea)

Extends tags functionality to associate keywords that can be linked to a tag. All incoming texts, are automatically parsed and if there is a keyword match, we associate the tag with the message

Thus Hello/hi/hola/namaste/good morning could all be keywords for the tag "greeting"

numeric tags are automatically parsed by the system and have a value

We can drive automation both on the tag, and the value of the tag

I've started work on this in the genstage branch, and will merge into master by end of day

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

seeds_scale should interleave sends and receives

Right now, all sent messages are first listed and then all received. This does not make it great for a real world scenario. we need to interleave them

also make sure the times are increasing and not the same time for everything. we need valid values to test things @ scale

also add the contact_id field for messages (I'm committing a fix for this soon)

Create and process optout tag for an user.

Is your feature request related to a problem? Please describe.

  1. Create a tag called OptOut with keywords: stop, halt, unsubscribe (and their Hindi equivalents)
  2. If the message body matches those keywords -> it gets tagged as optout

For messages tagged optout

  1. Set the current timestamp to optout_time filed for the contact.
  2. Set provider status as invalid for the contact
  3. Send a session template message with shortcode "optout" if one exists

We can follow a similar pattern as New User Pattern and Welcome Message

When we start processing opt-outs from provider, we might not be able to send them back a message. we'll handle this case at that time

Add docs to github pages

Is your feature request related to a problem? Please describe.
We will expose all our code documentation to the Public, so we can link it

Describe the solution you'd like
Expose docs via github pages

Update mix dependancies, if they are outdated

Describe the bug
We need to have a look for the outdated version for all the deps and update them.

Please run a mix check after updating any dependency so that we can catch compatibility issues and fix them.

Add graphql subscriptions ...

We also need to think of all the places where we'll need to inform clients of state changes.

this is primarily in the message send/receive flow and any automated actions we take after receiving a message

Add user id field to message table

Describe the bug
We need to set a user id to the massage table so that we know when sent the message to the beneficiary on the behalf of an organization.

Since there are some automated messages which will don't have any user id so we will make this field nullable.

This change will also help us to audit the messages and all.

Migrate BSP to glific

BSP will be all the services providers for our message communication. We will start with Gupshup and then add more BSP.

Migrate session_messages from two_way

Is your feature request related to a problem? Please describe.
Migrate session_messages from two_way to glific. This include: DB structure, ecto schema, graphql and tests

Describe the solution you'd like

  1. Call the table: session_templates. The top level context should be templates (since we will add hsm_templates in v0.3)

  2. add message_media_id to the table also

  3. delete the is_translated field

  4. Add a shortcode field called shortcode

  5. Add a couple of sample messages in seeds and seeds_scale. Two examples could be a sample
    template for New User and a goodbye message

Check the contact optin status before sending a message.

Is your feature request related to a problem? Please describe.
We need to validate the contact provider status before sending the message.

If the status is invalid then we the function will raise an Error that (Contact is not valid or opt-out)

Clean up Enums

Is your feature request related to a problem? Please describe.
Enums is polluting the top level namespace with one directory and two files.

Let's move it into its own directory called enums and all files under it. While we are at it, lets rename stuff to be consistent and call it Glific.Enums*

Add message, contacts, tags search to GQL

Given a search term we need to:

  1. Find all the messages: body (and hence contacts) matching this term

  2. Find all contacts whose name or phone matches this term

  3. Find all contact and messages that have a tag: label, description attached to them that matches this term

Add __meta__ to type for all schema definitions. Also fix delete operation

  1. We have not added the meta field to the t() definition in our schemas. We need to add it to all the schema

  2. Delete should respect FK constrains, Check language for an example which has an FK constraint from tags

%Language{}
%Glific.Settings.Language{
  _meta_: #Ecto.Schema.Metadata<:built, "languages">,
  description: nil,
  id: nil,
  inserted_at: nil,
  is_active: false,
  label: nil,
  locale: nil,
  tags: #Ecto.Association.NotLoaded<association :tags is not loaded>,
  updated_at: nil
}

Group by query is not consistent in mac and linux system

Describe the bug
In mac system server collation is not working with postgres and hence giving incorrect alphabetical order of strings (for case sensitive data)

  1. If we write test cases for case insensitive data, it doesn't pass in local , but passes in the github.
  2. This would happen for all the resources.

Cleanups in the file name and migrations

Describe the bug
A clear and concise description of what the bug is.

  • Rename BSP to Provider?
  • Rename recipient_id to receiver_id? (sender <-> receiver)
  • Rename anything with wa_ as provider_status, provider_message_id
  • Rename message_media -> messages_media
  • Quick check of file names, like: messages_tags.ex => message_tag.ex (context is plural, the datatype is singular)

Adding OFFSET and LIMIT functionality

Is your feature request related to a problem? Please describe.
I would love to see both OFFSET and LIMIT functionality for different GraphQL requests we make in the front-end.

Describe the solution you'd like
If these parameters could be added to the different objects, that would be great!

Conversations with filter returns empty value

Describe the bug

query conversations($nc: Int!, $sc: Int!, $filter: ConversationFilter) {
  conversations(numberOfConversations: $nc, sizeOfConversations: $sc, filter: $filter) {
    contact {
      id
      name
    }
    messages {
      id
      body
    }
  }
}

with variables

{
  "nc": 1,
  "sc": 1,
    "filter": { "id" : 359 }
}

returns

{
  "data": {
    "conversations": []
  }
}

To Reproduce
Steps to reproduce the behavior:

  • Use the above queries and check the result.

Expected behavior

  • It should return contact data with the messages
  • If messages are empty then it should return contact data and empty messages object

Session template improvements ..

Is your feature request related to a problem? Please describe.

  • Add :type to session_templates similar to messages

  • Add a send_session_message(contact_id(s), session message id) - we need this for automation in API and graphQL

Cleanups in message workflow

We need to make some changes in the code

  • - Add custom validation - Media ID should not be null if the message type Is not text
  • - Code cleanups in message controller
  • - Add message timestamp when the queue worker will send the message.
  • - Update status when we receive the message event callback.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.