Only inject @Parameter-created variables in the Action itself

Icann reports have 3 parameter-provided injections:

- yearMonth
- subdir
- reportType

We move all of them away from the "inner classes" and only @Inject them in the Actions themselves.

This has 2 benefits:
- it's much clearer what all the parameter inputs of the Actions are
- the "inner injected classes" don't assume anything about the Action that uses them - they will work just as well for JSON actions as for "regular" actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233625765
This commit is contained in:
guyben 2019-02-12 09:56:26 -08:00 committed by jianglai
parent e6c46cab58
commit 4097dae3b2
20 changed files with 364 additions and 270 deletions

View file

@ -15,13 +15,14 @@
package google.registry.reporting.icann;
import com.google.common.collect.ImmutableMap;
import org.joda.time.YearMonth;
/** Interface defining the necessary methods to construct ICANN reporting SQL queries. */
public interface QueryBuilder {
/** Returns a map from an intermediary view's table name to the query that generates it. */
ImmutableMap<String, String> getViewQueryMap();
ImmutableMap<String, String> getViewQueryMap(YearMonth yearMonth);
/** Returns a query that retrieves the overall report from the previously generated view. */
String getReportQuery();
String getReportQuery(YearMonth yearMonth);
}