How lennonkc/netsuiteai works
Project type and purpose
• This is a Node.js‐based backend integration tool (not a full “frontend/backend” app).
• Purpose: automate data flows between spreadsheets (XLSX/JSON/HTML) and a NetSuite instance for Thrasio’s sourcing and vendor processes.
File structure
• Top‐level:
• config/config.js – holds environment or NetSuite API credentials.
• package.json, package-lock.json – npm project metadata and dependencies.
• src/index.js – entry point; orchestrates the workflow.
• src/services:
• SourcePO.js – service for sourcing purchase orders.
• fullSourcing.js – orchestrates a complete sourcing run.
• vendorID.js – fetches or resolves vendor IDs.
• src/utils:
• netsuite_GetSearch.js – wraps NetSuite search API calls.
• xlsxToJson.js – parses incoming XLSX sheets into JSON objects.
• xlsxGenerator.js – builds XLSX outputs.
• htmlGenerator.js – produces HTML reports.
• 示例响应.json – sample response used for testing or offline processing.
README
• Very brief: “用于搭建为Thrasio设计的Netsuite项目.”
• Confirms integration with NetSuite and custom workflows to support Thrasio’s sourcing.
a. Main components
• “Orchestrator” (src/index.js)
• Service modules (SourcePO, fullSourcing, vendorID)
• Utility modules (NetSuite API wrapper, XLSX parser/generator, HTML generator)
• External systems:
• NetSuite SuiteTalk/WebServices API
• File storage (local or cloud for XLSX/JSON files)
• (Optional) Email or dashboard consuming HTML reports
b. Relationships & interactions
• Orchestrator invokes service modules in sequence.
• Each service calls netSuite_GetSearch to retrieve data.
• XLSX input → xlsxToJson → service logic → xlsxGenerator / htmlGenerator → output storage.
• Data/config flows from config module into every component.
c. Architectural patterns
• Modular layering: entry‐point → services → utilities → external systems.
• Single‐responsibility for each module.
• Clear separation between business logic (services) and I/O concerns (utils).
d. Technologies/frameworks
• Node.js runtime
• npm modules (xlsx, netsuite SDK or SOAP client)
• JavaScript ES modules or CommonJS