use of org.finos.waltz.model.IdSelectionOptions in project waltz by khartec.
the class EntityStatisticEndpoint method calculateHistoricStatTallyRoute.
private List<TallyPack<String>> calculateHistoricStatTallyRoute(Request request, Response response) throws IOException {
IdSelectionOptions idSelectionOptions = WebUtilities.readIdSelectionOptionsFromBody(request);
RollupKind rollupKind = extractRollupKind(request);
Duration duration = EnumUtilities.readEnum(request.queryParams("duration"), Duration.class, s -> Duration.MONTH);
Long statisticId = WebUtilities.getId(request);
return entityStatisticService.calculateHistoricStatTally(statisticId, rollupKind, idSelectionOptions, duration);
}
use of org.finos.waltz.model.IdSelectionOptions in project waltz by khartec.
the class AllocationsExtractor method registerExtractForAll.
private void registerExtractForAll(String path) {
post(path, (request, response) -> {
IdSelectionOptions idSelectionOptions = WebUtilities.readIdSelectionOptionsFromBody(request);
SelectConditionStep<Record> qry = prepareQuery(DSL.trueCondition(), idSelectionOptions);
return writeExtract("all_allocations", qry, request, response);
});
}
use of org.finos.waltz.model.IdSelectionOptions in project waltz by khartec.
the class AllocationsExtractor method registerExtractForCategory.
private void registerExtractForCategory(String path) {
post(path, (request, response) -> {
long measurableCategoryId = WebUtilities.getLong(request, "measurableCategoryId");
IdSelectionOptions applicationIdSelectionOptions = WebUtilities.readIdSelectionOptionsFromBody(request);
Record1<String> fileName = dsl.select(DSL.concat(MEASURABLE_CATEGORY.NAME, "_all_allocations")).from(MEASURABLE_CATEGORY).where(MEASURABLE_CATEGORY.ID.eq(measurableCategoryId)).fetchOne();
SelectConditionStep<Record> qry = prepareQuery(MEASURABLE.MEASURABLE_CATEGORY_ID.eq(measurableCategoryId), applicationIdSelectionOptions);
return writeExtract(fileName.value1(), qry, request, response);
});
}
use of org.finos.waltz.model.IdSelectionOptions in project waltz by khartec.
the class AllocationsExtractor method registerExtractForScheme.
private void registerExtractForScheme(String path) {
post(path, (request, response) -> {
long schemeId = WebUtilities.getLong(request, "schemeId");
IdSelectionOptions applicationIdSelectionOptions = WebUtilities.readIdSelectionOptionsFromBody(request);
Record2<String, String> fileNameInfoRow = dsl.select(MEASURABLE_CATEGORY.NAME, ALLOCATION_SCHEME.NAME).from(ALLOCATION_SCHEME).innerJoin(MEASURABLE_CATEGORY).on(ALLOCATION_SCHEME.MEASURABLE_CATEGORY_ID.eq(MEASURABLE_CATEGORY.ID)).where(ALLOCATION_SCHEME.ID.eq(schemeId)).fetchOne();
SelectConditionStep<Record> qry = prepareQuery(ALLOCATION_SCHEME.ID.eq(schemeId), applicationIdSelectionOptions);
String filename = fileNameInfoRow.value1() + "_" + fileNameInfoRow.value2();
return writeExtract(filename, qry, request, response);
});
}
Aggregations