Skip to content
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

Official stats prototype #2286

Draft
wants to merge 101 commits into
base: dev
Choose a base branch
from
Draft

Official stats prototype #2286

wants to merge 101 commits into from

Conversation

kevincarrogan
Copy link
Contributor

Aim

LTD-

kevincarrogan and others added 30 commits October 31, 2024 11:23
 - remove licence statuses endpoint for now
 - make tests work
Licence document generation date is taken for this purpose.
When all products on the application are NLR then the current code
allowed creation of a licence due a bug. This is not fixed yet so
exclude these cases as it can skew licence data.
In some case a licence is issued but subsequently application is
marked as withdrawn. Licence also should've been cancelled in this
case but we are not handling this atm so filter these cases.
As there can be multiple documents in these cases
Use Case as base object and use it to filter on the licence documents.
This avoids filtering of various case statuses, NLR products etc
Use the refusal letter generated date as the decision date
A case can have multiple outcomes and we create instances of this
model for each outcome.
These are created for issued, refused and revoked outcomes.
We now have LicenceDecision model so we can generate the extract
using those instances instead of deriving from other models.
all_issued = all(
ld.decision == LicenceDecisionType.ISSUED
for ld in licence_decision.case.licence_decisions.all()
if not ld.excluded_from_statistics_reason
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this are filtered in the view

saruniitr and others added 23 commits November 19, 2024 16:23
For those licences that are issued on appeal we want the decision
to be updated as 'issued_on_appeal'
If a licence that is issued on appeal needs amending and it is
reissued again then the new licence decision is also recorded
as issued on appeal (decision remains the same which is issue).
These are renamed as licence_decisions.feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants