Project Rates
Project-specific billing and cost rate customizations.
externalpermissionstable8 procedures
query
projectRates.listInferred outputList project rates for a project. Returns rates with source rate info if applicable.
Input
{
projectId: string;
}Output
Array<ProjectRateWithSource>query
projectRates.getByIdInferred outputGet a single project rate by ID with source rate info.
Input
{
id: string;
}Output
ProjectRateWithSource | nullmutation
projectRates.createInferred outputCreate a project rate. If sourceRateId is provided, the rate is copied from the global rate.
Input
{
name: string;
amount: number;
projectId: string;
period?: "year" | "hour" | "day" | "week" | "month" | undefined;
sourceRateId?: string | undefined;
usageType?: "other" | "billing" | "cost" | undefined;
}Output
{
id: string;
organizationId: string;
name: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
amount: string;
projectId: string;
period: "year" | "hour" | "day" | "week" | "month";
sourceRateId: string | null;
usageType: string | null;
sourceType: string;
sourceRateVersionId: string | null;
isCustomized: boolean | null;
customizationReason: string | null;
}mutation
projectRates.updateInferred outputUpdate a project rate. If the amount differs from source, the rate is marked as customized.
Input
{
id: string;
name?: string | undefined;
amount?: number | undefined;
period?: "year" | "hour" | "day" | "week" | "month" | undefined;
usageType?: "other" | "billing" | "cost" | null | undefined;
customizationReason?: string | undefined;
}Output
{
id: string;
organizationId: string;
name: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
amount: string;
projectId: string;
period: "year" | "hour" | "day" | "week" | "month";
sourceRateId: string | null;
usageType: string | null;
sourceType: string;
sourceRateVersionId: string | null;
isCustomized: boolean | null;
customizationReason: string | null;
} | nullmutation
projectRates.deleteInferred outputDelete a project rate.
Input
{
id: string;
}Output
{
success: boolean;
error: string;
} | {
success: boolean;
error?: undefined;
}mutation
projectRates.syncToGlobalInferred outputSync a project rate to match the current global rate value. Only works for project rates that have a source rate.
Input
{
id: string;
}Output
{
id: string;
organizationId: string;
name: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
amount: string;
projectId: string;
period: "year" | "hour" | "day" | "week" | "month";
sourceRateId: string | null;
usageType: string | null;
sourceType: string;
sourceRateVersionId: string | null;
isCustomized: boolean | null;
customizationReason: string | null;
}query
projectRates.getBySourceInferred outputGet project rate by source rate ID. Useful for checking if a global rate is already added to a project.
Input
{
projectId: string;
sourceRateId: string;
}Output
{
id: string;
organizationId: string;
name: string;
createdAt: Date;
updatedAt: Date | null;
deletedAt: Date | null;
amount: string;
projectId: string;
period: "year" | "hour" | "day" | "week" | "month";
sourceRateId: string | null;
usageType: string | null;
sourceType: string;
sourceRateVersionId: string | null;
isCustomized: boolean | null;
customizationReason: string | null;
} | nullquery
projectRates.findProjectsUsingRateInferred outputFind projects that use a specific global rate. Useful for showing impact when a global rate changes.
Input
{
rateId: string;
}Output
Array<{
projectId: string;
projectRateId: string;
isCustomized: boolean;
}>