Skip to content

starsong-consulting/moco-synthesizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOCO Synthesizer

Generate realistic synthetic data for MOCO test instances.

Creates a complete, plausible company structure with interconnected entities:

  • Users (employees + freelancers) with employments
  • Companies (customers) with contacts
  • Deals/Leads at different pipeline stages
  • Offers with line items, linked to deals
  • Projects from accepted offers with team assignments
  • Time tracking (activities) spread over months
  • Project expenses
  • Invoices based on logged hours
  • Purchases (supplier invoices)
  • CAMT.053 bank statements for payment reconciliation

Installation

git clone https://github.com/starsong-consulting/moco-synthesizer.git
cd moco-synthesizer
bundle install

Configuration

Create a .env file with your MOCO credentials:

MOCO_SUBDOMAIN=yourcompany
MOCO_API_KEY=your_api_key_here

Get your API key from MOCO under Profile → API Integration.

Usage

# Generate small dataset (default)
bundle exec ruby synthesize_full.rb

# Preview without making API calls
bundle exec ruby synthesize_full.rb --dry-run

# Generate medium or large dataset
bundle exec ruby synthesize_full.rb --scale medium
bundle exec ruby synthesize_full.rb --scale large

# Run specific step only
bundle exec ruby synthesize_full.rb --only users
bundle exec ruby synthesize_full.rb --only projects

Scale Options

Entity Small Medium Large
Employees 6 12 25
Freelancers 2 4 8
Companies 10 25 50
Deals 15 35 70
Offers 12 25 50
Projects 8 18 40
Purchases 8 20 40

Available Steps

Run individual steps with --only:

  • users - Employees and freelancers with employments
  • companies - Customer companies
  • contacts - Contacts for companies
  • deal_categories - Pipeline stages
  • deals - Leads/opportunities
  • offers - Quotes with line items
  • projects - Projects with tasks and team
  • activities - Time entries
  • expenses - Project expenses
  • invoices - Customer invoices
  • purchases - Supplier invoices
  • camt - Bank statement XML files

Output

The synthesizer creates interconnected data that flows naturally:

Deal (won) → Offer (accepted) → Project → Activities → Invoice
                                       → Expenses
                                       → Planning

CAMT Bank Statements

Two XML files are generated for import into MOCO's bank reconciliation:

  • bank_statement_incoming.xml - Customer payments (invoice receipts)
  • bank_statement_outgoing.xml - Supplier payments (purchase disbursements)

Payment references match invoice/purchase identifiers for automatic matching.

Requirements

  • Ruby 3.0+
  • MOCO account with API access
  • moco-ruby gem 1.2+

License

AGPL-3.0 - See LICENSE

About

Generate realistic synthetic data for MOCO test instances

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages