Documentation
¶
Index ¶
- type BoolCheckBoxExtractor
- type BoolClassificationCriteria
- type BoolContainsImageExtractor
- type BuyerDetails
- type CellRange
- type ClassificationCriteria
- type ColumnMapping
- type CompanyNameList
- type ControlCotent
- type DivideByZeroError
- type DualClassificationCriteria
- type DualColumnClfExtractor
- type ExcelExtractor
- func (e *ExcelExtractor) Close() error
- func (e *ExcelExtractor) Extract() SECCFExtraction
- func (e *ExcelExtractor) GetCellValue(cellRange CellRange, sheetName string) (string, error)
- func (e *ExcelExtractor) ReadFormControls()
- func (e *ExcelExtractor) ReplaceCompanyNames(items []string) []string
- func (e *ExcelExtractor) ToJson() string
- type ProductDetails
- type Response
- type SECCFExtraction
- type SearchCriteria
- type SheetNameGetter
- type SheetNotFoundError
- type SimpleValueExtractor
- type TriClassificationCritera
- type TriColumnClfExtractor
- type ValueExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoolCheckBoxExtractor ¶
type BoolCheckBoxExtractor struct{}
func (*BoolCheckBoxExtractor) Extract ¶
func (c *BoolCheckBoxExtractor) Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
type BoolContainsImageExtractor ¶ added in v0.3.27
type BoolContainsImageExtractor struct{}
func (*BoolContainsImageExtractor) Extract ¶ added in v0.3.27
func (c *BoolContainsImageExtractor) Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
type BuyerDetails ¶
type BuyerDetails struct {
SheetName string `json:"sheet_name"`
PartNumber string `json:"part_number"`
PartDescription string `json:"part_description"`
ClassificationOfItem string `json:"classification_of_item"`
ControlListClassificationNumber string `json:"control_list_classification_number"`
RFQ string `json:"rfq"`
BuildToPrint bool `json:"build_to_print"`
ManufacturedToSpecification bool `json:"manufactured_to_specification"`
OriginalEquipmentManufacturer bool `json:"original_equipment_manufacturer"`
Modified bool `json:"modified"`
}
func (*BuyerDetails) GetSheetName ¶
func (b *BuyerDetails) GetSheetName() string
Add methods to both structs to implement SheetNameGetter
type ClassificationCriteria ¶
type ColumnMapping ¶ added in v0.1.0
type CompanyNameList ¶
type CompanyNameList []string
type ControlCotent ¶ added in v0.1.0
type ControlCotent struct {
SheetName string `json:"sheet_name"`
ItemNum string `json:"item_num"`
PartNumber string `json:"part_number"`
ComponentManufacturerPartNumber string `json:"component_manufacturer_part_number"`
PartDescription string `json:"part_description"`
ManufacturerOfComponent string `json:"manufacturer_of_component"`
ExportRegulationCountry string `json:"export_regulation_country"`
DualControlListClfNum string `json:"dual_control_list_clf_num"`
MilitaryControlListClfNum string `json:"military_control_list_clf_num"`
IndicateLicenseApplication string `json:"inidcate_license_application"`
TopLevelDeliverableItem string `json:"top_level_delierable_item"`
USML_N string `json:"usml_n"`
ECCN_N string `json:"eccn_n"`
US_EA_CONTENT_RATIO string `json:"us_ea_content_ratio"`
}
type DivideByZeroError ¶
type DivideByZeroError struct {
// contains filtered or unexported fields
}
type DualClassificationCriteria ¶
type DualClassificationCriteria struct {
TYPE_1 ClassificationCriteria
TYPE_2 ClassificationCriteria
}
type DualColumnClfExtractor ¶
type DualColumnClfExtractor struct{}
func (*DualColumnClfExtractor) Extract ¶
func (d *DualColumnClfExtractor) Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
type ExcelExtractor ¶
type ExcelExtractor struct {
Extraction *SECCFExtraction
// contains filtered or unexported fields
}
func MakeSECCFExtractor ¶
func MakeSECCFExtractor(filePath string, companyNames CompanyNameList) (*ExcelExtractor, error)
func (*ExcelExtractor) Close ¶
func (e *ExcelExtractor) Close() error
func (*ExcelExtractor) Extract ¶
func (e *ExcelExtractor) Extract() SECCFExtraction
func (*ExcelExtractor) GetCellValue ¶
func (e *ExcelExtractor) GetCellValue(cellRange CellRange, sheetName string) (string, error)
func (*ExcelExtractor) ReadFormControls ¶
func (e *ExcelExtractor) ReadFormControls()
func (*ExcelExtractor) ReplaceCompanyNames ¶
func (e *ExcelExtractor) ReplaceCompanyNames(items []string) []string
func (*ExcelExtractor) ToJson ¶ added in v0.1.0
func (e *ExcelExtractor) ToJson() string
type ProductDetails ¶
type ProductDetails struct {
// Sheet Metadata
SheetName string `json:"sheet_name"`
// Supplier Details
SupplierPartNumber string `json:"supplier_part_number"`
SupplierCompanyName string `json:"supplier_company_name"`
SupplierFullAddress string `json:"supplier_full_address"`
SupplierCountry string `json:"supplier_country"`
SupplierCompanyNumber string `json:"supplier_company_number"`
// Manufacturer Details
ManufacturerPartNumber string `json:"manufacturer_part_number"`
ManufacturerCompanyName string `json:"manufacturer_company_name"`
ManufacturerFullAddress string `json:"manufacturer_full_address"`
ManufacturerCountry string `json:"manufacturer_country"`
ManufacturerCompanyNumber string `json:"manufacturer_company_number"`
// Product Details
CountryOfOrigin string `json:"country_of_origin"`
CustomsTariffCode string `json:"customs_tariff_code"`
ExportControlRegulated string `json:"export_control_regulated"` // Yes/No
PartClassification string `json:"part_classification"` // DU, MIL, CIVIL
ControlListClassificationNumber string `json:"control_list_classification_number"`
ThirdCountryControlledContent string `json:"third_country_controlled_content"` // Yes/No
EndUserStatementRequired string `json:"end_user_statement_required"` // Yes/No
ExportLicenceShipmentRequired string `json:"export_licence_shipment_required"` // Yes/No
ExportLicenceEndUserRequired string `json:"export_licence_end_user_required"` // Yes/No/End user not advised to supplier
AdditionalExportDocsRequired string `json:"additional_export_docs_required"` // Yes/No
// Mandatory
TransferReexportConditions string `json:"transfer_reexport_conditions"`
// Supplier Representative
RepresentativeName string `json:"representative_name"`
RepresentativePosition string `json:"representative_position"`
RepresentativeSignature bool `json:"representative_signature"` // Available/Not Available
SupplierCompanySeal string `json:"supplier_company_seal"` // Available/Not Available
SignatureDate string `json:"signature_date"` // Date format
}
func (*ProductDetails) GetSheetName ¶
func (p *ProductDetails) GetSheetName() string
type Response ¶
type Response struct {
Status string `json:"status"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
Response struct for structured output
type SECCFExtraction ¶
type SECCFExtraction struct {
BuyerDetails *BuyerDetails `json:"buyer_details"`
ProductDetails *ProductDetails `json:"product_details"`
ControlledContent []ControlCotent `json:"controlled_content"`
}
type SearchCriteria ¶
type SearchCriteria struct {
SearchTerms []string // Multiple possible terms to search for
CellRanges []CellRange // Multiple cell ranges to search in
DualColumnCheckBoxClf bool // check side by side column
DualColumnClfCriteria DualClassificationCriteria // Add this to map checkbox text to values
TriColumnCheckBoxClf bool // check tri-side by side column
TriColumnClfCriteria TriClassificationCritera // Add this to map checkbox text to values
BoolCheckBox bool
BoolClfCriteria BoolClassificationCriteria
BoolContainsImage bool
BoolClfContainsImage BoolClassificationCriteria
Offset int // Default offset of value for simple fields
}
SearchCriteria defines what to look for and where
type SheetNameGetter ¶
type SheetNameGetter interface {
GetSheetName() string
}
Generic interface for structures with SheetName
type SheetNotFoundError ¶
type SheetNotFoundError struct {
// contains filtered or unexported fields
}
func (SheetNotFoundError) Error ¶
func (e SheetNotFoundError) Error() string
type SimpleValueExtractor ¶
type SimpleValueExtractor struct{}
Implement different extractors for different types of fields
func (*SimpleValueExtractor) Extract ¶
func (s *SimpleValueExtractor) Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
type TriClassificationCritera ¶
type TriClassificationCritera struct {
TYPE_1 ClassificationCriteria
TYPE_2 ClassificationCriteria
TYPE_3 ClassificationCriteria
}
type TriColumnClfExtractor ¶
type TriColumnClfExtractor struct{}
func (*TriColumnClfExtractor) Extract ¶
func (d *TriColumnClfExtractor) Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
type ValueExtractor ¶
type ValueExtractor interface {
Extract(e *ExcelExtractor, sheetName string, criteria SearchCriteria, cellRange CellRange) (interface{}, error)
}
Add a method to handle value extraction based on criteria type
Click to show internal directories.
Click to hide internal directories.