companyidentity

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IdentifierTypeDARTCorpCode = "dart_corp_code"
	IdentifierTypeKRXStockCode = "krx_stock_code"
	RelationTypeIssuer         = "issuer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Company

type Company struct {
	ID          int64  `json:"id" csv:"id"`
	Name        string `json:"name" csv:"name"`
	LegalName   string `json:"legal_name,omitempty" csv:"legal_name"`
	EnglishName string `json:"english_name,omitempty" csv:"english_name"`
	CountryCode string `json:"country_code,omitempty" csv:"country_code"`
}

type CompanyInput

type CompanyInput struct {
	Name          string
	LegalName     string
	EnglishName   string
	CountryCode   string
	Identifiers   []IdentifierInput
	InstrumentRef InstrumentRef
}

type Identifier

type Identifier struct {
	CompanyID       int64                `json:"company_id" csv:"company_id"`
	Provider        provider.ProviderID  `json:"provider" csv:"provider"`
	Group           provider.GroupID     `json:"provider_group" csv:"provider_group"`
	Operation       provider.OperationID `json:"operation" csv:"operation"`
	IdentifierType  string               `json:"identifier_type" csv:"identifier_type"`
	IdentifierValue string               `json:"identifier_value" csv:"identifier_value"`
	Primary         bool                 `json:"primary" csv:"primary"`
	Confidence      float64              `json:"confidence" csv:"confidence"`
	SourceUpdatedAt string               `json:"source_updated_at,omitempty" csv:"source_updated_at"`
}

type IdentifierInput

type IdentifierInput struct {
	Provider        provider.ProviderID
	Group           provider.GroupID
	Operation       provider.OperationID
	IdentifierType  string
	IdentifierValue string
	Primary         bool
	Confidence      float64
	SourceUpdatedAt string
}

type InspectResult

type InspectResult struct {
	Company     Company          `json:"company"`
	Identifiers []Identifier     `json:"identifiers"`
	Instruments []InstrumentLink `json:"instruments"`
}
type InstrumentLink struct {
	CompanyID    int64                 `json:"company_id" csv:"company_id"`
	InstrumentID int64                 `json:"instrument_id" csv:"instrument_id"`
	Market       provider.Market       `json:"market" csv:"market"`
	SecurityType provider.SecurityType `json:"security_type" csv:"security_type"`
	Symbol       string                `json:"symbol" csv:"symbol"`
	Name         string                `json:"name,omitempty" csv:"name"`
	RelationType string                `json:"relation_type" csv:"relation_type"`
}

type InstrumentRef

type InstrumentRef struct {
	Market       provider.Market
	SecurityType provider.SecurityType
	Symbol       string
	Name         string
	RelationType string
}

type Repository

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

func NewRepository

func NewRepository(database *storage.Database) (Repository, error)

func (Repository) Inspect

func (r Repository) Inspect(ctx context.Context, query string) (InspectResult, error)

func (Repository) UpsertCompanies

func (r Repository) UpsertCompanies(ctx context.Context, companies []CompanyInput) (UpsertResult, error)

type UpsertResult

type UpsertResult struct {
	CompaniesWritten   int `json:"companies_written" csv:"companies_written"`
	IdentifiersWritten int `json:"identifiers_written" csv:"identifiers_written"`
	InstrumentsLinked  int `json:"instruments_linked" csv:"instruments_linked"`
}

Jump to

Keyboard shortcuts

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