03 — Integration

Workforce is a member of the Work & Supply network (message protocol v1) with the network domain workforce. Its contract is schema/workforce.integration.dsl (authoring spec v1.7), generated with python -m codegen.cli integration workforce --network work_supply; the handlers are in integration/handlers.py. The whole network is in networks/work_supply/NETWORK_MAP.md.

What it owns

Network entity Model Business reference
workforce.trade Trade code (people-assigned, may be corrected)
workforce.employee Employee employee_number (E-{sequence:04} for own staff; the employer's number for a contractor's person)

Messages

Kind Message What
publishes workforce.employee_registered a new employee: number, name, trade, employer, site, dates, status
publishes workforce.employee_changed the trade, employer, site, status, name or position changed (raised by profile_revision)
publishes workforce.employee_left the status became terminated (with the end date)
publishes workforce.trade_reference_changed a trade's code was corrected (generated)
consumes asset.site_reference_changed the readable site reference stays current (generated)
accepts workforce.register_employee, workforce.change_employee by message (the load driver, other systems) as well as on screen
answers workforce.search_trades, workforce.search_employees, workforce.employee_profile read-only
reads supplier.search_suppliers the picker for a contractor's employer

Work's copy

Work Management consumes the three employee events: - its Person row with the employee's network id is created or updated (name, number, position, trade, status; terminated becomes inactive in the copy). Person is read-only on Work's screens; Work's many …_person_id columns keep pointing at it. - for a contractor's person, its Organisation of type contractor with the supplier number as its code and supplier_cid / supplier_ref is found or created, and the Person is linked to it.

Work records the trade (trade_cid / trade_ref, picked with workforce.search_trades) on each assignment and time entry. A time entry's trade defaults to the person's trade when Work's copy knows it; a later change of trade leaves earlier entries as they were.

References

asset.site (no picker: the Register answers no site search yet; the site reference follows corrections) and supplier.supplier (picked with supplier.search_suppliers).

Not held

No pay, tax, bank, superannuation or home-address data, in the tables, the events or the queries.