@servicetitan/moneyout-api-client 1.41.0 → 1.42.0-beta.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,6 +19,12 @@ export interface IExpenseTenantSettings {
|
|
|
19
19
|
clears it.
|
|
20
20
|
*/
|
|
21
21
|
patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Set the tenant's card-transactions onboarding status (PYB-3416). Touches only that field — the
|
|
24
|
+
vendor-matching and receipt settings are left unchanged — and creates the not-yet-onboarded
|
|
25
|
+
settings row if the tenant has none.
|
|
26
|
+
*/
|
|
27
|
+
setOnboardingStatus(tenantId: number, request: SetExpenseOnboardingStatusRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;
|
|
22
28
|
}
|
|
23
29
|
export declare const BASE_URL_TOKEN_ExpenseTenantSettings: import("@servicetitan/react-ioc").SymbolToken<string>;
|
|
24
30
|
export declare class ExpenseTenantSettings implements IExpenseTenantSettings {
|
|
@@ -44,24 +50,42 @@ export declare class ExpenseTenantSettings implements IExpenseTenantSettings {
|
|
|
44
50
|
clears it.
|
|
45
51
|
*/
|
|
46
52
|
patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Set the tenant's card-transactions onboarding status (PYB-3416). Touches only that field — the
|
|
55
|
+
vendor-matching and receipt settings are left unchanged — and creates the not-yet-onboarded
|
|
56
|
+
settings row if the tenant has none.
|
|
57
|
+
*/
|
|
58
|
+
setOnboardingStatus(tenantId: number, request: SetExpenseOnboardingStatusRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;
|
|
47
59
|
}
|
|
48
60
|
export interface ExpenseTenantSettingsResponse {
|
|
49
61
|
vendorMatchingMode: VendorMatchingMode;
|
|
50
62
|
defaultVendorId?: number | undefined;
|
|
51
63
|
requireReceipt: boolean;
|
|
52
64
|
requireReceiptThresholdAmount?: number | undefined;
|
|
65
|
+
/** Read-only here; set through `PUT expense-settings/onboarding-status`. */
|
|
66
|
+
onboardingStatus: ExpenseOnboardingStatus;
|
|
53
67
|
}
|
|
54
68
|
/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.VendorMatchingMode` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */
|
|
55
69
|
export declare enum VendorMatchingMode {
|
|
56
70
|
MapToServiceTitanVendors = 0,
|
|
57
71
|
UseDefaultVendor = 1
|
|
58
72
|
}
|
|
73
|
+
/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.ExpenseOnboardingStatus` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */
|
|
74
|
+
export declare enum ExpenseOnboardingStatus {
|
|
75
|
+
NotStarted = 0,
|
|
76
|
+
InProgress = 1,
|
|
77
|
+
Completed = 2,
|
|
78
|
+
Dismissed = 3
|
|
79
|
+
}
|
|
59
80
|
export interface UpdateExpenseTenantSettingsRequest {
|
|
60
81
|
vendorMatchingMode: VendorMatchingMode;
|
|
61
82
|
defaultVendorId?: number | undefined;
|
|
62
83
|
requireReceipt: boolean;
|
|
63
84
|
requireReceiptThresholdAmount?: number | undefined;
|
|
64
85
|
}
|
|
86
|
+
export interface SetExpenseOnboardingStatusRequest {
|
|
87
|
+
onboardingStatus: ExpenseOnboardingStatus;
|
|
88
|
+
}
|
|
65
89
|
export interface OperationBase {
|
|
66
90
|
path?: string | undefined;
|
|
67
91
|
op?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expense-tenant-settings.api.d.ts","sourceRoot":"","sources":["../src/expense-tenant-settings.api.ts"],"names":[],"mappings":"AASA,OAAc,EAAsB,YAAY,EAAE,WAAW,EAAE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AAS,IAAI;IACb,SAAS,IAAI;CAChB;AAED,MAAM,WAAW,kCAAkC;IAC/C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,cAAc,EAAE,OAAO,CAAC;IACxB,6BAA6B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtD;AAED,MAAM,WAAW,iCAAiC;IAC9C,gBAAgB,EAAE,uBAAuB,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC5C,KAAK,CAAC,EAAE,GAAG,CAAC;CACf;AAED,MAAM,WAAW,6CAA8C,SAAQ,SAAS;CAC/E"}
|
|
@@ -104,6 +104,29 @@ export class ExpenseTenantSettings {
|
|
|
104
104
|
};
|
|
105
105
|
return makeCodedException(axios.request(options_));
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Set the tenant's card-transactions onboarding status (PYB-3416). Touches only that field — the
|
|
109
|
+
vendor-matching and receipt settings are left unchanged — and creates the not-yet-onboarded
|
|
110
|
+
settings row if the tenant has none.
|
|
111
|
+
*/ setOnboardingStatus(tenantId, request, cancelToken) {
|
|
112
|
+
let url_ = "/v1/tenant/{tenantId}/expense-settings/onboarding-status";
|
|
113
|
+
if (tenantId === undefined || tenantId === null) throw new Error("The parameter 'tenantId' must be defined.");
|
|
114
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
115
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
116
|
+
const content_ = request;
|
|
117
|
+
let options_ = {
|
|
118
|
+
baseURL: this.baseUrl,
|
|
119
|
+
cancelToken,
|
|
120
|
+
data: content_,
|
|
121
|
+
url: url_,
|
|
122
|
+
method: "PUT",
|
|
123
|
+
headers: {
|
|
124
|
+
"Content-Type": "application/json",
|
|
125
|
+
"Accept": "application/json"
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return makeCodedException(axios.request(options_));
|
|
129
|
+
}
|
|
107
130
|
constructor(baseUrl = ""){
|
|
108
131
|
_define_property(this, "baseUrl", void 0);
|
|
109
132
|
_define_property(this, "jsonParseReviver", void 0);
|
|
@@ -125,5 +148,12 @@ ExpenseTenantSettings = _ts_decorate([
|
|
|
125
148
|
VendorMatchingMode[VendorMatchingMode["UseDefaultVendor"] = 1] = "UseDefaultVendor";
|
|
126
149
|
return VendorMatchingMode;
|
|
127
150
|
}({});
|
|
151
|
+
/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.ExpenseOnboardingStatus` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */ export var ExpenseOnboardingStatus = /*#__PURE__*/ function(ExpenseOnboardingStatus) {
|
|
152
|
+
ExpenseOnboardingStatus[ExpenseOnboardingStatus["NotStarted"] = 0] = "NotStarted";
|
|
153
|
+
ExpenseOnboardingStatus[ExpenseOnboardingStatus["InProgress"] = 1] = "InProgress";
|
|
154
|
+
ExpenseOnboardingStatus[ExpenseOnboardingStatus["Completed"] = 2] = "Completed";
|
|
155
|
+
ExpenseOnboardingStatus[ExpenseOnboardingStatus["Dismissed"] = 3] = "Dismissed";
|
|
156
|
+
return ExpenseOnboardingStatus;
|
|
157
|
+
}({});
|
|
128
158
|
|
|
129
159
|
//# sourceMappingURL=expense-tenant-settings.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/expense-tenant-settings.api.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n//----------------------\n// <auto-generated>\n// Generated with ApiClientGenerator, using the NSwag toolchain\n// </auto-generated>\n//----------------------\n// ReSharper disable InconsistentNaming\n\nimport axios, { AxiosRequestConfig, AxiosPromise, CancelToken } from 'axios';\nimport { injectable, inject, optional, symbolToken } from '@servicetitan/react-ioc';\nimport { makeCodedException, makeContent } from './utils';\n// @ts-ignore: needed for Date serialization if a DateTime parameter has an Unspecified attribute on it\nimport moment from 'moment';\n\nexport interface IExpenseTenantSettings {\n /**\n * Get the tenant's current expense vendor-matching settings, or the default\n (`MapToServiceTitanVendors`) when no settings row exists yet.\n */\n getSettings(tenantId: number, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n /**\n * Full-replace upsert of the tenant's expense vendor-matching settings.\n */\n putSettings(tenantId: number, request: UpdateExpenseTenantSettingsRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n /**\n * Partial update of the tenant's expense vendor-matching settings. Loads the current state (or the\n not-yet-onboarded default when no row exists), applies the JSON Patch on top, then routes the\n complete resulting state through the same PutSettings validation and upsert — so a\n patch that switches to `UseDefaultVendor` must still leave a valid active\n `DefaultVendorId`, omitted fields keep their current value, and switching to\n `MapToServiceTitanVendors` preserves `DefaultVendorId` unless the patch explicitly\n clears it.\n */\n patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n}\n\nexport const BASE_URL_TOKEN_ExpenseTenantSettings = symbolToken<string>('BASE_URL_TOKEN', false);\n\n@injectable()\nexport class ExpenseTenantSettings implements IExpenseTenantSettings {\n protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;\n\n constructor(@inject(BASE_URL_TOKEN_ExpenseTenantSettings) @optional() private readonly baseUrl = \"\") {\n }\n\n /**\n * Get the tenant's current expense vendor-matching settings, or the default\n (`MapToServiceTitanVendors`) when no settings row exists yet.\n */\n getSettings(tenantId: number, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n\n /**\n * Full-replace upsert of the tenant's expense vendor-matching settings.\n */\n putSettings(tenantId: number, request: UpdateExpenseTenantSettingsRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n\n /**\n * Partial update of the tenant's expense vendor-matching settings. Loads the current state (or the\n not-yet-onboarded default when no row exists), applies the JSON Patch on top, then routes the\n complete resulting state through the same PutSettings validation and upsert — so a\n patch that switches to `UseDefaultVendor` must still leave a valid active\n `DefaultVendorId`, omitted fields keep their current value, and switching to\n `MapToServiceTitanVendors` preserves `DefaultVendorId` unless the patch explicitly\n clears it.\n */\n patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = operations;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n}\n\nexport interface ExpenseTenantSettingsResponse {\n vendorMatchingMode: VendorMatchingMode;\n defaultVendorId?: number | undefined;\n requireReceipt: boolean;\n requireReceiptThresholdAmount?: number | undefined;\n}\n\n/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.VendorMatchingMode` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */\nexport enum VendorMatchingMode {\n MapToServiceTitanVendors = 0,\n UseDefaultVendor = 1,\n}\n\nexport interface UpdateExpenseTenantSettingsRequest {\n vendorMatchingMode: VendorMatchingMode;\n defaultVendorId?: number | undefined;\n requireReceipt: boolean;\n requireReceiptThresholdAmount?: number | undefined;\n}\n\nexport interface OperationBase {\n path?: string | undefined;\n op?: string | undefined;\n from?: string | undefined;\n}\n\nexport interface Operation extends OperationBase {\n value?: any;\n}\n\nexport interface OperationOfUpdateExpenseTenantSettingsRequest extends Operation {\n}\n"],"names":["axios","injectable","inject","optional","symbolToken","makeCodedException","BASE_URL_TOKEN_ExpenseTenantSettings","ExpenseTenantSettings","getSettings","tenantId","cancelToken","url_","undefined","Error","replace","encodeURIComponent","options_","baseURL","baseUrl","url","method","headers","request","putSettings","content_","data","patchSettings","operations","jsonParseReviver","VendorMatchingMode"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB,GAClB,kBAAkB,GAClB,wBAAwB;AACxB,mBAAmB;AACnB,mEAAmE;AACnE,oBAAoB;AACpB,wBAAwB;AACxB,uCAAuC;AAEvC,OAAOA,WAA8D,QAAQ;AAC7E,SAASC,UAAU,EAAEC,MAAM,EAAEC,QA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,mBAAmB,KAAKN;QAC1DE,OAAOA,KAAKG,OAAO,CAAC,SAAS;QAE7B,MAAMU,WAAWG;QAEjB,IAAIX,WAA+B;YAC/BC,SAAS,IAAI,CAACC,OAAO;YACrBR;YACAe,MAAMD;YACNL,KAAKR;YACLS,QAAQ;YACRC,SAAS;gBACL,gBAAgB;gBAChB,UAAU;YACd;QACJ;QAEA,OAAOhB,mBAAmBL,MAAMsB,OAAO,CAAgCN;IAC3E;IAtFA,YAAY,AAA2EE,UAAU,EAAE,CAAE;;QAFrG,uBAAUU,oBAAV,KAAA;aAEuFV,UAAAA;aAF7EU,mBAAmEhB;IAG7E;AAsFJ;;;;;;;;;;AASA,2LAA2L,GAC3L,OAAO,IAAA,AAAKiB,4CAAAA;;;WAAAA;MAGX"}
|
|
1
|
+
{"version":3,"sources":["../src/expense-tenant-settings.api.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n//----------------------\n// <auto-generated>\n// Generated with ApiClientGenerator, using the NSwag toolchain\n// </auto-generated>\n//----------------------\n// ReSharper disable InconsistentNaming\n\nimport axios, { AxiosRequestConfig, AxiosPromise, CancelToken } from 'axios';\nimport { injectable, inject, optional, symbolToken } from '@servicetitan/react-ioc';\nimport { makeCodedException, makeContent } from './utils';\n// @ts-ignore: needed for Date serialization if a DateTime parameter has an Unspecified attribute on it\nimport moment from 'moment';\n\nexport interface IExpenseTenantSettings {\n /**\n * Get the tenant's current expense vendor-matching settings, or the default\n (`MapToServiceTitanVendors`) when no settings row exists yet.\n */\n getSettings(tenantId: number, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n /**\n * Full-replace upsert of the tenant's expense vendor-matching settings.\n */\n putSettings(tenantId: number, request: UpdateExpenseTenantSettingsRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n /**\n * Partial update of the tenant's expense vendor-matching settings. Loads the current state (or the\n not-yet-onboarded default when no row exists), applies the JSON Patch on top, then routes the\n complete resulting state through the same PutSettings validation and upsert — so a\n patch that switches to `UseDefaultVendor` must still leave a valid active\n `DefaultVendorId`, omitted fields keep their current value, and switching to\n `MapToServiceTitanVendors` preserves `DefaultVendorId` unless the patch explicitly\n clears it.\n */\n patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n /**\n * Set the tenant's card-transactions onboarding status (PYB-3416). Touches only that field — the\n vendor-matching and receipt settings are left unchanged — and creates the not-yet-onboarded\n settings row if the tenant has none.\n */\n setOnboardingStatus(tenantId: number, request: SetExpenseOnboardingStatusRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse>;\n}\n\nexport const BASE_URL_TOKEN_ExpenseTenantSettings = symbolToken<string>('BASE_URL_TOKEN', false);\n\n@injectable()\nexport class ExpenseTenantSettings implements IExpenseTenantSettings {\n protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;\n\n constructor(@inject(BASE_URL_TOKEN_ExpenseTenantSettings) @optional() private readonly baseUrl = \"\") {\n }\n\n /**\n * Get the tenant's current expense vendor-matching settings, or the default\n (`MapToServiceTitanVendors`) when no settings row exists yet.\n */\n getSettings(tenantId: number, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n url: url_,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n\n /**\n * Full-replace upsert of the tenant's expense vendor-matching settings.\n */\n putSettings(tenantId: number, request: UpdateExpenseTenantSettingsRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n\n /**\n * Partial update of the tenant's expense vendor-matching settings. Loads the current state (or the\n not-yet-onboarded default when no row exists), applies the JSON Patch on top, then routes the\n complete resulting state through the same PutSettings validation and upsert — so a\n patch that switches to `UseDefaultVendor` must still leave a valid active\n `DefaultVendorId`, omitted fields keep their current value, and switching to\n `MapToServiceTitanVendors` preserves `DefaultVendorId` unless the patch explicitly\n clears it.\n */\n patchSettings(tenantId: number, operations: OperationOfUpdateExpenseTenantSettingsRequest[], cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = operations;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n\n /**\n * Set the tenant's card-transactions onboarding status (PYB-3416). Touches only that field — the\n vendor-matching and receipt settings are left unchanged — and creates the not-yet-onboarded\n settings row if the tenant has none.\n */\n setOnboardingStatus(tenantId: number, request: SetExpenseOnboardingStatusRequest, cancelToken?: CancelToken): AxiosPromise<ExpenseTenantSettingsResponse> {\n let url_ = \"/v1/tenant/{tenantId}/expense-settings/onboarding-status\";\n if (tenantId === undefined || tenantId === null)\n throw new Error(\"The parameter 'tenantId' must be defined.\");\n url_ = url_.replace(\"{tenantId}\", encodeURIComponent(\"\" + tenantId));\n url_ = url_.replace(/[?&]$/, \"\");\n\n const content_ = request;\n\n let options_ = <AxiosRequestConfig>{\n baseURL: this.baseUrl,\n cancelToken,\n data: content_,\n url: url_,\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n };\n\n return makeCodedException(axios.request<ExpenseTenantSettingsResponse>(options_));\n }\n}\n\nexport interface ExpenseTenantSettingsResponse {\n vendorMatchingMode: VendorMatchingMode;\n defaultVendorId?: number | undefined;\n requireReceipt: boolean;\n requireReceiptThresholdAmount?: number | undefined;\n /** Read-only here; set through `PUT expense-settings/onboarding-status`. */\n onboardingStatus: ExpenseOnboardingStatus;\n}\n\n/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.VendorMatchingMode` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */\nexport enum VendorMatchingMode {\n MapToServiceTitanVendors = 0,\n UseDefaultVendor = 1,\n}\n\n/** Public-API mirror of `ServiceTitan.Fintech.MoneyoutService.Domain.Expenses.ExpenseOnboardingStatus` — Core.Models must not reference Domain, so the two enums are kept in lockstep by name. */\nexport enum ExpenseOnboardingStatus {\n NotStarted = 0,\n InProgress = 1,\n Completed = 2,\n Dismissed = 3,\n}\n\nexport interface UpdateExpenseTenantSettingsRequest {\n vendorMatchingMode: VendorMatchingMode;\n defaultVendorId?: number | undefined;\n requireReceipt: boolean;\n requireReceiptThresholdAmount?: number | undefined;\n}\n\nexport interface SetExpenseOnboardingStatusRequest {\n onboardingStatus: ExpenseOnboardingStatus;\n}\n\nexport interface OperationBase {\n path?: string | undefined;\n op?: string | undefined;\n from?: string | undefined;\n}\n\nexport interface Operation extends OperationBase {\n value?: any;\n}\n\nexport interface OperationOfUpdateExpenseTenantSettingsRequest extends Operation {\n}\n"],"names":["axios","injectable","inject","optional","symbolToken","makeCodedException","BASE_URL_TOKEN_ExpenseTenantSettings","ExpenseTenantSettings","getSettings","tenantId","cancelToken","url_","undefined","Error","replace","encodeURIComponent","options_","baseURL","baseUrl","url","method","headers","request","putSettings","content_","data","patchSettings","operations","setOnboardingStatus","jsonParseReviver","VendorMatchingMode","ExpenseOnboardingStatus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB,GAClB,kBAAkB,GAClB,wBAAwB;AACxB,mBAAmB;AACnB,mEAAmE;AACnE,oBAAoB;AACpB,wBAAwB;AACxB,uCAAuC;AAEvC,OAAOA,WAA8D,QAAQ;AAC7E,SAASC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,0BAA0B;AACpF,SAASC,kBAAkB,QAAqB,UAAU;AAgC1D,OAAO,MAAMC,uCAAuCF,YAAoB,kBAAkB,OAAO;AAGjG,OAAO,MAAMG;IAMT;;;KAGC,GACDC,YAAYC,QAAgB,EAAEC,WAAyB,EAA+C;QAClG,IAAIC,OAAO;QACX,IAAIF,aAAaG,aAAaH,aAAa,MACvC,MAAM,IAAII,MAAM;QACpBF,OAAOA,KAAKG,OAAO,CAAC,cAAcC,mBAAmB,KAAKN;QAC1DE,OAAOA,KAAKG,OAAO,CAAC,SAAS;QAE7B,IAAIE,WAA+B;YAC/BC,SAAS,IAAI,CAACC,OAAO;YACrBR;YACAS,KAAKR;YACLS,QAAQ;YACRC,SAAS;gBACL,gBAAgB;gBAChB,UAAU;YACd;QACJ;QAEA,OAAOhB,mBAAmBL,MAAMsB,OAAO,CAAgCN;IAC3E;IAEA;;KAEC,GACDO,YAAYd,QAAgB,EAAEa,OAA2C,EAAEZ,WAAyB,E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