@auditcore/ui-core 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1326 -0
- package/dist/account/camera.d.ts +8 -0
- package/dist/account/controller.d.ts +30 -0
- package/dist/account/index.d.ts +7 -0
- package/dist/account/messages.d.ts +2 -0
- package/dist/account/port.d.ts +10 -0
- package/dist/account/presentation.d.ts +9 -0
- package/dist/account/types.d.ts +42 -0
- package/dist/account/view.d.ts +12 -0
- package/dist/attributes/controller.d.ts +26 -0
- package/dist/attributes/index.d.ts +5 -0
- package/dist/attributes/messages.d.ts +3 -0
- package/dist/attributes/port.d.ts +4 -0
- package/dist/attributes/types.d.ts +60 -0
- package/dist/attributes/view.d.ts +49 -0
- package/dist/base/icons.d.ts +38 -0
- package/dist/base/index.d.ts +3 -0
- package/dist/base/types.d.ts +3 -0
- package/dist/batchchecks/controller.d.ts +60 -0
- package/dist/batchchecks/index.d.ts +7 -0
- package/dist/batchchecks/messages.d.ts +3 -0
- package/dist/batchchecks/model.d.ts +38 -0
- package/dist/batchchecks/port.d.ts +6 -0
- package/dist/batchchecks/rest-port.d.ts +4 -0
- package/dist/batchchecks/types.d.ts +121 -0
- package/dist/batchchecks/view.d.ts +58 -0
- package/dist/benford/chart.d.ts +49 -0
- package/dist/benford/controller.d.ts +48 -0
- package/dist/benford/index.d.ts +7 -0
- package/dist/benford/messages.d.ts +3 -0
- package/dist/benford/model.d.ts +32 -0
- package/dist/benford/rest-port.d.ts +4 -0
- package/dist/benford/types.d.ts +144 -0
- package/dist/benford/view.d.ts +45 -0
- package/dist/dataprotection/dsfa.d.ts +55 -0
- package/dist/dataprotection/dsfaView.d.ts +45 -0
- package/dist/dataprotection/exporters.d.ts +33 -0
- package/dist/dataprotection/index.d.ts +10 -0
- package/dist/dataprotection/messages.d.ts +5 -0
- package/dist/dataprotection/registerView.d.ts +47 -0
- package/dist/dataprotection/requests.d.ts +16 -0
- package/dist/dataprotection/rest-port.d.ts +4 -0
- package/dist/dataprotection/types.d.ts +291 -0
- package/dist/dataprotection/vvt.d.ts +69 -0
- package/dist/dbkanban/controller.d.ts +54 -0
- package/dist/dbkanban/index.d.ts +3 -0
- package/dist/dbkanban/messages.d.ts +5 -0
- package/dist/dbkanban/view.d.ts +39 -0
- package/dist/documents/controller.d.ts +63 -0
- package/dist/documents/form.d.ts +52 -0
- package/dist/documents/importing.d.ts +12 -0
- package/dist/documents/index.d.ts +6 -0
- package/dist/documents/list.d.ts +21 -0
- package/dist/documents/messages.d.ts +8 -0
- package/dist/documents/view.d.ts +36 -0
- package/dist/download.d.ts +14 -0
- package/dist/extraction/controller.d.ts +34 -0
- package/dist/extraction/index.d.ts +5 -0
- package/dist/extraction/messages.d.ts +3 -0
- package/dist/extraction/rest-port.d.ts +4 -0
- package/dist/extraction/types.d.ts +115 -0
- package/dist/extraction/view.d.ts +35 -0
- package/dist/extrapolation/controller-subsample.d.ts +20 -0
- package/dist/extrapolation/controller.d.ts +72 -0
- package/dist/extrapolation/index.d.ts +9 -0
- package/dist/extrapolation/messages.d.ts +3 -0
- package/dist/extrapolation/model-design.d.ts +28 -0
- package/dist/extrapolation/model-subsample.d.ts +40 -0
- package/dist/extrapolation/model.d.ts +92 -0
- package/dist/extrapolation/rest-port.d.ts +4 -0
- package/dist/extrapolation/types.d.ts +255 -0
- package/dist/extrapolation/view-details.d.ts +46 -0
- package/dist/extrapolation/view.d.ts +50 -0
- package/dist/focus.d.ts +10 -0
- package/dist/geo/controller.d.ts +87 -0
- package/dist/geo/index.d.ts +6 -0
- package/dist/geo/mapView.d.ts +30 -0
- package/dist/geo/messages.d.ts +3 -0
- package/dist/geo/model.d.ts +43 -0
- package/dist/geo/rest-port.d.ts +12 -0
- package/dist/geo/types.d.ts +195 -0
- package/dist/i18n.d.ts +29 -0
- package/dist/identifiers/controller.d.ts +63 -0
- package/dist/identifiers/index.d.ts +5 -0
- package/dist/identifiers/messages.d.ts +3 -0
- package/dist/identifiers/model.d.ts +87 -0
- package/dist/identifiers/rest-port.d.ts +4 -0
- package/dist/identifiers/types.d.ts +101 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +10676 -0
- package/dist/index.js.map +1 -0
- package/dist/kanban/index.d.ts +2 -0
- package/dist/kanban/messages.d.ts +6 -0
- package/dist/messages.d.ts +2 -0
- package/dist/reporting/controller.d.ts +46 -0
- package/dist/reporting/index.d.ts +5 -0
- package/dist/reporting/messages.d.ts +3 -0
- package/dist/reporting/rest-port.d.ts +4 -0
- package/dist/reporting/types.d.ts +72 -0
- package/dist/reporting/view.d.ts +12 -0
- package/dist/reporttemplates/controller.d.ts +46 -0
- package/dist/reporttemplates/index.d.ts +5 -0
- package/dist/reporttemplates/messages.d.ts +3 -0
- package/dist/reporttemplates/port.d.ts +4 -0
- package/dist/reporttemplates/types.d.ts +92 -0
- package/dist/reporttemplates/view.d.ts +27 -0
- package/dist/risk/controller.d.ts +54 -0
- package/dist/risk/format.d.ts +13 -0
- package/dist/risk/index.d.ts +7 -0
- package/dist/risk/labels.d.ts +9 -0
- package/dist/risk/messages.d.ts +3 -0
- package/dist/risk/port.d.ts +41 -0
- package/dist/risk/state.d.ts +61 -0
- package/dist/risk/types.d.ts +107 -0
- package/dist/runner/aktionen.d.ts +16 -0
- package/dist/runner/controller.d.ts +72 -0
- package/dist/runner/eingabe.d.ts +5 -0
- package/dist/runner/index.d.ts +9 -0
- package/dist/runner/messages.d.ts +3 -0
- package/dist/runner/port.d.ts +20 -0
- package/dist/runner/profil.d.ts +39 -0
- package/dist/runner/types.d.ts +109 -0
- package/dist/runner/view-listen.d.ts +32 -0
- package/dist/runner/view.d.ts +95 -0
- package/dist/samplesize/controller.d.ts +33 -0
- package/dist/samplesize/index.d.ts +7 -0
- package/dist/samplesize/messages.d.ts +3 -0
- package/dist/samplesize/model.d.ts +40 -0
- package/dist/samplesize/port.d.ts +9 -0
- package/dist/samplesize/types.d.ts +92 -0
- package/dist/samplesize/view.d.ts +39 -0
- package/dist/sampling/controller.d.ts +62 -0
- package/dist/sampling/index.d.ts +6 -0
- package/dist/sampling/messages.d.ts +3 -0
- package/dist/sampling/model.d.ts +63 -0
- package/dist/sampling/rest-port.d.ts +4 -0
- package/dist/sampling/types.d.ts +136 -0
- package/dist/sampling/view.d.ts +45 -0
- package/dist/screening/controller.d.ts +52 -0
- package/dist/screening/index.d.ts +8 -0
- package/dist/screening/messages.d.ts +7 -0
- package/dist/screening/rest-port.d.ts +4 -0
- package/dist/screening/runForm.d.ts +22 -0
- package/dist/screening/types.d.ts +295 -0
- package/dist/screening/view.d.ts +84 -0
- package/dist/store.d.ts +30 -0
- package/dist/synopsis/controller.d.ts +68 -0
- package/dist/synopsis/exporters.d.ts +16 -0
- package/dist/synopsis/index.d.ts +8 -0
- package/dist/synopsis/messages.d.ts +3 -0
- package/dist/synopsis/navigation.d.ts +5 -0
- package/dist/synopsis/port.d.ts +38 -0
- package/dist/synopsis/types.d.ts +121 -0
- package/dist/synopsis/viewModel.d.ts +74 -0
- package/dist/synopsis/wordDiff.d.ts +31 -0
- package/dist/table/index.d.ts +6 -0
- package/dist/tabular/index.d.ts +2 -0
- package/dist/tabular/messages.d.ts +3 -0
- package/dist/tabular/tableImport.d.ts +40 -0
- package/package.json +55 -0
- package/styles/account.css +37 -0
- package/styles/attributes.css +18 -0
- package/styles/base.css +116 -0
- package/styles/batchchecks.css +26 -0
- package/styles/benford.css +39 -0
- package/styles/dataprotection.css +68 -0
- package/styles/dbkanban.css +38 -0
- package/styles/documents.css +51 -0
- package/styles/extraction.css +25 -0
- package/styles/extrapolation.css +34 -0
- package/styles/geo.css +54 -0
- package/styles/identifiers.css +38 -0
- package/styles/index.css +24 -0
- package/styles/kanban.css +115 -0
- package/styles/reporting.css +22 -0
- package/styles/reporttemplates.css +21 -0
- package/styles/risk.css +92 -0
- package/styles/runner.css +54 -0
- package/styles/samplesize.css +27 -0
- package/styles/sampling.css +31 -0
- package/styles/screening.css +86 -0
- package/styles/synopsis.css +83 -0
- package/styles/table.css +17 -0
- package/styles/tabular.css +11 -0
- package/styles/tokens.css +121 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vertrag `auditcore_sampling.guidance/1` (Python `auditcore_sampling.web`,
|
|
3
|
+
* docs/ui/samplesize-rest.md): Stichprobenumfang nach dem KOM-Leitfaden
|
|
4
|
+
* EGESIF_16-0014-01.
|
|
5
|
+
*/
|
|
6
|
+
/** Tabelle, aus der die Konfidenzniveaus einer Methode stammen. */
|
|
7
|
+
export type SampleSizeConfidenceTable = 'z' | 'reliability' | null;
|
|
8
|
+
export interface SampleSizeMethod {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
section: string;
|
|
12
|
+
formula: string;
|
|
13
|
+
fields: readonly string[];
|
|
14
|
+
source: string;
|
|
15
|
+
confidence_table: SampleSizeConfidenceTable;
|
|
16
|
+
}
|
|
17
|
+
export interface SampleSizeLevel {
|
|
18
|
+
level: number;
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SampleSizeChoice {
|
|
22
|
+
id: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SampleSizeCatalogue {
|
|
26
|
+
contract: string;
|
|
27
|
+
library: string;
|
|
28
|
+
status: string;
|
|
29
|
+
status_label: string;
|
|
30
|
+
guidance: string;
|
|
31
|
+
materiality_rate: number;
|
|
32
|
+
methods: readonly SampleSizeMethod[];
|
|
33
|
+
factor_profiles: readonly (SampleSizeChoice & {
|
|
34
|
+
source: string;
|
|
35
|
+
note: string;
|
|
36
|
+
})[];
|
|
37
|
+
tables: {
|
|
38
|
+
z: readonly SampleSizeLevel[];
|
|
39
|
+
reliability: readonly SampleSizeLevel[];
|
|
40
|
+
expansion: readonly SampleSizeLevel[];
|
|
41
|
+
};
|
|
42
|
+
nonstatistical_rules: readonly (SampleSizeChoice & {
|
|
43
|
+
source: string;
|
|
44
|
+
})[];
|
|
45
|
+
assurance_levels: readonly SampleSizeChoice[];
|
|
46
|
+
}
|
|
47
|
+
export interface SampleSizeStratumRequest {
|
|
48
|
+
name: string;
|
|
49
|
+
population_size?: number;
|
|
50
|
+
book_value?: number;
|
|
51
|
+
sd?: number;
|
|
52
|
+
exhaustive: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Anfrage an `POST /guidance/size`; Anteile als Werte zwischen 0 und 1. */
|
|
55
|
+
export interface SampleSizeRequest {
|
|
56
|
+
method: string;
|
|
57
|
+
[field: string]: string | number | boolean | readonly SampleSizeStratumRequest[];
|
|
58
|
+
}
|
|
59
|
+
export interface SampleSizeStep {
|
|
60
|
+
label: string;
|
|
61
|
+
formula: string;
|
|
62
|
+
value: number;
|
|
63
|
+
source: string;
|
|
64
|
+
}
|
|
65
|
+
export interface SampleSizeAllocation {
|
|
66
|
+
name: string;
|
|
67
|
+
sample_size: number;
|
|
68
|
+
exhaustive: boolean;
|
|
69
|
+
population_size: number | null;
|
|
70
|
+
book_value: number | null;
|
|
71
|
+
share: number | null;
|
|
72
|
+
cut_off: number | null;
|
|
73
|
+
}
|
|
74
|
+
export interface SampleSizePlan {
|
|
75
|
+
contract: string;
|
|
76
|
+
library: string;
|
|
77
|
+
status: string;
|
|
78
|
+
status_label: string;
|
|
79
|
+
method: string;
|
|
80
|
+
sample_size: number;
|
|
81
|
+
raw_size: number;
|
|
82
|
+
interval: number | null;
|
|
83
|
+
inputs: Readonly<Record<string, unknown>>;
|
|
84
|
+
strata: readonly SampleSizeAllocation[];
|
|
85
|
+
derivation: readonly SampleSizeStep[];
|
|
86
|
+
warnings: readonly string[];
|
|
87
|
+
}
|
|
88
|
+
/** Fachlogik hinter der Oberfläche; Vue und React rufen nur diesen Port auf. */
|
|
89
|
+
export interface SamplesizePort {
|
|
90
|
+
profiles: () => Promise<SampleSizeCatalogue>;
|
|
91
|
+
plan: (request: SampleSizeRequest) => Promise<SampleSizePlan>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Locale, Translate } from '../i18n';
|
|
2
|
+
import { SamplesizeData } from './controller';
|
|
3
|
+
import { SamplesizeMessageKey } from './messages';
|
|
4
|
+
import { StratumColumn } from './model';
|
|
5
|
+
import { SampleSizeMethod, SampleSizePlan } from './types';
|
|
6
|
+
type T = Translate<SamplesizeMessageKey>;
|
|
7
|
+
export interface SamplesizeOption {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
/** Ein Eingabefeld, wie Vue und React es darstellen. */
|
|
12
|
+
export interface SamplesizeFieldView {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
kind: 'choice' | 'number';
|
|
16
|
+
options: SamplesizeOption[];
|
|
17
|
+
value: string;
|
|
18
|
+
issue: string | null;
|
|
19
|
+
inputMode: 'decimal' | 'numeric';
|
|
20
|
+
}
|
|
21
|
+
export interface SamplesizeCell {
|
|
22
|
+
key: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function samplesizeMethod(state: SamplesizeData): SampleSizeMethod | null;
|
|
26
|
+
/** Eingabefelder der gewählten Methode mit Beschriftung, Auswahl und Fehlermeldung. */
|
|
27
|
+
export declare function samplesizeFields(state: SamplesizeData, t: T, locale: Locale): SamplesizeFieldView[];
|
|
28
|
+
export declare function samplesizeStrataColumns(state: SamplesizeData, t: T): {
|
|
29
|
+
key: StratumColumn;
|
|
30
|
+
label: string;
|
|
31
|
+
}[];
|
|
32
|
+
/** Zahl für die Anzeige: ganze Beträge gruppiert, kleine Werte mit bis zu sechs Stellen. */
|
|
33
|
+
export declare function samplesizeNumber(value: number, locale: Locale): string;
|
|
34
|
+
export declare function samplesizeSummary(plan: SampleSizePlan, t: T, locale: Locale): SamplesizeCell[];
|
|
35
|
+
export declare function samplesizeAllocation(plan: SampleSizePlan, t: T, locale: Locale): string[][];
|
|
36
|
+
export declare function samplesizeDerivation(plan: SampleSizePlan, locale: Locale): string[][];
|
|
37
|
+
/** Anteile werden in Prozent erfasst (Beschriftung „(%)“). */
|
|
38
|
+
export declare const samplesizePercentFields: readonly string[];
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
import { RequestState } from '../store';
|
|
3
|
+
import { FieldError, SelectionValidation } from './model';
|
|
4
|
+
import { AllocationMethod, ExportFormat, MethodProfile, PopulationItem, SamplingCatalogue, SamplingPort, SelectionRequest, SelectionResult, SelectionVariant, SizeResult } from './types';
|
|
5
|
+
export type SamplingBusy = 'load' | 'size' | 'selection' | 'export';
|
|
6
|
+
export type SelectionError = Extract<SelectionValidation, {
|
|
7
|
+
ok: false;
|
|
8
|
+
}>['error'];
|
|
9
|
+
export interface SamplingCallbacks {
|
|
10
|
+
sizeCalculated?: (result: SizeResult) => void;
|
|
11
|
+
selectionDrawn?: (result: SelectionResult) => void;
|
|
12
|
+
failed?: (message: string) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Stand des Stichprobenrechners; `error` ist die Meldung der letzten abgelehnten Anfrage. */
|
|
15
|
+
export interface SamplingData extends RequestState<string> {
|
|
16
|
+
catalogue: SamplingCatalogue | null;
|
|
17
|
+
methodId: string;
|
|
18
|
+
texts: Record<string, string>;
|
|
19
|
+
confidence: number | null;
|
|
20
|
+
fieldErrors: Readonly<Record<string, FieldError>>;
|
|
21
|
+
size: SizeResult | null;
|
|
22
|
+
/** Importierte Grundgesamtheit; `null` = Eigenschaft `items`. */
|
|
23
|
+
imported: readonly PopulationItem[] | null;
|
|
24
|
+
sampleSize: string;
|
|
25
|
+
seed: string;
|
|
26
|
+
variant: SelectionVariant | null;
|
|
27
|
+
allocation: AllocationMethod | null;
|
|
28
|
+
selection: SelectionResult | null;
|
|
29
|
+
lastRequest: (SelectionRequest & {
|
|
30
|
+
seed: number;
|
|
31
|
+
}) | null;
|
|
32
|
+
selectionError: SelectionError | null;
|
|
33
|
+
}
|
|
34
|
+
export interface SamplingSource {
|
|
35
|
+
port: () => SamplingPort | null | undefined;
|
|
36
|
+
items: () => readonly PopulationItem[];
|
|
37
|
+
/** Zahl → Text im Sprachformat (Startwerte und Vorschläge der Felder). */
|
|
38
|
+
format: (value: number) => string;
|
|
39
|
+
callbacks?: () => SamplingCallbacks;
|
|
40
|
+
}
|
|
41
|
+
export declare const INITIAL_SAMPLING: SamplingData;
|
|
42
|
+
export declare function samplingProfile(state: SamplingData): MethodProfile | null;
|
|
43
|
+
export declare function samplingPopulation(state: SamplingData, items: readonly PopulationItem[]): readonly PopulationItem[];
|
|
44
|
+
export declare function isStratifiedPopulation(population: readonly PopulationItem[]): boolean;
|
|
45
|
+
export declare function createSamplingController(source: SamplingSource): {
|
|
46
|
+
store: import('..').Store<SamplingData>;
|
|
47
|
+
load: () => Promise<void>;
|
|
48
|
+
selectMethod: (id: string) => void;
|
|
49
|
+
applySuggestions: () => void;
|
|
50
|
+
calculate: () => Promise<void>;
|
|
51
|
+
draw: (freshSeed?: boolean) => Promise<void>;
|
|
52
|
+
exportSelection: (format: ExportFormat) => Promise<DownloadFile | null>;
|
|
53
|
+
/** Importierte Grundgesamtheit übernehmen; `null` kehrt zur Eigenschaft `items` zurück. */
|
|
54
|
+
usePopulation: (imported: readonly PopulationItem[] | null) => void;
|
|
55
|
+
setTexts: (texts: Record<string, string>) => void;
|
|
56
|
+
setConfidence: (confidence: number | null) => void;
|
|
57
|
+
setSampleSize: (sampleSize: string) => void;
|
|
58
|
+
setSeed: (seed: string) => void;
|
|
59
|
+
setVariant: (variant: SelectionVariant | null) => void;
|
|
60
|
+
setAllocation: (allocation: AllocationMethod | null) => void;
|
|
61
|
+
};
|
|
62
|
+
export type SamplingController = ReturnType<typeof createSamplingController>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Texte des Stichprobenrechners. */
|
|
2
|
+
export declare const samplingMessages: import('..').Catalogs<"loading" | "source" | "title" | "variant" | "method" | "exportCsv" | "result" | "failed" | "choose" | "colHits" | "parameters" | "confidence" | "methodHint" | "statusRECOMMENDED" | "statusSUPERSEDED" | "statusLEGACY_CHARACTERIZED" | "formula" | "confidenceOption" | "fromPopulation" | "calculate" | "errorRequired" | "errorInvalid" | "errorRange" | "rangeBetween" | "rangeFrom" | "rangeTo" | "resultSummary" | "interval" | "derivation" | "step" | "stepFormula" | "stepValue" | "population" | "populationCount" | "populationEmpty" | "strataCount" | "selection" | "sampleSize" | "allocation" | "seed" | "seedHint" | "draw" | "redraw" | "seedUsed" | "seedGenerated" | "seedGiven" | "reproducible" | "selectedSummary" | "allocationTable" | "stratum" | "stratumPopulation" | "stratumSample" | "stratumInterval" | "stratumStart" | "noStratum" | "excludedNegative" | "excludedZero" | "colOrder" | "colPosition" | "colId" | "colValue" | "colStratum" | "exportJson" | "selectionErrornoItems" | "selectionErrorsampleSize" | "selectionErrorseed" | "selectionErrorvariant" | "selectionErrorallocation" | "selectionErrorpartialStrata">;
|
|
3
|
+
export type SamplingMessageKey = keyof typeof samplingMessages.de;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AllocationMethod, MethodProfile, ParameterSpec, PopulationItem, SelectionRequest, SelectionVariant, SizeRequest } from './types';
|
|
2
|
+
export type FieldErrorCode = 'required' | 'invalid' | 'range';
|
|
3
|
+
export interface FieldError {
|
|
4
|
+
code: FieldErrorCode;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
}
|
|
8
|
+
export type SizeValidation = {
|
|
9
|
+
ok: true;
|
|
10
|
+
request: SizeRequest;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
errors: Readonly<Record<string, FieldError>>;
|
|
14
|
+
};
|
|
15
|
+
/** Anteile werden in Prozent eingegeben und angezeigt. */
|
|
16
|
+
export declare function isPercent(spec: ParameterSpec): boolean;
|
|
17
|
+
/** Eingabetext (deutsch oder englisch notiert) → Zahl; leer → null, unlesbar → undefined. */
|
|
18
|
+
export declare function parseInput(text: string): number | null | undefined;
|
|
19
|
+
/** Prüft ein Eingabefeld und liefert den Vertragswert (Prozent → Anteil). */
|
|
20
|
+
export declare function fieldValue(spec: ParameterSpec, text: string): {
|
|
21
|
+
value: number;
|
|
22
|
+
} | {
|
|
23
|
+
error: FieldError;
|
|
24
|
+
};
|
|
25
|
+
/** Anfrage für `POST /size`; jedes Feld ist Pflicht, nichts wird still ergänzt. */
|
|
26
|
+
export declare function buildSizeRequest(profile: MethodProfile, texts: Readonly<Record<string, string>>, confidence: number | null): SizeValidation;
|
|
27
|
+
/** Vorschlagswerte aus der Grundgesamtheit (Summe positiver Werte bzw. Anzahl). */
|
|
28
|
+
export declare function populationSuggestions(items: readonly PopulationItem[]): Readonly<Record<string, number>>;
|
|
29
|
+
/** Startwerte der Textfelder: vorgeschlagene Werte der Profile, sonst leer. */
|
|
30
|
+
export declare function initialTexts(profile: MethodProfile, formatter: (value: number) => string): Record<string, string>;
|
|
31
|
+
export interface StratumCount {
|
|
32
|
+
stratum: string;
|
|
33
|
+
population: number;
|
|
34
|
+
}
|
|
35
|
+
/** Schichten in Reihenfolge ihres ersten Auftretens; leer, wenn kein Element geschichtet ist. */
|
|
36
|
+
export declare function strataOf(items: readonly PopulationItem[]): StratumCount[];
|
|
37
|
+
/** Teilweise geschichtete Grundgesamtheit (der Server lehnt sie ab). */
|
|
38
|
+
export declare function hasPartialStrata(items: readonly PopulationItem[]): boolean;
|
|
39
|
+
export interface SelectionInput {
|
|
40
|
+
profile: MethodProfile;
|
|
41
|
+
items: readonly PopulationItem[];
|
|
42
|
+
sampleSize: string;
|
|
43
|
+
seed: string;
|
|
44
|
+
variant: SelectionVariant | null;
|
|
45
|
+
allocation: AllocationMethod | null;
|
|
46
|
+
}
|
|
47
|
+
export type SelectionValidation = {
|
|
48
|
+
ok: true;
|
|
49
|
+
request: SelectionRequest;
|
|
50
|
+
} | {
|
|
51
|
+
ok: false;
|
|
52
|
+
error: 'noItems' | 'sampleSize' | 'seed' | 'variant' | 'allocation' | 'partialStrata';
|
|
53
|
+
};
|
|
54
|
+
/** Anfrage für `POST /selection`; ein leerer Seed überlässt dem Server die Erzeugung. */
|
|
55
|
+
export declare function buildSelectionRequest(input: SelectionInput): SelectionValidation;
|
|
56
|
+
/** Übernommene Dateispalten → Elemente der Grundgesamtheit (Kennung sonst laufende Nummer). */
|
|
57
|
+
export declare function itemsFromImport(columns: {
|
|
58
|
+
values: readonly (number | null)[];
|
|
59
|
+
ids: readonly string[] | null;
|
|
60
|
+
strata: readonly string[] | null;
|
|
61
|
+
}): PopulationItem[];
|
|
62
|
+
/** Summe der positiven Werte (Auswahlbasis der Variante „portal“). */
|
|
63
|
+
export declare function positiveSum(items: readonly PopulationItem[]): number;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
export type MethodKind = 'mus' | 'srs';
|
|
3
|
+
export type MethodStatus = 'RECOMMENDED' | 'SUPERSEDED' | 'LEGACY_CHARACTERIZED';
|
|
4
|
+
export type SelectionVariant = 'portal' | 'flowstat';
|
|
5
|
+
export type AllocationMethod = 'proportional' | 'equal';
|
|
6
|
+
export interface ParameterSpec {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
unit: 'EUR' | 'Anteil' | 'Stück';
|
|
10
|
+
type: 'number' | 'integer' | 'choice';
|
|
11
|
+
minimum?: number;
|
|
12
|
+
maximum?: number;
|
|
13
|
+
exclusive_minimum?: number;
|
|
14
|
+
exclusive_maximum?: number;
|
|
15
|
+
suggested?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ConfidenceLevel {
|
|
18
|
+
level: number;
|
|
19
|
+
factor: number;
|
|
20
|
+
}
|
|
21
|
+
export interface MethodProfile {
|
|
22
|
+
id: string;
|
|
23
|
+
kind: MethodKind;
|
|
24
|
+
label: string;
|
|
25
|
+
status: MethodStatus;
|
|
26
|
+
recommended: boolean;
|
|
27
|
+
source: string;
|
|
28
|
+
note: string;
|
|
29
|
+
formula: string;
|
|
30
|
+
confidence_levels: readonly ConfidenceLevel[];
|
|
31
|
+
parameters: readonly ParameterSpec[];
|
|
32
|
+
default_variant: SelectionVariant | null;
|
|
33
|
+
}
|
|
34
|
+
export interface NamedOption<I extends string> {
|
|
35
|
+
id: I;
|
|
36
|
+
label: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
formula?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SamplingCatalogue {
|
|
41
|
+
library: string;
|
|
42
|
+
recommended: {
|
|
43
|
+
mus: string;
|
|
44
|
+
};
|
|
45
|
+
decision: Readonly<Record<string, string>>;
|
|
46
|
+
methods: readonly MethodProfile[];
|
|
47
|
+
selection_variants: readonly NamedOption<SelectionVariant>[];
|
|
48
|
+
allocation_methods: readonly NamedOption<AllocationMethod>[];
|
|
49
|
+
}
|
|
50
|
+
export type SizeRequest = {
|
|
51
|
+
method: string;
|
|
52
|
+
} & Readonly<Record<string, number | string>>;
|
|
53
|
+
export interface DerivationStep {
|
|
54
|
+
label: string;
|
|
55
|
+
formula: string;
|
|
56
|
+
value: number;
|
|
57
|
+
}
|
|
58
|
+
export interface SizeResult {
|
|
59
|
+
library: string;
|
|
60
|
+
method: string;
|
|
61
|
+
kind: MethodKind;
|
|
62
|
+
status: MethodStatus;
|
|
63
|
+
sample_size: number;
|
|
64
|
+
interval: number;
|
|
65
|
+
inputs: Readonly<Record<string, number>>;
|
|
66
|
+
warnings: readonly string[];
|
|
67
|
+
derivation: readonly DerivationStep[];
|
|
68
|
+
}
|
|
69
|
+
export interface PopulationItem {
|
|
70
|
+
id?: string | number;
|
|
71
|
+
value: number | null;
|
|
72
|
+
stratum?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface AllocationRequest {
|
|
75
|
+
total_sample_size: number;
|
|
76
|
+
method: AllocationMethod;
|
|
77
|
+
strata: Readonly<Record<string, number>>;
|
|
78
|
+
}
|
|
79
|
+
export interface AllocationResult {
|
|
80
|
+
method: AllocationMethod;
|
|
81
|
+
total_sample_size: number;
|
|
82
|
+
allocated: number;
|
|
83
|
+
strata: readonly {
|
|
84
|
+
stratum: string;
|
|
85
|
+
population: number;
|
|
86
|
+
sample_size: number;
|
|
87
|
+
}[];
|
|
88
|
+
}
|
|
89
|
+
export interface SelectionRequest {
|
|
90
|
+
method: MethodKind;
|
|
91
|
+
variant?: SelectionVariant;
|
|
92
|
+
items: readonly PopulationItem[];
|
|
93
|
+
sample_size: number;
|
|
94
|
+
seed?: number;
|
|
95
|
+
allocation?: AllocationMethod;
|
|
96
|
+
}
|
|
97
|
+
export interface SelectionRow {
|
|
98
|
+
order: number;
|
|
99
|
+
position: number;
|
|
100
|
+
id: string;
|
|
101
|
+
value: number | null;
|
|
102
|
+
stratum: string | null;
|
|
103
|
+
hits: number;
|
|
104
|
+
}
|
|
105
|
+
export interface StratumResult {
|
|
106
|
+
stratum: string | null;
|
|
107
|
+
population: number;
|
|
108
|
+
sample_size: number;
|
|
109
|
+
interval?: number;
|
|
110
|
+
start?: number;
|
|
111
|
+
excluded_negative?: readonly string[];
|
|
112
|
+
excluded_zero_or_missing?: readonly string[];
|
|
113
|
+
}
|
|
114
|
+
export interface SelectionResult {
|
|
115
|
+
library: string;
|
|
116
|
+
method: MethodKind;
|
|
117
|
+
variant: SelectionVariant | null;
|
|
118
|
+
seed: number;
|
|
119
|
+
seed_generated: boolean;
|
|
120
|
+
items_sha256: string;
|
|
121
|
+
population: number;
|
|
122
|
+
selected: number;
|
|
123
|
+
strata: readonly StratumResult[];
|
|
124
|
+
rows: readonly SelectionRow[];
|
|
125
|
+
}
|
|
126
|
+
export type ExportFormat = 'csv' | 'json';
|
|
127
|
+
/** Schnittstelle der Komponente zur Fachlogik; Standardumsetzung: `createSamplingRestPort`. */
|
|
128
|
+
export interface SamplingPort {
|
|
129
|
+
profiles(): Promise<SamplingCatalogue>;
|
|
130
|
+
size(request: SizeRequest): Promise<SizeResult>;
|
|
131
|
+
allocation(request: AllocationRequest): Promise<AllocationResult>;
|
|
132
|
+
selection(request: SelectionRequest): Promise<SelectionResult>;
|
|
133
|
+
exportSelection(request: SelectionRequest & {
|
|
134
|
+
seed: number;
|
|
135
|
+
}, format: ExportFormat): Promise<DownloadFile>;
|
|
136
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TableColumn, TableRow } from '@auditcore/common';
|
|
2
|
+
import { BadgeTone } from '../base/types';
|
|
3
|
+
import { Locale, Translate } from '../i18n';
|
|
4
|
+
import { SamplingMessageKey } from './messages';
|
|
5
|
+
import { FieldError } from './model';
|
|
6
|
+
import { ConfidenceLevel, MethodProfile, ParameterSpec, PopulationItem, SamplingCatalogue, SelectionResult, SizeResult } from './types';
|
|
7
|
+
import { SelectionError } from './controller';
|
|
8
|
+
export type SamplingTranslate = Translate<SamplingMessageKey>;
|
|
9
|
+
/** Einheit hinter dem Eingabefeld (Prozent, Euro oder keine). */
|
|
10
|
+
export declare function parameterUnit(spec: ParameterSpec): string;
|
|
11
|
+
/** Fehlermeldung eines Eingabefelds, leer ohne Fehler. */
|
|
12
|
+
export declare function samplingFieldError(error: FieldError | undefined, t: SamplingTranslate, locale: Locale): string;
|
|
13
|
+
export declare function selectionErrorKey(error: SelectionError): SamplingMessageKey;
|
|
14
|
+
export declare function confidenceText(level: ConfidenceLevel, t: SamplingTranslate, locale: Locale): string;
|
|
15
|
+
export interface MethodGroup {
|
|
16
|
+
kind: 'mus' | 'srs';
|
|
17
|
+
label: string;
|
|
18
|
+
methods: MethodProfile[];
|
|
19
|
+
}
|
|
20
|
+
export declare function methodGroups(catalogue: SamplingCatalogue): MethodGroup[];
|
|
21
|
+
export declare function methodTone(profile: MethodProfile | null): BadgeTone;
|
|
22
|
+
export declare function methodStatusKey(profile: MethodProfile): SamplingMessageKey;
|
|
23
|
+
/** Zusammenfassung der Grundgesamtheit; leer, wenn keine Elemente vorliegen. */
|
|
24
|
+
export declare function populationText(items: readonly PopulationItem[], t: SamplingTranslate, locale: Locale): string;
|
|
25
|
+
export declare function derivationColumns(t: SamplingTranslate, locale: Locale): TableColumn[];
|
|
26
|
+
export declare function derivationRows(result: SizeResult): TableRow[];
|
|
27
|
+
export declare function sizeTexts(result: SizeResult, t: SamplingTranslate, locale: Locale): {
|
|
28
|
+
size: string;
|
|
29
|
+
interval: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function selectionColumns(result: SelectionResult, t: SamplingTranslate, locale: Locale): TableColumn[];
|
|
32
|
+
export declare function strataColumns(result: SelectionResult, t: SamplingTranslate, locale: Locale): TableColumn[];
|
|
33
|
+
export declare function strataRows(result: SelectionResult): TableRow[];
|
|
34
|
+
export declare function selectionRows(result: SelectionResult): TableRow[];
|
|
35
|
+
/** Hinweise auf Elemente außerhalb der Auswahlbasis. */
|
|
36
|
+
export declare function excludedLines(result: SelectionResult, t: SamplingTranslate): string[];
|
|
37
|
+
export interface SelectionTexts {
|
|
38
|
+
seed: string;
|
|
39
|
+
origin: string;
|
|
40
|
+
summary: string;
|
|
41
|
+
reproducible: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function selectionTexts(result: SelectionResult, t: SamplingTranslate, locale: Locale): SelectionTexts;
|
|
44
|
+
/** Zahlformat der Eingabefelder (ohne Tausendertrennung, bis 6 Nachkommastellen). */
|
|
45
|
+
export declare function samplingInputNumber(locale: Locale): (value: number) => string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Store } from '../store';
|
|
2
|
+
import { HitView, LogView, Outcome, RunRequest, RunSummary, RunView, ScreeningPort, SettingsView, SourcesView, SubjectView } from './types';
|
|
3
|
+
import { HitFilter } from './view';
|
|
4
|
+
/** Fehler einer Portanfrage: Meldung des Servers bzw. `network_error` mit Status 0. */
|
|
5
|
+
export interface ScreeningError {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
status: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ReviewEvents {
|
|
11
|
+
onRunCreated?: (run: RunView) => void;
|
|
12
|
+
onDecided?: (payload: {
|
|
13
|
+
runId: string;
|
|
14
|
+
hitId: string;
|
|
15
|
+
status: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
onError?: (error: ScreeningError) => void;
|
|
18
|
+
/** Meldung für Fehler ohne Serverantwort (Netz, Programmfehler). */
|
|
19
|
+
networkMessage?: (message: string) => string;
|
|
20
|
+
}
|
|
21
|
+
export interface ScreeningData {
|
|
22
|
+
settings: SettingsView | null;
|
|
23
|
+
sources: SourcesView | null;
|
|
24
|
+
runs: RunSummary[];
|
|
25
|
+
run: RunView | null;
|
|
26
|
+
log: LogView | null;
|
|
27
|
+
selectedHitId: string | null;
|
|
28
|
+
filter: HitFilter;
|
|
29
|
+
busy: boolean;
|
|
30
|
+
error: ScreeningError | null;
|
|
31
|
+
}
|
|
32
|
+
export interface ScreeningSelection {
|
|
33
|
+
visibleSubjects: SubjectView[];
|
|
34
|
+
selected: {
|
|
35
|
+
subject: SubjectView;
|
|
36
|
+
hit: HitView;
|
|
37
|
+
} | null;
|
|
38
|
+
}
|
|
39
|
+
export declare function selectScreening(state: ScreeningData): ScreeningSelection;
|
|
40
|
+
export declare function asScreeningError(error: unknown, events: ReviewEvents): ScreeningError;
|
|
41
|
+
export declare function createScreeningController(port: () => ScreeningPort | null | undefined, events?: () => ReviewEvents): {
|
|
42
|
+
select: (hitId: string | null) => void;
|
|
43
|
+
setFilter: (filter: HitFilter) => void;
|
|
44
|
+
selectNext(): void;
|
|
45
|
+
decide: (outcome: Outcome, reason: string, fourEyes: boolean) => Promise<boolean>;
|
|
46
|
+
secondReview: (approve: boolean, reason: string) => Promise<boolean>;
|
|
47
|
+
load: () => Promise<void>;
|
|
48
|
+
openRun: (runId: string) => Promise<void>;
|
|
49
|
+
createRun: (request: RunRequest) => Promise<boolean>;
|
|
50
|
+
store: Store<ScreeningData>;
|
|
51
|
+
};
|
|
52
|
+
export type ScreeningController = ReturnType<typeof createScreeningController>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Kern der Screening-Trefferprüfung (Vertrag `screening_review/1`), gemeinsam für Vue und React. */
|
|
2
|
+
export { codeLabel, screeningMessages, type ScreeningKey, type ScreeningTranslate } from './messages';
|
|
3
|
+
export { createScreeningRestPort } from './rest-port';
|
|
4
|
+
export type * from './types';
|
|
5
|
+
export { CONTRACT as SCREENING_CONTRACT } from './types';
|
|
6
|
+
export { acceptsHit, awaitsSecondReview, breakdownRows, canDecide, comparisonRows, emptyFilter, filterOptions, filterSubjects, findHit, formatAge, formatDate as formatScreeningDate, formatPoints, formatScore, freshnessTone, indicatorLabels, nextOpenHit, parseSubjects, replaceHit, requiresFourEyes, scorePercent, validateDecision, type BreakdownRow, type ComparisonRow, type DecisionForm as ScreeningDecisionForm, type FilterOptions, type HitFilter, type MatchState, type Tone as BreakdownTone, type ViewMessage, } from './view';
|
|
7
|
+
export { asScreeningError, createScreeningController, selectScreening, type ReviewEvents, type ScreeningController, type ScreeningData, type ScreeningError, type ScreeningSelection, } from './controller';
|
|
8
|
+
export { SCREENING_KINDS, buildRunRequest, kindProfiles, kindSources, profileKeyOf, runFormDefaults, selectedProfile, type RunForm as ScreeningRunFormState, } from './runForm';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Translate } from '../i18n';
|
|
2
|
+
/** Texte der Screening-Trefferprüfung (Sanktionslisten, PEP). */
|
|
3
|
+
export declare const screeningMessages: import('..').Catalogs<"notice" | "unknown" | "input" | "title" | "entries" | "reason" | "profile" | "kind" | "method" | "noPort" | "networkError" | "complete" | "hints" | "decision" | "recommended" | "all" | "selectRun" | "sources" | "sourcesOfRun" | "newRun" | "runs" | "run" | "runDated" | "hits" | "comparison" | "breakdown" | "secondReview" | "log" | "filters" | "fourEyes" | "fourEyesPolicy" | "approve" | "reject" | "approved" | "rejected" | "listEntry" | "attribute" | "matchColumn" | "inconsistent" | "noSelection" | "final" | "saveDecision" | "secondReviewHint" | "lastDecision" | "fourEyesMarker" | "fourEyesMarkerPolicy" | "secondReviewDone" | "nextOpen" | "filterStatus" | "filterList" | "filterSubject" | "filterConfidence" | "filterMinScore" | "filterText" | "born" | "countryOf" | "normalized" | "queriedLists" | "findingSearched" | "findingNotSearched" | "noHitsFiltered" | "noHits" | "viaAlias" | "dobConflict" | "countryConflict" | "truncated" | "limitations" | "logEmpty" | "logSecondReview" | "logFourEyes" | "logSubjects" | "profileLine" | "namesHits" | "incompleteRun" | "lists" | "noStock" | "noStockRun" | "noStockHint" | "subjects" | "subjectsPlaceholder" | "minScore" | "caseReference" | "startRun" | "noRuns" | "runSummary" | "openCount" | "incompleteCount" | "level" | "minScoreBadge" | "classFrom" | "checkedAt" | "noSources" | "asOf" | "columnList" | "columnEntries" | "columnAsOf" | "via" | "dataLicence" | "ageUnknown" | "ageToday" | "ageOne" | "ageDays" | "asOfUnknown" | "rowName" | "rowMatched" | "rowAliases" | "rowBirth" | "rowCountry" | "rowAddress" | "rowIdentifiers" | "rowProgram" | "rowList" | "rowAsOf" | "stateMatch" | "stateConflict" | "stateNotCompared" | "errorOutcome" | "errorReason" | "errorReasonLength" | "errorLine" | "errorNoSubject" | "errorProfile" | "errorLists" | "status_open" | "status_pending_second_review" | "status_confirmed" | "status_dismissed" | "status_deferred" | "action_confirmed" | "action_dismissed" | "action_deferred" | "hint_confirmed" | "hint_dismissed" | "hint_deferred" | "subject_HITS" | "subject_NO_HITS" | "subject_INCOMPLETE" | "subject_NOT_SEARCHED" | "fresh_current" | "fresh_stale" | "fresh_unknown" | "fresh_not_judged" | "class_exact" | "class_high" | "class_medium" | "class_low" | "class_fuzzy" | "kind_sanctions" | "kind_pep" | "indicator_token_subset" | "indicator_alias_match" | "indicator_date_of_birth_not_compared" | "indicator_country_not_compared" | "indicator_below_min_score_after_adjustment">;
|
|
4
|
+
export type ScreeningKey = keyof typeof screeningMessages.de;
|
|
5
|
+
export type ScreeningTranslate = Translate<ScreeningKey>;
|
|
6
|
+
/** Beschriftung eines Codes aus dem Vertrag (Status, Stufe, Hinweis); unbekannte Codes bleiben stehen. */
|
|
7
|
+
export declare function codeLabel(t: ScreeningTranslate, prefix: string, code: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ProfileView, RunRequest, ScreeningKind, SettingsView, SourceView } from './types';
|
|
2
|
+
import { ViewMessage } from './view';
|
|
3
|
+
export declare const SCREENING_KINDS: readonly ScreeningKind[];
|
|
4
|
+
export interface RunForm {
|
|
5
|
+
kind: ScreeningKind;
|
|
6
|
+
profileKey: string;
|
|
7
|
+
lists: string[];
|
|
8
|
+
subjectsText: string;
|
|
9
|
+
minScore: number | null;
|
|
10
|
+
caseReference: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const profileKeyOf: (profile: Pick<ProfileView, "id" | "version">) => string;
|
|
13
|
+
export declare function kindProfiles(settings: SettingsView, kind: ScreeningKind): ProfileView[];
|
|
14
|
+
export declare function kindSources(sources: readonly SourceView[], kind: ScreeningKind): SourceView[];
|
|
15
|
+
export declare function selectedProfile(settings: SettingsView, form: Pick<RunForm, 'kind' | 'profileKey'>): ProfileView | undefined;
|
|
16
|
+
/** Vorbelegung bei Wechsel der Prüfart oder neuen Einstellungen: empfohlenes Profil, alle Listen, Standard-Mindestwert. */
|
|
17
|
+
export declare function runFormDefaults(settings: SettingsView, sources: readonly SourceView[], kind: ScreeningKind): Pick<RunForm, 'profileKey' | 'lists' | 'minScore'>;
|
|
18
|
+
/** Anfrage aus dem Formular; bei Fehlern `request: null` und die Meldungen als Katalogschlüssel. */
|
|
19
|
+
export declare function buildRunRequest(settings: SettingsView, form: RunForm): {
|
|
20
|
+
request: RunRequest | null;
|
|
21
|
+
errors: ViewMessage[];
|
|
22
|
+
};
|