@friggframework/core 2.0.0--canary.700.80ec1cc.0 → 2.0.0--canary.702.047d3c4.0
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/database/documentdb-utils.js +1 -6
- package/errors/index.js +0 -4
- package/generated/prisma-mongodb/edge.js +4 -52
- package/generated/prisma-mongodb/index-browser.js +1 -49
- package/generated/prisma-mongodb/index.d.ts +60 -3506
- package/generated/prisma-mongodb/index.js +4 -52
- package/generated/prisma-mongodb/package.json +1 -1
- package/generated/prisma-mongodb/schema.prisma +0 -65
- package/generated/prisma-mongodb/wasm.js +4 -52
- package/generated/prisma-postgresql/edge.js +4 -52
- package/generated/prisma-postgresql/index-browser.js +1 -49
- package/generated/prisma-postgresql/index.d.ts +94 -3824
- package/generated/prisma-postgresql/index.js +4 -52
- package/generated/prisma-postgresql/package.json +1 -1
- package/generated/prisma-postgresql/schema.prisma +0 -63
- package/generated/prisma-postgresql/wasm.js +4 -52
- package/handlers/WEBHOOKS.md +0 -29
- package/handlers/app-definition-loader.js +9 -2
- package/handlers/app-handler-helpers.js +2 -5
- package/handlers/integration-event-dispatcher.js +3 -7
- package/handlers/routers/integration-webhook-routers.js +38 -26
- package/index.js +0 -2
- package/integrations/integration-base.js +1 -162
- package/integrations/integration-router.js +1 -6
- package/integrations/repositories/integration-mapping-repository-documentdb.js +0 -50
- package/integrations/repositories/integration-mapping-repository-interface.js +0 -15
- package/integrations/repositories/integration-mapping-repository-mongo.js +0 -29
- package/integrations/repositories/integration-mapping-repository-postgres.js +0 -30
- package/integrations/repositories/integration-mapping-repository.js +0 -29
- package/integrations/repositories/integration-repository-documentdb.js +2 -6
- package/integrations/repositories/integration-repository-interface.js +0 -3
- package/integrations/repositories/integration-repository-mongo.js +5 -20
- package/integrations/repositories/integration-repository-postgres.js +1 -5
- package/integrations/repositories/process-repository-mongo.js +1 -1
- package/integrations/use-cases/create-integration.js +4 -14
- package/integrations/use-cases/delete-integration-for-user.js +4 -4
- package/integrations/use-cases/get-integration-for-user.js +2 -4
- package/integrations/use-cases/get-integration-instance.js +4 -4
- package/integrations/use-cases/get-integrations-for-user.js +4 -4
- package/integrations/use-cases/get-possible-integrations.js +2 -7
- package/integrations/use-cases/update-integration.js +4 -4
- package/package.json +6 -6
- package/prisma-mongodb/schema.prisma +0 -65
- package/prisma-postgresql/schema.prisma +0 -63
- package/queues/queuer-util.js +2 -9
- package/errors/mapping-already-exists-error.js +0 -14
- package/handlers/workers/integration-triggers.js +0 -25
- package/infrastructure/scheduler/recurrence.js +0 -204
- package/integrations/definitions/README.md +0 -278
- package/integrations/definitions/canonical.js +0 -11
- package/integrations/definitions/capabilities/AUDIT.md +0 -480
- package/integrations/definitions/capabilities/acmeerp.capabilities.json +0 -633
- package/integrations/definitions/capabilities/asana.capabilities.json +0 -279
- package/integrations/definitions/capabilities/calendly.capabilities.json +0 -385
- package/integrations/definitions/capabilities/docusign.capabilities.json +0 -314
- package/integrations/definitions/capabilities/fathom.capabilities.json +0 -238
- package/integrations/definitions/capabilities/github.capabilities.json +0 -585
- package/integrations/definitions/capabilities/hubspot.capabilities.json +0 -822
- package/integrations/definitions/capabilities/jira.capabilities.json +0 -391
- package/integrations/definitions/capabilities/klaviyo.capabilities.json +0 -503
- package/integrations/definitions/capabilities/linear.capabilities.json +0 -378
- package/integrations/definitions/capabilities/netsuite.capabilities.json +0 -535
- package/integrations/definitions/capabilities/notion.capabilities.json +0 -208
- package/integrations/definitions/capabilities/phone.capabilities.json +0 -511
- package/integrations/definitions/capabilities/pipedrive.capabilities.json +0 -430
- package/integrations/definitions/capabilities/quickbooks.capabilities.json +0 -635
- package/integrations/definitions/capabilities/salesforce.capabilities.json +0 -568
- package/integrations/definitions/capabilities/shopify.capabilities.json +0 -1128
- package/integrations/definitions/capabilities/slack.capabilities.json +0 -373
- package/integrations/definitions/capabilities/stripe.capabilities.json +0 -630
- package/integrations/definitions/capabilities/webflow.capabilities.json +0 -196
- package/integrations/definitions/capabilities/zendesk.capabilities.json +0 -422
- package/integrations/definitions/compile.js +0 -80
- package/integrations/definitions/config-form.js +0 -137
- package/integrations/definitions/examples/acme-erp-quickbooks.definition.json +0 -467
- package/integrations/definitions/examples/asana-slack.definition.json +0 -219
- package/integrations/definitions/examples/calendly-salesforce.definition.json +0 -459
- package/integrations/definitions/examples/docusign-salesforce.definition.json +0 -305
- package/integrations/definitions/examples/fathom-hubspot-notion.definition.json +0 -575
- package/integrations/definitions/examples/github-linear.definition.json +0 -322
- package/integrations/definitions/examples/hubspot-slack.definition.json +0 -427
- package/integrations/definitions/examples/klaviyo-hubspot.definition.json +0 -336
- package/integrations/definitions/examples/phone-hubspot.definition.json +0 -633
- package/integrations/definitions/examples/pipedrive-hubspot.definition.json +0 -136
- package/integrations/definitions/examples/pipedrive-phone.definition.json +0 -340
- package/integrations/definitions/examples/records/phone-hubspot.definition-version.json +0 -652
- package/integrations/definitions/examples/records/phone-hubspot.integration.json +0 -86
- package/integrations/definitions/examples/records/phone-hubspot.mappings.json +0 -39
- package/integrations/definitions/examples/records/phone-hubspot.workflow-run.json +0 -62
- package/integrations/definitions/examples/shopify-klaviyo.definition.json +0 -488
- package/integrations/definitions/examples/shopify-netsuite.definition.json +0 -622
- package/integrations/definitions/examples/stripe-quickbooks.definition.json +0 -476
- package/integrations/definitions/examples/webflow-hubspot-slack.definition.json +0 -262
- package/integrations/definitions/examples/zendesk-jira.definition.json +0 -604
- package/integrations/definitions/expressions.js +0 -229
- package/integrations/definitions/index.js +0 -45
- package/integrations/definitions/integration-runtime.js +0 -763
- package/integrations/definitions/interpreter.js +0 -104
- package/integrations/definitions/manifests.js +0 -177
- package/integrations/definitions/renderers/common.js +0 -67
- package/integrations/definitions/renderers/html.js +0 -129
- package/integrations/definitions/renderers/hubspot.js +0 -59
- package/integrations/definitions/renderers/preview.js +0 -154
- package/integrations/definitions/renderers/slack.js +0 -146
- package/integrations/definitions/repositories/definition-version-repository.js +0 -67
- package/integrations/definitions/repositories/workflow-run-repository.js +0 -80
- package/integrations/definitions/router.js +0 -170
- package/integrations/definitions/runtime.js +0 -268
- package/integrations/definitions/schema/capability-manifest.v0.1.schema.json +0 -549
- package/integrations/definitions/schema/installation.v0.1.schema.json +0 -130
- package/integrations/definitions/schema/integration-definition.v0.1.schema.json +0 -909
- package/integrations/definitions/schema/records.md +0 -105
- package/integrations/definitions/schema-check.js +0 -58
- package/integrations/definitions/scripts/check-manifests.js +0 -220
- package/integrations/definitions/scripts/validate.js +0 -66
- package/integrations/definitions/steps.js +0 -123
- package/integrations/definitions/sync-engine.js +0 -297
- package/integrations/definitions/tests/helpers-fake-crm.js +0 -49
- package/integrations/definitions/transforms.js +0 -91
- package/integrations/definitions/use-cases/definition-use-cases.js +0 -245
- package/integrations/definitions/validate.js +0 -436
- package/integrations/definitions/versioning.js +0 -176
- package/integrations/definitions/webhooks.js +0 -119
- package/integrations/integration-types.js +0 -64
- package/integrations/triggers.js +0 -244
- package/integrations/use-cases/run-trigger-tick.js +0 -155
- package/integrations/use-cases/run-trigger.js +0 -77
- package/prisma-postgresql/migrations/20261018000000_add_data_defined_integrations/migration.sql +0 -66
- package/prisma-postgresql/migrations/20261019000000_workflow_run_waits/migration.sql +0 -7
- package/prisma-postgresql/migrations/20261019120000_definition_workspace/migration.sql +0 -5
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://friggframework.org/schemas/integration-definition/v0.1.json",
|
|
3
|
-
"schemaVersion": "0.1",
|
|
4
|
-
"id": "stripe-quickbooks",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"display": {
|
|
7
|
-
"label": "Stripe \u2192 QuickBooks Online",
|
|
8
|
-
"description": "Book every Stripe payment as a QuickBooks sales receipt, refunds as refund receipts, keep customers matched, and reconcile each night's payouts into deposits net of Stripe fees.",
|
|
9
|
-
"category": "Accounting",
|
|
10
|
-
"tags": [
|
|
11
|
-
"payments",
|
|
12
|
-
"accounting",
|
|
13
|
-
"reconciliation"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"modules": {
|
|
17
|
-
"stripe": {
|
|
18
|
-
"module": "stripe",
|
|
19
|
-
"version": "^2.3"
|
|
20
|
-
},
|
|
21
|
-
"quickbooks": {
|
|
22
|
-
"module": "quickbooks",
|
|
23
|
-
"version": "^2.0"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"settings": {
|
|
27
|
-
"clearingAccount": {
|
|
28
|
-
"type": "option",
|
|
29
|
-
"options": "quickbooks.account",
|
|
30
|
-
"label": "Book Stripe payments to (a Stripe clearing account)",
|
|
31
|
-
"required": true,
|
|
32
|
-
"help": "Payouts move money from this account to your bank."
|
|
33
|
-
},
|
|
34
|
-
"salesItem": {
|
|
35
|
-
"type": "option",
|
|
36
|
-
"options": "quickbooks.item",
|
|
37
|
-
"label": "Product/service for Stripe payments",
|
|
38
|
-
"required": true
|
|
39
|
-
},
|
|
40
|
-
"guestCustomer": {
|
|
41
|
-
"type": "option",
|
|
42
|
-
"options": "quickbooks.customer",
|
|
43
|
-
"label": "Customer for payments without a Stripe customer",
|
|
44
|
-
"help": "For example \"Stripe guest checkout\"."
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"syncs": [
|
|
48
|
-
{
|
|
49
|
-
"id": "customers",
|
|
50
|
-
"label": "Customers",
|
|
51
|
-
"source": "stripe.customer",
|
|
52
|
-
"target": "quickbooks.customer",
|
|
53
|
-
"direction": "one_way",
|
|
54
|
-
"identity": {
|
|
55
|
-
"match": [
|
|
56
|
-
{
|
|
57
|
-
"source": "email",
|
|
58
|
-
"target": "PrimaryEmailAddr.Address",
|
|
59
|
-
"transform": "lowercase",
|
|
60
|
-
"key": "email"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"onAmbiguous": "first"
|
|
64
|
-
},
|
|
65
|
-
"mapping": [
|
|
66
|
-
{
|
|
67
|
-
"source": "name",
|
|
68
|
-
"target": "DisplayName",
|
|
69
|
-
"transform": "default",
|
|
70
|
-
"options": {
|
|
71
|
-
"value": "Stripe customer"
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"source": "name",
|
|
76
|
-
"target": "GivenName",
|
|
77
|
-
"transform": "split_full_name",
|
|
78
|
-
"options": {
|
|
79
|
-
"part": "first"
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"source": "name",
|
|
84
|
-
"target": "FamilyName",
|
|
85
|
-
"transform": "split_full_name",
|
|
86
|
-
"options": {
|
|
87
|
-
"part": "last"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"source": "email",
|
|
92
|
-
"target": "PrimaryEmailAddr.Address",
|
|
93
|
-
"transform": "lowercase"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"source": "phone",
|
|
97
|
-
"target": "PrimaryPhone.FreeFormNumber",
|
|
98
|
-
"transform": "to_e164_phone"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"source": "address.line1",
|
|
102
|
-
"target": "BillAddr.Line1"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"source": "address.city",
|
|
106
|
-
"target": "BillAddr.City"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
"source": "address.state",
|
|
110
|
-
"target": "BillAddr.CountrySubDivisionCode"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"source": "address.postal_code",
|
|
114
|
-
"target": "BillAddr.PostalCode"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"source": "address.country",
|
|
118
|
-
"target": "BillAddr.Country"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"source": "id",
|
|
122
|
-
"target": "Notes",
|
|
123
|
-
"transform": "none"
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
"backfill": {
|
|
127
|
-
"trigger": "userAction",
|
|
128
|
-
"pageSize": 100
|
|
129
|
-
},
|
|
130
|
-
"ongoing": {
|
|
131
|
-
"mode": "webhook"
|
|
132
|
-
},
|
|
133
|
-
"default": "on"
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
"workflows": [
|
|
137
|
-
{
|
|
138
|
-
"id": "payment-sales-receipt",
|
|
139
|
-
"label": "Book payments as sales receipts",
|
|
140
|
-
"description": "Each succeeded payment intent becomes one sales receipt, deposited to the Stripe clearing account.",
|
|
141
|
-
"purpose": "write",
|
|
142
|
-
"default": "on",
|
|
143
|
-
"trigger": {
|
|
144
|
-
"type": "webhook",
|
|
145
|
-
"module": "stripe",
|
|
146
|
-
"topic": "payment_intent.succeeded",
|
|
147
|
-
"filter": "$.record.metadata.quickbooks != 'skip'"
|
|
148
|
-
},
|
|
149
|
-
"steps": [
|
|
150
|
-
{
|
|
151
|
-
"id": "customer",
|
|
152
|
-
"use": "links.find",
|
|
153
|
-
"with": {
|
|
154
|
-
"sync": "customers",
|
|
155
|
-
"from": "stripe",
|
|
156
|
-
"id": "$.record.customer"
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"id": "resolveCustomer",
|
|
161
|
-
"use": "branch",
|
|
162
|
-
"cases": [
|
|
163
|
-
{
|
|
164
|
-
"when": "$.record.customer == null",
|
|
165
|
-
"do": [
|
|
166
|
-
{
|
|
167
|
-
"use": "set",
|
|
168
|
-
"with": {
|
|
169
|
-
"customerId": "$.install.guestCustomer"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
"when": "$.steps.customer == null",
|
|
176
|
-
"do": [
|
|
177
|
-
{
|
|
178
|
-
"id": "stripeCustomer",
|
|
179
|
-
"use": "stripe.customer.get",
|
|
180
|
-
"with": {
|
|
181
|
-
"id": "$.record.customer"
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
"id": "qbFields",
|
|
186
|
-
"use": "map",
|
|
187
|
-
"with": {
|
|
188
|
-
"sync": "customers",
|
|
189
|
-
"record": "$.steps.stripeCustomer"
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
"id": "qbCustomer",
|
|
194
|
-
"use": "quickbooks.customer.create",
|
|
195
|
-
"with": {
|
|
196
|
-
"customer": "$.steps.qbFields"
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"use": "links.upsert",
|
|
201
|
-
"with": {
|
|
202
|
-
"sync": "customers",
|
|
203
|
-
"ids": {
|
|
204
|
-
"stripe": "$.steps.stripeCustomer.id",
|
|
205
|
-
"quickbooks": "$.steps.qbCustomer.Id"
|
|
206
|
-
},
|
|
207
|
-
"keys": {
|
|
208
|
-
"email": "$.steps.stripeCustomer.email"
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
"use": "set",
|
|
214
|
-
"with": {
|
|
215
|
-
"customerId": "$.steps.qbCustomer.Id"
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
"else": [
|
|
222
|
-
{
|
|
223
|
-
"use": "set",
|
|
224
|
-
"with": {
|
|
225
|
-
"customerId": "$.steps.customer.quickbooks"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"use": "stop",
|
|
232
|
-
"when": "$.vars.customerId == null",
|
|
233
|
-
"with": {
|
|
234
|
-
"reason": "Guest payment and no guest customer is configured"
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
"id": "receipt",
|
|
239
|
-
"use": "map",
|
|
240
|
-
"with": {
|
|
241
|
-
"record": {
|
|
242
|
-
"paymentId": "$.record.id",
|
|
243
|
-
"amount": "{{record.amount_received | from_minor_units: record.currency}}",
|
|
244
|
-
"date": "{{record.created | from_unix | date}}",
|
|
245
|
-
"currency": "$.record.currency",
|
|
246
|
-
"description": "$.record.description",
|
|
247
|
-
"email": "$.record.receipt_email",
|
|
248
|
-
"customerId": "$.vars.customerId",
|
|
249
|
-
"depositTo": "$.install.clearingAccount",
|
|
250
|
-
"itemId": "$.install.salesItem"
|
|
251
|
-
},
|
|
252
|
-
"mapping": [
|
|
253
|
-
{
|
|
254
|
-
"source": "customerId",
|
|
255
|
-
"target": "CustomerRef.value"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
"source": "date",
|
|
259
|
-
"target": "TxnDate"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"source": "depositTo",
|
|
263
|
-
"target": "DepositToAccountRef.value"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
"source": "paymentId",
|
|
267
|
-
"target": "PaymentRefNum"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"source": "currency",
|
|
271
|
-
"target": "CurrencyRef.value",
|
|
272
|
-
"transform": "uppercase"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
"source": "email",
|
|
276
|
-
"target": "BillEmail.Address",
|
|
277
|
-
"transform": "lowercase"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"source": "description",
|
|
281
|
-
"target": "PrivateNote",
|
|
282
|
-
"transform": "default",
|
|
283
|
-
"options": {
|
|
284
|
-
"value": "Stripe payment"
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"target": "Line[0].DetailType",
|
|
289
|
-
"value": "SalesItemLineDetail"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
"source": "amount",
|
|
293
|
-
"target": "Line[0].Amount",
|
|
294
|
-
"transform": "number"
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"source": "description",
|
|
298
|
-
"target": "Line[0].Description"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"source": "itemId",
|
|
302
|
-
"target": "Line[0].SalesItemLineDetail.ItemRef.value"
|
|
303
|
-
}
|
|
304
|
-
]
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
"use": "quickbooks.salesReceipt.create",
|
|
309
|
-
"with": {
|
|
310
|
-
"salesReceipt": "$.steps.receipt"
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
],
|
|
314
|
-
"retry": {
|
|
315
|
-
"max": 6,
|
|
316
|
-
"backoff": "exponential"
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
"id": "refund-receipt",
|
|
321
|
-
"label": "Book refunds as refund receipts",
|
|
322
|
-
"purpose": "write",
|
|
323
|
-
"default": "on",
|
|
324
|
-
"trigger": {
|
|
325
|
-
"type": "webhook",
|
|
326
|
-
"module": "stripe",
|
|
327
|
-
"topic": "refund.created",
|
|
328
|
-
"filter": "$.record.status == 'succeeded' || $.record.status == 'pending'"
|
|
329
|
-
},
|
|
330
|
-
"steps": [
|
|
331
|
-
{
|
|
332
|
-
"id": "payment",
|
|
333
|
-
"use": "stripe.paymentIntent.get",
|
|
334
|
-
"with": {
|
|
335
|
-
"id": "$.record.payment_intent"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
{
|
|
339
|
-
"id": "customer",
|
|
340
|
-
"use": "links.find",
|
|
341
|
-
"with": {
|
|
342
|
-
"sync": "customers",
|
|
343
|
-
"from": "stripe",
|
|
344
|
-
"id": "$.steps.payment.customer"
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
"id": "note",
|
|
349
|
-
"use": "template",
|
|
350
|
-
"with": {
|
|
351
|
-
"id": "refund-note"
|
|
352
|
-
}
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
"use": "quickbooks.refundReceipt.create",
|
|
356
|
-
"with": {
|
|
357
|
-
"refundReceipt": {
|
|
358
|
-
"CustomerRef": {
|
|
359
|
-
"value": "{{steps.customer.quickbooks | default: install.guestCustomer}}"
|
|
360
|
-
},
|
|
361
|
-
"TxnDate": "{{record.created | from_unix | date}}",
|
|
362
|
-
"DepositToAccountRef": {
|
|
363
|
-
"value": "$.install.clearingAccount"
|
|
364
|
-
},
|
|
365
|
-
"PaymentRefNum": "$.record.id",
|
|
366
|
-
"PrivateNote": "$.steps.note",
|
|
367
|
-
"Line": [
|
|
368
|
-
{
|
|
369
|
-
"Amount": "{{record.amount | from_minor_units: record.currency}}",
|
|
370
|
-
"DetailType": "SalesItemLineDetail",
|
|
371
|
-
"SalesItemLineDetail": {
|
|
372
|
-
"ItemRef": {
|
|
373
|
-
"value": "$.install.salesItem"
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
]
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
]
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
"id": "payout-reconciliation",
|
|
385
|
-
"label": "Nightly payout reconciliation",
|
|
386
|
-
"description": "For each payout that arrived yesterday, record a deposit from the clearing account to the bank, with Stripe fees split out to an expense account.",
|
|
387
|
-
"purpose": "maintain",
|
|
388
|
-
"default": "on",
|
|
389
|
-
"settings": {
|
|
390
|
-
"bankAccount": {
|
|
391
|
-
"type": "option",
|
|
392
|
-
"options": "quickbooks.account",
|
|
393
|
-
"label": "Bank account payouts land in",
|
|
394
|
-
"required": true
|
|
395
|
-
},
|
|
396
|
-
"feeAccount": {
|
|
397
|
-
"type": "option",
|
|
398
|
-
"options": "quickbooks.account",
|
|
399
|
-
"label": "Expense account for Stripe fees",
|
|
400
|
-
"required": true
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
"trigger": {
|
|
404
|
-
"type": "schedule",
|
|
405
|
-
"cron": "30 2 * * *",
|
|
406
|
-
"timezone": "America/Chicago"
|
|
407
|
-
},
|
|
408
|
-
"steps": [
|
|
409
|
-
{
|
|
410
|
-
"id": "payouts",
|
|
411
|
-
"use": "stripe.payout.list",
|
|
412
|
-
"with": {
|
|
413
|
-
"status": "paid",
|
|
414
|
-
"arrivedAfter": "-1d",
|
|
415
|
-
"limit": 100
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
"use": "stop",
|
|
420
|
-
"when": "$.steps.payouts[0] == null",
|
|
421
|
-
"with": {
|
|
422
|
-
"reason": "No payouts arrived yesterday"
|
|
423
|
-
}
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
"id": "deposits",
|
|
427
|
-
"use": "foreach",
|
|
428
|
-
"with": {
|
|
429
|
-
"over": "$.steps.payouts",
|
|
430
|
-
"max": 50
|
|
431
|
-
},
|
|
432
|
-
"do": [
|
|
433
|
-
{
|
|
434
|
-
"id": "transactions",
|
|
435
|
-
"use": "stripe.balanceTransaction.list",
|
|
436
|
-
"with": {
|
|
437
|
-
"payout": "$.item.id",
|
|
438
|
-
"limit": 100
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
"id": "summary",
|
|
443
|
-
"use": "code",
|
|
444
|
-
"with": {
|
|
445
|
-
"ref": "@acme/finance-steps#payoutDepositLines@1.0.0",
|
|
446
|
-
"with": {
|
|
447
|
-
"payout": "$.item",
|
|
448
|
-
"transactions": "$.steps.transactions",
|
|
449
|
-
"clearingAccount": "$.install.clearingAccount",
|
|
450
|
-
"feeAccount": "$.settings.feeAccount"
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
"id": "deposit",
|
|
456
|
-
"use": "quickbooks.deposit.create",
|
|
457
|
-
"with": {
|
|
458
|
-
"deposit": {
|
|
459
|
-
"TxnDate": "$.steps.summary.date",
|
|
460
|
-
"DepositToAccountRef": {
|
|
461
|
-
"value": "$.settings.bankAccount"
|
|
462
|
-
},
|
|
463
|
-
"PrivateNote": "Stripe payout {{item.id}} ({{steps.summary.count}} transactions)",
|
|
464
|
-
"Line": "$.steps.summary.lines"
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
]
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
}
|
|
472
|
-
],
|
|
473
|
-
"templates": {
|
|
474
|
-
"refund-note": "Stripe refund {{record.id}} for payment {{record.payment_intent}} ({{record.reason | default: 'no reason given'}})."
|
|
475
|
-
}
|
|
476
|
-
}
|