@tesouro/embedded-components-react 0.7.40 → 0.7.42
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.
- package/README.md +2 -2
- package/dist/index.css +11 -0
- package/dist/index.d.ts +16 -14
- package/dist/lib/CounterpartsWidget.d.ts +16 -14
- package/dist/lib/CounterpartsWidgetPublic.d.ts +16 -14
- package/dist/lib/CustomersWidget.d.ts +16 -14
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/acceptDisclosures.js +33 -28
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/mocks/labels.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/businessDetailsPanelMapping.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/bankAccountOnboarding.js +40 -22
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/mocks/labels.js +14 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +8 -10
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +274 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +30 -4
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +21 -272
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +65 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +341 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +27 -65
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +26 -341
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +72 -27
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +85 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +8 -74
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +55 -83
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +42 -37
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +30 -29
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/constants.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsTable.js +143 -95
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +60 -48
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index2.js +22 -15
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/ui/dist/index3.js +137 -135
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/expenseManagement.js +163 -140
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/mocks/labels.js +22 -16
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/labels.js +12 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js +255 -88
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +106 -108
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +0 -64
package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
import { Scope as e } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
2
2
|
import "../../../../shared/data-access/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { EMPLOYEE_ROLE as
|
|
5
|
-
import { IDENTITY as
|
|
6
|
-
import { offsetPage as
|
|
7
|
-
import { SETTINGS_LABELS as
|
|
3
|
+
import { AN_APPROVAL_POLICY as t, AN_ORGANIZATION as n, AN_ORGANIZATION_ROLE as r, AN_ORGANIZATION_USER as i, A_DISCLOSURES_SET as a } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
|
|
4
|
+
import { EMPLOYEE_ROLE as o, ENGINEERING as s, GRACE as c, HEADQUARTERS as l, REMOTE as ee, SALES as u, SAM as d, TEAM as f, TYLER as p, teamId as m } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/team.js";
|
|
5
|
+
import { FINOPS as h, IDENTITY as g, bodyOf as _, endpoint as v, initRoute as y, json as b, noContent as x, problem as S, wait as C } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
|
|
6
|
+
import { finopsOffsetPage as w, offsetPage as te, sortRows as ne } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/worlds.js";
|
|
7
|
+
import { SETTINGS_LABELS as T } from "./labels.js";
|
|
8
8
|
//#region ../../libs/tesouro-embedded-components-react/settings-widget/feature/dist/mocks/settings.js
|
|
9
|
-
var
|
|
10
|
-
id:
|
|
11
|
-
organizationId:
|
|
12
|
-
name:
|
|
13
|
-
email:
|
|
9
|
+
var E = "Example Bank", D = "https://example.test/support", O = r, k = [O, o], A = {
|
|
10
|
+
id: i.id,
|
|
11
|
+
organizationId: n.id,
|
|
12
|
+
name: i.name,
|
|
13
|
+
email: i.email,
|
|
14
14
|
phoneNumber: "+12175550142",
|
|
15
15
|
isAuthorizedSigner: !0,
|
|
16
16
|
permissions: [],
|
|
17
|
-
role:
|
|
17
|
+
role: O.key,
|
|
18
18
|
status: "ACTIVE"
|
|
19
|
-
},
|
|
20
|
-
...
|
|
19
|
+
}, j = {
|
|
20
|
+
...n,
|
|
21
21
|
phoneNumber: "+12175550100"
|
|
22
|
-
},
|
|
23
|
-
...
|
|
22
|
+
}, M = {
|
|
23
|
+
...a,
|
|
24
24
|
accepted: !0,
|
|
25
|
-
disclosures: (
|
|
25
|
+
disclosures: (a.disclosures ?? []).map((e) => ({
|
|
26
26
|
...e,
|
|
27
27
|
accepted: !0
|
|
28
28
|
}))
|
|
29
|
-
},
|
|
29
|
+
}, N = {
|
|
30
30
|
tokenParam: "PaginationToken",
|
|
31
31
|
next: "nextPaginationToken",
|
|
32
32
|
prev: "prevPaginationToken"
|
|
33
33
|
};
|
|
34
|
-
function
|
|
34
|
+
function P(e, t) {
|
|
35
35
|
let n = t.has("paginationToken") ? {
|
|
36
|
-
...
|
|
36
|
+
...N,
|
|
37
37
|
tokenParam: "paginationToken"
|
|
38
|
-
} :
|
|
39
|
-
return
|
|
38
|
+
} : N;
|
|
39
|
+
return te(e, t, {
|
|
40
40
|
paging: n,
|
|
41
41
|
defaultLimit: 100
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let t =
|
|
47
|
-
departments: [
|
|
48
|
-
locations: [
|
|
44
|
+
var F = (e) => `${g}${e}`, I = 500;
|
|
45
|
+
function L({ canWrite: e }) {
|
|
46
|
+
let t = f.map((e) => ({ ...e })), n = {
|
|
47
|
+
departments: [s, u].map((e) => ({ ...e })),
|
|
48
|
+
locations: [l, ee].map((e) => ({ ...e }))
|
|
49
49
|
}, r = 0, i = {
|
|
50
50
|
departments: "department",
|
|
51
51
|
locations: "location"
|
|
52
|
-
}, a = (e, n) => t.filter((t) => t[i[e]]?.id === n),
|
|
52
|
+
}, a = (e, n) => t.filter((t) => t[i[e]]?.id === n), o = (e) => (t) => ({
|
|
53
53
|
...t,
|
|
54
54
|
memberCount: a(e, t.id).length
|
|
55
|
-
}),
|
|
56
|
-
let
|
|
55
|
+
}), c = () => S(403, "Forbidden", "This token cannot change the team."), p = (t, n, r) => v(t, F(n), async (t, n) => e ? (await C(I), r(t, n)) : c()), h = (e) => !e || e === "ALL" ? t : t.filter((t) => t.status === e), g = (e) => {
|
|
56
|
+
let c = `/${e}`;
|
|
57
57
|
return [
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
v("GET", F(c), ({ query: t }) => b(P(n[e].map(o(e)), t))),
|
|
59
|
+
v("GET", F(`${c}/:id`), ({ query: t }, { id: r }) => {
|
|
60
60
|
let i = n[e].find((e) => e.id === r);
|
|
61
|
-
return i ?
|
|
61
|
+
return i ? b({
|
|
62
62
|
...i,
|
|
63
|
-
members:
|
|
63
|
+
members: P(a(e, r).map((e) => ({
|
|
64
64
|
id: e.id,
|
|
65
65
|
name: e.name,
|
|
66
66
|
email: e.email,
|
|
@@ -69,25 +69,25 @@ function P({ canWrite: e }) {
|
|
|
69
69
|
createdDateTime: e.createdDateTime,
|
|
70
70
|
lastLoggedInDateTime: e.lastLoggedInDateTime
|
|
71
71
|
})), t)
|
|
72
|
-
}) :
|
|
72
|
+
}) : S(404, "Not Found", "No such group.");
|
|
73
73
|
}),
|
|
74
|
-
|
|
74
|
+
p("POST", c, (t) => {
|
|
75
75
|
r += 1;
|
|
76
76
|
let i = {
|
|
77
|
-
...
|
|
78
|
-
id:
|
|
79
|
-
name:
|
|
77
|
+
...s,
|
|
78
|
+
id: m(20 + r),
|
|
79
|
+
name: _(t)?.name ?? "New group",
|
|
80
80
|
memberCount: 0
|
|
81
81
|
};
|
|
82
|
-
return n[e] = [...n[e], i],
|
|
82
|
+
return n[e] = [...n[e], i], b(i, 201);
|
|
83
83
|
}),
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
p("PUT", `${c}/:id`, (t, { id: n }) => y(e, t, n)),
|
|
85
|
+
p("DELETE", `${c}/:id`, (r, { id: a }) => (n[e] = n[e].filter((e) => e.id !== a), t = t.map((t) => t[i[e]]?.id === a ? {
|
|
86
86
|
...t,
|
|
87
87
|
[i[e]]: null
|
|
88
|
-
} : t),
|
|
89
|
-
|
|
90
|
-
let o = n[e].find((e) => e.id === a), s =
|
|
88
|
+
} : t), x())),
|
|
89
|
+
p("POST", `${c}/:id/members`, (r, { id: a }) => {
|
|
90
|
+
let o = n[e].find((e) => e.id === a), s = _(r);
|
|
91
91
|
return !o || !s?.userIds || (t = t.map((t) => {
|
|
92
92
|
if (!s.userIds?.includes(t.id)) return t;
|
|
93
93
|
let n = s.type === "REMOVE" ? null : {
|
|
@@ -98,35 +98,35 @@ function P({ canWrite: e }) {
|
|
|
98
98
|
...t,
|
|
99
99
|
[i[e]]: n
|
|
100
100
|
};
|
|
101
|
-
})),
|
|
101
|
+
})), x();
|
|
102
102
|
})
|
|
103
103
|
];
|
|
104
|
-
},
|
|
105
|
-
let
|
|
106
|
-
n[e] = n[e].map((e) => e.id === a &&
|
|
104
|
+
}, y = (e, r, a) => {
|
|
105
|
+
let s = _(r)?.name;
|
|
106
|
+
n[e] = n[e].map((e) => e.id === a && s ? {
|
|
107
107
|
...e,
|
|
108
|
-
name:
|
|
109
|
-
} : e), t = t.map((t) => t[i[e]]?.id === a &&
|
|
108
|
+
name: s
|
|
109
|
+
} : e), t = t.map((t) => t[i[e]]?.id === a && s ? {
|
|
110
110
|
...t,
|
|
111
111
|
[i[e]]: {
|
|
112
112
|
id: a,
|
|
113
|
-
name:
|
|
113
|
+
name: s
|
|
114
114
|
}
|
|
115
115
|
} : t);
|
|
116
|
-
let
|
|
117
|
-
return
|
|
116
|
+
let c = n[e].find((e) => e.id === a);
|
|
117
|
+
return c ? b(o(e)(c)) : S(404, "Not Found", "");
|
|
118
118
|
};
|
|
119
119
|
return [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
let n =
|
|
128
|
-
...
|
|
129
|
-
id:
|
|
120
|
+
v("GET", F("/users/me"), () => b(A)),
|
|
121
|
+
v("GET", F("/organizations/:id"), () => b(j)),
|
|
122
|
+
v("GET", F("/disclosures"), () => b(M)),
|
|
123
|
+
v("GET", F("/users"), ({ query: e }) => b(P(h(e.get("Status")), e))),
|
|
124
|
+
v("GET", F("/roles"), ({ query: e }) => b(P(k, e))),
|
|
125
|
+
v("GET", F("/roles/:id/permissions"), () => b({ data: [] })),
|
|
126
|
+
p("POST", "/users", (e) => {
|
|
127
|
+
let n = _(e), i = t.find((e) => e.email === n.email), a = i ?? {
|
|
128
|
+
...d,
|
|
129
|
+
id: m(30 + (r += 1)),
|
|
130
130
|
name: n.name || "New member",
|
|
131
131
|
email: n.email || "new.member@example.test",
|
|
132
132
|
jobTitle: n.jobTitle ?? null,
|
|
@@ -134,7 +134,7 @@ function P({ canWrite: e }) {
|
|
|
134
134
|
role: null,
|
|
135
135
|
createdDateTime: (/* @__PURE__ */ new Date()).toISOString()
|
|
136
136
|
};
|
|
137
|
-
return i || (t = [...t, a]),
|
|
137
|
+
return i || (t = [...t, a]), b({
|
|
138
138
|
id: a.id,
|
|
139
139
|
createdAt: a.createdDateTime,
|
|
140
140
|
email: a.email,
|
|
@@ -145,57 +145,224 @@ function P({ canWrite: e }) {
|
|
|
145
145
|
status: a.status
|
|
146
146
|
}, 201);
|
|
147
147
|
}),
|
|
148
|
-
|
|
149
|
-
let r =
|
|
148
|
+
p("PATCH", "/users/:id", (e, { id: n }) => {
|
|
149
|
+
let r = _(e);
|
|
150
150
|
t = t.map((e) => e.id === n ? {
|
|
151
151
|
...e,
|
|
152
152
|
...r,
|
|
153
153
|
id: n
|
|
154
154
|
} : e);
|
|
155
155
|
let i = t.find((e) => e.id === n);
|
|
156
|
-
return i ?
|
|
156
|
+
return i ? b(i) : S(404, "Not Found", "No such user.");
|
|
157
157
|
}),
|
|
158
|
-
|
|
158
|
+
p("POST", "/users/:id/disable", (e, { id: n }) => (t = t.map((e) => e.id === n ? {
|
|
159
159
|
...e,
|
|
160
160
|
status: "INACTIVE"
|
|
161
|
-
} : e),
|
|
161
|
+
} : e), b({
|
|
162
162
|
userId: n,
|
|
163
163
|
isEnabled: !1
|
|
164
164
|
}))),
|
|
165
|
-
|
|
166
|
-
let r =
|
|
165
|
+
p("POST", "/roles/:id/members", (e, { id: n }) => {
|
|
166
|
+
let r = k.find((e) => e.id === n), i = _(e);
|
|
167
167
|
return r && i?.userIds && (t = t.map((e) => i.userIds?.includes(e.id) ? {
|
|
168
168
|
...e,
|
|
169
169
|
role: i.type === "REMOVE" ? null : r.key
|
|
170
|
-
} : e)),
|
|
170
|
+
} : e)), x();
|
|
171
|
+
}),
|
|
172
|
+
...g("departments"),
|
|
173
|
+
...g("locations")
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
var R = (e) => `${h}${e}`, z = (e) => `00000000-0000-4000-8000-000000000${String(600 + e).padStart(3, "0")}`, B = "{event_name == 'submitted_for_approval'}", V = (e, t, n) => ({
|
|
177
|
+
operator: t,
|
|
178
|
+
left_operand: { name: e },
|
|
179
|
+
right_operand: n
|
|
180
|
+
}), H = (e, n) => ({
|
|
181
|
+
...t,
|
|
182
|
+
id: z(e),
|
|
183
|
+
priority: e,
|
|
184
|
+
...n
|
|
185
|
+
}), U = (e, t) => ({ all: [
|
|
186
|
+
B,
|
|
187
|
+
V("invoice.amount", ">=", e),
|
|
188
|
+
...t === void 0 ? [] : [V("invoice.amount", "<=", t)],
|
|
189
|
+
V("invoice.currency", "==", "USD")
|
|
190
|
+
] }), W = (e) => [{
|
|
191
|
+
if: {
|
|
192
|
+
run_concurrently: !0,
|
|
193
|
+
all: e.map((e) => ({
|
|
194
|
+
call: "role_ids" in e ? "ApprovalRequests.request_approval_by_role" : "ApprovalRequests.request_approval_by_users",
|
|
195
|
+
params: {
|
|
196
|
+
...e,
|
|
197
|
+
required_approval_count: 1
|
|
198
|
+
}
|
|
199
|
+
}))
|
|
200
|
+
},
|
|
201
|
+
then: ["{Payables.approve(invoice.id)}"],
|
|
202
|
+
else: ["{Payables.reject(invoice.id)}"]
|
|
203
|
+
}], G = [H(1, {
|
|
204
|
+
name: "Bills up to $500",
|
|
205
|
+
object_type: "payable",
|
|
206
|
+
trigger: U(0, 5e4),
|
|
207
|
+
script: W([{ user_ids: [p.id, c.id] }])
|
|
208
|
+
}), H(2, {
|
|
209
|
+
name: "Bills $1,000 and above",
|
|
210
|
+
object_type: "payable",
|
|
211
|
+
trigger: U(1e5),
|
|
212
|
+
script: W([{ user_ids: [c.id] }, { role_ids: [O.id] }])
|
|
213
|
+
})], K = [
|
|
214
|
+
H(3, {
|
|
215
|
+
name: "Less than $100",
|
|
216
|
+
object_type: "transaction",
|
|
217
|
+
trigger: { all: [B, V("transaction.amount", "<", 1e4)] },
|
|
218
|
+
script: ["{Transactions.approve(transaction.id)}"]
|
|
219
|
+
}),
|
|
220
|
+
H(4, {
|
|
221
|
+
name: "$100–$1000",
|
|
222
|
+
object_type: "transaction",
|
|
223
|
+
trigger: { all: [
|
|
224
|
+
B,
|
|
225
|
+
V("transaction.amount", ">=", 1e4),
|
|
226
|
+
V("transaction.amount", "<", 1e5)
|
|
227
|
+
] },
|
|
228
|
+
script: [{
|
|
229
|
+
if: { any: [{
|
|
230
|
+
call: "ApprovalRequests.request_approval_from_reporting_manager",
|
|
231
|
+
params: { required_approval_count: 1 }
|
|
232
|
+
}] },
|
|
233
|
+
then: ["{Transactions.approve(transaction.id)}"],
|
|
234
|
+
else: ["{Transactions.reject(transaction.id)}"]
|
|
235
|
+
}]
|
|
236
|
+
}),
|
|
237
|
+
H(5, {
|
|
238
|
+
name: "$1000 or more",
|
|
239
|
+
object_type: "transaction",
|
|
240
|
+
trigger: { all: [B, V("transaction.amount", ">=", 1e5)] },
|
|
241
|
+
script: t.script
|
|
242
|
+
})
|
|
243
|
+
], q = { required_fields: [{
|
|
244
|
+
field: "receipt_id",
|
|
245
|
+
amount_threshold: 7500
|
|
246
|
+
}, {
|
|
247
|
+
field: "description",
|
|
248
|
+
amount_threshold: 2e4
|
|
249
|
+
}] }, J = (e, t, n, r, i = !1) => ({
|
|
250
|
+
id: z(20 + e),
|
|
251
|
+
created_at: "2026-01-15T09:00:00.000Z",
|
|
252
|
+
updated_at: "2026-01-15T09:00:00.000Z",
|
|
253
|
+
name: t,
|
|
254
|
+
nominal_code: n,
|
|
255
|
+
description: r,
|
|
256
|
+
type: "expense",
|
|
257
|
+
status: "active",
|
|
258
|
+
is_bank_account: !1,
|
|
259
|
+
is_external: i,
|
|
260
|
+
currency: "USD"
|
|
261
|
+
}), Y = [
|
|
262
|
+
J(1, "Travel", "6200", "Flights, hotels and ground transport"),
|
|
263
|
+
J(2, "Meals & entertainment", "6300", "Client and team meals"),
|
|
264
|
+
J(3, "Software", "6500", "SaaS subscriptions and licences"),
|
|
265
|
+
J(4, "Office supplies", "6600", "Stationery and small equipment"),
|
|
266
|
+
J(5, "Rent", "6100", "Synced from QuickBooks", !0)
|
|
267
|
+
];
|
|
268
|
+
function X() {
|
|
269
|
+
let e = [...G, ...K].map((e) => ({ ...e })), n = { ...q }, r = Y.map((e) => ({ ...e })), i = 0, a = (e, t, n) => v(e, R(t), async (e, t) => (await C(I), n(e, t)));
|
|
270
|
+
return [
|
|
271
|
+
v("GET", R("/approval-policies"), ({ query: t }) => {
|
|
272
|
+
let n = t.get("object_type");
|
|
273
|
+
return b(w(e.filter((e) => !n || e.object_type === n), t));
|
|
274
|
+
}),
|
|
275
|
+
a("POST", "/approval-policies", (n) => {
|
|
276
|
+
let r = _(n), a = {
|
|
277
|
+
...t,
|
|
278
|
+
...r,
|
|
279
|
+
id: z(40 + (i += 1)),
|
|
280
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
281
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
282
|
+
};
|
|
283
|
+
return e = [...e, a], b(a, 201);
|
|
284
|
+
}),
|
|
285
|
+
a("PATCH", "/approval-policies/:id", (t, { id: n }) => {
|
|
286
|
+
let r = _(t);
|
|
287
|
+
e = e.map((e) => e.id === n ? {
|
|
288
|
+
...e,
|
|
289
|
+
...r,
|
|
290
|
+
id: n
|
|
291
|
+
} : e);
|
|
292
|
+
let i = e.find((e) => e.id === n);
|
|
293
|
+
return i ? b(i) : S(404, "Not Found", "No such policy.");
|
|
294
|
+
}),
|
|
295
|
+
a("DELETE", "/approval-policies/:id", (t, { id: n }) => (e = e.filter((e) => e.id !== n), x())),
|
|
296
|
+
v("GET", R("/transactions/validations"), () => b(n)),
|
|
297
|
+
a("PUT", "/transactions/validations", (e) => (n = {
|
|
298
|
+
...n,
|
|
299
|
+
..._(e)
|
|
300
|
+
}, b(n))),
|
|
301
|
+
v("GET", R("/ledger-accounts"), ({ query: e }) => {
|
|
302
|
+
let t = ne(r, (e) => e.name ?? "", e.get("order"));
|
|
303
|
+
return b({
|
|
304
|
+
...w(t, e),
|
|
305
|
+
total_count: t.length
|
|
306
|
+
});
|
|
307
|
+
}),
|
|
308
|
+
a("POST", "/ledger-accounts", (e) => {
|
|
309
|
+
let t = _(e), n = {
|
|
310
|
+
...J(10 + (i += 1), "", "", ""),
|
|
311
|
+
...t
|
|
312
|
+
};
|
|
313
|
+
return r = [...r, n], b(n, 201);
|
|
314
|
+
}),
|
|
315
|
+
a("PATCH", "/ledger-accounts/:id", (e, { id: t }) => {
|
|
316
|
+
let n = _(e);
|
|
317
|
+
r = r.map((e) => e.id === t ? {
|
|
318
|
+
...e,
|
|
319
|
+
...n,
|
|
320
|
+
id: t
|
|
321
|
+
} : e);
|
|
322
|
+
let i = r.find((e) => e.id === t);
|
|
323
|
+
return i ? b(i) : S(404, "Not Found", "No such ledger account.");
|
|
171
324
|
}),
|
|
172
|
-
|
|
173
|
-
...C("locations")
|
|
325
|
+
a("DELETE", "/ledger-accounts/:id", (e, { id: t }) => (r = r.filter((e) => e.id !== t), x()))
|
|
174
326
|
];
|
|
175
327
|
}
|
|
176
|
-
var
|
|
328
|
+
var Z = [
|
|
177
329
|
e.UserReadOrg,
|
|
178
330
|
e.RoleReadOrg,
|
|
179
331
|
e.UserWriteOrg,
|
|
180
332
|
e.OrganizationReadOrg
|
|
181
|
-
],
|
|
333
|
+
], re = [e.UserReadOrg, e.RoleReadOrg], Q = [
|
|
334
|
+
...Z,
|
|
335
|
+
e.ApprovalPolicyReadOrg,
|
|
336
|
+
e.ApprovalPolicyWriteOrg,
|
|
337
|
+
e.ExpenseWriteOrg,
|
|
338
|
+
e.PayableWriteOrg,
|
|
339
|
+
e.AccountingConfigReadOrg,
|
|
340
|
+
e.AccountingConfigWriteOrg
|
|
341
|
+
], $ = (t, n, r) => ({
|
|
182
342
|
key: t,
|
|
183
|
-
...
|
|
184
|
-
routes: () => [
|
|
343
|
+
...T.scenarios[t],
|
|
344
|
+
routes: () => [
|
|
345
|
+
y(n, { bankName: E }),
|
|
346
|
+
...L({ canWrite: n.includes(e.UserWriteOrg) }),
|
|
347
|
+
...X()
|
|
348
|
+
],
|
|
185
349
|
props: {
|
|
186
|
-
profileContactUrl:
|
|
350
|
+
profileContactUrl: D,
|
|
187
351
|
...r
|
|
188
352
|
}
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
353
|
+
}), ie = [
|
|
354
|
+
$("team", Z, { defaultSelectedSection: "team" }),
|
|
355
|
+
$("profile", Z, { defaultSelectedSection: "profile" }),
|
|
356
|
+
$("legal", Z, { defaultSelectedSection: "legal" }),
|
|
357
|
+
$("help", Z, {
|
|
194
358
|
defaultSelectedSection: "help",
|
|
195
|
-
helpContactUrl:
|
|
359
|
+
helpContactUrl: D
|
|
196
360
|
}),
|
|
197
|
-
|
|
198
|
-
|
|
361
|
+
$("read-only-team", re, { defaultSelectedSection: "team" }),
|
|
362
|
+
$("no-team", [], { defaultSelectedSection: "team" }),
|
|
363
|
+
$("expense", Q, { defaultSelectedSection: "expense" }),
|
|
364
|
+
$("bill-pay", Q, { defaultSelectedSection: "bill-pay" }),
|
|
365
|
+
$("accounting", Q, { defaultSelectedSection: "accounting" })
|
|
199
366
|
];
|
|
200
367
|
//#endregion
|
|
201
|
-
export {
|
|
368
|
+
export { ie as settingsScenarios };
|