From bcc44a0f522528d576918003800d057c64e280fc Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Thu, 2 May 2024 07:48:26 +0300 Subject: [PATCH 1/2] add permissions and groups --- desgin/{ => db}/database.sql | 0 desgin/visit/sequence.pu | 15 +++++++++++++++ desgin/visit/usecase.pu | 15 +++++++++++++++ desgin/visit/visit.md | 12 ++++++++++++ project/requirements.txt | 1 + requirements.txt | 4 ++++ 6 files changed, 47 insertions(+) rename desgin/{ => db}/database.sql (100%) create mode 100644 desgin/visit/sequence.pu create mode 100644 desgin/visit/usecase.pu create mode 100644 desgin/visit/visit.md diff --git a/desgin/database.sql b/desgin/db/database.sql similarity index 100% rename from desgin/database.sql rename to desgin/db/database.sql diff --git a/desgin/visit/sequence.pu b/desgin/visit/sequence.pu new file mode 100644 index 0000000..09a3217 --- /dev/null +++ b/desgin/visit/sequence.pu @@ -0,0 +1,15 @@ +@startuml visit + +participant Admin +participant System +participant Visit + +Admin -> System : "set visit" + + + +Admin -> System : "get visit" +System -> Admin : "split visit to missed and current and upcoming" + +Admin -> System : "update visit to finished" +@enduml \ No newline at end of file diff --git a/desgin/visit/usecase.pu b/desgin/visit/usecase.pu new file mode 100644 index 0000000..42a24bc --- /dev/null +++ b/desgin/visit/usecase.pu @@ -0,0 +1,15 @@ +@startuml OnlineShoppingSystem + +left to right direction +actor Admin as "Admin" +actor System as "System" +actor Patient as "Patient" + +rectangle "Use Cases" { + Admin --> (Manage patients) + Admin --> (Manage visits) + System --> (Split visits to missed and current and upcoming) + Patient --> (Get his data) +} + +@enduml diff --git a/desgin/visit/visit.md b/desgin/visit/visit.md new file mode 100644 index 0000000..21c28cb --- /dev/null +++ b/desgin/visit/visit.md @@ -0,0 +1,12 @@ +```mermaid +graph TD; + A[Visit] -->|1| B[Unfinished Visit] + A -->|2| C[Finished Visit] + B -->|edit| D[Admin set Finished] + B -->|get| E[System] + E -->|date < today| F[Missed Visit] + E -->|date > today| G[ Upcoming Visit] + E -->|date = today| H[Current Visit] + + +``` \ No newline at end of file diff --git a/project/requirements.txt b/project/requirements.txt index 35f4189..49d6ffd 100644 --- a/project/requirements.txt +++ b/project/requirements.txt @@ -4,6 +4,7 @@ distlib==0.3.8 Django==5.0.3 django-cors-headers==4.3.1 django-database-url==1.0.3 +django-filter==24.2 django-shortuuidfield==0.1.3 djangorestframework==3.15.1 djangorestframework-simplejwt==5.3.1 diff --git a/requirements.txt b/requirements.txt index 63dde74..49d6ffd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,10 +4,13 @@ distlib==0.3.8 Django==5.0.3 django-cors-headers==4.3.1 django-database-url==1.0.3 +django-filter==24.2 django-shortuuidfield==0.1.3 djangorestframework==3.15.1 djangorestframework-simplejwt==5.3.1 drf-yasg==1.21.7 +factory-boy==3.3.0 +Faker==25.0.0 filelock==3.13.3 identify==2.5.35 inflection==0.5.1 @@ -18,6 +21,7 @@ platformdirs==4.2.0 pre-commit==3.7.0 psycopg2-binary==2.9.9 PyJWT==2.8.0 +python-dateutil==2.9.0.post0 python-decouple==3.8 pytz==2024.1 PyYAML==6.0.1 From 3d05ef59e6b7027600105f744cf50195df9cc7a7 Mon Sep 17 00:00:00 2001 From: MohamedHamed12 Date: Thu, 2 May 2024 08:02:33 +0300 Subject: [PATCH 2/2] add fake data --- project/accounts/filters/__init__.py | 2 +- ...04_alter_doctor_marital_status_and_more.py | 28 ++++++++++++++++++ ...xample_3LXLiLE.jpg => example_B7DUFHc.jpg} | Bin ...xample_DhsRdWI.jpg => example_BPSSWvZ.jpg} | Bin ...xample_NhnPU17.jpg => example_EiPkSgj.jpg} | Bin ...xample_V4cIqzy.jpg => example_KiB9VWI.jpg} | Bin ...xample_VwHcJWd.jpg => example_V7tBFdE.jpg} | Bin ...xample_YjFvqYO.jpg => example_Yup6Xje.jpg} | Bin ...xample_fgo15kh.jpg => example_afvsRsx.jpg} | Bin ...xample_icvPwan.jpg => example_awpCuxp.jpg} | Bin ...xample_kOe1UL0.jpg => example_cIkBNRq.jpg} | Bin ...xample_npx8snv.jpg => example_xMb9ehF.jpg} | Bin .../media/user_images/example_zXMv1nd.jpg | Bin 0 -> 825 bytes ...e_visit_enddatetime_alter_visit_doctors.py | 25 ++++++++++++++++ 14 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 project/accounts/migrations/0004_alter_doctor_marital_status_and_more.py rename project/project/media/user_images/{example_3LXLiLE.jpg => example_B7DUFHc.jpg} (100%) rename project/project/media/user_images/{example_DhsRdWI.jpg => example_BPSSWvZ.jpg} (100%) rename project/project/media/user_images/{example_NhnPU17.jpg => example_EiPkSgj.jpg} (100%) rename project/project/media/user_images/{example_V4cIqzy.jpg => example_KiB9VWI.jpg} (100%) rename project/project/media/user_images/{example_VwHcJWd.jpg => example_V7tBFdE.jpg} (100%) rename project/project/media/user_images/{example_YjFvqYO.jpg => example_Yup6Xje.jpg} (100%) rename project/project/media/user_images/{example_fgo15kh.jpg => example_afvsRsx.jpg} (100%) rename project/project/media/user_images/{example_icvPwan.jpg => example_awpCuxp.jpg} (100%) rename project/project/media/user_images/{example_kOe1UL0.jpg => example_cIkBNRq.jpg} (100%) rename project/project/media/user_images/{example_npx8snv.jpg => example_xMb9ehF.jpg} (100%) create mode 100644 project/project/media/user_images/example_zXMv1nd.jpg create mode 100644 project/visit/migrations/0002_remove_visit_enddatetime_alter_visit_doctors.py diff --git a/project/accounts/filters/__init__.py b/project/accounts/filters/__init__.py index 0dca486..c0732ce 100644 --- a/project/accounts/filters/__init__.py +++ b/project/accounts/filters/__init__.py @@ -31,7 +31,7 @@ class Meta: 'national_id': ['exact'], 'full_name': ['exact'], 'created_at': ['year', 'month', 'day'], - 'experience': ['exact'], + 'experience_years': ['exact'], 'work_days': ['exact'], 'license_number': ['exact'], } \ No newline at end of file diff --git a/project/accounts/migrations/0004_alter_doctor_marital_status_and_more.py b/project/accounts/migrations/0004_alter_doctor_marital_status_and_more.py new file mode 100644 index 0000000..30b43da --- /dev/null +++ b/project/accounts/migrations/0004_alter_doctor_marital_status_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.3 on 2024-05-02 04:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0003_alter_address_user_alter_phone_user_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="doctor", + name="marital_status", + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AlterField( + model_name="employee", + name="marital_status", + field=models.CharField(blank=True, max_length=255, null=True), + ), + migrations.AlterField( + model_name="patient", + name="marital_status", + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/project/project/media/user_images/example_3LXLiLE.jpg b/project/project/media/user_images/example_B7DUFHc.jpg similarity index 100% rename from project/project/media/user_images/example_3LXLiLE.jpg rename to project/project/media/user_images/example_B7DUFHc.jpg diff --git a/project/project/media/user_images/example_DhsRdWI.jpg b/project/project/media/user_images/example_BPSSWvZ.jpg similarity index 100% rename from project/project/media/user_images/example_DhsRdWI.jpg rename to project/project/media/user_images/example_BPSSWvZ.jpg diff --git a/project/project/media/user_images/example_NhnPU17.jpg b/project/project/media/user_images/example_EiPkSgj.jpg similarity index 100% rename from project/project/media/user_images/example_NhnPU17.jpg rename to project/project/media/user_images/example_EiPkSgj.jpg diff --git a/project/project/media/user_images/example_V4cIqzy.jpg b/project/project/media/user_images/example_KiB9VWI.jpg similarity index 100% rename from project/project/media/user_images/example_V4cIqzy.jpg rename to project/project/media/user_images/example_KiB9VWI.jpg diff --git a/project/project/media/user_images/example_VwHcJWd.jpg b/project/project/media/user_images/example_V7tBFdE.jpg similarity index 100% rename from project/project/media/user_images/example_VwHcJWd.jpg rename to project/project/media/user_images/example_V7tBFdE.jpg diff --git a/project/project/media/user_images/example_YjFvqYO.jpg b/project/project/media/user_images/example_Yup6Xje.jpg similarity index 100% rename from project/project/media/user_images/example_YjFvqYO.jpg rename to project/project/media/user_images/example_Yup6Xje.jpg diff --git a/project/project/media/user_images/example_fgo15kh.jpg b/project/project/media/user_images/example_afvsRsx.jpg similarity index 100% rename from project/project/media/user_images/example_fgo15kh.jpg rename to project/project/media/user_images/example_afvsRsx.jpg diff --git a/project/project/media/user_images/example_icvPwan.jpg b/project/project/media/user_images/example_awpCuxp.jpg similarity index 100% rename from project/project/media/user_images/example_icvPwan.jpg rename to project/project/media/user_images/example_awpCuxp.jpg diff --git a/project/project/media/user_images/example_kOe1UL0.jpg b/project/project/media/user_images/example_cIkBNRq.jpg similarity index 100% rename from project/project/media/user_images/example_kOe1UL0.jpg rename to project/project/media/user_images/example_cIkBNRq.jpg diff --git a/project/project/media/user_images/example_npx8snv.jpg b/project/project/media/user_images/example_xMb9ehF.jpg similarity index 100% rename from project/project/media/user_images/example_npx8snv.jpg rename to project/project/media/user_images/example_xMb9ehF.jpg diff --git a/project/project/media/user_images/example_zXMv1nd.jpg b/project/project/media/user_images/example_zXMv1nd.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e7203c6c1ba50d9fd988245bd91f5a9f23fdadf8 GIT binary patch literal 825 zcmex=^(PF6}rMnOeST|r4lSw=>~TvNxu(8R<c1}I=;VrF4wW9Q)H;sz?% zD!{d!pzFb!U9xX3zTPI5o8roG<0MW4oqZMDikqloVbuf*=gfJ(V&YTRE(2~ znmD<{#3dx9RMpfqG__1j&CD$#!^cw^i}n}V99Yz)!7zj|^Z%Oww!9Eh literal 0 HcmV?d00001 diff --git a/project/visit/migrations/0002_remove_visit_enddatetime_alter_visit_doctors.py b/project/visit/migrations/0002_remove_visit_enddatetime_alter_visit_doctors.py new file mode 100644 index 0000000..621a2d5 --- /dev/null +++ b/project/visit/migrations/0002_remove_visit_enddatetime_alter_visit_doctors.py @@ -0,0 +1,25 @@ +# Generated by Django 5.0.3 on 2024-05-02 04:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("accounts", "0004_alter_doctor_marital_status_and_more"), + ("visit", "0001_initial"), + ] + + operations = [ + migrations.RemoveField( + model_name="visit", + name="enddatetime", + ), + migrations.AlterField( + model_name="visit", + name="doctors", + field=models.ManyToManyField( + blank=True, null=True, related_name="visits", to="accounts.doctor" + ), + ), + ]