Skip to main content

Type Definitions

Beta Feature

RevOps Functions are a limited access beta feature. Please contact your Account Manager if you are interested in joining the beta. The information in this document is a work in progress and is subject to change.

Please provide any questions or feedback to support@revops.io or via your Slack Connect channel if applicable. Additional features and functionality will be added in the future.

Shared Types

RevOps Functions currently utilize the following types. These interfaces are loaded into the editor automatically and are shared across all function types. Each function type will also have specific input and output types that are built on top of these.

type DateType = string | null;

type AgreementType =
| "new-order"
| "renewal"
| "nda"
| "one-party-nda"
| "expansion"
| "referral-agreement"
| "data-processing"
| "partnership"
| "msa"
| "cancellation"
| "misc";

interface Overview {
contractStartDate: DateType;
contractEndDate: DateType;
contractDuration: number | null;
}

interface Template {
id: string;
name: string;
}

type TermPropertyType =
| "money"
| "number"
| "date"
| "dropdown"
| "string"
| "email";

interface TermProperty {
name: string;
type: TermPropertyType;
value: string;
}

interface OptionTermProperty extends TermProperty {
type: "dropdown";
options: { value: string; text: string }[];
}

type TermType = TermPropertyType | "paragraph" | "contract-period";

type BuiltInId =
| "latePaymentPercentageFee"
| "purchaseOrderNumber"
| "daysUntilDue"
| "billingStartDate"
| "externalAccountId"
| "billingFrequency"
| "contractStartDate"
| "contractDuration"
| "automaticRenewal"
| "expirationDate";

interface Term {
id: string;
name: string;
label: string;
type: TermType;
builtInId: BuiltInId | null;
properties: (TermProperty | OptionTermProperty)[];
}

interface DateTerm extends Term {
type: "date" | "contract-period";
startDate: DateType;
endDate: DateType;
}

interface NumberTerm extends Term {
type: "money" | "number";
value: number;
}

interface ValueTerm extends Term {
type: "dropdown" | "string" | "email";
value: string;
}

interface OptionTerm extends ValueTerm {
type: "dropdown";
options: { value: string; text: string }[];
}

type UnitPricingInterval = "month" | "year" | "one-time";

interface PricingPeriod {
unitPricingInterval: UnitPricingInterval;
quantity: number;
listPrice: number;
adjustedPrice: number;
netPrice: number;
annualPrice: number;
monthlyPrice: number;
startDate: DateType;
endDate: DateType;
periodDuration: number;
}

type LineItemPropertyType =
| "dropdown"
| "number"
| "checkbox"
| "string"
| "limit";

interface LineItemProperty {
name: string;
value: string | boolean | number;
type: LineItemPropertyType;
}

interface LineItemCheckboxProperty extends LineItemProperty {
value: boolean;
type: "checkbox";
}

interface LineItemValueProperty extends LineItemProperty {
value: string;
type: "dropdown";
}

interface LineItemNumberProperty extends LineItemProperty {
value: number;
type: "number";
}

interface LineItemLimitProperty extends LineItemProperty {
value: number;
enabled: boolean;
type: "limit";
}

interface OptionLineItemProperty extends LineItemValueProperty {
type: "dropdown";
options: { text: string; value: string }[];
}

interface LineItem {
name: string;
lineItemTitle: string;
skuId: string;
productCode: string;
pricingSchedule: PricingPeriod[];
properties: (
| LineItemProperty
| LineItemCheckboxProperty
| LineItemValueProperty
| LineItemNumberProperty
| LineItemLimitProperty
)[];
}

Pre-Submit Validation

interface PreSubmitTestData {
deal: {
lineItems: LineItem[];
terms: (Term | ValueTerm | OptionTerm | NumberTerm | DateTerm)[];
template: Template;
agreementType: AgreementType;
overview: Overview;
};
}

type PreSubmitResponse =
| string
| (string | { message: string; blocking?: boolean })[];

Custom Approval Triggers

interface ApprovalTriggerTestData {
deal: {
lineItems: LineItem[];
terms: (Term | ValueTerm | OptionTerm | NumberTerm | DateTerm)[];
template: Template;
agreementType: AgreementType;
overview: Overview;
};
}