@happyvertical/smrt-timesheets
Shared time entries: who worked how long on what, approval and correction, and immutable charge and compensation snapshots taken at approval.
What it gives you
Shared time entries: who worked how long on what, approval and correction, and immutable charge and compensation snapshots taken at approval.
- 01One model for professional services, shop floors, and job sites: a Profile or an agent, a generic work reference, a duration, a source
- 02Approved entries never change; a correction is a new row and the original flips to corrected
- 03Money is never on the entry: approval writes one charge and one compensation snapshot in integer minor units
Moved out of projects and support
ServiceTimeEntry, the two snapshots, and ServiceEvidenceService moved here from smrt-projects. The table names are unchanged, so existing rows need no migration, and the old qualified names resolve as deprecated aliases. Under pnpm an application that depends on smrt-projects or smrt-support must add this package directly, or the CLI stops planning the three time tables.
Attendance and period timecards
The attendance subpath adds AttendancePunch, AttendanceBreak, and AttendanceService: punch in and out, paid and unpaid breaks, autoClose, and offline replay where committed attendance wins. The rollup subpath adds per-person regular and overtime rollups, immutable confirmation, and attributed adjustments. Calendar, holiday, and overtime rules belong to the consumer.
Decimal hours and dated labour pricing
A source that supplies decimal hours records durationHours as exact text; seconds and timestamps stay null. DatedLabourCommercialResolver is an opt-in resolver with effective-dated customer, wage, and burden rates; the host authorizes the schedule and binds the work date.
Package UI
Components in this package
Import these public components directly. When the package also exports playground entries, the next tab renders its real components with package-owned example data.
Package previews
No playground module yet
This package does not currently export a ./playground module. Its component names and import path remain available in the Components tab.
Intentionally not registered
Generated interface
REST
The exact route set comes from each model's @smrt({ api }) policy
and the application manifest—not from a second controller definition.
GET /api/service-time-entries
GET /api/service-time-entries/:id
POST /api/service-time-entries
PATCH /api/service-time-entries/:idWhat stays consistent
- Tenant scope and operation permissions run before model access.
- OpenAPI and generated clients use the same manifest fields.
- Packages can expose read-only or custom action sets.
Generated interface
MCP
AI tools are generated from the methods you explicitly include. Their inputs are validated against the same model metadata used by REST and CLI.
service-time-entries_list({ where, limit, orderBy })
service-time-entries_get({ id })
service-time-entries_create({ data })
service-time-entries_update({ id, data })Agent-safe by construction
- Tool availability can be narrower than the HTTP API.
- Principal execution intersects RBAC, agent ceilings, and persona tools.
- Descriptions and schemas are emitted from source metadata.
Browser-native agent interface
WebMCP
The generated web definitions carry the same tool names, descriptions, and JSON Schema
inputs as MCP. smrt-web registers them with document.modelContext.
import { webMcpToolDefinitions } from '@happyvertical/smrt-virt-web';
import { registerWebMcpTools } from '@happyvertical/smrt-web';
// Omitting an exposure policy registers read-only tools only.
const dispose = registerWebMcpTools(webMcpToolDefinitions);The page keeps its security boundary
- Tools execute through generated REST fetchers as the signed-in page user.
- Authentication, tenant gates, permissions, and field policy stay server-side.
- Feature detection makes registration a safe no-op outside supported browsers.
Generated interface
CLI
The app CLI turns manifest resources into predictable operator commands while keeping package-specific actions close to their models.
smrt service-time-entries list --limit 25 --order-by created_at:desc
smrt service-time-entries get <id>
smrt service-time-entries create --from-file ./record.jsonMade for automation
- Machine-readable output and file-based input.
- The same include/exclude policy as other surfaces.
- Migration, introspection, dispatch, and knowledge commands stay in smrt-cli.