There is currently no convenient way to check whether an arbitrary LBL Project ID (docs) is currently "valid".
Add the following:
A subcommand of the billing_ids command named validate that takes a billing ID as input and prints out "Valid" or "Invalid".
A view at the URL /billing/validate/ that takes a billing ID as input and returns in some way whether it is valid.
In the billing ID usages page (Admin > LBL Project IDs), add a "Validate" button next to "Create" that links to this view.
It should have the same permissions as the other billing views.
To check validity, call coldfront.core.billing.utils.validation.is_billing_id_valid.
Enforce that the billing ID is "well-formed" before bothering to check for validity.
(Optional) To improve UX, take as input a list of billing IDs and return whether they are individually valid/invalid. For the UI, this could be a text area that takes a newline-separated list. For the CLI, this could be given as an arbitrary number of arguments (search for nargs='+' in management commands).
There is currently no convenient way to check whether an arbitrary LBL Project ID (docs) is currently "valid".
Add the following:
billing_ids
command namedvalidate
that takes a billing ID as input and prints out "Valid" or "Invalid"./billing/validate/
that takes a billing ID as input and returns in some way whether it is valid.To check validity, call
coldfront.core.billing.utils.validation.is_billing_id_valid
.Enforce that the billing ID is "well-formed" before bothering to check for validity.
(Optional) To improve UX, take as input a list of billing IDs and return whether they are individually valid/invalid. For the UI, this could be a text area that takes a newline-separated list. For the CLI, this could be given as an arbitrary number of arguments (search for
nargs='+'
in management commands).Add tests.