checks

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearRegistry

func ClearRegistry()

func FormatSummaryLine

func FormatSummaryLine(results []CheckResult) string

FormatSummaryLine returns a one-line summary like: "Data quality: 2 critical, 5 errors, 12 warnings" Returns empty string if no results.

func RegisterAudit

func RegisterAudit(c AuditCheck)

func RegisterInline

func RegisterInline(c InlineCheck)

func SaveResults

func SaveResults(ctx context.Context, pool *pgxpool.Pool, results []CheckResult, subscriptionID uuid.UUID, runID uuid.UUID) error

Types

type AssetsChange

type AssetsChange struct{}

AssetsChange detects ARQ records where total_assets changed more than 5x quarter-over-quarter.

func (*AssetsChange) Audit

func (c *AssetsChange) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*AssetsChange) DataTypes

func (c *AssetsChange) DataTypes() []string

func (*AssetsChange) Description

func (c *AssetsChange) Description() string

func (*AssetsChange) Name

func (c *AssetsChange) Name() string

func (*AssetsChange) Phase

func (c *AssetsChange) Phase() CheckPhase

func (*AssetsChange) Severity

func (c *AssetsChange) Severity() CheckSeverity

type AuditCheck

type AuditCheck interface {
	Check
	Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, lookback *time.Duration) ([]CheckResult, error)
}

func AuditChecks

func AuditChecks() []AuditCheck

type AuditOptions

type AuditOptions struct {
	Lookback  *time.Duration
	Full      bool
	DataTypes []string
	Checks    []string
}

AuditOptions controls which checks run and over what time range.

type AuditRunner

type AuditRunner struct {
	// contains filtered or unexported fields
}

AuditRunner executes a set of AuditChecks and manages run checkpoints.

func NewAuditRunner

func NewAuditRunner(checks []AuditCheck, pool *pgxpool.Pool) *AuditRunner

NewAuditRunner creates an AuditRunner with the given checks and pool.

func (*AuditRunner) Run

func (r *AuditRunner) Run(ctx context.Context, opts AuditOptions, table string) ([]CheckResult, error)

Run executes all matching checks against table and returns the combined results.

type BalanceSheetIdentity

type BalanceSheetIdentity struct{}

BalanceSheetIdentity checks that Assets = Liabilities + Equity within 0.5% tolerance (min 1000). The 0.5% threshold accommodates companies with significant non-controlling interests (e.g. BRK/B ~0.2% NCI) where the equity field uses parent-only StockholdersEquity to match Sharadar.

func (*BalanceSheetIdentity) DataTypes

func (c *BalanceSheetIdentity) DataTypes() []string

func (*BalanceSheetIdentity) Description

func (c *BalanceSheetIdentity) Description() string

func (*BalanceSheetIdentity) Name

func (c *BalanceSheetIdentity) Name() string

func (*BalanceSheetIdentity) Phase

func (c *BalanceSheetIdentity) Phase() CheckPhase

func (*BalanceSheetIdentity) Severity

func (c *BalanceSheetIdentity) Severity() CheckSeverity

func (*BalanceSheetIdentity) Validate

type CashFlowSum

type CashFlowSum struct{}

CashFlowSum checks that OpCF + InvCF + FinCF ~= NetCashFlow within 1% tolerance (min 1M).

func (*CashFlowSum) DataTypes

func (c *CashFlowSum) DataTypes() []string

func (*CashFlowSum) Description

func (c *CashFlowSum) Description() string

func (*CashFlowSum) Name

func (c *CashFlowSum) Name() string

func (*CashFlowSum) Phase

func (c *CashFlowSum) Phase() CheckPhase

func (*CashFlowSum) Severity

func (c *CashFlowSum) Severity() CheckSeverity

func (*CashFlowSum) Validate

func (c *CashFlowSum) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type Check

type Check interface {
	Name() string
	Description() string
	Phase() CheckPhase
	Severity() CheckSeverity
	DataTypes() []string
}

type CheckPhase

type CheckPhase int
const (
	PhaseInline CheckPhase = iota
	PhaseAudit
	PhaseBoth
)

type CheckResult

type CheckResult struct {
	CheckName     string
	Severity      CheckSeverity
	Ticker        string
	CompositeFigi string
	Dimension     string
	EventDate     time.Time
	Field         string
	Message       string
	Expected      string
	Actual        string
	DataType      string
}

type CheckSeverity

type CheckSeverity int
const (
	SeverityInfo CheckSeverity = iota
	SeverityWarning
	SeverityError
	SeverityCritical
)

func (CheckSeverity) String

func (s CheckSeverity) String() string

type CurrentRatioCalc

type CurrentRatioCalc struct{}

CurrentRatioCalc checks that CurrentRatio ~= CurrentAssets/CurrentLiabilities within 0.05 absolute tolerance.

func (*CurrentRatioCalc) DataTypes

func (c *CurrentRatioCalc) DataTypes() []string

func (*CurrentRatioCalc) Description

func (c *CurrentRatioCalc) Description() string

func (*CurrentRatioCalc) Name

func (c *CurrentRatioCalc) Name() string

func (*CurrentRatioCalc) Phase

func (c *CurrentRatioCalc) Phase() CheckPhase

func (*CurrentRatioCalc) Severity

func (c *CurrentRatioCalc) Severity() CheckSeverity

func (*CurrentRatioCalc) Validate

func (c *CurrentRatioCalc) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type DuplicateObservations

type DuplicateObservations struct{}

DuplicateObservations checks for duplicate primary keys (composite_figi, dimension, event_date) within the table having COUNT > 1.

func (*DuplicateObservations) Audit

func (c *DuplicateObservations) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*DuplicateObservations) DataTypes

func (c *DuplicateObservations) DataTypes() []string

func (*DuplicateObservations) Description

func (c *DuplicateObservations) Description() string

func (*DuplicateObservations) Name

func (c *DuplicateObservations) Name() string

func (*DuplicateObservations) Phase

func (c *DuplicateObservations) Phase() CheckPhase

func (*DuplicateObservations) Severity

func (c *DuplicateObservations) Severity() CheckSeverity

type EodWithoutFundamentals

type EodWithoutFundamentals struct{}

EodWithoutFundamentals finds tickers with recent EOD data but no recent fundamentals (6 months). Requires both 'eod' and 'fundamentals' views to exist; returns nil if either is absent.

func (*EodWithoutFundamentals) Audit

func (c *EodWithoutFundamentals) Audit(ctx context.Context, pool *pgxpool.Pool, _ string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*EodWithoutFundamentals) DataTypes

func (c *EodWithoutFundamentals) DataTypes() []string

func (*EodWithoutFundamentals) Description

func (c *EodWithoutFundamentals) Description() string

func (*EodWithoutFundamentals) Name

func (c *EodWithoutFundamentals) Name() string

func (*EodWithoutFundamentals) Phase

func (*EodWithoutFundamentals) Severity

func (c *EodWithoutFundamentals) Severity() CheckSeverity

type FundamentalsWithoutAsset

type FundamentalsWithoutAsset struct{}

FundamentalsWithoutAsset finds fundamentals records whose composite_figi doesn't exist in the assets view.

func (*FundamentalsWithoutAsset) Audit

func (c *FundamentalsWithoutAsset) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*FundamentalsWithoutAsset) DataTypes

func (c *FundamentalsWithoutAsset) DataTypes() []string

func (*FundamentalsWithoutAsset) Description

func (c *FundamentalsWithoutAsset) Description() string

func (*FundamentalsWithoutAsset) Name

func (c *FundamentalsWithoutAsset) Name() string

func (*FundamentalsWithoutAsset) Phase

func (*FundamentalsWithoutAsset) Severity

type GrossProfitCalc

type GrossProfitCalc struct{}

GrossProfitCalc checks that GrossProfit = Revenue - CostOfRevenue within 0.1% tolerance.

func (*GrossProfitCalc) DataTypes

func (c *GrossProfitCalc) DataTypes() []string

func (*GrossProfitCalc) Description

func (c *GrossProfitCalc) Description() string

func (*GrossProfitCalc) Name

func (c *GrossProfitCalc) Name() string

func (*GrossProfitCalc) Phase

func (c *GrossProfitCalc) Phase() CheckPhase

func (*GrossProfitCalc) Severity

func (c *GrossProfitCalc) Severity() CheckSeverity

func (*GrossProfitCalc) Validate

func (c *GrossProfitCalc) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type InlineCheck

type InlineCheck interface {
	Check
	Validate(ctx context.Context, obs *data.Observation) ([]CheckResult, bool)
}

func InlineChecks

func InlineChecks() []InlineCheck

type InlineValidator

type InlineValidator struct {
	// contains filtered or unexported fields
}

func NewInlineValidator

func NewInlineValidator(checks []InlineCheck) *InlineValidator

func (*InlineValidator) Validate

func (v *InlineValidator) Validate(ctx context.Context, obs *data.Observation) ([]CheckResult, bool)

type MarginRange

type MarginRange struct{}

MarginRange finds records where gross_margin, ebitda_margin, or profit_margin is outside [-10, 10] (and non-zero). Margins outside this range likely indicate data errors. Values in [-10, -1] or [1, 10] are common for pre-revenue startups and early-stage companies.

func (*MarginRange) Audit

func (c *MarginRange) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*MarginRange) DataTypes

func (c *MarginRange) DataTypes() []string

func (*MarginRange) Description

func (c *MarginRange) Description() string

func (*MarginRange) Name

func (c *MarginRange) Name() string

func (*MarginRange) Phase

func (c *MarginRange) Phase() CheckPhase

func (*MarginRange) Severity

func (c *MarginRange) Severity() CheckSeverity

type MetricFundamentalAgree

type MetricFundamentalAgree struct{}

MetricFundamentalAgree compares PE between fundamentals and metrics views. Flags records where both are non-zero and differ by > 50%. Requires both views to exist.

func (*MetricFundamentalAgree) Audit

func (c *MetricFundamentalAgree) Audit(ctx context.Context, pool *pgxpool.Pool, _ string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*MetricFundamentalAgree) DataTypes

func (c *MetricFundamentalAgree) DataTypes() []string

func (*MetricFundamentalAgree) Description

func (c *MetricFundamentalAgree) Description() string

func (*MetricFundamentalAgree) Name

func (c *MetricFundamentalAgree) Name() string

func (*MetricFundamentalAgree) Phase

func (*MetricFundamentalAgree) Severity

func (c *MetricFundamentalAgree) Severity() CheckSeverity

type MissingQuarters

type MissingQuarters struct{}

MissingQuarters uses a LEAD window function to find gaps > 120 days between consecutive ARQ event_dates for the same composite_figi.

func (*MissingQuarters) Audit

func (c *MissingQuarters) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*MissingQuarters) DataTypes

func (c *MissingQuarters) DataTypes() []string

func (*MissingQuarters) Description

func (c *MissingQuarters) Description() string

func (*MissingQuarters) Name

func (c *MissingQuarters) Name() string

func (*MissingQuarters) Phase

func (c *MissingQuarters) Phase() CheckPhase

func (*MissingQuarters) Severity

func (c *MissingQuarters) Severity() CheckSeverity

type NetIncomeEPS

type NetIncomeEPS struct{}

NetIncomeEPS checks that EPS * SharesDiluted ~= NetIncome within 5% tolerance (min 1M).

func (*NetIncomeEPS) DataTypes

func (c *NetIncomeEPS) DataTypes() []string

func (*NetIncomeEPS) Description

func (c *NetIncomeEPS) Description() string

func (*NetIncomeEPS) Name

func (c *NetIncomeEPS) Name() string

func (*NetIncomeEPS) Phase

func (c *NetIncomeEPS) Phase() CheckPhase

func (*NetIncomeEPS) Severity

func (c *NetIncomeEPS) Severity() CheckSeverity

func (*NetIncomeEPS) Validate

func (c *NetIncomeEPS) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type OperatingIncomeCalc

type OperatingIncomeCalc struct{}

OperatingIncomeCalc checks that OperatingIncome = GrossProfit - OperatingExpenses within 0.1% tolerance.

func (*OperatingIncomeCalc) DataTypes

func (c *OperatingIncomeCalc) DataTypes() []string

func (*OperatingIncomeCalc) Description

func (c *OperatingIncomeCalc) Description() string

func (*OperatingIncomeCalc) Name

func (c *OperatingIncomeCalc) Name() string

func (*OperatingIncomeCalc) Phase

func (c *OperatingIncomeCalc) Phase() CheckPhase

func (*OperatingIncomeCalc) Severity

func (c *OperatingIncomeCalc) Severity() CheckSeverity

func (*OperatingIncomeCalc) Validate

type PERange

type PERange struct{}

PERange finds records where PE is positive and exceeds 1000, which likely indicates a data error. Negative PE (negative earnings) is normal and not flagged.

func (*PERange) Audit

func (c *PERange) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*PERange) DataTypes

func (c *PERange) DataTypes() []string

func (*PERange) Description

func (c *PERange) Description() string

func (*PERange) Name

func (c *PERange) Name() string

func (*PERange) Phase

func (c *PERange) Phase() CheckPhase

func (*PERange) Severity

func (c *PERange) Severity() CheckSeverity

type PositiveAssets

type PositiveAssets struct{}

PositiveAssets checks that TotalAssets is greater than zero.

func (*PositiveAssets) DataTypes

func (c *PositiveAssets) DataTypes() []string

func (*PositiveAssets) Description

func (c *PositiveAssets) Description() string

func (*PositiveAssets) Name

func (c *PositiveAssets) Name() string

func (*PositiveAssets) Phase

func (c *PositiveAssets) Phase() CheckPhase

func (*PositiveAssets) Severity

func (c *PositiveAssets) Severity() CheckSeverity

func (*PositiveAssets) Validate

func (c *PositiveAssets) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type PositiveRevenue

type PositiveRevenue struct{}

PositiveRevenue checks that Revenues is >= 0.

func (*PositiveRevenue) DataTypes

func (c *PositiveRevenue) DataTypes() []string

func (*PositiveRevenue) Description

func (c *PositiveRevenue) Description() string

func (*PositiveRevenue) Name

func (c *PositiveRevenue) Name() string

func (*PositiveRevenue) Phase

func (c *PositiveRevenue) Phase() CheckPhase

func (*PositiveRevenue) Severity

func (c *PositiveRevenue) Severity() CheckSeverity

func (*PositiveRevenue) Validate

func (c *PositiveRevenue) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type PositiveShares

type PositiveShares struct{}

PositiveShares checks that WeightedAverageSharesDiluted is > 0.

func (*PositiveShares) DataTypes

func (c *PositiveShares) DataTypes() []string

func (*PositiveShares) Description

func (c *PositiveShares) Description() string

func (*PositiveShares) Name

func (c *PositiveShares) Name() string

func (*PositiveShares) Phase

func (c *PositiveShares) Phase() CheckPhase

func (*PositiveShares) Severity

func (c *PositiveShares) Severity() CheckSeverity

func (*PositiveShares) Validate

func (c *PositiveShares) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type RequiredFields

type RequiredFields struct{}

RequiredFields checks that revenues, total_assets, and equity are non-zero.

func (*RequiredFields) DataTypes

func (c *RequiredFields) DataTypes() []string

func (*RequiredFields) Description

func (c *RequiredFields) Description() string

func (*RequiredFields) Name

func (c *RequiredFields) Name() string

func (*RequiredFields) Phase

func (c *RequiredFields) Phase() CheckPhase

func (*RequiredFields) Severity

func (c *RequiredFields) Severity() CheckSeverity

func (*RequiredFields) Validate

func (c *RequiredFields) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

type RevenueChange

type RevenueChange struct{}

RevenueChange detects ARQ records where revenue changed more than 10x quarter-over-quarter.

func (*RevenueChange) Audit

func (c *RevenueChange) Audit(ctx context.Context, pool *pgxpool.Pool, table string, lastChecked *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*RevenueChange) DataTypes

func (c *RevenueChange) DataTypes() []string

func (*RevenueChange) Description

func (c *RevenueChange) Description() string

func (*RevenueChange) Name

func (c *RevenueChange) Name() string

func (*RevenueChange) Phase

func (c *RevenueChange) Phase() CheckPhase

func (*RevenueChange) Severity

func (c *RevenueChange) Severity() CheckSeverity

type StaleData

type StaleData struct{}

StaleData groups ARQ records by ticker/composite_figi and flags those whose MAX(event_date) is older than 6 months. Always performs a full scan regardless of lastChecked.

func (*StaleData) Audit

func (c *StaleData) Audit(ctx context.Context, pool *pgxpool.Pool, table string, _ *time.Time, _ *time.Duration) ([]CheckResult, error)

func (*StaleData) DataTypes

func (c *StaleData) DataTypes() []string

func (*StaleData) Description

func (c *StaleData) Description() string

func (*StaleData) Name

func (c *StaleData) Name() string

func (*StaleData) Phase

func (c *StaleData) Phase() CheckPhase

func (*StaleData) Severity

func (c *StaleData) Severity() CheckSeverity

type ValidDates

type ValidDates struct{}

ValidDates checks that EventDate, ReportPeriod, and DateKey are not in the future.

func (*ValidDates) DataTypes

func (c *ValidDates) DataTypes() []string

func (*ValidDates) Description

func (c *ValidDates) Description() string

func (*ValidDates) Name

func (c *ValidDates) Name() string

func (*ValidDates) Phase

func (c *ValidDates) Phase() CheckPhase

func (*ValidDates) Severity

func (c *ValidDates) Severity() CheckSeverity

func (*ValidDates) Validate

func (c *ValidDates) Validate(_ context.Context, obs *data.Observation) ([]CheckResult, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL