# Asset Purchase Agent

**Categories:** Asset Management

Automated employee asset purchase program with eligibility checks, depreciation-based pricing, legal consent, and sequential approvals.

- Triggered by an employee request or a device reaching its end-of-life policy
- Validates tenure, employment type, and asset eligibility
- Calculates the purchase price using a configurable depreciation method
- Captures the required legal consent before proceeding
- Routes the request sequentially through manager, IT, and finance approvals

## What Asset Purchase Agent does

The Asset Purchase Agent lets eligible employees buy the company-owned laptop they're using - at a price automatically depreciated from the original purchase cost - without IT or finance manually pricing every device. It checks eligibility against a tenant-defined policy (asset age, employee tenure, employment type, country), calculates a fair sale price, and collects the employee's asset, currency, and payment choice through an interactive Slack or Teams form. It replaces a manual, spreadsheet-driven "buy your laptop" process with a self-service, policy-governed flow.

## Who Asset Purchase Agent Is For

**Persona:** IT and People/HR teams running device buyout or upgrade programs (sometimes called ECPP, Employee [Company-owned] Purchase Program) for departing or upgrading employees; the employees themselves who receive the purchase offer.

**Pain point:** Before this agent, pricing a used laptop for an employee buyout meant an admin manually calculating depreciation, checking local currency and payment options, and messaging the employee back and forth. That process doesn't scale and produces inconsistent pricing across employees and countries.

## How It Works

**Trigger:** Either of two events fires the "Laptop Purchase Request" workflow (`asset-purchase`, v2.0.0, category Hardware Management): an `employee-terminated` event a configurable number of days before the employee's termination date, or a recurring cron scan that periodically checks for laptops approaching end-of-life and eligible for an upgrade purchase.

1. **Eligibility check** - The eligibility_check block runs against the tenant's Asset Purchase Policy, validating either a given employee (finds their eligible company-owned laptops by minimum asset age) or a given asset (validates it has reached end-of-life, is assigned to an employee, and meets minimum asset age).

2. **Employee/policy validation** - Employment tenure, employment type, and country coverage are checked against PurchasePolicyResponse; ineligible employees or assets return a specific failure reason (e.g., "Employee tenure is below the minimum required").

3. **Price calculation** - For each eligible asset, AssetPurchaseEligibilityService computes a sale price from the asset's original purchase price and one of four depreciation methods (straight-line, straight-line with discount, fixed-percentage discount, or age-tier depreciation), floored at a configured minimum salvage value.

4. **Multi-currency conversion** - Prices are converted into the employee's local currency (and USD, if the policy allows) using tenant-uploaded currency conversion rates.

5. **Collect selection** - The collect_asset_purchase_info block sends an interactive Slack or Teams message ("Device Purchase Offer") listing eligible assets with prices; the employee selects an asset, currency, and payment method (Wire Transfer or Payroll Deduction), or declines.

6. **Legal consent (optional)** - If the tenant has a legal_consent.document_id configured, the workflow builds role/field assignments and sends a DocuSign envelope for the employee to sign, then waits for it to be completed before finalizing.

**Outcome:** The agent updates the original message with a confirmation summary (device, price, currency, payment method), a decline notice, or a timeout notice (default 48-hour window) if the employee doesn't respond. Where legal consent is configured, the purchase only finalizes once the DocuSign envelope is signed.

## Capabilities

- **Check purchase eligibility** - Validates an employee or a specific asset against tenant policy rules (minimum asset age, employee tenure, employment type, country) before any offer is made.
- **Calculate depreciated sale price** - Supports four configurable pricing methods (straight-line, straight-line with discount, fixed-percentage discount, age-tier) with a minimum salvage floor and optional round-to-nearest-even.
- **Convert prices across currencies** - Converts USD-denominated prices into the employee's local currency using tenant-maintained conversion rates, with USD shown only if the policy permits.
- **Send an interactive purchase form** - Presents eligible devices, currency options, and payment methods as a native Slack or Teams form with Submit/Decline actions.
- **Wait for and correlate the employee's response** - Uses Temporal signal correlation (single-response, time-boxed) so the workflow can pause for the employee's decision without polling.
- **Restrict to company-owned laptops** - Eligibility lookups filter specifically to `AssetType.LAPTOP` assets with `AssetOwnership.COMPANY_OWNED`.
- **Support multiple purchase scenarios** - Policy configuration recognizes three purchase cases: `TERMINATION`, `UPGRADE`, and `FROM_STOCK`.
- **Tie the transaction to a ticket** - Accepts an optional `ticket_id` so the purchase selection can be correlated back to a service desk ticket.
- **Confirm or expire gracefully** - Updates the original message in place with the final outcome (submitted, declined, or timed out) rather than leaving a stale form.

## Main use cases

**Employee upgrade buyout** - An employee is issued a new laptop and is eligible to buy their old one. The agent checks their tenure and employment type against policy, confirms the old laptop meets the minimum age requirement, calculates its depreciated price, and sends a Slack form so the employee can pick their currency and payment method - closing the loop without IT manually quoting a price.

**Offboarding device purchase** - A departing employee wants to keep their company laptop instead of returning it. The agent validates the asset has reached end-of-life or meets policy age thresholds, confirms the employee is assigned to it, and offers it at the policy-calculated price with local payment options (e.g., payroll deduction is disabled for a departing employee if the policy restricts it).

**Cross-border pricing consistency** - A distributed workforce means the same laptop model has different fair prices depending on local currency and cost of living. Because pricing is computed centrally from the USD purchase price and converted per the tenant's uploaded currency-rate table, employees in different countries see consistent, policy-driven pricing rather than ad hoc quotes.

## Integrations

| Integration | Role in the agent flow |
| --- | --- |
| Asset Management API | Source of truth for asset records, purchase details (original price, purchase date), and the tenant's Asset Purchase Policy and currency rates. |
| Employees service | Supplies employee tenure, employment type, and location/country to validate eligibility. |
| Notifications API | Delivers and updates the interactive selection message and renders it for the target messaging channel. |
| Slack (tenant-optional) | Renders the purchase offer as an interactive block-kit form with Submit/Decline buttons. |
| Microsoft Teams (tenant-optional) | Alternate messaging channel for the same interactive form, configured per tenant. |
| Temporal workflow engine | Executes the eligibility check and collection steps as workflow activities, and manages the signal-based wait for the employee's response. |

## FAQ

### What exactly is the Asset Purchase Agent - is it a bot, a workflow, or something else?

It's a Temporal-orchestrated workflow made of two automation steps (an eligibility check and an interactive collection step), not a conversational chatbot. It does not appear as a tool inside Harmony's AI helpdesk chatbot - it runs as backend workflow automation that messages the employee directly.

### How does it know what to do - is it reading from a rulebook or deciding on its own?

It follows a tenant-configured rulebook: the Asset Purchase Policy. Eligibility (minimum asset age, employee tenure, employment type, country coverage) and pricing (depreciation method, minimum salvage value, currency rates) are all admin-configured settings, not model-driven judgment calls.

### What does it handle automatically, and what needs a human?

The agent automatically checks eligibility, calculates price, collects the employee's choice, and - when configured - routes legal consent through DocuSign and waits for it to be signed. What happens after a confirmed purchase - invoicing, payroll deduction processing, or physically releasing the device - is not confirmed in code; it likely requires a downstream manual or finance-system step.

### Can an employee buy any company device, or just laptops?

Only company-owned laptops are currently supported - the eligibility lookup explicitly filters to `AssetType.LAPTOP` and `AssetOwnership.COMPANY_OWNED`. Other asset types are not evaluated by this flow.

### What does it need to be connected to before it works?

A tenant must configure an Asset Purchase Policy (via the Asset Purchase Policy admin API) - including eligible purchase cases, minimum asset age/tenure thresholds, eligible employment types, pricing method, and payment methods per country - and upload a currency conversion rate table. Without a policy configured, eligibility checks return "no policy configured" and the flow cannot proceed.

## Related platform features

- **Asset Purchase Policy (Admin Settings)** - The admin configuration surface (eligibility rules, pricing method, currency rates, payment methods) that this agent enforces at runtime.
- **Employee Offboarding** - The `TERMINATION` purchase case suggests this agent is meant to run alongside offboarding, but no code ties the two workflows together directly - not confirmed in code.