dodil/erp-method

starters/uk-wholesale-sample.calls.yaml

# Starter (OPTIONAL): sample data for the uk-wholesale starter — one customer, one product (TRD-00001), 100 in stock — so a
# first sale runs end to end on an empty business. Skip it when the business brings its own products: the numbers
# (TRD-00001, CUST-0001, stock 100) collide with theirs.
#
# It needs starters/uk-wholesale.calls.yaml seeded FIRST (it uses the warehouse MAIN, bin MAIN/A/01, price list LIST-GBP, the
# NET30 terms and uk_business VAT treatment that file creates). Same replay as the base starter:
#
#   erp-compose init --starter uk-wholesale-sample --dir sample      (writes sample/config/starter.calls.yaml)
#   erp-compose seed --local compose.yaml sample/config/starter.calls.yaml
#
# Every value is PLACEHOLDER; nothing here is a real customer.
modules: [sales-order, product, business-partner, ar, gl, tax, payments, inventory]
calls:
  # ── SAMPLE DATA (PLACEHOLDER): one customer, one product, opening stock — so a first sale runs; replace or delete ──
  # (traded goods are numbered from the type's series: the first is TRD-00001)
  - {use_case: upsert_partner, as: cust, args: {bp_key: CUST-0001, legal_name: "PLACEHOLDER Customer Ltd", country: GB, roles: [customer]}}
  - {use_case: set_party_tax, args: {bp_id: $cust.bp_id, treatment_code: uk_business}}
  - {use_case: set_billing_profile, args: {bp_id: $cust.bp_id, bill_to_name: "PLACEHOLDER Customer Ltd",
                                           bill_to_address: "PLACEHOLDER 2 Sample Road, Sampletown SA1 1AA",
                                           invoice_email: accounts@customer.example, terms_id: NET30, currency: GBP}}
  - {use_case: add_product, as: prod, args: {name: "PLACEHOLDER Sample product", product_type_code: TRADING, base_unit_code: C62,
                                   tax_category: standard, invoicing_policy: delivered, billing_kind: one_off, billing_plan: single}}
  - {use_case: set_units, args: {product_id: $prod.product_id, sales_unit_code: C62, purchase_unit_code: C62}}
  - {use_case: activate_product, args: {product_id: $prod.product_id}}
  - {use_case: set_prices, args: {price_list_id: LIST-GBP, rows: [{product_id: $prod.product_id, valid_from: $today, unit_price: "25.00"}], rules: []}}
  - {use_case: publish_price_list, args: {price_list_id: LIST-GBP}}
  # opening stock AT COST: received like goods in (a count would value found stock at 0). It lands on 1001 Stock against
  # 2109 Goods received not invoiced; move that to the opening balances when they are entered.
  - {use_case: post_receipt, args: {move_ref: "pur:OPEN-1:1", source_kind: purchase_receipt, source_id: OPEN-1, product_id: $prod.product_id,
                                    quantity: "100", unit_code: C62, location_id: MAIN/A/01, received_on: $today, unit_cost: "10.00",
                                    currency: GBP}}