@fragment-dev/cli 2026.8.12-1 → 2026.8.12-4
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/dist/{chunk-NNQ7VY2C.js → chunk-25RM4I6G.js} +1 -1
- package/dist/{chunk-SPATLADZ.js → chunk-D67ACT4J.js} +318 -10
- package/dist/{chunk-YXLQQEPT.js → chunk-ISIHYAS2.js} +2 -2
- package/dist/{chunk-HQFWYLCJ.js → chunk-JCJNNUTD.js} +1 -1
- package/dist/{chunk-Z7BQVKJE.js → chunk-MXE6IHUJ.js} +1 -1
- package/dist/commands/gen-graphql.js +2 -2
- package/dist/commands/verify-schema.js +3 -3
- package/dist/commands.js +5 -5
- package/dist/index.js +5 -5
- package/dist/utils/schemaValidation.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -4651,6 +4651,14 @@ var SystemLineKind = {
|
|
|
4651
4651
|
payment_fee_line: "payment_fee_line"
|
|
4652
4652
|
};
|
|
4653
4653
|
var SystemLineKindSchema = z.nativeEnum(SystemLineKind);
|
|
4654
|
+
var SystemLineParameterName = {
|
|
4655
|
+
payment_settlement_line: "payment_amount",
|
|
4656
|
+
payment_fee_line: "fragment_fee_amount"
|
|
4657
|
+
};
|
|
4658
|
+
var SYSTEM_LINE_AMOUNT = {
|
|
4659
|
+
[SystemLineKind.payment_settlement_line]: `{{${SystemLineParameterName.payment_settlement_line}}}`,
|
|
4660
|
+
[SystemLineKind.payment_fee_line]: `-{{${SystemLineParameterName.payment_fee_line}}}`
|
|
4661
|
+
};
|
|
4654
4662
|
var BaseSchemaPaymentInput = z.object({
|
|
4655
4663
|
amount: z.string(),
|
|
4656
4664
|
direction: PaymentTypeDirectionSchema
|
|
@@ -6344,7 +6352,7 @@ var getFullyParameterizedAccount = (accountPath, accountPathToAccount, entryPara
|
|
|
6344
6352
|
});
|
|
6345
6353
|
return account;
|
|
6346
6354
|
};
|
|
6347
|
-
var validateLineAccount = (entryType, lineKey, accountPath, accountPathToAccount, entryParameters) => {
|
|
6355
|
+
var validateLineAccount = (entryType, lineKey, accountPath, accountPathToAccount, entryParameters, options) => {
|
|
6348
6356
|
const validationResults = safeGetZodErrors(
|
|
6349
6357
|
ParameterizedString.refine((s2) => s2.length > 0, {
|
|
6350
6358
|
message: `Ledger Line (${lineKey}) in Ledger Entry (${entryType}) must specify a Ledger Account path`
|
|
@@ -6391,8 +6399,9 @@ var validateLineAccount = (entryType, lineKey, accountPath, accountPathToAccount
|
|
|
6391
6399
|
});
|
|
6392
6400
|
}
|
|
6393
6401
|
try {
|
|
6394
|
-
if (account && getSchemaAccountCategory(account) === "Payment" /* Payment */) {
|
|
6402
|
+
if (!options?.allowPaymentAccount && account && getSchemaAccountCategory(account) === "Payment" /* Payment */) {
|
|
6395
6403
|
validationResults.push({
|
|
6404
|
+
code: "payment_account_in_ledger_entry",
|
|
6396
6405
|
message: `Ledger Entries cannot post to Payment Accounts. (entry: ${entryType} | line key: ${lineKey} | account path: ${accountPath})`,
|
|
6397
6406
|
path: ["account", "path"]
|
|
6398
6407
|
});
|
|
@@ -6483,7 +6492,7 @@ var validateLineTx = (tx, accountPath, accountPathToAccount, entryParameters, li
|
|
|
6483
6492
|
}
|
|
6484
6493
|
return validationResults;
|
|
6485
6494
|
};
|
|
6486
|
-
var validateLine = (entryType, entryParameters, entryHasTwoLines, entryHasAnyLineWithTx, line, accountPathToAccount) => {
|
|
6495
|
+
var validateLine = (entryType, entryParameters, entryHasTwoLines, entryHasAnyLineWithTx, line, accountPathToAccount, options) => {
|
|
6487
6496
|
const validationResult = validateLineKey(line.key);
|
|
6488
6497
|
const accountPath = line.account.path;
|
|
6489
6498
|
const parameters = entryParameters ?? {};
|
|
@@ -6503,7 +6512,8 @@ var validateLine = (entryType, entryParameters, entryHasTwoLines, entryHasAnyLin
|
|
|
6503
6512
|
line.key,
|
|
6504
6513
|
accountPath,
|
|
6505
6514
|
accountPathToAccount,
|
|
6506
|
-
parameters
|
|
6515
|
+
parameters,
|
|
6516
|
+
options
|
|
6507
6517
|
)
|
|
6508
6518
|
);
|
|
6509
6519
|
validationResult.push(
|
|
@@ -6540,7 +6550,7 @@ var validateLine = (entryType, entryParameters, entryHasTwoLines, entryHasAnyLin
|
|
|
6540
6550
|
var isKDefined = (k2, line) => {
|
|
6541
6551
|
return line[k2] !== void 0;
|
|
6542
6552
|
};
|
|
6543
|
-
var validateBalancedLineGroup = (entryType, entryParameters, lines, accountPathToAccount) => {
|
|
6553
|
+
var validateBalancedLineGroup = (entryType, entryParameters, lines, accountPathToAccount, options) => {
|
|
6544
6554
|
const parameterizedLines = lines.map(
|
|
6545
6555
|
(line) => parameterizeSchemaLedgerLineInput({
|
|
6546
6556
|
line,
|
|
@@ -6563,7 +6573,8 @@ var validateBalancedLineGroup = (entryType, entryParameters, lines, accountPathT
|
|
|
6563
6573
|
lines.length === 2,
|
|
6564
6574
|
lines.some((l) => l.tx),
|
|
6565
6575
|
line,
|
|
6566
|
-
accountPathToAccount
|
|
6576
|
+
accountPathToAccount,
|
|
6577
|
+
options
|
|
6567
6578
|
).length === 0
|
|
6568
6579
|
);
|
|
6569
6580
|
if (parameterizedLines.length < lines.length) {
|
|
@@ -6587,7 +6598,7 @@ var validateBalancedLineGroup = (entryType, entryParameters, lines, accountPathT
|
|
|
6587
6598
|
}
|
|
6588
6599
|
return [];
|
|
6589
6600
|
};
|
|
6590
|
-
var validateBalancedLines = (entryType, entryParameters, lines, accountPathToAccount) => {
|
|
6601
|
+
var validateBalancedLines = (entryType, entryParameters, lines, accountPathToAccount, options) => {
|
|
6591
6602
|
const staticLines = lines.filter((line) => !line.repeated);
|
|
6592
6603
|
const repeatedGroups = /* @__PURE__ */ new Map();
|
|
6593
6604
|
lines.forEach((line) => {
|
|
@@ -6604,7 +6615,8 @@ var validateBalancedLines = (entryType, entryParameters, lines, accountPathToAcc
|
|
|
6604
6615
|
entryType,
|
|
6605
6616
|
entryParameters,
|
|
6606
6617
|
staticLines,
|
|
6607
|
-
accountPathToAccount
|
|
6618
|
+
accountPathToAccount,
|
|
6619
|
+
options
|
|
6608
6620
|
)
|
|
6609
6621
|
);
|
|
6610
6622
|
}
|
|
@@ -6614,7 +6626,8 @@ var validateBalancedLines = (entryType, entryParameters, lines, accountPathToAcc
|
|
|
6614
6626
|
entryType,
|
|
6615
6627
|
entryParameters,
|
|
6616
6628
|
groupLines,
|
|
6617
|
-
accountPathToAccount
|
|
6629
|
+
accountPathToAccount,
|
|
6630
|
+
options
|
|
6618
6631
|
).map((error) => ({
|
|
6619
6632
|
...error,
|
|
6620
6633
|
message: `[repeated key '${key}'] ${error.message}`
|
|
@@ -7447,6 +7460,285 @@ var validateGroup = (group, validatedCoA, validatedEntries, index) => {
|
|
|
7447
7460
|
return errors;
|
|
7448
7461
|
};
|
|
7449
7462
|
|
|
7463
|
+
// ../../libs/schema-validation/utils/transformers/payments.ts
|
|
7464
|
+
init_cjs_shims();
|
|
7465
|
+
var amountMatchesSystemLine = (amount, system) => amount === SYSTEM_LINE_AMOUNT[system];
|
|
7466
|
+
var getAccountCategoryOrUndefined = (account) => {
|
|
7467
|
+
try {
|
|
7468
|
+
return getSchemaAccountCategory(account);
|
|
7469
|
+
} catch (e2) {
|
|
7470
|
+
if (e2 instanceof AccountCategoryMutualExclusionError) {
|
|
7471
|
+
return void 0;
|
|
7472
|
+
}
|
|
7473
|
+
throw e2;
|
|
7474
|
+
}
|
|
7475
|
+
};
|
|
7476
|
+
var findPaymentAccountPath = (accountPathToAccount) => Array.from(accountPathToAccount.entries()).find(
|
|
7477
|
+
([, account]) => getAccountCategoryOrUndefined(account) === "Payment" /* Payment */
|
|
7478
|
+
)?.[0];
|
|
7479
|
+
var fillInPaymentEntryLines = (entry, accountPathToAccount) => (entry.lines ?? []).map((line, idx) => {
|
|
7480
|
+
const path = line.account?.path ? getStructuralPath(line.account.path) : void 0;
|
|
7481
|
+
return {
|
|
7482
|
+
...line,
|
|
7483
|
+
account: line.account ?? { path: "" },
|
|
7484
|
+
key: line.key ?? `line-${idx}`,
|
|
7485
|
+
amount: line.amount ?? "",
|
|
7486
|
+
currency: line.currency ?? (path ? accountPathToAccount.get(path)?.currency : void 0)
|
|
7487
|
+
};
|
|
7488
|
+
});
|
|
7489
|
+
var validateSystemLines = ({
|
|
7490
|
+
lines,
|
|
7491
|
+
event,
|
|
7492
|
+
entryIdentity,
|
|
7493
|
+
paymentAccountPath
|
|
7494
|
+
}) => {
|
|
7495
|
+
const errors = [];
|
|
7496
|
+
if (event !== PaymentEventKey.processing_to_settled) {
|
|
7497
|
+
lines.forEach((line, idx) => {
|
|
7498
|
+
if (line.system) {
|
|
7499
|
+
errors.push({
|
|
7500
|
+
path: ["lines", idx, "system"],
|
|
7501
|
+
message: `System lines are only allowed on the '${PaymentEventKey.processing_to_settled}' entry. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7502
|
+
});
|
|
7503
|
+
}
|
|
7504
|
+
});
|
|
7505
|
+
return errors;
|
|
7506
|
+
}
|
|
7507
|
+
Object.values(SystemLineKind).forEach((system) => {
|
|
7508
|
+
const count = lines.filter((line) => line.system === system).length;
|
|
7509
|
+
if (count !== 1) {
|
|
7510
|
+
errors.push({
|
|
7511
|
+
path: ["lines"],
|
|
7512
|
+
message: `Payment entry (${entryIdentity}) must have exactly one line with system '${system}', found ${count}.`
|
|
7513
|
+
});
|
|
7514
|
+
}
|
|
7515
|
+
});
|
|
7516
|
+
lines.forEach((line, idx) => {
|
|
7517
|
+
const isPaymentAccountLine = paymentAccountPath !== void 0 && getStructuralPath(line.account.path) === paymentAccountPath;
|
|
7518
|
+
if (line.system) {
|
|
7519
|
+
if (paymentAccountPath !== void 0 && !isPaymentAccountLine) {
|
|
7520
|
+
errors.push({
|
|
7521
|
+
path: ["lines", idx, "account", "path"],
|
|
7522
|
+
message: `System line '${line.system}' must post to the Payment Account. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7523
|
+
});
|
|
7524
|
+
}
|
|
7525
|
+
if (!amountMatchesSystemLine(line.amount, line.system)) {
|
|
7526
|
+
errors.push({
|
|
7527
|
+
path: ["lines", idx, "amount"],
|
|
7528
|
+
message: `System line '${line.system}' must have amount '${SYSTEM_LINE_AMOUNT[line.system]}'. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7529
|
+
});
|
|
7530
|
+
}
|
|
7531
|
+
} else if (isPaymentAccountLine) {
|
|
7532
|
+
errors.push({
|
|
7533
|
+
path: ["lines", idx, "system"],
|
|
7534
|
+
message: `Only system lines may post to the Payment Account. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7535
|
+
});
|
|
7536
|
+
}
|
|
7537
|
+
});
|
|
7538
|
+
return errors;
|
|
7539
|
+
};
|
|
7540
|
+
var validatePaymentEntry = ({
|
|
7541
|
+
entry,
|
|
7542
|
+
event,
|
|
7543
|
+
entryIdentity,
|
|
7544
|
+
accountPathToAccount,
|
|
7545
|
+
paymentAccountPath
|
|
7546
|
+
}) => {
|
|
7547
|
+
const errors = [];
|
|
7548
|
+
errors.push(...validateDescription(entry.description));
|
|
7549
|
+
const lines = fillInPaymentEntryLines(entry, accountPathToAccount);
|
|
7550
|
+
if (lines.length > MAX_ENTRY_LINES) {
|
|
7551
|
+
errors.push({
|
|
7552
|
+
path: ["lines"],
|
|
7553
|
+
message: `Payment entry (${entryIdentity}) has too many lines. The maximum allowed is ${MAX_ENTRY_LINES}, but this entry has ${lines.length}.`
|
|
7554
|
+
});
|
|
7555
|
+
}
|
|
7556
|
+
const allowPaymentAccount = event === PaymentEventKey.processing_to_settled;
|
|
7557
|
+
errors.push(
|
|
7558
|
+
...lines.flatMap((line, idx) => {
|
|
7559
|
+
const lineErrors = [];
|
|
7560
|
+
if (line.tx) {
|
|
7561
|
+
lineErrors.push({
|
|
7562
|
+
path: ["tx"],
|
|
7563
|
+
message: `Payment entry lines cannot specify tx matches. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7564
|
+
});
|
|
7565
|
+
}
|
|
7566
|
+
if (line.repeated) {
|
|
7567
|
+
lineErrors.push({
|
|
7568
|
+
path: ["repeated"],
|
|
7569
|
+
message: `Payment entry lines cannot be repeated. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7570
|
+
});
|
|
7571
|
+
}
|
|
7572
|
+
if (line.tags?.length) {
|
|
7573
|
+
lineErrors.push({
|
|
7574
|
+
path: ["tags"],
|
|
7575
|
+
message: `Payment entry lines cannot specify tags. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7576
|
+
});
|
|
7577
|
+
}
|
|
7578
|
+
const account = accountPathToAccount.get(
|
|
7579
|
+
getStructuralPath(line.account.path)
|
|
7580
|
+
);
|
|
7581
|
+
if (account && getAccountCategoryOrUndefined(account) === "Linked" /* Linked */) {
|
|
7582
|
+
lineErrors.push({
|
|
7583
|
+
path: ["account", "path"],
|
|
7584
|
+
message: `Payment entry lines cannot post to Linked Accounts. (payment entry: ${entryIdentity} | line key: ${line.key})`
|
|
7585
|
+
});
|
|
7586
|
+
}
|
|
7587
|
+
lineErrors.push(
|
|
7588
|
+
...validateLine(
|
|
7589
|
+
entryIdentity,
|
|
7590
|
+
void 0,
|
|
7591
|
+
lines.length === 2,
|
|
7592
|
+
false,
|
|
7593
|
+
line,
|
|
7594
|
+
accountPathToAccount,
|
|
7595
|
+
{ allowPaymentAccount }
|
|
7596
|
+
).filter(({ path }) => path[0] !== "tx")
|
|
7597
|
+
);
|
|
7598
|
+
return lineErrors.map(({ path, ...rest }) => ({
|
|
7599
|
+
path: ["lines", idx, ...path],
|
|
7600
|
+
...rest
|
|
7601
|
+
}));
|
|
7602
|
+
})
|
|
7603
|
+
);
|
|
7604
|
+
errors.push(
|
|
7605
|
+
...validateUniqueByKey({
|
|
7606
|
+
key: "key",
|
|
7607
|
+
items: lines,
|
|
7608
|
+
pathPrefix: ["lines"],
|
|
7609
|
+
getErrorMessage: (item) => `Payment entry (${entryIdentity}) already has a line with key '${item.key}'`
|
|
7610
|
+
})
|
|
7611
|
+
);
|
|
7612
|
+
errors.push(
|
|
7613
|
+
...validateBalancedLines(
|
|
7614
|
+
entryIdentity,
|
|
7615
|
+
void 0,
|
|
7616
|
+
lines,
|
|
7617
|
+
accountPathToAccount,
|
|
7618
|
+
{
|
|
7619
|
+
allowPaymentAccount
|
|
7620
|
+
}
|
|
7621
|
+
)
|
|
7622
|
+
);
|
|
7623
|
+
errors.push(
|
|
7624
|
+
...validateSystemLines({ lines, event, entryIdentity, paymentAccountPath })
|
|
7625
|
+
);
|
|
7626
|
+
return errors;
|
|
7627
|
+
};
|
|
7628
|
+
var validatePaymentType = ({
|
|
7629
|
+
paymentType,
|
|
7630
|
+
accountPathToAccount,
|
|
7631
|
+
paymentAccountPath
|
|
7632
|
+
}) => {
|
|
7633
|
+
const errors = validateNonEmptySafeString({
|
|
7634
|
+
value: paymentType.type,
|
|
7635
|
+
path: ["type"],
|
|
7636
|
+
name: "type",
|
|
7637
|
+
entityName: "Payment Type"
|
|
7638
|
+
});
|
|
7639
|
+
if (paymentType.typeVersion !== 1) {
|
|
7640
|
+
errors.push({
|
|
7641
|
+
path: ["typeVersion"],
|
|
7642
|
+
message: `Payment Type (${paymentType.type}) must have typeVersion 1.`
|
|
7643
|
+
});
|
|
7644
|
+
}
|
|
7645
|
+
if (paymentType.payment.direction !== PaymentTypeDirection.payin) {
|
|
7646
|
+
errors.push({
|
|
7647
|
+
path: ["payment", "direction"],
|
|
7648
|
+
message: `Payment Type (${paymentType.type}) must have direction '${PaymentTypeDirection.payin}'. Direction '${PaymentTypeDirection.payout}' is not yet supported.`
|
|
7649
|
+
});
|
|
7650
|
+
}
|
|
7651
|
+
if (!paymentType.payment.amount.trim()) {
|
|
7652
|
+
errors.push({
|
|
7653
|
+
path: ["payment", "amount"],
|
|
7654
|
+
message: `Payment Type (${paymentType.type}) must specify a payment amount.`
|
|
7655
|
+
});
|
|
7656
|
+
} else {
|
|
7657
|
+
errors.push(
|
|
7658
|
+
...safeGetZodErrors(ParameterizedAmount(), paymentType.payment.amount, [
|
|
7659
|
+
"payment",
|
|
7660
|
+
"amount"
|
|
7661
|
+
])
|
|
7662
|
+
);
|
|
7663
|
+
}
|
|
7664
|
+
Object.keys(paymentType.accounting).filter((event) => !(event in PaymentEventKey)).forEach((event) => {
|
|
7665
|
+
errors.push({
|
|
7666
|
+
path: ["accounting", event],
|
|
7667
|
+
message: `Payment Type (${paymentType.type}) has unknown accounting event '${event}'. Supported events: ${Object.values(
|
|
7668
|
+
PaymentEventKey
|
|
7669
|
+
).join(", ")}.`
|
|
7670
|
+
});
|
|
7671
|
+
});
|
|
7672
|
+
if (!paymentType.accounting.processing_to_settled) {
|
|
7673
|
+
errors.push({
|
|
7674
|
+
path: ["accounting", PaymentEventKey.processing_to_settled],
|
|
7675
|
+
message: `Payment Type (${paymentType.type}) must define a '${PaymentEventKey.processing_to_settled}' entry.`
|
|
7676
|
+
});
|
|
7677
|
+
}
|
|
7678
|
+
errors.push(
|
|
7679
|
+
...Object.values(PaymentEventKey).flatMap((event) => {
|
|
7680
|
+
const entry = paymentType.accounting[event];
|
|
7681
|
+
if (!entry) {
|
|
7682
|
+
return [];
|
|
7683
|
+
}
|
|
7684
|
+
return validatePaymentEntry({
|
|
7685
|
+
entry,
|
|
7686
|
+
event,
|
|
7687
|
+
entryIdentity: `${paymentType.type}.${paymentType.typeVersion}.${event}`,
|
|
7688
|
+
accountPathToAccount,
|
|
7689
|
+
paymentAccountPath
|
|
7690
|
+
}).map(({ path, ...rest }) => ({
|
|
7691
|
+
path: ["accounting", event, ...path],
|
|
7692
|
+
...rest
|
|
7693
|
+
}));
|
|
7694
|
+
})
|
|
7695
|
+
);
|
|
7696
|
+
return errors;
|
|
7697
|
+
};
|
|
7698
|
+
var transformAndValidatePayments = ({
|
|
7699
|
+
payments,
|
|
7700
|
+
validatedCoA
|
|
7701
|
+
}) => {
|
|
7702
|
+
const accountPathToAccount = getStructuralPathToAccount(validatedCoA);
|
|
7703
|
+
const paymentAccountPath = findPaymentAccountPath(accountPathToAccount);
|
|
7704
|
+
const errors = [];
|
|
7705
|
+
if (payments.types.length > 0 && paymentAccountPath === void 0) {
|
|
7706
|
+
errors.push({
|
|
7707
|
+
path: ["types"],
|
|
7708
|
+
message: `Schema must contain a Payment Account to define Payment Types.`
|
|
7709
|
+
});
|
|
7710
|
+
}
|
|
7711
|
+
errors.push(
|
|
7712
|
+
...Array.from(
|
|
7713
|
+
groupByMap(
|
|
7714
|
+
payments.types.map((paymentType, idx) => [paymentType, idx]),
|
|
7715
|
+
([paymentType]) => `${paymentType.type}:${paymentType.typeVersion}`
|
|
7716
|
+
).values()
|
|
7717
|
+
).filter((group) => group.length > 1).flatMap(
|
|
7718
|
+
(group) => group.map(([paymentType, idx]) => ({
|
|
7719
|
+
message: `Payment Types cannot have duplicate types '${paymentType.type}'`,
|
|
7720
|
+
path: ["types", idx, "type"]
|
|
7721
|
+
}))
|
|
7722
|
+
)
|
|
7723
|
+
);
|
|
7724
|
+
errors.push(
|
|
7725
|
+
...payments.types.flatMap(
|
|
7726
|
+
(paymentType, idx) => validatePaymentType({
|
|
7727
|
+
paymentType,
|
|
7728
|
+
accountPathToAccount,
|
|
7729
|
+
paymentAccountPath
|
|
7730
|
+
}).map(({ path, ...rest }) => ({
|
|
7731
|
+
path: ["types", idx, ...path],
|
|
7732
|
+
...rest
|
|
7733
|
+
}))
|
|
7734
|
+
)
|
|
7735
|
+
);
|
|
7736
|
+
return {
|
|
7737
|
+
filledIn: payments,
|
|
7738
|
+
errors
|
|
7739
|
+
};
|
|
7740
|
+
};
|
|
7741
|
+
|
|
7450
7742
|
// ../../libs/schema-validation/types.ts
|
|
7451
7743
|
var SchemaCurrencyMatchInput2 = z.object({
|
|
7452
7744
|
customCurrencyId: ParameterizedString.optional(),
|
|
@@ -7747,7 +8039,13 @@ var Schema = z.object({
|
|
|
7747
8039
|
scenes: z.array(Scene).optional(),
|
|
7748
8040
|
groups: z.array(SchemaEntryGroup).optional()
|
|
7749
8041
|
}).transform((schema, ctx) => {
|
|
7750
|
-
const {
|
|
8042
|
+
const {
|
|
8043
|
+
chartOfAccounts,
|
|
8044
|
+
ledgerEntries,
|
|
8045
|
+
consistencyConfig,
|
|
8046
|
+
groups,
|
|
8047
|
+
payments
|
|
8048
|
+
} = schema;
|
|
7751
8049
|
const { errors, filledIn: validatedLedgerEntries } = transformAndValidateEntries({
|
|
7752
8050
|
ledgerEntries: ledgerEntries ?? { types: [] },
|
|
7753
8051
|
validatedCoA: chartOfAccounts
|
|
@@ -7759,6 +8057,16 @@ var Schema = z.object({
|
|
|
7759
8057
|
path
|
|
7760
8058
|
})
|
|
7761
8059
|
);
|
|
8060
|
+
transformAndValidatePayments({
|
|
8061
|
+
payments: payments ?? { types: [] },
|
|
8062
|
+
validatedCoA: chartOfAccounts
|
|
8063
|
+
}).errors.map((e2) => ({ ...e2, path: ["payments", ...e2.path] })).forEach(
|
|
8064
|
+
({ message, path }) => ctx.addIssue({
|
|
8065
|
+
code: z.ZodIssueCode.custom,
|
|
8066
|
+
message,
|
|
8067
|
+
path
|
|
8068
|
+
})
|
|
8069
|
+
);
|
|
7762
8070
|
if (groups && groups.length > 0) {
|
|
7763
8071
|
groups.forEach((group, index) => {
|
|
7764
8072
|
const groupErrors = validateGroup(
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
} from "./chunk-IXX2EVIM.js";
|
|
28
28
|
import {
|
|
29
29
|
VerifySchema
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JCJNNUTD.js";
|
|
31
31
|
import {
|
|
32
32
|
GenGraphQL
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-25RM4I6G.js";
|
|
34
34
|
import {
|
|
35
35
|
GetSchema
|
|
36
36
|
} from "./chunk-JDSPZQFF.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenGraphQL
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-25RM4I6G.js";
|
|
4
4
|
import "../chunk-BMLIRDHA.js";
|
|
5
5
|
import "../chunk-FMY4RHS4.js";
|
|
6
6
|
import "../chunk-X5KIPJRF.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-D67ACT4J.js";
|
|
8
8
|
import "../chunk-W5FV2YSN.js";
|
|
9
9
|
import "../chunk-V6GWSE3B.js";
|
|
10
10
|
import "../chunk-LRQRC5Z7.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VerifySchema
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JCJNNUTD.js";
|
|
4
|
+
import "../chunk-MXE6IHUJ.js";
|
|
5
5
|
import "../chunk-A4BSWX5D.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-D67ACT4J.js";
|
|
7
7
|
import "../chunk-W5FV2YSN.js";
|
|
8
8
|
import "../chunk-V6GWSE3B.js";
|
|
9
9
|
import "../chunk-LRQRC5Z7.js";
|
package/dist/commands.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMANDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ISIHYAS2.js";
|
|
4
4
|
import "./chunk-JFF37Z5K.js";
|
|
5
5
|
import "./chunk-63M7ILIN.js";
|
|
6
6
|
import "./chunk-HVQUC54T.js";
|
|
@@ -10,14 +10,14 @@ import "./chunk-VCANHQTI.js";
|
|
|
10
10
|
import "./chunk-URUHIS5X.js";
|
|
11
11
|
import "./chunk-TUQGCEII.js";
|
|
12
12
|
import "./chunk-IXX2EVIM.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-JCJNNUTD.js";
|
|
14
|
+
import "./chunk-MXE6IHUJ.js";
|
|
15
15
|
import "./chunk-A4BSWX5D.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-25RM4I6G.js";
|
|
17
17
|
import "./chunk-BMLIRDHA.js";
|
|
18
18
|
import "./chunk-FMY4RHS4.js";
|
|
19
19
|
import "./chunk-X5KIPJRF.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-D67ACT4J.js";
|
|
21
21
|
import "./chunk-W5FV2YSN.js";
|
|
22
22
|
import "./chunk-V6GWSE3B.js";
|
|
23
23
|
import "./chunk-LRQRC5Z7.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMANDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ISIHYAS2.js";
|
|
4
4
|
import "./chunk-JFF37Z5K.js";
|
|
5
5
|
import "./chunk-63M7ILIN.js";
|
|
6
6
|
import "./chunk-HVQUC54T.js";
|
|
@@ -10,14 +10,14 @@ import "./chunk-VCANHQTI.js";
|
|
|
10
10
|
import "./chunk-URUHIS5X.js";
|
|
11
11
|
import "./chunk-TUQGCEII.js";
|
|
12
12
|
import "./chunk-IXX2EVIM.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-JCJNNUTD.js";
|
|
14
|
+
import "./chunk-MXE6IHUJ.js";
|
|
15
15
|
import "./chunk-A4BSWX5D.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-25RM4I6G.js";
|
|
17
17
|
import "./chunk-BMLIRDHA.js";
|
|
18
18
|
import "./chunk-FMY4RHS4.js";
|
|
19
19
|
import "./chunk-X5KIPJRF.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-D67ACT4J.js";
|
|
21
21
|
import "./chunk-W5FV2YSN.js";
|
|
22
22
|
import "./chunk-V6GWSE3B.js";
|
|
23
23
|
import "./chunk-LRQRC5Z7.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
extractSchemaMetadata,
|
|
4
4
|
isJsonParseError,
|
|
5
5
|
validateSchemaStructure
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-MXE6IHUJ.js";
|
|
7
|
+
import "../chunk-D67ACT4J.js";
|
|
8
8
|
import "../chunk-W5FV2YSN.js";
|
|
9
9
|
import "../chunk-V6GWSE3B.js";
|
|
10
10
|
import "../chunk-LRQRC5Z7.js";
|
package/oclif.manifest.json
CHANGED