- Home
- Skills
- Linehaul Ai
- Linehaulai Claude Marketplace
- Load Lifecycle Patterns
load-lifecycle-patterns_skill
- Go
3
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill linehaul-ai/linehaulai-claude-marketplace --skill load-lifecycle-patterns- SKILL.md12.4 KB
Overview
This skill documents the critical business logic for load lifecycle and billing workflows in laneweaverTMS. It codifies valid status transitions, cancellation and TONU handling, billing milestones, quick pay behavior, and core financial calculations. Use it as a single-source reference when implementing or reviewing load, billing, and payment flows.
How this skill works
The skill defines the canonical load status lifecycle and valid transitions, including required triggers and terminal states. It specifies cancellation rules, TONU evaluation and recording, and the post-delivery billing pipeline from POD to customer invoice and carrier payment. It also provides financial formulas and implementation patterns (views, calculated columns) for gross/net profit and margin calculations, plus quick pay fee handling.
When to use it
- Implementing load status transitions and validation logic
- Building post-delivery billing workflows (POD → invoice → payment)
- Implementing TONU charge evaluation, recording, and billing
- Adding quick pay support and fee calculation for carrier payments
- Calculating financial metrics (gross profit, net profit, margins)
Best practices
- Validate every status change against the allowed transitions table and record timestamps
- Store money fields as NUMERIC(10,2) and handle NULL carrier_rate safely
- Track POD and carrier bill receipt separately; use a generated invoice_ready flag to gate customer invoicing
- Record cancellations in a dedicated table and sync loads.is_cancelled via a trigger
- Treat quick pay as carrier-initiated: calculate fee, deduct from carrier payment, and index quick_pay_requested for fast querying
Example use cases
- Enforce uncovered→assigned→dispatched→delivered lifecycle with guards preventing uncovered→delivered transitions
- When a load is cancelled after assignment, create load_cancellations with TONU amount and bill customer for TONU
- Only create a customer_invoice when invoice_ready = pod_received AND carrier_bill_received
- Calculate grossProfit and grossMarginPct in a view used by reporting and dashboard logic
- Process a carrier quick pay request by computing fee_pct, storing quick_pay_fee_amount, and scheduling expedited payment
FAQ
Apply TONU when a load is cancelled after carrier assignment and the cancellation is not due to carrier fault; document amount in load_cancellations and bill the customer.
How do I know when to create a customer invoice?
Create the customer invoice only when invoice_ready is true (both POD and carrier bill received). This is best enforced with a generated column or equivalent business rule.