# Relationships (Engagements)

The kinds of working relationships between parties. See
[README.md](README.md#engagement-proposed--replaces-vague-relationship)
for the proposed term **engagement** and
[the table of engagement types](README.md#engagement-type-and-the-roles-in-it-proposed)
for the canonical roles each side plays.

## Engagement types

### subcontract
One party (the **Prime**) owns the client relationship and delegates
work to another party (the **Subcontractor**).

- **Transparent** — the end client knows who's actually doing the work
  (Conversion Geek prime → PlusROI subcontractor; Adi subcontractor →
  Bowden Works prime → PlusROI prime on most projects).
- **Opaque** — the subcontractor poses as the prime to the end client
  (former PlusROI → NewGrowth on Qualia; Adi using a PlusROI email).

Visibility level on the project (see README) is set per-engagement.

When the user previously asked "what is McAllister when McAllister
hires PlusROI?", McAllister is the **Prime** in that engagement and
PlusROI is the **Subcontractor**.

### freelance
One party (the **Engager**, typically an agency or person hiring out)
engages a person or small org (the **Freelancer**) to do work, without
ongoing partnership equity.

- Usually billed **per-unit**, sometimes **hourly** or **fixed-price**.
- Examples: Yulia ↔ PlusROI; Carmen ↔ What Works; Summer ↔ McAllister.
- Mechanically similar to subcontract but used when the engaged party
  is a person or solo shop rather than an agency.

### partnership
Shared upside (profit-share) on a project or book of work. Both sides
are **Partners**. Usually undocumented but contractually defensible.

- Bowden Works ⇄ PlusROI: the canonical case.
- Heather ⇄ Bowden Works on direct projects: same pattern.
- Could become 3-way (Rian + Heather + Summer, etc.).

### referral
The **Referrer** introduces the work and collects a commission, without
doing the work or having ongoing operational visibility. The receiving
party is the **Operator**.

- AISV → PlusROI on Community Financials.
- McAllister → PlusROI on *some* projects (referrer on some, prime on
  others — same parties, different engagement types per project).
- TCIR → PlusROI on most resorts.

### referral-pass-through
A referrer (the **Referrer-of-Record**) that also routes the
client-side billing. They invoice the client and pay through to the
**Operator**, even though they don't deliver the work themselves.

- Legacy McAllister on Copernic when PlusROI delivered but the client
  paid McAllister.

### direct-client
The end **Client** paying the **Operator** for delivered work.

- Community Financials, Copernic, Hartling Group resorts, DaxTech, etc.

### employment
Salaried **Employer** ↔ **Employee**. **Not currently in use.**
Tingang may have some workers in this category that aren't visible
from outside.

### official-partnership
A documented co-ownership of an org. Both sides are **Owners**.
May or may not include actual work.

- Nicole Bowden (Bowden Works, no work).
- Danielle Cooper (PlusROI, bookkeeping work + gross-percentage cut).

## Compensation models

Independent of engagement type — see
[README.md](README.md#compensation-model-proposed) for the enum.

A party may have **multiple compensation models** in play with the same
counter-party, scoped per-project or per-engagement. Heather has a
per-unit engagement with PlusROI AND a partnership engagement with
Bowden Works simultaneously.

## Engagement lifecycle

Engagements evolve. The model should treat each change as a new state,
not erase the old. Examples seen in the data:

- **Falling out**: Hartling Group fired PlusROI, kept Bowden Works.
- **Dissolution**: NewGrowth dissolved; Mark joined Qualia; PlusROI's
  engagement shifted from Subcontractor-of-NewGrowth to direct
  operator/agency for Qualia.
- **Brand swap**: Customer First Design's public face went Salty Waffle
  → AISV. The commission entitlement (legal entity) didn't change.
- **Role flip**: McAllister often flips between **Prime** (subcontract
  engagement, owning the client relationship) and **Referrer** (referral
  engagement, just collecting commission) on different projects with
  PlusROI.

## Visibility level

See [README.md](README.md#visibility-level-proposed) for the proposed
enum. Critically:

- Visibility is **per-engagement on a project**, not per-party globally.
- The same party can be operator on one project and referrer-blind on
  another.
- The project's *owning agency* (operator) chooses what to expose to
  each other engaged party.

---

## A worked example of the worst case

A real chain that could exist today, in order from worker outward:

1. A **Tingang freelancer** (Zeina) tracks time in Clockify against a
   Copernic project.
2. **Adi** receives that time, divides it by the freelancer's rate
   proportion, and invoices Bowden Works on the *converted* hours
   (Adi-equivalent hours), hourly.
3. **Bowden Works** receives Adi's invoice, marks it up, and bills
   PlusROI for the time as part of the partnership.
4. **PlusROI** absorbs Bowden Works' invoice + per-unit costs from other
   freelancers (e.g., Summer also worked on the project), and invoices
   McAllister.
5. **McAllister** receives PlusROI's invoice and bills **Copernic**
   (the end client).
6. **Copernic** pays McAllister. McAllister pays PlusROI. PlusROI
   computes net profit (after Danielle's cut, freelancer payouts,
   accounting fees) and pays Bowden Works half. Bowden Works pays Adi
   per his earlier invoice.

Simultaneously, on the same project:
- McAllister may have a **separate side scope** they engaged Bowden
  Works on directly — Bowden Works invoices McAllister directly.
- Summer might be doing some of her work on the project through
  McAllister rather than PlusROI — she invoices McAllister directly
  for that portion.

Then, mid-project, Copernic decides to drop McAllister and contract
PlusROI directly. The work continues unchanged from Bowden Works' and
Adi's perspective. But now:
- McAllister's engagement type flips from **Prime** (in a subcontract
  with PlusROI) to **Referrer** (commission only) on all future work.
- Summer's portion is consolidated under PlusROI; OR Copernic engages
  Agent Noir directly; OR a mix.
- A new commission entitlement is established for McAllister on future
  work, with **referrer-blind** visibility.

**Implication for the data model:**

- A single project carries multiple engagements (operator, subcontractor,
  referrer, possibly more).
- Each engagement on a project has its own visibility level.
- Each engagement has its own compensation model and rate, independent
  of the others.
- Engagement state changes over time and the system should preserve
  history (when did McAllister stop being the billing layer? when did
  the commission entitlement start?).
- Reporting "what did each party earn on this project" needs to walk
  the full chain — gross revenue minus pass-throughs minus commissions
  minus subcontractor costs at each layer.
