nelc / futurex-openedx-extensions

Open edX APIs and reporting tools
Other
0 stars 0 forks source link

feat: create new api and models for the Clickhouse queries #43

Closed OmarIthawi closed 1 month ago

OmarIthawi commented 3 months ago
class ClickhouseQuery(models.Model):
    scope = ChoiceField('course', 'tenant', 'user')  # Determines which variables is passed to the query
    slug = SlugField()
    query = TextField()  # This is a query but with some variables for substiution with `.format` function

The API would have different endpoints but with similar structure e.g.

GET /fx/query/course/<slug>?course_id=<course_id>&tenand_id=<tenand_id>
GET /fx/query/user/<slug>?user_id=<user_id>&tenand_id=<tenand_id>
GET /fx/query/tenant/<slug>?tenant_id=<user_id>

This way we can assign security allowed roles for different scope of queries.

e.g.

GET /fx/query/user/activities?user=1223,tenant=23232
OmarIthawi commented 3 months ago

@iamjazzar Please share the document with Shadi.

OmarIthawi commented 1 month ago

Done.