forked from openimis/openimis-be-grievance_py
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CM-830: access basic data about grievances (for example number of gri…
…evances) (#18) * CM-830: added grievance for opensearch reporting layer * CM-830: removed processing json ext
- Loading branch information
1 parent
24b06d2
commit eadeb27
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from django.apps import apps | ||
|
||
# Check if the 'opensearch_reports' app is in INSTALLED_APPS | ||
if 'opensearch_reports' in apps.app_configs: | ||
from django_opensearch_dsl import Document, fields as opensearch_fields | ||
from django_opensearch_dsl.registries import registry | ||
from grievance_social_protection.models import Ticket | ||
|
||
@registry.register_document | ||
class TicketDocument(Document): | ||
key = opensearch_fields.KeywordField(), | ||
title = opensearch_fields.KeywordField(), | ||
|
||
description = opensearch_fields.KeywordField(), | ||
code = opensearch_fields.KeywordField(), | ||
attending_staff = opensearch_fields.KeywordField(), | ||
status = opensearch_fields.KeywordField(), | ||
|
||
category = opensearch_fields.KeywordField(), | ||
flags = opensearch_fields.KeywordField(), | ||
channel = opensearch_fields.KeywordField(), | ||
resolution = opensearch_fields.KeywordField(), | ||
|
||
class Index: | ||
name = 'ticket' | ||
settings = { | ||
'number_of_shards': 1, | ||
'number_of_replicas': 0 | ||
} | ||
auto_refresh = True | ||
|
||
class Django: | ||
model = Ticket | ||
fields = [ | ||
'id', 'key', 'title', 'code' | ||
] | ||
queryset_pagination = 5000 |