Monument

Rates

Organization rates, rate versions, and effective rate resolution.

externalpermissionstable10 procedures
queryrates.listInferred output

List rates for the organization with optional filters. Returns rates with their current version info (including amount).

Input
{
  tags?: Array<string> | undefined;
  isDefault?: boolean | undefined;
  search?: string | undefined;
  limit?: number | undefined;
  offset?: number | undefined;
  rateType?: "cost" | "billable" | undefined;
}
Output
PaginatedResult<RateWithCurrentVersion>
queryrates.getByIdInferred output

Get a single rate by ID with current version.

Input
{
  id: string;
}
Output
RateWithCurrentVersion | null
queryrates.getByCodeInferred output

Get a single rate by code with current version.

Input
{
  code: string;
}
Output
RateWithCurrentVersion | null
mutationrates.createInferred output

Create a new rate with its initial version.

Input
{
  name: string;
  amount: number;
  effectiveFrom: string;
  code?: string | undefined;
  description?: string | undefined;
  tags?: Array<string> | undefined;
  isDefault?: boolean | undefined;
  currency?: string | undefined;
  rateType?: "cost" | "billable" | undefined;
  period?: "year" | "hour" | "day" | "week" | "month" | undefined;
  hoursPerPeriod?: number | undefined;
  applicableRole?: string | undefined;
  effectiveTo?: string | undefined;
  changeReason?: string | undefined;
}
Output
RateWithCurrentVersion
mutationrates.updateInferred output

Update a rate's shell properties (not the version/amount). To change the amount, create a new version.

Input
{
  id: string;
  name?: string | undefined;
  description?: string | null | undefined;
  tags?: Array<string> | undefined;
  isDefault?: boolean | undefined;
  currency?: string | undefined;
  rateType?: "cost" | "billable" | undefined;
  period?: "year" | "hour" | "day" | "week" | "month" | undefined;
  hoursPerPeriod?: number | null | undefined;
  applicableRole?: string | null | undefined;
}
Output
{
  id: string;
  code: string | null;
  organizationId: string;
  name: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  description: string | null;
  tags: Array<string> | null;
  isDefault: boolean | null;
  currentVersionId: string | null;
  currency: string | null;
  rateType: "cost" | "billable";
  period: "year" | "hour" | "day" | "week" | "month";
  hoursPerPeriod: string | null;
  applicableRole: string | null;
} | null
mutationrates.deleteInferred output

Soft delete a rate.

Input
{
  id: string;
}
Output
{
  success: boolean;
  error: string;
} | {
  success: boolean;
  error?: undefined;
}
mutationrates.createVersionInferred output

Create a new version for a rate. This becomes the current version and the previous version's effectiveTo is updated.

Input
{
  rateId: string;
  amount: number;
  effectiveFrom: string;
  effectiveTo?: string | undefined;
  changeReason?: string | undefined;
}
Output
{
  id: string;
  organizationId: string;
  createdAt: Date;
  rateId: string;
  amount: string;
  version: number;
  createdByResourceId: string | null;
  effectiveFrom: string;
  effectiveTo: string | null;
  changeReason: string | null;
  previousVersionId: string | null;
}
queryrates.listVersionsInferred output

List all versions for a rate, ordered by version number descending.

Input
{
  rateId: string;
}
Output
Array<{
  id: string;
  organizationId: string;
  createdAt: Date;
  rateId: string;
  amount: string;
  version: number;
  createdByResourceId: string | null;
  effectiveFrom: string;
  effectiveTo: string | null;
  changeReason: string | null;
  previousVersionId: string | null;
}>
queryrates.getVersionInferred output

Get a specific rate version by ID.

Input
{
  id: string;
}
Output
{
  id: string;
  organizationId: string;
  createdAt: Date;
  rateId: string;
  amount: string;
  version: number;
  createdByResourceId: string | null;
  effectiveFrom: string;
  effectiveTo: string | null;
  changeReason: string | null;
  previousVersionId: string | null;
} | null
queryrates.getVersionAtDateInferred output

Get the rate version that was effective at a specific date.

Input
{
  date: string;
  rateId: string;
}
Output
{
  id: string;
  organizationId: string;
  createdAt: Date;
  rateId: string;
  amount: string;
  version: number;
  createdByResourceId: string | null;
  effectiveFrom: string;
  effectiveTo: string | null;
  changeReason: string | null;
  previousVersionId: string | null;
} | null