-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: 410 Report Verification - LFO #2714
Merged
+1,221
−567
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5cf16a4
feat: report verification for LFO
shon-button 4b629e8
chore: update verification RJSF schemas
shon-button b235fc5
chore: add verification properties to initial data
shon-button a327afe
tests: update verification api/service test
shon-button 287bad2
tests: verification page
shon-button 8393d7f
chore: verification data handling functions
shon-button c39bf13
tests: add verification utils tests
shon-button File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
125 changes: 125 additions & 0 deletions
125
...eporting/migrations/0050_remove_reportverification_other_facility_coordinates_and_more.py
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,125 @@ | ||
# Generated by Django 5.0.10 on 2025-02-03 23:56 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
( | ||
'registration', | ||
'0072_alter_historicaloptedinoperationdetail_meets_producing_gger_schedule_a1_regulated_product_and_more', | ||
), | ||
('reporting', '0049_alter_gcs_add_CEMS'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='reportverification', | ||
name='other_facility_coordinates', | ||
), | ||
migrations.RemoveField( | ||
model_name='reportverification', | ||
name='other_facility_name', | ||
), | ||
migrations.RemoveField( | ||
model_name='reportverification', | ||
name='visit_name', | ||
), | ||
migrations.RemoveField( | ||
model_name='reportverification', | ||
name='visit_type', | ||
), | ||
migrations.CreateModel( | ||
name='ReportVerificationVisit', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_at', models.DateTimeField(auto_now_add=True, null=True)), | ||
('updated_at', models.DateTimeField(blank=True, null=True)), | ||
('archived_at', models.DateTimeField(blank=True, null=True)), | ||
( | ||
'visit_name', | ||
models.CharField( | ||
db_comment='The name of the site visited (Facility X, Other, or None)', max_length=100 | ||
), | ||
), | ||
( | ||
'visit_type', | ||
models.CharField( | ||
blank=True, | ||
choices=[('In person', 'In Person'), ('Virtual', 'Virtual')], | ||
db_comment='The type of visit conducted (Virtual or In Person)', | ||
max_length=10, | ||
null=True, | ||
), | ||
), | ||
( | ||
'visit_coordinates', | ||
models.CharField( | ||
blank=True, | ||
db_comment='Geographic location of an other facility visited', | ||
max_length=100, | ||
null=True, | ||
), | ||
), | ||
( | ||
'is_other_visit', | ||
models.BooleanField( | ||
db_comment='Flag to indicate the visit is an other facility visited', default=False | ||
), | ||
), | ||
( | ||
'archived_by', | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name='%(class)s_archived', | ||
to='registration.user', | ||
), | ||
), | ||
( | ||
'created_by', | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name='%(class)s_created', | ||
to='registration.user', | ||
), | ||
), | ||
( | ||
'report_verification', | ||
models.ForeignKey( | ||
db_comment='The report verification associated with this visit', | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name='report_verification_visits', | ||
to='reporting.reportverification', | ||
), | ||
), | ||
( | ||
'updated_by', | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name='%(class)s_updated', | ||
to='registration.user', | ||
), | ||
), | ||
], | ||
options={ | ||
'db_table': 'erc"."verification_visit', | ||
'db_table_comment': 'Table to store individual verification visit information', | ||
}, | ||
), | ||
migrations.AddConstraint( | ||
model_name='reportverificationvisit', | ||
constraint=models.CheckConstraint( | ||
check=models.Q(('is_other_visit', False), ('visit_coordinates__isnull', False), _connector='OR'), | ||
name='other_facility_must_have_coordinates', | ||
violation_error_message='Coordinates must be provided for an other facility visit', | ||
), | ||
), | ||
] |
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
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,57 @@ | ||
from django.db import models | ||
from django.db.models import Q | ||
from registration.models.time_stamped_model import TimeStampedModel | ||
from reporting.models.report_verification import ReportVerification | ||
|
||
|
||
class ReportVerificationVisit(TimeStampedModel): | ||
""" | ||
Model to store information about a verification visit for a report verification. | ||
""" | ||
|
||
report_verification = models.ForeignKey( | ||
ReportVerification, | ||
on_delete=models.CASCADE, | ||
related_name="report_verification_visits", | ||
db_comment="The report verification associated with this visit", | ||
) | ||
|
||
visit_name = models.CharField( | ||
max_length=100, db_comment="The name of the site visited (Facility X, Other, or None)" | ||
) | ||
|
||
class VisitType(models.TextChoices): | ||
IN_PERSON = "In person" | ||
VIRTUAL = "Virtual" | ||
|
||
visit_type = models.CharField( | ||
max_length=10, | ||
choices=VisitType.choices, | ||
null=True, | ||
blank=True, | ||
db_comment="The type of visit conducted (Virtual or In Person)", | ||
) | ||
|
||
visit_coordinates = models.CharField( | ||
max_length=100, | ||
null=True, | ||
blank=True, | ||
db_comment="Geographic location of an other facility visited", | ||
) | ||
|
||
is_other_visit = models.BooleanField( | ||
db_comment="Flag to indicate the visit is an other facility visited", | ||
default=False, | ||
) | ||
|
||
class Meta: | ||
db_table = 'erc"."verification_visit' | ||
db_table_comment = "Table to store individual verification visit information" | ||
app_label = 'reporting' | ||
constraints = [ | ||
models.CheckConstraint( | ||
name="other_facility_must_have_coordinates", | ||
check=Q(is_other_visit=False) | Q(visit_coordinates__isnull=False), | ||
violation_error_message="Coordinates must be provided for an other facility visit", | ||
), | ||
] |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are inferred from the django model, they're redundant with the
Meta fields = [...]
declaration. We can just remove those linesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pbastia
FYI: when I remove the "redundant fields" I get MyPy failed