mirror of
https://github.com/google/nomulus.git
synced 2025-06-26 22:34:55 +02:00
Enable ability to generate invoices without publishing
This adds a parameter to control invoice reporting, which defaults to false for now (since we plan on manually adjusting the invoice next month). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=193708323
This commit is contained in:
parent
4151660dab
commit
139c8e190d
4 changed files with 75 additions and 6 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.reporting.billing;
|
||||
|
||||
import static google.registry.request.RequestParameters.extractOptionalBooleanParameter;
|
||||
import static google.registry.request.RequestParameters.extractRequiredParameter;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
|
@ -43,6 +44,7 @@ public final class BillingModule {
|
|||
public static final String INVOICES_DIRECTORY = "invoices";
|
||||
|
||||
static final String PARAM_JOB_ID = "jobId";
|
||||
static final String PARAM_SHOULD_PUBLISH = "shouldPublish";
|
||||
static final String BILLING_QUEUE = "billing";
|
||||
static final String CRON_QUEUE = "retryable-cron-tasks";
|
||||
|
||||
|
@ -56,6 +58,15 @@ public final class BillingModule {
|
|||
return extractRequiredParameter(req, PARAM_JOB_ID);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Parameter(PARAM_SHOULD_PUBLISH)
|
||||
static boolean provideShouldPublish(
|
||||
HttpServletRequest req,
|
||||
@Config("defaultShouldPublishInvoices") boolean defaultShouldPublishInvoices) {
|
||||
return extractOptionalBooleanParameter(req, PARAM_SHOULD_PUBLISH)
|
||||
.orElse(defaultShouldPublishInvoices);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@InvoiceDirectoryPrefix
|
||||
static String provideDirectoryPrefix(YearMonth yearMonth) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue