-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from mngoe/checque-sante-to-merge
OP-1199 - Voucher Scheme new features (Subservices and subitems)
- Loading branch information
Showing
11 changed files
with
347 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
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
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,38 @@ | ||
import graphene | ||
from core import prefix_filterset, ExtendedConnection, filter_validity | ||
from graphene.utils.deduplicator import deflate | ||
from graphene_django import DjangoObjectType | ||
from .models import Service, ServiceItem, ServiceService | ||
|
||
class ServiceGQLType(DjangoObjectType): | ||
attachments_count = graphene.Int() | ||
client_mutation_id = graphene.String() | ||
|
||
class Meta: | ||
model = Service | ||
interfaces = (graphene.relay.Node,) | ||
filter_fields = { | ||
'uuid': ['exact'], | ||
'code': ['exact', 'icontains', 'istartswith'], | ||
'name': ['exact', 'icontains', 'istartswith'], | ||
'type': ['exact'], | ||
'packagetype': ['exact', 'in'], | ||
'care_type': ['exact'], | ||
'category': ['exact'], | ||
} | ||
connection_class = ExtendedConnection | ||
|
||
@classmethod | ||
def get_queryset(cls, queryset, info): | ||
service_ids = Service.get_queryset(queryset, info).values('uuid').all() | ||
return Service.objects.filter(uuid__in=service_ids) | ||
|
||
|
||
class ServiceItemGQLType(DjangoObjectType): | ||
class Meta: | ||
model = ServiceItem | ||
|
||
|
||
class ServiceServiceGQLType(DjangoObjectType): | ||
class Meta: | ||
model = ServiceService |
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,67 @@ | ||
# Generated by Django 3.0.14 on 2022-08-04 11:12 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('medical', '0007_alter_item_maximum_amount_alter_item_quantity_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='service', | ||
options={'managed': True}, | ||
), | ||
migrations.CreateModel( | ||
name='ServiceService', | ||
fields=[ | ||
('id', models.AutoField(db_column='idSCP', primary_key=True, serialize=False)), | ||
('qty_provided', models.IntegerField(blank=True, db_column='qty', null=True)), | ||
('scpDate', models.DateTimeField(blank=True, db_column='created_date', default=django.utils.timezone.now, null=True)), | ||
('price_asked', models.DecimalField(blank=True, db_column='price', decimal_places=2, max_digits=18, null=True)), | ||
('service', models.ForeignKey(db_column='ServiceId', on_delete=django.db.models.deletion.DO_NOTHING, related_name='servicesServices', to='medical.Service')), | ||
('servicelinkedService', models.ForeignKey(db_column='ServiceLinked', on_delete=django.db.models.deletion.DO_NOTHING, to='medical.service')), | ||
('status', models.BooleanField(default=True)), | ||
], | ||
options={ | ||
'db_table': 'tblServiceContainedPackage', | ||
'managed': True, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='ServiceItem', | ||
fields=[ | ||
('id', models.AutoField(db_column='idPCP', primary_key=True, serialize=False)), | ||
('qty_provided', models.IntegerField(blank=True, db_column='qty', null=True)), | ||
('pcpDate', models.DateTimeField(blank=True, db_column='created_date', default=django.utils.timezone.now, null=True)), | ||
('price_asked', models.DecimalField(blank=True, db_column='price', decimal_places=2, max_digits=18, null=True)), | ||
('item', models.ForeignKey(db_column='ItemID', on_delete=django.db.models.deletion.DO_NOTHING, related_name='itemsServices', to='medical.Item')), | ||
('servicelinkedItem', models.ForeignKey(db_column='ServiceID', on_delete=django.db.models.deletion.DO_NOTHING, related_name='servicesLinked', to='medical.Service')), | ||
('status', models.BooleanField(default=True)), | ||
], | ||
options={ | ||
'db_table': 'tblProductContainedPackage', | ||
'managed': True, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='service', | ||
name='manualPrice', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AddField( | ||
model_name='service', | ||
name='packagetype', | ||
field=models.CharField(choices=[('P', 'P'), ('S', 'S'), ('F', 'F')], db_column='ServPackageType', default='S', max_length=1), | ||
), | ||
|
||
migrations.AlterField( | ||
model_name='service', | ||
name='patient_category', | ||
field=models.SmallIntegerField(db_column='ServPatCat', default='15'), | ||
), | ||
] |
Oops, something went wrong.