Skip to content

closemarketing/fakererp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fakererp

A PHP CLI that fills ERP systems with realistic, made-up test data — contacts, estimates and invoices — through their public APIs. Built for QA/staging environments where you need volume and variety without using real customer data.

Think php faker-holded that actually runs: point it at an ERP's API key in .env, run one command, and your test account has fake-but-valid contacts, estimates and invoices in it.

Supported ERPs

ERP API version Docs
Holded v2 docs/holded/api-v2.md

More ERPs can be added following AGENTS.md.

Requirements

  • PHP 8.1 or higher, with the curl and mbstring extensions.
  • Composer.
  • An API key for the ERP you want to seed (see the ERP's docs above for where to generate one).

Installation

git clone <this-repo>
cd fakererp
composer install
cp .env.example .env

Open .env and fill in the values for the ERP you want to use — at a minimum, its API key. Any value you leave empty will simply be asked for interactively the first time you run a command, with the option to save your answer back to .env.

Usage

All commands are run through bin/fakererp:

php bin/fakererp <command> [options]

Holded

Generate contacts, estimates (presupuestos) and invoices (facturas) in a Holded account:

# Everything in one go: 10 contacts, 5 estimates, 5 invoices
php bin/fakererp holded:seed

# Customize the amounts
php bin/fakererp holded:seed --contacts=25 --estimates=10 --invoices=15

# Or run each step independently
php bin/fakererp holded:contacts --count=20
php bin/fakererp holded:estimates --count=10
php bin/fakererp holded:invoices --count=10
  • holded:contacts creates contacts of varied types (client, supplier, lead, debtor, creditor, other), mixing individuals and companies, each with a checksum-valid Spanish NIF/NIE/CIF.
  • holded:estimates / holded:invoices reuse existing contacts in the account (fetched via the API); if the account has none yet, they will ask how many to create first, then attach the documents to them.
  • If HOLDED_API_KEY (or any other required setting) is missing from .env, the command will ask for it and offer to save it for next time. Pass --no-interaction to disable prompts (e.g. in CI) — in that case, missing required settings make the command fail with a clear error instead of hanging.

Run php bin/fakererp list to see all available commands, and php bin/fakererp <command> --help for a command's options.

Configuration reference

See .env.example for every supported setting and what it controls (API keys, base URLs, default record counts per command).

Development

composer install
vendor/bin/phpunit

Tests mock all HTTP calls — no command in the test suite talks to a real ERP.

Adding a new ERP

See AGENTS.md for the connector interface, the checklist to follow, and the data-quality requirements (contact type variety, valid fiscal identifiers, realistic line items, etc.) every connector must meet.

Safety

This tool is meant for test/staging accounts only. It creates real records through the target ERP's API — never point it at a production account's API key.

About

Script for making sample data in Tests ERPs in order to facilitate actions and tests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages