diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 629d1b9b..00000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./eslint" -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1e3d82ec..3cd7e22c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ npm-debug.* package-lock.json yarn.lock .scannerwork +.lint/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c1c831..926d1ac8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,121 @@ +## [12.2.3](https://github.com/softwaregroup-bg/ut-rule/compare/v12.2.2...v12.2.3) (2022-11-01) + + +### Bug Fixes + +* hide 'see more' action BPS-229 ([#242](https://github.com/softwaregroup-bg/ut-rule/issues/242)) ([d17e86f](https://github.com/softwaregroup-bg/ut-rule/commit/d17e86f1283a807890b666912c534385288110d5)) + + + +## [12.2.2](https://github.com/softwaregroup-bg/ut-rule/compare/v12.2.1...v12.2.2) (2022-10-24) + + + +## [12.2.1](https://github.com/softwaregroup-bg/ut-rule/compare/v12.2.0...v12.2.1) (2022-09-07) + + +### Bug Fixes + +* renamed account ([#239](https://github.com/softwaregroup-bg/ut-rule/issues/239)) ([53ca795](https://github.com/softwaregroup-bg/ut-rule/commit/53ca795e9662488848ad9270729626e4b2d9ab8a)) + + + +# [12.2.0](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.9...v12.2.0) (2022-08-24) + + +### Features + +* bill payment test data ([#238](https://github.com/softwaregroup-bg/ut-rule/issues/238)) ([439fa4e](https://github.com/softwaregroup-bg/ut-rule/commit/439fa4ec9c4965e965da5b1fbf8d36a3e3fc1649)) + + + +## [12.1.9](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.8...v12.1.9) (2022-08-01) + + + +## [12.1.8](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.7...v12.1.8) (2022-06-01) + + +### Bug Fixes + +* hide table titles #UTCORE-121 ([0b67ca9](https://github.com/softwaregroup-bg/ut-rule/commit/0b67ca9b9868a8e8c018ed18cc286ef09d5a84a5)), closes [#UTCORE-121](https://github.com/softwaregroup-bg/ut-rule/issues/UTCORE-121) + + + +## [12.1.7](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.6...v12.1.7) (2022-05-25) + + +### Bug Fixes + +* Run ERP seed if only exist. BPS-57 ([#230](https://github.com/softwaregroup-bg/ut-rule/issues/230)) ([9011c28](https://github.com/softwaregroup-bg/ut-rule/commit/9011c28893bf3cc8678733ab13eb35f7bd6bb460)) + + + +## [12.1.6](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.5...v12.1.6) (2022-05-05) + + +### Bug Fixes + +* **ECNT2-1263:** rounding ([#229](https://github.com/softwaregroup-bg/ut-rule/issues/229)) ([bb564a6](https://github.com/softwaregroup-bg/ut-rule/commit/bb564a605ae3eb516ce762875bc25a0e7b2f83d4)) + + + +## [12.1.5](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.4...v12.1.5) (2022-05-03) + + + +## [12.1.4](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.3...v12.1.4) (2022-04-21) + + +### Bug Fixes + +* **MSA-2182:** edit amount type rounding is not correct ([#228](https://github.com/softwaregroup-bg/ut-rule/issues/228)) ([90d18df](https://github.com/softwaregroup-bg/ut-rule/commit/90d18df241cd626b47e415f3582f8f2e0fa3404b)) + + + +## [12.1.3](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.2...v12.1.3) (2022-04-06) + + +### Bug Fixes + +* wallet to erp rule, #UTCORE-121 ([#227](https://github.com/softwaregroup-bg/ut-rule/issues/227)) ([487dc37](https://github.com/softwaregroup-bg/ut-rule/commit/487dc3768ab0b62e0c65494e1900842571ef8ab7)), closes [#UTCORE-121](https://github.com/softwaregroup-bg/ut-rule/issues/UTCORE-121) + + + +## [12.1.2](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.1...v12.1.2) (2022-03-30) + + + +## [12.1.1](https://github.com/softwaregroup-bg/ut-rule/compare/v12.1.0...v12.1.1) (2022-03-13) + + + +# [12.1.0](https://github.com/softwaregroup-bg/ut-rule/compare/v12.0.2...v12.1.0) (2022-03-04) + + +### Features + +* PS-261 - Support multiple selection for Channel organization input ([#226](https://github.com/softwaregroup-bg/ut-rule/issues/226)) ([e300e67](https://github.com/softwaregroup-bg/ut-rule/commit/e300e671d8cd12a12b024565b9164c5e37d9e2ae)) + + + +## [12.0.2](https://github.com/softwaregroup-bg/ut-rule/compare/v12.0.1...v12.0.2) (2022-02-21) + + +### Bug Fixes + +* add microservice config ([f8336df](https://github.com/softwaregroup-bg/ut-rule/commit/f8336dfd0323a49a88d9de5adee2cd0a89cfbca7)) + + + +## [12.0.1](https://github.com/softwaregroup-bg/ut-rule/compare/v12.0.0...v12.0.1) (2022-02-21) + + + +# [12.0.0](https://github.com/softwaregroup-bg/ut-rule/compare/v12.0.0-timezone.1...v12.0.0) (2022-02-21) + + + ## [11.5.1](https://github.com/softwaregroup-bg/ut-rule/compare/v11.5.0...v11.5.1) (2021-12-23) diff --git a/Jenkinsfile b/Jenkinsfile index e87336aa..7ab40c0f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,6 @@ -library identifier: 'jenkinsfile@master', retriever: modernSCM([ +library identifier: 'jenkinsfile@gallium', retriever: modernSCM([ $class: 'GitSCMSource', remote: 'https://github.com/softwaregroup-bg/jenkinsfile.git' ]) -ut buildImage: 'softwaregroup/ut-docker' - +ut buildImage: 'nexus-dev.softwaregroup.com:5000/softwaregroup/ut-gallium' diff --git a/api/sql/schema/350-rule.conditionUnapproved.sql b/api/sql/schema/350-rule.conditionUnapproved.sql new file mode 100644 index 00000000..a2b5d88d --- /dev/null +++ b/api/sql/schema/350-rule.conditionUnapproved.sql @@ -0,0 +1,17 @@ +CREATE TABLE [rule].[conditionUnapproved] ( + conditionId INT IDENTITY(1000, 1) NOT NULL, + [priority] INT, + operationStartDate DATETIME, + operationEndDate DATETIME, + sourceAccountId NVARCHAR(255), + destinationAccountId NVARCHAR(255), + isDeleted BIT NOT NULL DEFAULT(0), -- a flag to show if the rule is deleted, e.g. 1 - Deleted + createdBy BIGINT NULL, -- id of the actor + createdOn DATETIME2 (0) NULL, -- date of the rule created + updatedBy BIGINT NULL, -- id of the actor + updatedOn DATETIME2 (0) NULL, -- date of the rule updated + status VARCHAR(20) NULL DEFAULT('pending'), + rejectReason VARCHAR(255) NULL, + CONSTRAINT [pkRuleConditionUnapproved] PRIMARY KEY CLUSTERED ([conditionId] ASC), + CONSTRAINT fkRuleConditionUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/350-rule.conditionUnapprovedActor.sql b/api/sql/schema/350-rule.conditionUnapprovedActor.sql new file mode 100644 index 00000000..ac1081d0 --- /dev/null +++ b/api/sql/schema/350-rule.conditionUnapprovedActor.sql @@ -0,0 +1,11 @@ +CREATE TABLE [rule].[conditionActorUnapproved] ( + conditionId INT NOT NULL, + factor CHAR(2) NOT NULL, + actorId BIGINT NOT NULL, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT pkRuleConditionActorUnapproved PRIMARY KEY CLUSTERED (conditionId, factor, actorId), + CONSTRAINT fkRuleConditionActorUnapproved_conditionId FOREIGN KEY (conditionId) REFERENCES [rule].[conditionUnapproved](conditionId), + CONSTRAINT fkRuleConditionActorUnapproved_actorId FOREIGN KEY(actorId) REFERENCES [core].[actor] (actorId), + CONSTRAINT ccRuleConditionActorUnapproved_factor CHECK (factor IN ('so', 'do', 'co')), -- source organization, destination organization, channel organization + CONSTRAINT fkRuleConditionActorUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/350-rule.conditionUnapprovedItem.sql b/api/sql/schema/350-rule.conditionUnapprovedItem.sql new file mode 100644 index 00000000..57d322ae --- /dev/null +++ b/api/sql/schema/350-rule.conditionUnapprovedItem.sql @@ -0,0 +1,11 @@ +CREATE TABLE [rule].[conditionItemUnapproved] ( + conditionId INT NOT NULL, + factor CHAR(2) NOT NULL, + itemNameId BIGINT NOT NULL, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT pkRuleConditionItemUnapproved PRIMARY KEY CLUSTERED (conditionId, factor, itemNameId), + CONSTRAINT fkRuleConditionItemUnapproved_conditionId FOREIGN KEY (conditionId) REFERENCES [rule].[conditionUnapproved](conditionId), + CONSTRAINT fkRuleConditionItemUnapproved_itemNameId FOREIGN KEY(itemNameId) REFERENCES [core].[itemName] (itemNameId), + CONSTRAINT ccRuleConditionItemUnapproved_factor CHECK (factor IN ('ss', 'ds', 'cs', 'oc', 'sc', 'dc')), -- source spatial, destination spatial, channel spatial, operation category, source category, destination category + CONSTRAINT fkRuleConditionItemUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/350-rule.conditionUnapprovedProperty.sql b/api/sql/schema/350-rule.conditionUnapprovedProperty.sql new file mode 100644 index 00000000..7d16929d --- /dev/null +++ b/api/sql/schema/350-rule.conditionUnapprovedProperty.sql @@ -0,0 +1,12 @@ +CREATE TABLE [rule].[conditionPropertyUnapproved] ( + conditionId INT NOT NULL, + factor CHAR(2) NOT NULL, + [name] NVARCHAR(50) NOT NULL, + [value] NVARCHAR(200) NOT NULL, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT pkRuleConditionPropertyUnapproved PRIMARY KEY CLUSTERED (conditionId, factor, [name]), + CONSTRAINT fkRuleConditionPropertyUnapproved_conditionId FOREIGN KEY (conditionId) REFERENCES [rule].[conditionUnapproved](conditionId), + CONSTRAINT ccRuleConditionPropertyUnapproved_factor CHECK (factor IN ('so', 'do', 'co', 'ss', 'ds', 'cs', 'oc', 'sc', 'dc')), + -- source organization, destination organization, channel organization, source spatial, destination spatial, channel spatial, operation category, source category, destination category + CONSTRAINT fkRuleConditionPropertyUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/360-rule.limitUnapproved.sql b/api/sql/schema/360-rule.limitUnapproved.sql new file mode 100644 index 00000000..c67d4932 --- /dev/null +++ b/api/sql/schema/360-rule.limitUnapproved.sql @@ -0,0 +1,21 @@ +CREATE TABLE [rule].[limitUnapproved] ( + limitId INT IDENTITY(1000, 1) NOT NULL, + conditionId INT NOT NULL, + currency VARCHAR(3) NOT NULL, + minAmount MONEY, + maxAmount MONEY, + maxAmountDaily MONEY, + maxCountDaily BIGINT, + maxAmountWeekly MONEY, + maxCountWeekly BIGINT, + maxAmountMonthly MONEY, + maxCountMonthly BIGINT, + [credentials] INT, + [priority] SMALLINT, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT [pkRuleLimitUnapproved] PRIMARY KEY CLUSTERED (limitId ASC), + CONSTRAINT ukRuleLimitUnapprovedConditionCurrencyPriority UNIQUE (conditionId, currency, [priority]), + CONSTRAINT ukRuleLimitUnapprovedConditionCurrencyCredentials UNIQUE (conditionId, currency, [credentials]), + CONSTRAINT [fkRuleLimitUnapproved_condition] FOREIGN KEY (conditionId) REFERENCES [rule].[conditionUnapproved](conditionId), + CONSTRAINT fkRuleLimitUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/360-rule.splitNameUnapproved.sql b/api/sql/schema/360-rule.splitNameUnapproved.sql new file mode 100644 index 00000000..051fe7fe --- /dev/null +++ b/api/sql/schema/360-rule.splitNameUnapproved.sql @@ -0,0 +1,11 @@ +CREATE TABLE [rule].[splitNameUnapproved] ( + splitNameId INT IDENTITY(1000, 1) NOT NULL, + conditionId INT NOT NULL, + name VARCHAR(50) NOT NULL, + tag VARCHAR(max), + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT [pkRuleSplitNameUnapproved] PRIMARY KEY CLUSTERED (splitNameId ASC), + CONSTRAINT [fkRuleSplitNameUnapproved_ruleCondition] FOREIGN KEY (conditionId) REFERENCES [rule].[conditionUnapproved](conditionId), + CONSTRAINT [ukRuleSplitNameUnapprovedConditionIdName] UNIQUE (conditionId, name), + CONSTRAINT fkRuleSplitNameUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/370-rule.splitAssignmentUnapproved.sql b/api/sql/schema/370-rule.splitAssignmentUnapproved.sql new file mode 100644 index 00000000..16b6d73f --- /dev/null +++ b/api/sql/schema/370-rule.splitAssignmentUnapproved.sql @@ -0,0 +1,14 @@ +CREATE TABLE [rule].[splitAssignmentUnapproved] ( + splitAssignmentId INT IDENTITY(1000, 1) NOT NULL, + splitNameId INT NOT NULL, + debit VARCHAR(50) NOT NULL, + credit VARCHAR(50) NOT NULL, + minValue MONEY, + maxValue MONEY, + [percent] DECIMAL(9, 2), + description VARCHAR(50) NOT NULL, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT [pkRuleSplitAssignmentUnapproved] PRIMARY KEY CLUSTERED (splitAssignmentId ASC), + CONSTRAINT [fkRuleSplitAssignmentUnapproved_ruleSplitName] FOREIGN KEY (splitNameId) REFERENCES [rule].[splitNameUnapproved](splitNameId), + CONSTRAINT fkRuleSplitAssignmentUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/370-rule.splitRangeUnapproved.sql b/api/sql/schema/370-rule.splitRangeUnapproved.sql new file mode 100644 index 00000000..898e704a --- /dev/null +++ b/api/sql/schema/370-rule.splitRangeUnapproved.sql @@ -0,0 +1,22 @@ +CREATE TABLE [rule].[splitRangeUnapproved] ( + splitRangeId INT IDENTITY(1000, 1) NOT NULL, + splitNameId INT NOT NULL, + startAmount MONEY NOT NULL, + startAmountCurrency VARCHAR(3) NOT NULL, + startAmountDaily MONEY NOT NULL, + startCountDaily BIGINT NOT NULL, + startAmountWeekly MONEY NOT NULL, + startCountWeekly BIGINT NOT NULL, + startAmountMonthly MONEY NOT NULL, + startCountMonthly BIGINT NOT NULL, + isSourceAmount BIT NOT NULL, + minValue MONEY, + maxValue MONEY, + [percent] DECIMAL(9, 2), + percentBase MONEY, + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT [pkRuleSplitRangeUnapproved] PRIMARY KEY CLUSTERED (splitRangeId ASC), + CONSTRAINT [ukRuleSplitRangeUnapproved_splitNameId__startAmount__startAmountCurrency] UNIQUE (splitNameId, startAmount, startAmountCurrency, startAmountDaily, startCountDaily, startAmountWeekly, startCountWeekly, startAmountMonthly, startCountMonthly), + CONSTRAINT [fkRuleSplitRangeUnapproved_ruleSplitName] FOREIGN KEY (splitNameId) REFERENCES [rule].[splitNameUnapproved](splitNameId), + CONSTRAINT fkRuleSplitRangeUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/380-rule.splitAnalyticUnapproved.sql b/api/sql/schema/380-rule.splitAnalyticUnapproved.sql new file mode 100644 index 00000000..009a740a --- /dev/null +++ b/api/sql/schema/380-rule.splitAnalyticUnapproved.sql @@ -0,0 +1,11 @@ +CREATE TABLE [rule].[splitAnalyticUnapproved] ( + splitAnalyticId INT IDENTITY(1000, 1) NOT NULL, + splitAssignmentId INT NOT NULL, + [name] VARCHAR(50), + [value] VARCHAR(100), + status VARCHAR(20) NULL DEFAULT('pending'), + CONSTRAINT [pkRuleSplitAnalyticUnapproved] PRIMARY KEY CLUSTERED (splitAnalyticId ASC), + CONSTRAINT [ukRuleSplitAnalyticUnapproved_splitAssignmentId_name] UNIQUE (splitAssignmentId, [name]), + CONSTRAINT [fkRuleSplitAnalyticUnapproved_ruleSplitName] FOREIGN KEY (splitAssignmentId) REFERENCES [rule].[splitAssignmentUnapproved](splitAssignmentId), + CONSTRAINT fkRuleSplitAnalyticUnapproved_status FOREIGN KEY(status) REFERENCES [core].[status] (statusId) +) diff --git a/api/sql/schema/750-rule.decision.fetch.sql b/api/sql/schema/750-rule.decision.fetch.sql index 4ea72027..60a81e91 100644 --- a/api/sql/schema/750-rule.decision.fetch.sql +++ b/api/sql/schema/750-rule.decision.fetch.sql @@ -3,7 +3,7 @@ ALTER PROCEDURE [rule].[decision.fetch] @operationDate DATETIME, -- the date when operation is triggered @sourceAccountId NVARCHAR(255), -- source account id @destinationAccountId NVARCHAR(255), -- destination account id - @amount MONEY, -- operation amount + @amountString VARCHAR(21), -- operation amount @totals [rule].totals READONLY, -- totals by transfer type (amountDaily, countDaily, amountWeekly ... etc.) @currency VARCHAR(3), -- operation currenc @isSourceAmount BIT, @@ -14,7 +14,14 @@ ALTER PROCEDURE [rule].[decision.fetch] @credentials INT = NULL, -- the passed credentials to validate operation success @isTransactionValidate BIT = 0 -- flag showing if operation is only validated (1) or executed (0) AS -BEGIN +BEGIN TRY + + DECLARE @scale TINYINT = ISNULL((SELECT scale + FROM core.currency c + JOIN core.itemName it ON it.itemNameId = c.itemNameId + WHERE itemCode = @currency), 2) + DECLARE @amount MONEY = TRY_CONVERT(MONEY, @amountString) + IF @amount IS NULL RAISERROR('rule.amount', 16, 1) DECLARE @transferTypeId BIGINT SELECT @transferTypeId = CAST(value AS BIGINT) @@ -34,7 +41,7 @@ BEGIN countMonthly BIGINT ) - SET @operationDate = ISNULL(@operationDate, GETDATE()) + SET @operationDate = ISNULL(@operationDate, GETUTCDATE()) DECLARE @calcCommission MONEY, @@ -286,10 +293,10 @@ BEGIN SELECT 'amount' AS resultSetName, 1 single SELECT - (SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|acquirer|%' AND tag LIKE '%|fee|%') acquirerFee, - (SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|issuer|%' AND tag LIKE '%|fee|%') issuerFee, - NULL processorFee, -- @TODO calc processor fee - (SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|commission|%') commission, + CONVERT(VARCHAR(21), ROUND((SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|acquirer|%' AND tag LIKE '%|fee|%'), @scale), 2) acquirerFee, + CONVERT(VARCHAR(21), ROUND((SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|issuer|%' AND tag LIKE '%|fee|%'), @scale), 2) issuerFee, + CONVERT(VARCHAR(21), ROUND((SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|processor|%' AND tag LIKE '%|fee|%'), @scale), 2) processorFee, + CONVERT(VARCHAR(21), ROUND((SELECT SUM(ISNULL(fee, 0)) FROM @fee WHERE tag LIKE '%|commission|%'), @scale), 2) commission, @operationDate transferDateTime, @transferTypeId transferTypeId @@ -319,11 +326,11 @@ BEGIN a.conditionId, a.splitNameId, a.tag, - CONVERT(VARCHAR, CAST(CASE + CONVERT(VARCHAR, ROUND(CAST(CASE WHEN assignment.[percent] * a.fee / 100 > assignment.maxValue THEN maxValue WHEN assignment.[percent] * a.fee / 100 < assignment.minValue THEN minValue ELSE assignment.[percent] * a.fee / 100 - END AS MONEY), 2) amount, + END AS MONEY), @scale), 2) amount, ISNULL(d.accountNumber, assignment.debit) debit, ISNULL(c.accountNumber, assignment.credit) credit, assignment.description, @@ -336,4 +343,10 @@ BEGIN integration.vAssignment d ON CAST(d.accountId AS VARCHAR(100)) = assignment.debit LEFT JOIN integration.vAssignment c ON CAST(c.accountId AS VARCHAR(100)) = assignment.credit -END +END TRY +BEGIN CATCH + IF @@trancount > 0 + ROLLBACK TRANSACTION + EXEC [core].[error] + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.decision.lookup.sql b/api/sql/schema/750-rule.decision.lookup.sql index ad9f8541..ff1908af 100644 --- a/api/sql/schema/750-rule.decision.lookup.sql +++ b/api/sql/schema/750-rule.decision.lookup.sql @@ -5,7 +5,7 @@ ALTER PROCEDURE [rule].[decision.lookup] @sourceAccount VARCHAR(100), -- source account number @sourceCardProductId BIGINT = NULL, -- product id of the card @destinationAccount VARCHAR(100), -- destination account number - @amount money, -- operation amount + @amount VARCHAR(21), -- operation amount @currency VARCHAR(3), -- operation currency @isSourceAmount BIT = 0, @sourceAccountOwnerId BIGINT = NULL, -- the source account owner id @@ -96,7 +96,7 @@ BEGIN -- if check credentials has been setup for the account and/or the account product, assign the value to variable. account is with higher priority SET @credentialsCheck = CASE WHEN COALESCE (@sourceAccountCheckMask, @sourceProductCheckMask, 0) = 0 THEN NULL ELSE ISNULL (@sourceAccountCheckMask, @sourceProductCheckMask) END - SELECT @operationDate = ISNULL(@operationDate, GETDATE()) + SELECT @operationDate = ISNULL(@operationDate, GETUTCDATE()) INSERT INTO @totals(transferTypeId, amountDaily, countDaily, amountWeekly, countWeekly, amountMonthly, countMonthly) @@ -179,7 +179,7 @@ BEGIN @operationDate = @operationDate, @sourceAccountId = @sourceAccountId, @destinationAccountId = @destinationAccountId, - @amount = @amount, + @amountString = @amount, @totals = @totals, @currency = @currency, @isSourceAmount = @isSourceAmount, diff --git a/api/sql/schema/750-rule.operation.lookup.sql b/api/sql/schema/750-rule.operation.lookup.sql index fff512e4..a6be69a0 100644 --- a/api/sql/schema/750-rule.operation.lookup.sql +++ b/api/sql/schema/750-rule.operation.lookup.sql @@ -5,7 +5,7 @@ AS SELECT 'operation' AS resultSetName, 1 single SELECT n.itemNameId transferTypeId, - ISNULL(@operationDateTime, GETDATE()) transferDateTime + ISNULL(@operationDateTime, GETUTCDATE()) transferDateTime FROM [core].[itemName] n JOIN diff --git a/api/sql/schema/750-rule.rule.add.sql b/api/sql/schema/750-rule.rule.add.sql index 661a83f5..a80869b6 100644 --- a/api/sql/schema/750-rule.rule.add.sql +++ b/api/sql/schema/750-rule.rule.add.sql @@ -41,7 +41,7 @@ BEGIN TRY operationEndDate, sourceAccountId, destinationAccountId, - GETDATE(), + GETUTCDATE(), ISNULL(createdBy, @userId) FROM @condition; @@ -228,7 +228,7 @@ BEGIN TRY SELECT @conditionId [key], c.priority rulePriority, - GETDATE() creationDateTime + GETUTCDATE() creationDateTime FROM @condition c FOR XML RAW diff --git a/api/sql/schema/750-rule.rule.addUnapproved.sql b/api/sql/schema/750-rule.rule.addUnapproved.sql new file mode 100644 index 00000000..8896b392 --- /dev/null +++ b/api/sql/schema/750-rule.rule.addUnapproved.sql @@ -0,0 +1,269 @@ +ALTER PROCEDURE [rule].[rule.addUnapproved] + @condition [rule].conditionUnapprovedTT READONLY, + @conditionActor [rule].conditionActorUnapprovedTT READONLY, + @conditionItem [rule].conditionItemUnapprovedTT READONLY, + @conditionProperty [rule].conditionPropertyUnapprovedTT READONLY, + @limit [rule].limitUnapprovedTT READONLY, + @split XML, + @meta core.metaDataTT READONLY -- information for the logged user +AS +DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) +DECLARE @splitName [rule].splitNameUnapprovedTT, + @splitAssignment [rule].splitAssignmentUnapprovedTT, + @conditionId INT +BEGIN TRY + + IF EXISTS + ( + SELECT [priority] + FROM [rule].condition + WHERE [priority] = (SELECT [priority] FROM @condition) + AND isDeleted = 0 + ) + OR + EXISTS + ( + SELECT [priority] + FROM [rule].conditionUnapproved + WHERE [priority] = (SELECT [priority] FROM @condition) + ) + BEGIN + RAISERROR ('rule.duplicatedPriority', 16, 1) + END + + BEGIN TRANSACTION + + INSERT INTO [rule].conditionUnapproved( + [priority], + operationStartDate, + operationEndDate, + sourceAccountId, + destinationAccountId, + createdOn, + createdBy, + status + ) + SELECT + [priority], + operationStartDate, + operationEndDate, + sourceAccountId, + destinationAccountId, + GETDATE(), + ISNULL(createdBy, @userId), + 'pending' + FROM @condition; + + SET @conditionId = SCOPE_IDENTITY() + + INSERT INTO [rule].conditionActorUnapproved + ( + conditionId, + factor, + actorId, + status + ) + SELECT + @conditionId, + factor, + actorId, + 'pending' + FROM @conditionActor + + INSERT INTO [rule].conditionItemUnapproved + ( + conditionId, + factor, + itemNameId, + status + ) + SELECT + @conditionId, + factor, + itemNameId, + 'pending' + FROM @conditionItem + + INSERT INTO [rule].conditionPropertyUnapproved + ( + conditionId, + factor, + name, + value, + status + ) + SELECT + @conditionId, + factor, + name, + value, + 'pending' + FROM @conditionProperty + + INSERT INTO [rule].limitUnapproved( + conditionId, + currency, + minAmount, + maxAmount, + maxAmountDaily, + maxCountDaily, + maxAmountWeekly, + maxCountWeekly, + maxAmountMonthly, + maxCountMonthly, + [credentials], + [priority], + status + ) + SELECT @conditionId, + [currency], + [minAmount], + [maxAmount], + [maxAmountDaily], + [maxCountDaily], + [maxAmountWeekly], + [maxCountWeekly], + [maxAmountMonthly], + [maxCountMonthly], + [credentials], + [priority], + 'pending' + FROM @limit + + MERGE INTO [rule].splitNameUnapproved + USING @split.nodes('/data/rows/splitName') AS records(r) + ON 1 = 0 + WHEN NOT MATCHED THEN + INSERT (conditionId, name, tag, status) VALUES (@conditionId, r.value('(name)[1]', 'NVARCHAR(50)'), r.value('(tag)[1]', 'NVARCHAR(max)'), 'pending') + OUTPUT INSERTED.* INTO @splitName; + + MERGE INTO [rule].splitRangeUnapproved + USING ( + SELECT + sn.splitNameId AS splitNameId, + splitRange.x.value('(startAmount)[1]', 'money') AS startAmount, + splitRange.x.value('(startAmountCurrency)[1]', 'VARCHAR(3)') AS startAmountCurrency, + ISNULL(splitRange.x.value('(./startAmountDaily/text())[1]', 'money'), 0) AS startAmountDaily, + ISNULL(splitRange.x.value('(./startCountDaily/text())[1]', 'BIGINT'), 0) AS startCountDaily, + ISNULL(splitRange.x.value('(./startAmountWeekly/text())[1]', 'money'), 0) AS startAmountWeekly, + ISNULL(splitRange.x.value('(./startCountWeekly/text())[1]', 'BIGINT'), 0) AS startCountWeekly, + ISNULL(splitRange.x.value('(./startAmountMonthly/text())[1]', 'money'), 0) AS startAmountMonthly, + ISNULL(splitRange.x.value('(./startCountMonthly/text())[1]', 'BIGINT'), 0) AS startCountMonthly, + ISNULL(splitRange.x.value('(isSourceAmount)[1]', 'BIT'), 1) AS isSourceAmount, + splitRange.x.value('(minValue)[1]', 'money') AS minValue, + splitRange.x.value('(maxValue)[1]', 'money') AS maxValue, + splitRange.x.value('(percent)[1]', 'money') AS [percent], + splitRange.x.value('(percentBase)[1]', 'money') AS percentBase, + 'pending' AS status + FROM + @split.nodes('/data/rows/splitRange') AS splitRange(x) + JOIN + @splitName sn + ON + splitRange.x.value('(../splitName/name)[1]', 'NVARCHAR(50)') = sn.name + ) AS r + ON 1 = 0 + WHEN NOT MATCHED THEN + INSERT ( + splitNameId, + startAmount, + startAmountCurrency, + startAmountDaily, + startCountDaily, + startAmountWeekly, + startCountWeekly, + startAmountMonthly, + startCountMonthly, + isSourceAmount, + minValue, + maxValue, + [percent], + percentBase, + status) + VALUES ( + r.splitNameId, + r.startAmount, + r.startAmountCurrency, + r.startAmountDaily, + r.startCountDaily, + r.startAmountWeekly, + r.startCountWeekly, + r.startAmountMonthly, + r.startCountMonthly, + r.isSourceAmount, + r.minValue, + r.maxValue, + r.[percent], + r.percentBase, + 'pending'); + + MERGE INTO [rule].splitAssignmentUnapproved + USING ( + SELECT + sn.splitNameId AS splitNameId, + splitAssignment.x.value('(debit)[1]', 'VARCHAR(50)') AS debit, + splitAssignment.x.value('(credit)[1]', 'VARCHAR(50)') AS credit, + splitAssignment.x.value('(minValue)[1]', 'money') AS minValue, + splitAssignment.x.value('(maxValue)[1]', 'money') AS maxValue, + splitAssignment.x.value('(percent)[1]', 'decimal') AS [percent], + splitAssignment.x.value('(description)[1]', 'VARCHAR(50)') AS description, + 'pending' AS status + FROM + @split.nodes('/data/rows/splitAssignment') AS splitAssignment(x) + JOIN + @splitName sn + ON + splitAssignment.x.value('(../splitName/name)[1]', 'NVARCHAR(50)') = sn.name + ) AS r + ON 1 = 0 + WHEN NOT MATCHED THEN + INSERT (splitNameId, debit, credit, minValue, maxValue, [percent], description, status) + VALUES (r.splitNameId, r.debit, r.credit, r.minValue, r.maxValue, r.[percent], r.description, 'pending') + OUTPUT INSERTED.* INTO @splitAssignment; + + + MERGE INTO [rule].splitAnalyticUnapproved + USING ( + SELECT + sn.splitAssignmentId AS splitAssignmentId, + records.x.value('(name)[1]', 'NVARCHAR(50)') AS [name], + records.x.value('(value)[1]', 'NVARCHAR(150)') AS [value], + 'pending' AS status + FROM + @split.nodes('/data/rows/splitAssignment/splitAnalytic') records(x) + JOIN + @splitAssignment sn + ON + records.x.value('(../debit)[1]', 'NVARCHAR(50)') = sn.debit + AND records.x.value('(../credit)[1]', 'NVARCHAR(50)') = sn.credit + AND records.x.value('(../description)[1]', 'NVARCHAR(50)') = sn.[description] + + ) AS r (splitAssignmentId, [name], [value], status) + ON 1 = 0 + WHEN NOT MATCHED THEN + INSERT (splitAssignmentId, [name], [value], status) + VALUES (r.splitAssignmentId, r.[name], r.[value], 'pending'); + + COMMIT TRANSACTION + + DECLARE @outcome XML = ( + SELECT + @conditionId [key], + c.priority rulePriority, + GETUTCDATE() creationDateTime + FROM + @condition c + FOR XML RAW + ) + + EXEC core.outcome @proc = @@PROCID, @outcome = @outcome, @meta = @meta + + EXEC [rule].[rule.fetch] @meta = @meta, @conditionId = @conditionId +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + + EXEC core.error + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.rule.approve.sql b/api/sql/schema/750-rule.rule.approve.sql new file mode 100644 index 00000000..033a61a6 --- /dev/null +++ b/api/sql/schema/750-rule.rule.approve.sql @@ -0,0 +1,345 @@ +ALTER PROCEDURE [rule].[rule.approve] + @conditionId INT, + @meta core.metaDataTT READONLY -- information for the logged user +AS + +BEGIN TRY + + DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) + -- checks if the user has a right to get user + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END + + IF NOT EXISTS( + SELECT 1 + FROM [rule].[condition] c + WHERE c.conditionId = @conditionId) + AND + NOT EXISTS( + SELECT 1 + FROM [rule].[conditionUnapproved] c + WHERE c.conditionId = @conditionId) + BEGIN + RAISERROR ('rule.ruleNotExists', 16, 1) + END + + BEGIN TRANSACTION + + -- handle condition + IF EXISTS(SELECT 1 FROM [rule].[conditionUnapproved] WHERE conditionId = @conditionId AND isDeleted = 1) + BEGIN + DECLARE @conditionRemoveIds core.arrayList + INSERT INTO @conditionRemoveIds + SELECT @conditionId + EXEC [rule].[rule.remove] @conditionId = @conditionRemoveIds + END + ELSE + BEGIN + IF EXISTS(SELECT 1 FROM [rule].[condition] WHERE conditionId = @conditionId) + BEGIN + UPDATE c + SET + c.updatedBy = cu.updatedBy, + c.updatedOn = cu.updatedOn, + c.status = 'approved', + c.operationStartDate = cu.operationStartDate, + c.operationEndDate = cu.operationEndDate, + c.sourceAccountId = cu.sourceAccountId, + c.priority = cu.priority, + c.isEnabled = cu.isEnabled + FROM [rule].[condition] c + INNER JOIN [rule].[conditionUnapproved] cu ON cu.conditionId = c.conditionId + WHERE c.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[condition] ON -- allow conditionId to be inserted in the condition table + INSERT INTO [rule].[condition] (conditionId, priority, status, operationStartDate, operationEndDate, sourceAccountId, isDeleted, createdBy, updatedBy, isEnabled) + SELECT cu.conditionId, cu.priority, 'approved', cu.operationStartDate, cu.operationEndDate, cu.sourceAccountId, 0, cu.createdBy, cu.updatedBy, cu.isEnabled + FROM [rule].[conditionUnapproved] cu + WHERE cu.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[condition] OFF + END + END + + + + -- handle condition actor + IF EXISTS(SELECT 1 FROM [rule].[conditionActor] WHERE conditionId = @conditionId) + BEGIN + UPDATE ca + SET + ca.factor = cau.factor, + ca.actorId = cau.actorId, + ca.status = 'approved' + FROM [rule].[conditionActor] ca + INNER JOIN [rule].[conditionActorUnapproved] cau ON cau.conditionId = ca.conditionId + WHERE ca.conditionId = @conditionId + END + ELSE + BEGIN + INSERT INTO [rule].[conditionActor] (conditionId, factor, actorId, status) + SELECT cau.conditionId, cau.factor, cau.actorId, 'approved' + FROM [rule].[conditionActorUnapproved] cau + WHERE cau.conditionId = @conditionId + END + + + + -- handle condition item + IF EXISTS(SELECT 1 FROM [rule].[conditionItem] WHERE conditionId = @conditionId) + BEGIN + UPDATE ca + SET + ca.factor = cau.factor, + ca.itemNameId = cau.itemNameId, + ca.status = 'approved' + FROM [rule].[conditionItem] ca + INNER JOIN [rule].[conditionItemUnapproved] cau ON cau.conditionId = ca.conditionId + WHERE ca.conditionId = @conditionId + END + ELSE + BEGIN + INSERT INTO [rule].[conditionItem] (conditionId, factor, itemNameId, status) + SELECT ciu.conditionId, ciu.factor, ciu.itemNameId, 'approved' + FROM [rule].[conditionItemUnapproved] ciu + WHERE ciu.conditionId = @conditionId + END + + + + -- handle condition property + IF EXISTS(SELECT 1 FROM [rule].[conditionProperty] WHERE conditionId = @conditionId) + BEGIN + UPDATE ca + SET + ca.factor = cau.factor, + ca.name = cau.name, + ca.value = cau.value, + ca.status = 'approved' + FROM [rule].[conditionProperty] ca + INNER JOIN [rule].[conditionPropertyUnapproved] cau ON cau.conditionId = ca.conditionId + WHERE ca.conditionId = @conditionId + END + ELSE + BEGIN + INSERT INTO [rule].[conditionProperty] (conditionId, factor, name, value, status) + SELECT cai.conditionId, cai.factor, cai.name, cai.value, 'approved' + FROM [rule].[conditionPropertyUnapproved] cai + WHERE cai.conditionId = @conditionId + END + + + + -- handle limit + IF EXISTS(SELECT 1 FROM [rule].[limit] WHERE conditionId = @conditionId) + BEGIN + UPDATE ca + SET + ca.currency = cau.currency, + ca.minAmount = cau.minAmount, + ca.maxAmount = cau.maxAmount, + ca.maxAmountDaily = cau.maxAmountDaily, + ca.maxCountDaily = cau.maxCountDaily, + ca.maxAmountWeekly = cau.maxAmountWeekly, + ca.maxCountWeekly = cau.maxCountWeekly, + ca.maxAmountMonthly = cau.maxAmountMonthly, + ca.maxCountMonthly = cau.maxCountMonthly, + ca.credentials = cau.credentials, + ca.priority = cau.priority, + ca.status = 'approved' + FROM [rule].limit ca + INNER JOIN [rule].[limitUnapproved] cau ON cau.conditionId = ca.conditionId + WHERE ca.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[limit] ON -- allow limitId to be inserted in the limit table + INSERT INTO [rule].[limit] (limitId, conditionId, currency, minAmount, maxAmount, maxAmountDaily, maxCountDaily, maxAmountWeekly, maxCountWeekly, maxAmountMonthly, maxCountMonthly, [credentials], [priority], status) + SELECT + cai.limitId, + cai.conditionId, + cai.currency, + cai.minAmount, + cai.maxAmount, + cai.maxAmountDaily, + cai.maxCountDaily, + cai.maxAmountWeekly, + cai.maxCountWeekly, + cai.maxAmountMonthly, + cai.maxCountMonthly, + cai.credentials, + cai.priority, + 'approved' + FROM [rule].[limitUnapproved] cai + WHERE cai.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[limit] OFF + END + + + + -- handle split analytic + IF EXISTS( + SELECT 1 FROM [rule].[splitAnalytic] sa + JOIN [rule].[splitAssignment] sp ON sp.splitAssignmentId = sa.splitAssignmentId + JOIN [rule].[splitName] sn ON sp.splitNameId = sn.splitNameId + WHERE sn.conditionId = @conditionId + ) + BEGIN + UPDATE spa + SET + spa.name = spau.name, + spa.value = spau.value, + spa.status = 'approved' + FROM [rule].[splitAnalytic] spa + INNER JOIN [rule].[splitAnalyticUnapproved] spau ON spau.splitAnalyticId = spa.splitAnalyticId + INNER JOIN [rule].[splitAssignmentUnapproved] sp ON sp.splitAssignmentId = spau.splitAssignmentId + INNER JOIN [rule].[splitNameUnapproved] sn ON sp.splitNameId = sp.splitNameId + WHERE sn.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[splitAnalytic] ON -- allow splitAnalyticId to be inserted in the split analytic table + INSERT INTO [rule].[splitAnalytic] (splitAnalyticId, splitAssignmentId, name, value, status) + SELECT spau.splitAnalyticId, spau.splitAssignmentId, spau.name, spau.value, 'approved' + FROM [rule].[splitAnalyticUnapproved] spau + JOIN [rule].[splitAssignmentUnapproved] sp ON sp.splitAssignmentId = spau.splitAssignmentId + JOIN [rule].[splitNameUnapproved] sn ON sp.splitNameId = sn.splitNameId + WHERE sn.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[splitAnalytic] OFF + END + + + + -- handle split name + IF EXISTS(SELECT 1 FROM [rule].[splitName] WHERE conditionId = @conditionId) + BEGIN + UPDATE sn + SET + sn.name = snu.name, + sn.tag = snu.tag, + sn.status = 'approved' + FROM [rule].[splitName] sn + INNER JOIN [rule].[splitNameUnapproved] snu ON snu.splitNameId = sn.splitNameId + WHERE sn.conditionid = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[splitName] ON -- allow split name to be inserted in the split name table + INSERT INTO [rule].[splitName] (splitNameId, conditionId, name, tag, status) + SELECT snu.splitNameId, snu.conditionId, snu.name, snu.tag, 'approved' + FROM [rule].[splitNameUnapproved] snu + WHERE snu.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[splitName] OFF + END + + + + -- handle split range + IF EXISTS( + SELECT 1 FROM [rule].[splitRange] sr + JOIN [rule].[splitName] sn ON sn.splitNameId = sr.splitNameId + WHERE sn.conditionId = @conditionId + ) + BEGIN + UPDATE sr + SET + sr.startAmount = sru.startAmount, + sr.startAmountCurrency = sru.startAmountCurrency, + sr.startAmountDaily = sru.startAmountDaily, + sr.startCountDaily = sru.startCountDaily, + sr.startAmountWeekly = sru.startAmountWeekly, + sr.startCountWeekly = sru.startCountWeekly, + sr.startAmountMonthly = sru.startAmountMonthly, + sr.startCountMonthly = sru.startCountMonthly, + sr.isSourceAmount = sru.isSourceAmount, + sr.minValue = sru.minValue, + sr.maxValue = sru.maxValue, + sr.[percent] = sru.[percent], + sr.percentBase = sru.percentBase, + sr.status = 'approved' + FROM [rule].[splitRange] sr + INNER JOIN [rule].[splitRangeUnapproved] sru ON sru.splitRangeId = sr.splitRangeId + INNER JOIN [rule].[splitNameUnapproved] sn ON sn.splitNameId = sr.splitNameId + WHERE sn.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[splitRange] ON --allow split range id to be inserted + INSERT INTO [rule].[splitRange] ( splitRangeId, startAmount, startAmountCurrency, startAmountDaily, startCountDaily, startAmountWeekly, startCountWeekly, startAmountMonthly, startCountMonthly, isSourceAmount, minValue, maxValue, [percent], percentBase, splitNameId, status) + SELECT + sr.splitRangeId, + sr.startAmount, + sr.startAmountCurrency, + sr.startAmountDaily, + sr.startCountDaily, + sr.startAmountWeekly, + sr.startCountWeekly, + sr.startAmountMonthly, + sr.startCountMonthly, + sr.isSourceAmount, + sr.minValue, + sr.maxValue, + sr.[percent], + sr.percentBase, + sr.splitNameId, + 'approved' + FROM [rule].[splitRangeUnapproved] sr + INNER JOIN [rule].[splitNameUnapproved] sn ON sn.splitNameId = sr.splitNameId + WHERE sn.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[splitRange] OFF + END + + + + -- handle split assignment + IF EXISTS( + SELECT 1 FROM [rule].[splitAssignment] sa + JOIN [rule].[splitName] sn ON sn.splitNameId = sa.splitNameId + WHERE sn.conditionId = @conditionId + ) + BEGIN + UPDATE sa + SET + sa.debit = sau.debit, + sa.credit = sau.credit, + sa.minValue = sau.minValue, + sa.maxValue = sau.maxValue, + sa.[percent] = sau.[percent], + sa.description = sau.description, + sa.status = 'approved' + FROM [rule].[splitAssignment] sa + INNER JOIN [rule].[splitAssignmentUnapproved] sau ON sau.splitAssignmentId = sa.splitAssignmentId + JOIN [rule].[splitNameUnapproved] sna ON sau.splitNameId = sna.splitNameId + WHERE sna.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[splitAssignment] ON -- allow splitAssignment to be inserted in the split assignment table + INSERT INTO [rule].[splitAssignment] (splitAssignmentId, splitNameId, debit, credit, minValue, maxValue, [percent], description, status) + SELECT sa.splitAssignmentId, sa.splitNameId, sa.debit, sa.credit, sa.minValue, sa.maxValue, sa.[percent], sa.description, 'approved' + FROM [rule].[splitAssignmentUnapproved] sa + JOIN [rule].[splitNameUnapproved] sn ON sn.splitNameId = sa.splitNameId + WHERE sn.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[splitAssignment] OFF + END + + + DECLARE @conditionIds core.arrayList + INSERT INTO @conditionIds + SELECT @conditionId + EXEC [rule].[rule.deleteUnapproved] @conditionId = @conditionIds + + COMMIT TRANSACTION + +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + EXEC core.error + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.rule.deleteUnapproved.sql b/api/sql/schema/750-rule.rule.deleteUnapproved.sql new file mode 100644 index 00000000..377e7093 --- /dev/null +++ b/api/sql/schema/750-rule.rule.deleteUnapproved.sql @@ -0,0 +1,93 @@ +ALTER PROCEDURE [rule].[rule.deleteUnapproved] + @conditionId core.arrayList READONLY, + @meta core.metaDataTT READONLY -- information for the user that makes the operation +AS +DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) +BEGIN TRY + + BEGIN TRANSACTION + DELETE x + FROM + [rule].limitUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + DELETE x + FROM + [rule].conditionActorUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + DELETE x + FROM + [rule].conditionItemUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + DELETE x + FROM + [rule].conditionPropertyUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + DELETE + x + FROM + [rule].splitRangeUnapproved x + JOIN + [rule].splitNameUnapproved s ON s.splitNameId = x.splitNameId + JOIN + @conditionId item ON s.conditionId = item.value + + DELETE + x + FROM + [rule].splitAnalyticUnapproved x + JOIN + [rule].splitAssignmentUnapproved y ON y.splitAssignmentId = x.splitAssignmentId + JOIN + [rule].splitNameUnapproved s ON s.splitNameId = y.splitNameId + JOIN + @conditionId item ON s.conditionId = item.value + + DELETE + x + FROM + [rule].splitAssignmentUnapproved x + JOIN + [rule].splitNameUnapproved s ON s.splitNameId = x.splitNameId + JOIN + @conditionId item ON s.conditionId = item.value + + DELETE + x + FROM + [rule].splitRangeUnapproved x + JOIN + [rule].splitNameUnapproved s ON s.splitNameId = x.splitNameId + JOIN + @conditionId item ON s.conditionId = item.value + + DELETE + x + FROM + [rule].splitNameUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + DELETE + x + FROM + [rule].conditionUnapproved x + JOIN + @conditionId item ON x.conditionId = item.value + + + COMMIT TRANSACTION +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + EXEC core.error + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.rule.discard.sql b/api/sql/schema/750-rule.rule.discard.sql new file mode 100644 index 00000000..a7ef78c7 --- /dev/null +++ b/api/sql/schema/750-rule.rule.discard.sql @@ -0,0 +1,109 @@ +ALTER PROCEDURE [rule].[rule.discard] + @conditionId INT, + @meta core.metaDataTT READONLY -- information for the logged user +AS + +BEGIN TRY + + DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) + -- checks if the user has a right to get user + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END + + IF NOT EXISTS( + SELECT 1 + FROM [rule].[condition] c + WHERE c.conditionId = @conditionId) + AND + NOT EXISTS( + SELECT 1 + FROM [rule].[conditionUnapproved] c + WHERE c.conditionId = @conditionId) + BEGIN + RAISERROR ('rule.ruleNotExists', 16, 1) + END + + + + -- check if the maker and the checker are different users + IF EXISTS ( + SELECT u.updatedBy + FROM [user].[userUnapproved] u + LEFT JOIN [user].[vSystemUser] su ON su.actorId = u.updatedBy + WHERE u.actorId = @userId + AND u.updatedBy = @userId + AND su.actorId IS NULL) + RAISERROR('user.cannotPerformThisOperation', 16, 1) + + BEGIN TRANSACTION + + DECLARE @splitNameId NVARCHAR(25); + SET @splitNameId = (SELECT splitNameId FROM [rule].[splitNameUnapproved] WHERE conditionId = @conditionId ) + + + -- handle condition actor + DELETE FROM [rule].[conditionActorUnapproved] + WHERE conditionId = @conditionId + + + -- handle condition item + DELETE FROM [rule].[conditionItemUnapproved] + WHERE conditionId = @conditionId + + + + -- handle condition property + DELETE FROM [rule].[conditionPropertyUnapproved] + WHERE conditionId = @conditionId + + + -- handle limit + DELETE FROM [rule].limit + WHERE conditionId = @conditionId + + + IF @splitNameId IS NOT NULL + BEGIN + -- handle split analytic + DELETE spa + FROM [rule].[splitAnalyticUnapproved] spa + INNER JOIN [rule].[splitAssignmentUnapproved] sp ON sp.splitAssignmentId = spa.splitAssignmentId + INNER JOIN [rule].[splitNameUnapproved] sn ON sp.splitNameId = sp.splitNameId + WHERE sn.splitNameId = @splitNameId + + + -- handle split assignment + DELETE sau + FROM [rule].[splitAssignmentUnapproved] sau + INNER JOIN [rule].[splitNameUnapproved] sn ON sn.splitNameId = sau.splitNameId + WHERE sn.conditionId = @conditionId + + -- handle split range + DELETE sau + FROM [rule].[splitRangeUnapproved] sau + INNER JOIN [rule].[splitNameUnapproved] sn ON sn.splitNameId = sau.splitNameId + WHERE sn.conditionId = @conditionId + + -- handle split name + DELETE FROM [rule].[splitNameUnapproved] + WHERE conditionid = @conditionId + END + + -- handle condition + DELETE FROM [rule].[conditionUnapproved] + WHERE conditionId = @conditionId + + + COMMIT TRANSACTION + +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + EXEC core.error + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.rule.edit.sql b/api/sql/schema/750-rule.rule.edit.sql index 6f53a96a..5130bb09 100644 --- a/api/sql/schema/750-rule.rule.edit.sql +++ b/api/sql/schema/750-rule.rule.edit.sql @@ -10,7 +10,7 @@ AS SET NOCOUNT ON DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) DECLARE @splitName TABLE (splitNameId INT, rowPosition INT) -DECLARE @splitAssignment [rule].splitAssignmentTT +DECLARE @splitAssignment [rule].splitAssignmentUnapprovedTT DECLARE @conditionId INT = (SELECT conditionId FROM @condition) BEGIN TRY @@ -18,7 +18,7 @@ BEGIN TRY IF EXISTS ( SELECT [priority] - FROM [rule].condition + FROM [rule].conditionUnapproved WHERE [priority] = (SELECT [priority] FROM @condition) AND conditionId != @conditionId AND isDeleted = 0 @@ -39,10 +39,10 @@ BEGIN TRY destinationAccountId = c1.destinationAccountId, updatedOn = GETDATE(), updatedBy = @userId - FROM [rule].condition c + FROM [rule].conditionUnapproved c JOIN @condition c1 ON c.conditionId = c1.conditionId - MERGE INTO [rule].conditionActor ca + MERGE INTO [rule].conditionActorUnapproved ca USING @conditionActor ca1 ON ca.conditionId = ca1.conditionId AND ca.factor = ca1.factor AND ca.actorId = ca1.actorId WHEN NOT MATCHED BY TARGET THEN @@ -51,7 +51,7 @@ BEGIN TRY WHEN NOT MATCHED BY SOURCE AND ca.conditionId = @conditionId THEN DELETE; - MERGE INTO [rule].conditionItem ci + MERGE INTO [rule].conditionItemUnapproved ci USING @conditionItem ci1 ON ci.conditionId = ci1.conditionId AND ci.factor = ci1.factor AND ci.itemNameId = ci1.itemNameId WHEN NOT MATCHED BY TARGET THEN @@ -60,7 +60,7 @@ BEGIN TRY WHEN NOT MATCHED BY SOURCE AND ci.conditionId = @conditionId THEN DELETE; - MERGE INTO [rule].conditionProperty cp + MERGE INTO [rule].conditionPropertyUnapproved cp USING @conditionProperty cp1 ON cp.conditionId = cp1.conditionId AND cp.factor = cp1.factor AND cp.name = cp1.name WHEN MATCHED THEN @@ -72,7 +72,7 @@ BEGIN TRY WHEN NOT MATCHED BY SOURCE AND cp.conditionId = @conditionId THEN DELETE; - MERGE INTO [rule].limit l + MERGE INTO [rule].limitUnapproved l USING @limit l1 ON l.[limitId] = l1.limitId WHEN MATCHED THEN UPDATE @@ -94,25 +94,25 @@ BEGIN TRY DELETE; DELETE x - FROM [rule].splitRange x - JOIN [rule].splitName sn ON x.splitNameId = sn.splitNameId + FROM [rule].splitRangeUnapproved x + JOIN [rule].splitNameUnapproved sn ON x.splitNameId = sn.splitNameId LEFT JOIN @split.nodes('/data/rows/splitRange/splitRangeId') AS records(x) ON x.splitRangeId = records.x.value('(./text())[1]', 'INT') WHERE sn.conditionId = @conditionId AND records.x.value('(./text())[1]', 'INT') IS NULL DELETE x - FROM [rule].splitAnalytic x - JOIN [rule].splitAssignment sa ON x.splitAssignmentId = sa.splitAssignmentId - JOIN [rule].splitName sn ON sa.splitNameId = sn.splitNameId + FROM [rule].splitAnalyticUnapproved x + JOIN [rule].splitAssignmentUnapproved sa ON x.splitAssignmentId = sa.splitAssignmentId + JOIN [rule].splitNameUnapproved sn ON sa.splitNameId = sn.splitNameId LEFT JOIN @split.nodes('/data/rows/splitAssignment/splitAnalytic/splitAnalyticId') AS records(x) ON x.splitAnalyticId = records.x.value('(./text())[1]', 'INT') WHERE sn.conditionId = @conditionId AND records.x.value('(./text())[1]', 'INT') IS NULL DELETE x - FROM [rule].splitAssignment x - JOIN [rule].splitName sn ON x.splitNameId = sn.splitNameId + FROM [rule].splitAssignmentUnapproved x + JOIN [rule].splitNameUnapproved sn ON x.splitNameId = sn.splitNameId LEFT JOIN @split.nodes('/data/rows/splitAssignment/splitAssignmentId') AS records(x) ON x.splitAssignmentId = records.x.value('(./text())[1]', 'INT') WHERE sn.conditionId = @conditionId AND records.x.value('(./text())[1]', 'INT') IS NULL - MERGE INTO [rule].splitName x + MERGE INTO [rule].splitNameUnapproved x USING ( SELECT records.r.value('(./splitNameId)[1]', 'INT') AS splitNameId, @@ -132,7 +132,7 @@ BEGIN TRY DELETE OUTPUT INSERTED.splitNameId, sn.rowPos INTO @splitName; - MERGE INTO [rule].splitRange x + MERGE INTO [rule].splitRangeUnapproved x USING ( SELECT records.x.value('(./splitRangeId)[1]', 'INT') AS splitRangeId, @@ -200,7 +200,7 @@ BEGIN TRY r.[percent], r.percentBase); - MERGE INTO [rule].splitAssignment x + MERGE INTO [rule].splitAssignmentUnapproved x USING ( SELECT records.x.value('(./splitAssignmentId)[1]', 'INT') AS splitAssignmentId, @@ -227,7 +227,7 @@ BEGIN TRY VALUES (r.splitNameId, r.debit, r.credit, r.minValue, r.maxValue, r.[percent], r.description) OUTPUT INSERTED.* INTO @splitAssignment; - MERGE INTO [rule].splitAnalytic x + MERGE INTO [rule].splitAnalyticUnapproved x USING ( SELECT DISTINCT -- new splitAnalytic & new splitAssignment NULL AS [splitAnalyticId], @@ -297,7 +297,7 @@ BEGIN TRY EXEC core.outcome @proc = @@PROCID, @outcome = @outcome, @meta = @meta - EXEC [rule].[rule.fetch] @conditionId = @conditionId + EXEC [rule].[rule.fetch] @meta = @meta, @conditionId = @conditionId END TRY BEGIN CATCH IF @@TRANCOUNT > 0 diff --git a/api/sql/schema/750-rule.rule.fetch.sql b/api/sql/schema/750-rule.rule.fetch.sql index d17b8a49..46252557 100644 --- a/api/sql/schema/750-rule.rule.fetch.sql +++ b/api/sql/schema/750-rule.rule.fetch.sql @@ -1,26 +1,42 @@ ALTER PROCEDURE [rule].[rule.fetch] @conditionId INT = NULL, - @operationCode NVARCHAR(200) = NULL, -- used for filtering, the code of the operation for which the rules are defined - @pageSize INT = 25, -- how many rows will be returned per page - @pageNumber INT = 1, -- which page number to display, - @meta core.metaDataTT READONLY -- information for the logged user + @pageSize INT = 25, + -- how many ROWS will be returned per page + @pageNumber INT = 1, + -- which page number to display, + @meta core.metaDataTT READONLY +-- information for the logged user AS -SET NOCOUNT ON +DECLARE @userId BIGINT = (SELECT [auth.actorId] +FROM @meta) +DECLARE @startRow INT = (@pageNumber - 1) * @pageSize + 1 +DECLARE @endRow INT = @startRow + @pageSize - 1 BEGIN - IF @conditionId IS NOT NULL AND NOT EXISTS (SELECT conditionid FROM [rule].[condition] WHERE conditionId = @conditionId) - RAISERROR ('rule.ruleNotExists', 16, 1) - DECLARE @operationId BIGINT = (SELECT itemNameId FROM core.itemName i - JOIN core.itemType it ON i.itemTypeId = it.itemTypeId - WHERE it.alias = 'operation' AND i.itemCode = @operationCode) + -- checks if the user has a right to get user + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END - DECLARE @recordsTotal INT = 0 + IF @conditionId IS NOT NULL AND NOT EXISTS (SELECT conditionId + FROM [rule].[condition] + WHERE conditionId = @conditionId) + AND + NOT EXISTS + (SELECT conditionId + FROM [rule].[conditionUnapproved] + WHERE conditionId = @conditionId) + RAISERROR ('rule.ruleNotExists', 16, 1) IF OBJECT_ID('tempdb..#RuleConditions') IS NOT NULL DROP TABLE #RuleConditions - CREATE TABLE #RuleConditions ( + CREATE TABLE #RuleConditions + ( conditionId INT, [priority] INT, operationEndDate DATETIME, @@ -28,24 +44,53 @@ BEGIN sourceAccountId NVARCHAR(255), destinationAccountId NVARCHAR(255), rowNum INT, - recordsTotal INT) - - INSERT INTO #RuleConditions(conditionId, [priority], operationEndDate, operationStartDate, sourceAccountId, destinationAccountId, rowNum, recordsTotal) - SELECT rc.conditionId, rc.[priority], - rc.operationEndDate, rc.operationStartDate, - rc.sourceAccountId, rc.destinationAccountId, - ROW_NUMBER() OVER(ORDER BY rc.[priority] ASC) AS rowNum, - COUNT(*) OVER(PARTITION BY 1) AS recordsTotal - FROM [rule].condition rc - WHERE (@conditionId IS NULL OR rc.conditionId = @conditionId ) - AND rc.isDeleted = 0 - AND (@operationId IS NULL - OR EXISTS(SELECT * FROM [rule].conditionItem ri WHERE ri.conditionId = rc.conditionId AND ri.factor = 'oc' AND ri.itemNameId = @operationId)) - ORDER BY rc.[priority] ASC - OFFSET (@pageNumber - 1) * @PageSize ROWS - FETCH NEXT @PageSize ROWS ONLY - - SET @recordsTotal = ISNULL((SELECT TOP 1 recordsTotal FROM #RuleConditions), 0) + status VARCHAR(20), + recordsTotal INT, + isEnabled INT + ); + WITH + CTE + AS + ( + SELECT rc.conditionId, + rc.[priority], + rc.operationEndDate, + rc.operationStartDate, + rc.sourceAccountId, + rc.destinationAccountId, + rc.status, + rc.isEnabled, + ROW_NUMBER() OVER(ORDER BY rc.[priority] ASC) AS rowNum, + COUNT(*) OVER(PARTITION BY 1) AS recordsTotal + FROM + ( + SELECT c.conditionId, c.status, c.[priority], c.operationStartDate, c.operationEndDate, c.sourceAccountId, c.destinationAccountId, 0 AS [isDeleted], c.isEnabled + FROM [rule].condition c + LEFT JOIN [rule].conditionUnapproved cu ON cu.conditionId = c.conditionId + UNION ALL + SELECT cu.conditionId, cu.status, cu.[priority], cu.operationStartDate, cu.operationEndDate, cu.sourceAccountId, cu.destinationAccountId, cu.isDeleted, cu.isEnabled + FROM [rule].conditionUnapproved cu + LEFT JOIN [rule].condition c ON c.conditionId = cu.conditionId + ) rc + WHERE (@conditionId IS NULL OR rc.conditionId = @conditionId ) AND rc.isDeleted = 0 + ) + + INSERT INTO #RuleConditions + ( conditionId, [priority], operationEndDate, operationStartDate, sourceAccountId, destinationAccountId, rowNum, recordsTotal, status, isEnabled) + SELECT + conditionId, + [priority], + operationEndDate, + operationStartDate, + sourceAccountId, + destinationAccountId, + rowNum, + recordsTotal, + status, + isEnabled + FROM CTE + WHERE (rowNum BETWEEN @startRow AND @endRow) OR (@startRow >= recordsTotal AND RowNum > recordsTotal - (recordsTotal % @pageSize)) + SELECT 'condition' AS resultSetName SELECT @@ -54,90 +99,165 @@ BEGIN rct.[operationEndDate], rct.[operationStartDate], rct.[sourceAccountId], - rct.[destinationAccountId] + rct.[destinationAccountId], + rct.status, + rct.isEnabled FROM #RuleConditions rct - ORDER BY rct.[priority] ASC SELECT 'conditionActor' AS resultSetName SELECT - ca.*, a.actorType AS [type] + cca.conditionId, cca.factor, cca.actorId, cca.status, + CASE WHEN @conditionId IS NOT NULL THEN CAST(cca.actorId AS NVARCHAR) ELSE org.organizationName END AS actorId, a.actorType AS [type] + -- ca.*, a.actorType AS [type] FROM - [rule].conditionActor ca - JOIN - #RuleConditions rct ON rct.conditionId = ca.conditionId - JOIN - core.actor a ON a.actorId = ca.actorId + ( + SELECT ca.conditionId, ca.status, ca.factor, ca.actorId + FROM [rule].conditionActor ca + + UNION ALL + + SELECT cau.conditionId, cau.status, cau.factor, cau.actorId + FROM [rule].conditionActorUnapproved cau + + ) cca + JOIN #RuleConditions rct ON rct.conditionId = cca.conditionId + JOIN core.actor a ON a.actorId = cca.actorId + JOIN customer.organization org ON org.actorId = cca.actorId + WHERE + @conditionId IS NULL OR cca.conditionId = @conditionId SELECT 'conditionItem' AS resultSetName SELECT - c.*, t.alias AS [type], t.name AS itemTypeName, i.itemName + c.conditionId, c.factor, c.status, t.alias AS [type], t.name AS itemTypeName, i.itemName AS itemName FROM - [rule].conditionItem c - JOIN - #RuleConditions rct ON rct.conditionId = c.conditionId - JOIN - core.itemName i ON i.itemNameId = c.itemNameId - JOIN - core.itemType t ON t.itemTypeId = i.itemTypeId + ( + SELECT ci.conditionId, ci.factor, ci.status, ci.itemNameId + FROM [rule].conditionItem ci + + UNION ALL + + SELECT ciu.conditionId, ciu.factor, ciu.status, ciu.itemNameId + FROM [rule].conditionItemUnapproved ciu + ) c + JOIN #RuleConditions rct ON rct.conditionId = c.conditionId + JOIN core.itemName i ON i.itemNameId = c.itemNameId + JOIN core.itemType t ON t.itemTypeId = i.itemTypeId + WHERE + @conditionId IS NULL OR c.conditionId = @conditionId + SELECT 'conditionProperty' AS resultSetName SELECT cp.* FROM - [rule].conditionProperty cp - JOIN - #RuleConditions rct ON rct.conditionId = cp.conditionId + ( + SELECT * + FROM [rule].conditionProperty + + UNION ALL + + SELECT * + FROM [rule].conditionPropertyUnapproved + ) cp + JOIN #RuleConditions rct ON rct.conditionId = cp.conditionId + WHERE + @conditionId IS NULL OR cp.conditionId = @conditionId SELECT 'splitName' AS resultSetName SELECT sn.* FROM - [rule].splitName sn - JOIN - #RuleConditions rct ON rct.conditionId = sn.conditionId + ( + SELECT * + FROM [rule].splitName + + UNION ALL + + SELECT * + FROM [rule].splitNameUnapproved + ) sn + JOIN #RuleConditions rct ON rct.conditionId = sn.conditionId + WHERE + @conditionId IS NULL OR sn.conditionId = @conditionId + + SELECT 'splitRange' AS resultSetName SELECT sr.* FROM - [rule].splitRange sr - JOIN - [rule].splitName sn ON sn.splitNameId = sr.splitNameId - JOIN - #RuleConditions rct ON rct.conditionId = sn.conditionId + ( + SELECT * + FROM [rule].splitRange + + UNION ALL + + SELECT * + FROM [rule].splitRangeUnapproved + ) sr + LEFT JOIN [rule].splitNameUnapproved snu ON snu.splitNameId = sr.splitNameId + LEFT JOIN [rule].splitName sn ON sn.splitNameId = sr.splitNameId + WHERE @conditionId IS NULL OR sn.conditionId = @conditionId OR snu.conditionId = @conditionId SELECT 'splitAssignment' AS resultSetName SELECT sa.* FROM - [rule].splitAssignment sa - JOIN - [rule].splitName sn ON sn.splitNameId = sa.splitNameId - JOIN - #RuleConditions rct ON rct.conditionId = sn.conditionId + ( + SELECT * + FROM [rule].splitAssignment + + UNION ALL + + SELECT * + FROM [rule].splitAssignmentUnapproved + ) sa + LEFT JOIN [rule].splitNameUnapproved snu ON snu.splitNameId = sa.splitNameId + LEFT JOIN [rule].splitName sn ON sn.splitNameId = sa.splitNameId + WHERE @conditionId IS NULL OR sn.conditionId = @conditionId OR snu.conditionId = @conditionId SELECT 'limit' AS resultSetName SELECT l.* FROM - [rule].limit l - JOIN - #RuleConditions rct ON rct.conditionId = l.conditionId + ( + SELECT * + FROM [rule].limit + + UNION ALL + + SELECT * + FROM [rule].limitUnapproved + ) l + JOIN #RuleConditions rct ON rct.conditionId = l.conditionId + WHERE + @conditionId IS NULL OR l.conditionId = @conditionId SELECT 'splitAnalytic' AS resultSetName SELECT san.* FROM - [rule].splitAnalytic san - JOIN - [rule].splitAssignment sa ON sa.splitAssignmentId = san.splitAssignmentId - JOIN - [rule].splitName sn ON sn.splitNameId = sa.splitNameId - JOIN - #RuleConditions rct ON rct.conditionId = sn.conditionId + ( + SELECT * + FROM [rule].splitAnalytic + + UNION ALL + + SELECT * + FROM [rule].splitAnalyticUnapproved ) san + JOIN [rule].splitAssignmentUnapproved sa ON sa.splitAssignmentId = san.splitAssignmentId + JOIN [rule].splitNameUnapproved sn ON sn.splitNameId = sa.splitNameId + JOIN #RuleConditions rct ON rct.conditionId = sn.conditionId + WHERE + @conditionId IS NULL OR sn.conditionId = @conditionId SELECT 'pagination' AS resultSetName - SELECT @pageSize AS pageSize, @recordsTotal AS recordsTotal, @pageNumber AS pageNumber, (@recordsTotal - 1) / @pageSize + 1 AS pagesTotal + SELECT TOP 1 + @pageSize AS pageSize, + recordsTotal AS recordsTotal, + CASE WHEN @pageNumber < (recordsTotal - 1) / @pageSize + 1 THEN @pageNumber ELSE (recordsTotal - 1) / @pageSize + 1 END AS pageNumber, + (recordsTotal - 1) / @pageSize + 1 AS pagesTotal + FROM #RuleConditions DROP TABLE #RuleConditions END diff --git a/api/sql/schema/750-rule.rule.get.sql b/api/sql/schema/750-rule.rule.get.sql new file mode 100644 index 00000000..1376eae5 --- /dev/null +++ b/api/sql/schema/750-rule.rule.get.sql @@ -0,0 +1,219 @@ +ALTER PROCEDURE [rule].[rule.get] + @conditionId INT, + @meta core.metaDataTT READONLY +-- information for the logged user +AS + +BEGIN + + DECLARE @userId BIGINT = (SELECT [auth.actorId] + FROM @meta) + -- checks if the user has a right to get user + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END + + IF NOT EXISTS( + SELECT 1 + FROM [rule].condition c + WHERE c.conditionId = @conditionId) + AND + NOT EXISTS( + SELECT 1 + FROM [rule].conditionUnapproved c + WHERE c.conditionId = @conditionId) + RAISERROR ('rule.ruleNotExists', 16, 1) + + + + + SELECT 'condition' AS resultSetName, 1 single + SELECT + c.[conditionId], + c.[priority], + c.[operationEndDate], + c.[operationStartDate], + c.[sourceAccountId], + c.[destinationAccountId], + CASE WHEN co.status IS NOT NULL THEN co.status ELSE c.status END AS [status], + CASE WHEN co.conditionId IS NULL THEN 1 ELSE 0 END AS [isNew], + c.[isEnabled] + FROM [rule].condition c + LEFT JOIN [rule].conditionUnapproved co ON co.conditionId = c.conditionId + WHERE c.conditionId = @conditionId + + SELECT 'conditionUnapproved' AS resultSetName, 1 single + SELECT + c.[conditionId], + c.[priority], + c.[operationEndDate], + c.[operationStartDate], + c.[sourceAccountId], + c.[destinationAccountId], + c.[rejectReason], + c.status, + CASE WHEN co.conditionId IS NULL THEN 1 ELSE 0 END AS [isNew], + c.[isEnabled] + FROM [rule].conditionUnapproved c + LEFT JOIN [rule].[condition] co ON co.conditionId = c.conditionId + WHERE c.conditionId = @conditionId + + + + + SELECT 'conditionActor' AS resultSetName + SELECT + cca.conditionId, cca.factor, cca.actorId, CASE WHEN cau.status IS NOT NULL THEN cau.status ELSE cca.status END AS [status], org.organizationName AS actorId, a.actorType AS [type] + -- ca.*, a.actorType AS [type] + FROM [rule].conditionActor cca + JOIN + core.actor a ON a.actorId = cca.actorId + JOIN + customer.organization org ON org.actorId = cca.actorId + LEFT JOIN + [rule].conditionActorUnapproved cau ON cau.conditionId = cca.conditionId + WHERE cca.conditionId = @conditionId + + SELECT 'conditionActorUnapproved' AS resultSetName + SELECT + cca.conditionId, cca.factor, cca.actorId, cca.status, org.organizationName AS actorId, a.actorType AS [type] + -- ca.*, a.actorType AS [type] + FROM [rule].conditionActorUnapproved cca + JOIN + core.actor a ON a.actorId = cca.actorId + JOIN + customer.organization org ON org.actorId = cca.actorId + WHERE cca.conditionId = @conditionId + + + + SELECT 'conditionItem' AS resultSetName + SELECT + c.conditionId, c.factor, CASE WHEN ciu.status IS NOT NULL THEN ciu.status ELSE c.status END AS [status], t.alias AS [type], t.name AS itemTypeName, i.itemName AS itemName + FROM [rule].conditionItem AS c + JOIN core.itemName i ON i.itemNameId = c.itemNameId + JOIN core.itemType t ON t.itemTypeId = i.itemTypeId + LEFT JOIN + [rule].conditionItemUnapproved ciu ON ciu.conditionId = c.conditionId + WHERE c.conditionId = @conditionId + + + SELECT 'conditionItemUnapproved' AS resultSetName + SELECT + c.conditionId, c.factor, c.status, t.alias AS [type], t.name AS itemTypeName, i.itemName AS itemName + FROM [rule].conditionItemUnapproved AS c + JOIN core.itemName i ON i.itemNameId = c.itemNameId + JOIN core.itemType t ON t.itemTypeId = i.itemTypeId + WHERE c.conditionId = @conditionId + + + + SELECT 'conditionProperty' AS resultSetName + SELECT + cp.conditionId, cp.factor, cp.name, cp.value, CASE WHEN cpu.status IS NOT NULL THEN cpu.status ELSE cp.status END AS [status] + FROM [rule].conditionProperty cp + LEFT JOIN [rule].conditionPropertyUnapproved cpu ON cpu.conditionId = cp.conditionId + WHERE cp.conditionId = @conditionId + + + SELECT 'conditionPropertyUnapproved' AS resultSetName + SELECT + cp.* + FROM [rule].conditionPropertyUnapproved cp + WHERE cp.conditionId = @conditionId + + + + + SELECT 'splitName' AS resultSetName + SELECT + sn.conditionId, sn.name, sn.splitNameId, sn.tag, CASE WHEN snu.status IS NOT NULL THEN snu.status ELSE sn.status END AS [status] + FROM [rule].splitName sn + LEFT JOIN [rule].splitNameUnapproved snu ON snu.conditionId = sn.conditionId + WHERE sn.conditionId = @conditionId + + SELECT 'splitNameUnapproved' AS resultSetName + SELECT + sn.* + FROM [rule].splitNameUnapproved sn + WHERE sn.conditionId = @conditionId + + + + SELECT 'splitRange' AS resultSetName + SELECT + sr.isSourceAmount, sr.maxValue, sr.minValue, sr.[percent], sr.percentBase, sr.splitNameId, sr.startAmount, sr.startAmountCurrency, + sr.startAmountDaily, sr.startAmountMonthly, sr.startAmountWeekly, sr.startCountDaily, sr.startCountMonthly, sr.startCountWeekly, + CASE WHEN sru.status IS NOT NULL THEN sru.status ELSE sr.status END AS [status] + FROM [rule].splitRange sr + JOIN [rule].splitName sn ON sn.splitNameId = sr.splitNameId + LEFT JOIN [rule].splitNameUnapproved snu ON snu.conditionId = sn.conditionId + LEFT JOIN [rule].splitRangeUnapproved sru ON sru.splitNameId = snu.splitNameId + WHERE sn.conditionId = @conditionId + + SELECT 'splitRangeUnapproved' AS resultSetName + SELECT + sr.* + FROM [rule].splitRangeUnapproved sr + JOIN [rule].splitNameUnapproved sn ON sn.splitNameId = sr.splitNameId + WHERE sn.conditionId = @conditionId + + + + + SELECT 'splitAssignment' AS resultSetName + SELECT + sa.credit, sa.debit, sa.description, sa.maxValue, sa.minValue, sa.[percent], sa.splitAssignmentId, sa.splitNameId, CASE WHEN sau.status IS NOT NULL THEN sau.status ELSE sa.status END AS status + FROM [rule].splitAssignment sa + JOIN [rule].splitName sn ON sn.splitNameId = sa.splitNameId + LEFT JOIN [rule].splitAssignmentUnapproved sau ON sau.splitAssignmentId = sa.splitAssignmentId + WHERE sn.conditionId = @conditionId + + SELECT 'splitAssignmentUnapproved' AS resultSetName + SELECT + sa.* + FROM [rule].splitAssignmentUnapproved sa + JOIN [rule].splitNameUnapproved sn ON sn.splitNameId = sa.splitNameId + WHERE sn.conditionId = @conditionId + + + + + SELECT 'limit' AS resultSetName + SELECT + l.conditionId, l.credentials, l.currency, l.limitId, l.maxAmount, l.maxAmountDaily, l.maxAmountMonthly, l.maxAmountWeekly, + l.maxCountDaily, l.maxCountMonthly, l.maxCountWeekly, l.minAmount, l.priority, CASE WHEN lu.status IS NOT NULL THEN lu.status ELSE l.status END AS [status] + FROM [rule].limit l + LEFT JOIN [rule].limitUnapproved lu ON lu.limitId = l.limitId + WHERE l.conditionId = @conditionId + + SELECT 'limitUnapproved' AS resultSetName + SELECT + l.* + FROM [rule].limitUnapproved l + WHERE l.conditionId = @conditionId + + + + + SELECT 'splitAnalytic' AS resultSetName + SELECT + san.name, san.splitAnalyticId, san.splitAssignmentId, san.value, CASE WHEN sau.status IS NOT NULL THEN sau.status ELSE san.status END AS [status] + FROM [rule].splitAnalytic san + JOIN [rule].splitAssignment sa ON sa.splitAssignmentId = san.splitAssignmentId + JOIN [rule].splitName sn ON sn.splitNameId = sa.splitNameId + LEFT JOIN [rule].splitAnalyticUnapproved sau ON sau.splitAnalyticId = san.splitAnalyticId + WHERE sn.conditionId = @conditionId + + SELECT 'splitAnalyticUnapproved' AS resultSetName + SELECT + san.* + FROM [rule].splitAnalyticUnapproved san + JOIN [rule].splitAssignmentUnapproved sa ON sa.splitAssignmentId = san.splitAssignmentId + JOIN [rule].splitNameUnapproved sn ON sn.splitNameId = sa.splitNameId + WHERE sn.conditionId = @conditionId + + END diff --git a/api/sql/schema/750-rule.rule.reject.sql b/api/sql/schema/750-rule.rule.reject.sql new file mode 100644 index 00000000..e8faa72c --- /dev/null +++ b/api/sql/schema/750-rule.rule.reject.sql @@ -0,0 +1,148 @@ +ALTER PROCEDURE [rule].[rule.reject] + @conditionId INT, + @rejectReason NVARCHAR(MAX), -- the reason the user was rejected by the checker + @meta core.metaDataTT READONLY -- information for the logged user +AS + +BEGIN TRY + + DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) + -- checks if the user has a right to get user + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END + + IF NOT EXISTS( + SELECT 1 + FROM [rule].[condition] c + WHERE c.conditionId = @conditionId) + AND + NOT EXISTS( + SELECT 1 + FROM [rule].[conditionUnapproved] c + WHERE c.conditionId = @conditionId) + BEGIN + RAISERROR ('rule.ruleNotExists', 16, 1) + END + + + + -- check if the maker and the checker are different users + IF EXISTS ( + SELECT u.updatedBy + FROM [user].[userUnapproved] u + LEFT JOIN [user].[vSystemUser] su ON su.actorId = u.updatedBy + WHERE u.actorId = @userId + AND u.updatedBy = @userId + AND su.actorId IS NULL) + RAISERROR('user.cannotPerformThisOperation', 16, 1) + + BEGIN TRANSACTION + + -- handle condition + UPDATE c + SET + c.status = 'rejected', + c.rejectReason = @rejectReason + FROM [rule].[conditionUnapproved] c + WHERE c.conditionId = @conditionId + + + + + -- handle condition actor + UPDATE ca + SET + ca.status = 'rejected' + FROM [rule].[conditionActorUnapproved] ca + WHERE ca.conditionId = @conditionId + + + + -- handle condition item + UPDATE ca + SET + ca.status = 'rejected' + FROM [rule].[conditionItemUnapproved] ca + WHERE ca.conditionId = @conditionId + + + + -- handle condition property + UPDATE ca + SET + ca.status = 'rejected' + FROM [rule].[conditionPropertyUnapproved] ca + WHERE ca.conditionId = @conditionId + + + + -- handle limit + UPDATE ca + SET + ca.status = 'rejected' + FROM [rule].limit ca + WHERE ca.conditionId = @conditionId + + + + -- handle split analytic + UPDATE spa + SET + spa.status = 'rejected' + FROM [rule].[splitAnalyticUnapproved] spa + INNER JOIN [rule].[splitAssignmentUnapproved] sp ON sp.splitAssignmentId = spa.splitAssignmentId + INNER JOIN [rule].[splitNameUnapproved] sn ON sp.splitNameId = sp.splitNameId + WHERE sn.conditionId = @conditionId + + + + -- handle split name + UPDATE sn + SET + sn.status = 'rejected' + FROM [rule].[splitNameUnapproved] sn + WHERE sn.conditionid = @conditionId + + + + -- handle split range + UPDATE sa + SET + sa.status = 'rejected' + FROM [rule].[splitRangeUnapproved] sa + JOIN [rule].[splitNameUnapproved] sna ON sa.splitNameId = sna.splitNameId + WHERE sna.conditionId = @conditionId + + + -- handle split assignment + UPDATE sa + SET + sa.status = 'rejected' + FROM [rule].[splitAssignmentUnapproved] sa + JOIN [rule].[splitNameUnapproved] sna ON sa.splitNameId = sna.splitNameId + WHERE sna.conditionId = @conditionId + + + + -- handle split range + UPDATE sr + SET + sa.status = 'rejected' + FROM [rule].[splitRangeUnapproved] sr + JOIN [rule].[splitNameUnapproved] sna ON sr.splitNameId = sna.splitNameId + WHERE sna.conditionId = @conditionId + + + COMMIT TRANSACTION + +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + EXEC core.error + RETURN 55555 +END CATCH diff --git a/api/sql/schema/750-rule.rule.remove.sql b/api/sql/schema/750-rule.rule.remove.sql index 32586cef..00f72a99 100644 --- a/api/sql/schema/750-rule.rule.remove.sql +++ b/api/sql/schema/750-rule.rule.remove.sql @@ -66,7 +66,7 @@ BEGIN TRY UPDATE x SET isDeleted = 1, - updatedOn = GETDATE(), + updatedOn = GETUTCDATE(), updatedBy = @userId FROM [rule].condition x @@ -77,7 +77,7 @@ BEGIN TRY SELECT x.conditionId [key], x.priority rulePriority, - GETDATE() deletionDateTime + GETUTCDATE() deletionDateTime FROM [rule].condition x JOIN diff --git a/api/sql/schema/751-rule.alter.sql b/api/sql/schema/751-rule.alter.sql new file mode 100644 index 00000000..f72af8e6 --- /dev/null +++ b/api/sql/schema/751-rule.alter.sql @@ -0,0 +1,101 @@ +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.condition')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[condition] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[condition] + WITH CHECK ADD CONSTRAINT [fk_condition_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.conditionActor')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[conditionActor] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[conditionActor] + WITH CHECK ADD CONSTRAINT [fk_conditionActor_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.conditionItem')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[conditionItem] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[conditionItem] + WITH CHECK ADD CONSTRAINT [fk_conditionItem_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.conditionProperty')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[conditionProperty] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[conditionProperty] + WITH CHECK ADD CONSTRAINT [fk_conditionProperty_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.limit')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[limit] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[limit] + WITH CHECK ADD CONSTRAINT [fk_limit_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.splitName')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[splitName] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[splitName] + WITH CHECK ADD CONSTRAINT [fk_splitName_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.splitAssignment')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[splitAssignment] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[splitAssignment] + WITH CHECK ADD CONSTRAINT [fk_splitAssignment_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.splitRange')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[splitRange] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[splitRange] + WITH CHECK ADD CONSTRAINT [fk_splitRange_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'status' AND OBJECT_ID = OBJECT_ID(N'rule.splitAnalytic')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[splitAnalytic] + ADD status VARCHAR(20) NULL DEFAULT('pending') + + ALTER TABLE [rule].[splitAnalytic] + WITH CHECK ADD CONSTRAINT [fk_splitAnalytic_status] FOREIGN KEY ([status]) + REFERENCES [core].[status] ([statusId]) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'isEnabled' AND OBJECT_ID = OBJECT_ID(N'rule.condition')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[condition] + ADD isEnabled BIT NOT NULL DEFAULT(0) + END + +IF NOT EXISTS(SELECT 1 FROM sys.columns WHERE Name = N'isEnabled' AND OBJECT_ID = OBJECT_ID(N'rule.conditionUnapproved')) -- add column if it does not exist + BEGIN + ALTER TABLE [rule].[conditionUnapproved] + ADD isEnabled BIT NOT NULL DEFAULT(0) + END diff --git a/api/sql/schema/751-rule.rule.lock.sql b/api/sql/schema/751-rule.rule.lock.sql new file mode 100644 index 00000000..d85dc49b --- /dev/null +++ b/api/sql/schema/751-rule.rule.lock.sql @@ -0,0 +1,53 @@ +ALTER PROCEDURE [rule].[rule.lock] -- the SP locks/unlocks(after approval) selected rules + @conditionId BIGINT, -- a condition id + @isEnabled BIT, -- the condition status to set + @meta core.metaDataTT READONLY -- information for the user that makes the operation +AS +BEGIN TRY + DECLARE @userId BIGINT = (SELECT [auth.actorId] FROM @meta) + + -- checks if the user has a right to make the operation + DECLARE @actionID VARCHAR(100) = OBJECT_SCHEMA_NAME(@@PROCID) + '.' + OBJECT_NAME(@@PROCID), @return INT = 0 + EXEC @return = [user].[permission.check] @actionId = @actionID, @objectId = NULL, @meta = @meta + IF @return != 0 + BEGIN + RETURN 55555 + END + + IF EXISTS( + SELECT ru.status + FROM [rule].conditionUnapproved ru + WHERE ru.status IN ('new', 'pending') AND @conditionId = ru.conditionId + ) + BEGIN + RAISERROR('user.cannotLockRule', 16, 1); + RETURN 5555 + END + + + IF @isEnabled = 1 + BEGIN + UPDATE c + SET isEnabled = @isEnabled, + updatedBy = @userId, + updatedOn = SYSDATETIME() + FROM [rule].condition c + WHERE c.conditionId = @conditionId + END + ELSE + BEGIN + SET IDENTITY_INSERT [rule].[conditionUnapproved] ON + INSERT INTO [rule].[conditionUnapproved] (conditionId, priority, status, operationStartDate, operationEndDate, sourceAccountId, isDeleted, createdBy, updatedBy, isEnabled) + SELECT cu.conditionId, cu.priority, 'pending', cu.operationStartDate, cu.operationEndDate, cu.sourceAccountId, 0, @userId, @userId, @isEnabled + FROM [rule].[condition] cu + WHERE cu.conditionId = @conditionId + SET IDENTITY_INSERT [rule].[conditionUnapproved] OFF + END + +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + EXEC core.error + RETURN 55555 +END CATCH diff --git a/browser/adminPortal.js b/browser/adminPortal.js new file mode 100644 index 00000000..6c1a211c --- /dev/null +++ b/browser/adminPortal.js @@ -0,0 +1,15 @@ +require('ut-portal-admin/entry')({ + modules: [ + require('ut-core/portal').default, + require('../portal').default + ], + utCore: true, + utMicroservice: true, + portal: { + test: { + menu: [ + 'rule.condition.browse' + ] + } + } +}); diff --git a/common/index.js b/common/index.js index 76f64ecf..28ec9b37 100644 --- a/common/index.js +++ b/common/index.js @@ -47,7 +47,8 @@ function prepareRuleModel(dbresult) { properties: [], countries: [], cities: [], - regions: [] + regions: [], + organization: [] }, destination: { properties: [], @@ -74,8 +75,15 @@ function prepareRuleModel(dbresult) { } }; (dbresult.conditionActor || []).forEach((ca) => { - const des = rule[propMap[ca.factor]]; - des && (des[ca.type] = parseInt(ca.actorId)); + if (['organization'].indexOf(ca.type) > -1) { + const des = rule[propMap[ca.factor]]; + des && des[ca.type] && des[ca.type].push({ + key: parseInt(ca.actorId), + name: ca.organizationName + }); + } else { + rule[propMap[ca.factor]] && (rule[propMap[ca.factor]][ca.type] = parseInt(ca.actorId)); + } }); // condition item (dbresult.conditionItem || []).forEach((item) => { diff --git a/config.js b/config.js index e7461f0e..ebe3ebdb 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,14 @@ const test = { - sqlStandard: true + sqlStandard: true, + sqlTest: true +}; + +const utc = { + 'any.required': ` + Configuration value utRule.sql.utc=true is required. + Check the release notes in /ut-rule/doc/release-v12.md + before adding it to your configuration. +` }; module.exports = () => ({ @@ -19,6 +28,9 @@ module.exports = () => ({ gateway: true }, types: { + sql: { + utc: true + }, gateway: true }, doc: { @@ -26,6 +38,9 @@ module.exports = () => ({ }, // test types unit: { + sql: { + utc: true + }, adapter: true, orchestrator: true, gateway: true, @@ -40,16 +55,30 @@ module.exports = () => ({ db: { adapter: true }, + microservice: { + sql: { + utc: true + }, + adapter: true, + orchestrator: true, + gateway: true + }, validation: ({joi}) => joi.object({ adapter: joi.boolean(), orchestrator: joi.boolean(), gateway: joi.boolean(), test: joi.boolean(), sql: joi.object({ + utc: joi.valid(true).required().messages(utc), exclude: joi.any(), clearing: joi.boolean() - }), - sqlTest: joi.boolean(), // unused config to be removed in next major version + }).required().messages(utc), + sqlTest: [ + joi.boolean(), + joi.object({ + exclude: joi.any() + }) + ], sqlSeed: [ joi.boolean(), joi.object({ diff --git a/doc/release-v12.md b/doc/release-v12.md new file mode 100644 index 00000000..ba6824ba --- /dev/null +++ b/doc/release-v12.md @@ -0,0 +1,20 @@ +# ut-rule version 12 release notes + +## Breaking Changes + +- Changed datetime values in DB to use UTC +- When editing rules, the times reported to ut-notice and ut-audit will be in UTC + +## Upgrade Steps + +- Make sure you upgrade ut-transfer to ^8.0.0 and read the release notes + for that version. +- Make sure to set utRule.sql.utc=true in the configuration to indicate that + you are aware of the implications of the breaking changes in ut-rule and + ut-transfer. +- Do not upgrade to this version if you are not sure what needs to be + done in the database. + +## Full change set + +[https://github.com/softwaregroup-bg/ut-rule/compare/v11.5.1...v12.0.0](https://github.com/softwaregroup-bg/ut-rule/compare/v11.5.1...v12.0.0) diff --git a/errors.js b/errors.js index 2fc8b986..1fa1a769 100644 --- a/errors.js +++ b/errors.js @@ -4,6 +4,7 @@ module.exports = function error({utError: {defineError, getError, fetchErrors}}) const Rule = defineError('rule', null, 'ut-rule rule error', 'error'); defineError('generic', Rule, 'Rule generic'); + defineError('amount', Rule, 'Invalid amount'); defineError('ruleNotExists', Rule, 'Rule does not exists'); defineError('exceedMaxLimitAmount', Rule, 'Transaction amount is above maximum'); defineError('exceedMinLimitAmount', Rule, 'Transaction amount is below minimum'); diff --git a/eslint.js b/eslint.js deleted file mode 100644 index 32d03431..00000000 --- a/eslint.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('ut-tools/eslint'); diff --git a/handlers.d.ts b/handlers.d.ts index bbe2144d..35fe016f 100644 --- a/handlers.d.ts +++ b/handlers.d.ts @@ -5,7 +5,7 @@ declare namespace rule_decision_fetch { * Unknown Property */ [x: string]: unknown; - amount: number; + amountString: string; channelCityId?: number | null; channelCountryId?: number | null; channelId?: number | null; @@ -55,7 +55,7 @@ declare namespace rule_decision_fetch { declare namespace rule_decision_lookup { export interface params { - amount: number; + amount: string; channelId?: number | null; currency: string; destinationAccount: string; @@ -156,6 +156,8 @@ export interface handlers { export interface errors { 'error.rule': ut.error, + 'error.rule.amount': ut.error, + errorRuleAmount: ut.error, 'error.rule.duplicatedPriority': ut.error, errorRuleDuplicatedPriority: ut.error, 'error.rule.exceedDailyLimitAmount': ut.error, @@ -213,6 +215,8 @@ interface methods extends core.handlers {} export type libFactory = ut.libFactory export type handlerFactory = ut.handlerFactory> export type handlerSet = ut.handlerSet> +export type test = ut.test +export type steps = ut.steps import portal from 'ut-portal' export type pageFactory = portal.pageFactory diff --git a/index.js b/index.js index bfc58641..0a1da0ea 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -module.exports = () => function utRule() { +module.exports = require('ut-run').microservice(module, require, () => function utRule() { return { config: require('./config'), adapter: () => [ @@ -21,4 +21,4 @@ module.exports = () => function utRule() { ...require('./test/steps') ] }; -}; +}); diff --git a/test/unit/index.test.js b/index.test.js similarity index 100% rename from test/unit/index.test.js rename to index.test.js diff --git a/model/condition.js b/model/condition.js index 8132b16b..ac22c661 100644 --- a/model/condition.js +++ b/model/condition.js @@ -23,6 +23,7 @@ module.exports = ({joi}) => ({ } }, conditionActor: { + title: '', widget: { type: 'table', widgets: ['factor', 'type', 'actor'] @@ -36,6 +37,7 @@ module.exports = ({joi}) => ({ } }, conditionItem: { + title: '', widget: { type: 'table', widgets: ['factor', 'type', 'itemNameId'] @@ -49,6 +51,7 @@ module.exports = ({joi}) => ({ } }, splitName: { + title: '', widget: { type: 'table', selectionMode: 'single', @@ -62,6 +65,7 @@ module.exports = ({joi}) => ({ } }, splitRange: { + title: '', widget: { type: 'table', selectionMode: 'single', @@ -98,6 +102,7 @@ module.exports = ({joi}) => ({ } }, splitAssignment: { + title: '', widget: { type: 'table', selectionMode: 'single', diff --git a/package.json b/package.json index 681ae5e4..c07400c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ut-rule", - "version": "11.5.1", + "version": "12.2.3", "main": "index.js", "browser": "browser.js", "pkg": { @@ -13,19 +13,29 @@ "lodash.map": "4.6.0", "lodash.merge": "4.6.2", "lodash.set": "4.3.2", - "ut-model": "^7.5.1" + "ut-model": "^8.8.1" }, "devDependencies": { - "react-select": "^1.0.0-rc.2", - "tap": "^15.1.5", - "ut-front-react": ">=12.4.0-redux.4 <=12.4.0-redux.999", + "@hot-loader/react-dom": "17.0.1", + "classnames": "^2.2.5", + "tap": "^16.3.0", + "ut-browser": "^7.7.4", + "ut-cache": "^6.0.1", "ut-core": "^8.19.4", - "ut-customer": "^9.7.61", + "ut-customer": "^10.9.7", + "ut-db": "^8.5.6", + "ut-dispatch-db": "^1.5.0", + "ut-document": "^9.3.1", + "ut-front-react": "^13.2.6", + "ut-login": "^7.20.1", + "ut-port-http": "^8.9.3", + "ut-port-jsonrpc": "^7.3.1", "ut-history": "^3.2.0", "ut-port-script": "^7.2.0", - "ut-portal": "^7.10.0", + "ut-portal": "^9.4.18", + "ut-portal-admin": "^7.14.1", "ut-run": "^10.64.7", - "ut-tools": "^6.39.0" + "ut-user": "^10.33.5" }, "peerDependencies": { "classnames": "^2.2.6", @@ -37,32 +47,35 @@ "react-router": "^4.3.1 || ^5.2.0", "react-router-dom": "^4.3.1 || ^5.2.0", "redux": "^3.7.2 || ^4.0.5", - "ut-dispatch-db": "^1.3.0", + "ut-dispatch-db": "^1.5.0", "ut-history": "^3.2.0", - "ut-run": "^10.49.1" + "ut-portal": "^9.4.7", + "ut-run": "^10.70.19" }, "description": "UT Rule", "scripts": { - "lint": "ut-lint .", - "release": "ut-release", - "storybook": "ut-portal storybook -p 6006 --ci", - "portal": "ut-portal", + "build": "ut-webpack --mode development", "changelog": "ut-changelog", "check": "ut-check", "cover": "ut-cover-parallel", + "gitlab": "ut-gitlab", + "jenkins": "ut-jenkins", + "lint": "UT_ENV=uat node index server api && ut-lint .", "lint-js": "ut-lint-js .", + "portal": "ut-storybook build", "postpublish": "ut-postpublish", "postversion": "ut-postversion", "precommit": "ut-precommit", - "precover": "ut-precover", + "precover": "ut-webpack --mode development && ut-precover", "prepublish": "ut-prepublish", "prepush": "ut-prepush", "pretest": "ut-pretest", "preversion": "ut-preversion", + "release": "ut-release", + "snapshot": "node ui.test --playwright.update-snapshots", + "storybook": "ut-storybook start -p 6006 --ci", "test": "ut-test-parallel", - "version": "node build && ut-portal build && git add handlers.d.ts && ut-version", - "jenkins": "ut-jenkins", - "gitlab": "ut-gitlab" + "version": "node build && ut-storybook build && ut-storybook publish && git add handlers.d.ts system/api && ut-version" }, "publishConfig": { "registry": "https://nexus.softwaregroup.com/repository/npm-internal" diff --git a/portal/config.js b/portal/config.js index f8363e21..b838c43c 100644 --- a/portal/config.js +++ b/portal/config.js @@ -1,7 +1,9 @@ module.exports = () => ({ // environments + common: { + browser: true + }, storybook: { - browser: true, backend: { mock: true } diff --git a/portal/index.stories.old.js b/portal/index.stories.old.js index 7fd17932..2ce63fdd 100644 --- a/portal/index.stories.old.js +++ b/portal/index.stories.old.js @@ -52,6 +52,17 @@ const page = app({ splitAnalytic: [], pagination: [] }), + 'rule.rule.addUnapproved': () => ({ + condition: [], + conditionActor: [], + conditionItem: [], + conditionProperty: [], + splitName: [], + splitRange: [], + splitAssignment: [], + limit: [], + splitAnalytic: [] + }), 'rule.rule.fetchDeleted': () => ({ condition: [], pagination: [] diff --git a/server/common.js b/server/common.js new file mode 100644 index 00000000..39c68a9c --- /dev/null +++ b/server/common.js @@ -0,0 +1,22 @@ +module.exports = { + implementation: 'rule', + adapter: true, + utPort: { + noRecursion: true + }, + utBus: { + serviceBus: { + requireMeta: true + } + }, + utCache: { + adapter: true + }, + utPortal: true, + utBrowser: true, + utLogin: true, + utCore: true, + utCustomer: true, + utDocument: true, + utUser: true +}; diff --git a/server/debug.json b/server/debug.json new file mode 100644 index 00000000..9a19bd5f --- /dev/null +++ b/server/debug.json @@ -0,0 +1,5 @@ +{ + "run": { + "hotReload": true + } +} diff --git a/server/dev.json b/server/dev.json new file mode 100644 index 00000000..fcec2c2b --- /dev/null +++ b/server/dev.json @@ -0,0 +1,10 @@ +{ + "console": true, + "utCustomer": { + "sql": { + "ledger": true, + "notice": true, + "integration": true + } + } +} \ No newline at end of file diff --git a/server/index.js b/server/index.js new file mode 100644 index 00000000..a5e20a5d --- /dev/null +++ b/server/index.js @@ -0,0 +1,15 @@ +module.exports = [ + 'ut-cache', + 'ut-db', + 'ut-portal', + 'ut-browser', + 'ut-core', + 'ut-document', + 'ut-customer', + 'ut-user', + 'ut-login', + '..' +].map(item => [{ + main: require.resolve(item), + pkg: require.resolve(item + '/package.json') +}]); diff --git a/server/unit.js b/server/unit.js new file mode 100644 index 00000000..904a5dfc --- /dev/null +++ b/server/unit.js @@ -0,0 +1,3 @@ +module.exports = { + db: true +}; diff --git a/system/api/core/openapi.json b/system/api/core/openapi.json new file mode 100644 index 00000000..6ea82c3b --- /dev/null +++ b/system/api/core/openapi.json @@ -0,0 +1,9125 @@ +{ + "info": { + "description": "UT Microservice API", + "title": "core", + "version": "8.24.11" + }, + "openapi": "3.0.0", + "paths": { + "/rpc/core/actor/addResult": { + "post": { + "description": "core.actor.addResult", + "operationId": "core.actor.addResult", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actor.addResult" + ], + "example": "core.actor.addResult", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorType": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "actorType" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actor.addResult" + ], + "example": "core.actor.addResult", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "actorId": { + "additionalProperties": false, + "properties": { + "": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "actorId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "actorId", + "" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Generate core actor id and return in as result", + "tags": [ + "core" + ] + } + }, + "/rpc/core/actorHierarchy/addMS": { + "post": { + "description": "core.actorHierarchy.addMS", + "operationId": "core.actorHierarchy.addMS", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorHierarchy.addMS" + ], + "example": "core.actorHierarchy.addMS", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorHierarchy": { + "items": { + "additionalProperties": false, + "properties": { + "object": { + "type": "number" + }, + "predicate": { + "minLength": 1, + "type": "string" + }, + "subject": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "subject", + "predicate", + "object" + ], + "type": "object" + }, + "type": "array" + }, + "noResultSet": { + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorHierarchy.addMS" + ], + "example": "core.actorHierarchy.addMS", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Add actorHierarchy", + "tags": [ + "core" + ] + } + }, + "/rpc/core/actorProperty/get": { + "post": { + "description": "core.actorProperty.get", + "operationId": "core.actorProperty.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorProperty.get" + ], + "example": "core.actorProperty.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "name": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorProperty.get" + ], + "example": "core.actorProperty.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "nullable": true, + "properties": { + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core ActorProperty get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/cbs/fetch": { + "post": { + "description": "core.cbs.fetch", + "operationId": "core.cbs.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.cbs.fetch" + ], + "example": "core.cbs.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.cbs.fetch" + ], + "example": "core.cbs.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "cbs": { + "items": { + "additionalProperties": false, + "properties": { + "cbsId": { + "type": "number" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "ut5Key": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "cbsId", + "name", + "itemNameId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "CBS Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/delete": { + "post": { + "description": "core.component.delete", + "operationId": "core.component.delete", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.delete" + ], + "example": "core.component.delete", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "componentId": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.delete" + ], + "example": "core.component.delete", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "items": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "component" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Component delete", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/edit": { + "post": { + "description": "core.component.edit", + "operationId": "core.component.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.edit" + ], + "example": "core.component.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "component": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method", + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.edit" + ], + "example": "core.component.edit", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Set component configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/get": { + "post": { + "description": "core.component.get", + "operationId": "core.component.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.get" + ], + "example": "core.component.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.get" + ], + "example": "core.component.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "additionalProperties": false, + "nullable": true, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Component get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/edit": { + "post": { + "description": "Core Configuration Edit", + "operationId": "core.configuration.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.edit" + ], + "example": "core.configuration.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "nullable": true, + "type": "string" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.edit" + ], + "example": "core.configuration.edit", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Configuration Edit", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/fetch": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.fetch" + ], + "example": "core.configuration.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "key": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.fetch" + ], + "example": "core.configuration.fetch", + "type": "string" + }, + "result": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "nullable": true, + "type": "string" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + }, + "type": "array" + }, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/get": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.get" + ], + "example": "core.configuration.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configurationId": { + "type": "integer" + }, + "key": { + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.get" + ], + "example": "core.configuration.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "nullable": true, + "type": "string" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/list": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.list", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.list" + ], + "example": "core.configuration.list", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "key": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "orderBy": { + "items": { + "additionalProperties": false, + "properties": { + "dir": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + }, + "field": { + "maxLength": 128, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "paging": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.list" + ], + "example": "core.configuration.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "configuration": { + "items": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "nullable": true, + "type": "string" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/country/fetch": { + "post": { + "description": "core.country.fetch", + "operationId": "core.country.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.country.fetch" + ], + "example": "core.country.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.country.fetch" + ], + "example": "core.country.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "country": { + "items": { + "additionalProperties": false, + "properties": { + "ageOfMajority": { + "nullable": true, + "type": "integer" + }, + "alpha3Code": { + "nullable": true, + "type": "string" + }, + "countryCode": { + "minLength": 1, + "type": "string" + }, + "countryId": { + "type": "number" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "numericCode": { + "nullable": true, + "type": "string" + }, + "phoneLength": { + "nullable": true, + "type": "integer" + }, + "phonePrefix": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "countryCode", + "countryId", + "itemNameId", + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Country fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/currency/fetch": { + "post": { + "description": "Core Currency Fetch", + "operationId": "core.currency.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.fetch" + ], + "example": "core.currency.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.fetch" + ], + "example": "core.currency.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "currency": { + "items": { + "additionalProperties": false, + "properties": { + "currency": { + "minLength": 1, + "type": "string" + }, + "currencyId": { + "type": "number" + }, + "isoCode": { + "minLength": 1, + "type": "string" + }, + "itemDescription": { + "minLength": 1, + "type": "string" + }, + "scale": { + "type": "number" + } + }, + "required": [ + "currencyId", + "scale", + "isoCode", + "currency", + "itemDescription" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Currency Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/currency/get": { + "post": { + "description": "core.currency.get", + "operationId": "core.currency.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.get" + ], + "example": "core.currency.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "currencyId": { + "type": "number" + } + }, + "required": [ + "currencyId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.get" + ], + "example": "core.currency.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "currency": { + "items": { + "additionalProperties": false, + "properties": { + "currency": { + "minLength": 1, + "type": "string" + }, + "currencyId": { + "type": "number" + }, + "isoCode": { + "minLength": 1, + "type": "string" + }, + "itemDescription": { + "minLength": 1, + "type": "string" + }, + "scale": { + "type": "number" + } + }, + "required": [ + "currencyId", + "scale", + "isoCode", + "currency", + "itemDescription" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Currency get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/dropdown/list": { + "post": { + "description": "list dropdown items", + "operationId": "core.dropdown.list", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.dropdown.list" + ], + "example": "core.dropdown.list", + "type": "string" + }, + "params": { + "additionalProperties": true, + "description": "Method parameters", + "properties": {}, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.dropdown.list" + ], + "example": "core.dropdown.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "core.country": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "nullable": true, + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.currencyCode": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "nullable": true, + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.externalSystemAttributes": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "value": { + "oneOf": [ + { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + { + "minLength": 1, + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value", + "alias", + "systemType" + ], + "type": "object" + }, + "type": "array" + }, + "core.externalSystemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "value": { + "oneOf": [ + { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + { + "minLength": 1, + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "core.itemName": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + { + "minLength": 1, + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value", + "parent" + ], + "type": "object" + }, + "type": "array" + }, + "core.itemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "value": { + "oneOf": [ + { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + { + "minLength": 1, + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "core.language": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "nullable": true, + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.timeZone": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "nullable": true, + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "value": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "list dropdown items", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/activateDeactivate": { + "post": { + "description": "Activate/Deactivate External Systems Configuration", + "operationId": "core.externalSystem.activateDeactivate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.activateDeactivate" + ], + "example": "core.externalSystem.activateDeactivate", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "isActive": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "isActive" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method", + "params" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.activateDeactivate" + ], + "example": "core.externalSystem.activateDeactivate", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Activate/Deactivate External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/add": { + "post": { + "description": "Add External Systems Configuration", + "operationId": "core.externalSystem.add", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.add" + ], + "example": "core.externalSystem.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystem": { + "additionalProperties": false, + "properties": { + "encryptionType": { + "nullable": true, + "type": "string" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "port": { + "nullable": true, + "type": "integer" + }, + "serverTimeout": { + "nullable": true, + "type": "integer" + } + }, + "required": [ + "organizationId", + "externalSystemTypeId" + ], + "type": "object" + }, + "externalSystemAttributesValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "value": {} + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "externalSystem" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.add" + ], + "example": "core.externalSystem.add", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "serverInfo": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": "string" + }, + "encryptionType": { + "nullable": true, + "type": "string" + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "nullable": true, + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "organizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "organizationName": { + "type": "string" + }, + "port": { + "nullable": true, + "type": "integer" + }, + "serverTimeout": { + "nullable": true, + "type": "integer" + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "useSsl": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "type", + "systemType", + "isActive", + "isDeleted" + ], + "type": "object" + }, + "type": "array" + }, + "userData": { + "items": { + "additionalProperties": false, + "properties": { + "externalUserId": { + "type": "integer" + }, + "userAlias": { + "type": "string" + }, + "userName": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "userMapping": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "value": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "serverInfo" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Add External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/delete": { + "post": { + "description": "Delete External Systems Configuration", + "operationId": "core.externalSystem.delete", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.delete" + ], + "example": "core.externalSystem.delete", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "externalSystemId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.delete" + ], + "example": "core.externalSystem.delete", + "type": "string" + }, + "result": { + "items": {}, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Delete External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/edit": { + "post": { + "description": "Edit External Systems Configuration", + "operationId": "core.externalSystem.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.edit" + ], + "example": "core.externalSystem.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystem": { + "additionalProperties": false, + "properties": { + "encryptionType": { + "nullable": true, + "type": "string" + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "port": { + "nullable": true, + "type": "integer" + }, + "serverTimeout": { + "nullable": true, + "type": "integer" + } + }, + "required": [ + "externalSystemId", + "organizationId", + "externalSystemTypeId" + ], + "type": "object" + }, + "externalSystemAttributesValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "externalSystemId": { + "type": "integer" + }, + "value": {} + }, + "required": [ + "externalSystemId", + "attributeId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.edit" + ], + "example": "core.externalSystem.edit", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Edit External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/fetch": { + "post": { + "description": "Fetch External Systems Configuration", + "operationId": "core.externalSystem.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.fetch" + ], + "example": "core.externalSystem.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "type": "string" + }, + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "businessUnitId": { + "type": "number" + }, + "isActive": { + "type": "boolean" + }, + "orderBy": { + "additionalProperties": false, + "properties": { + "dir": { + "minLength": 1, + "type": "string" + }, + "field": { + "type": "string" + } + }, + "required": [ + "dir" + ], + "type": "object" + }, + "paging": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "typeId": { + "type": "integer" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.fetch" + ], + "example": "core.externalSystem.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "externalSystems": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "externalSystemId": { + "type": "number" + }, + "externalSystemTypeId": { + "type": "number" + }, + "externalSystemTypeKey": { + "nullable": true, + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "externalSystems" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch External System Configurations", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/get": { + "post": { + "description": "Get External System Configuration", + "operationId": "core.externalSystem.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.get" + ], + "example": "core.externalSystem.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "type": "integer" + } + }, + "required": [ + "externalSystemId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.get" + ], + "example": "core.externalSystem.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "serverInfo": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": "string" + }, + "encryptionType": { + "nullable": true, + "type": "string" + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "nullable": true, + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "organizationId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "organizationName": { + "type": "string" + }, + "port": { + "nullable": true, + "type": "integer" + }, + "serverTimeout": { + "nullable": true, + "type": "integer" + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "useSsl": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "type", + "systemType", + "isActive", + "isDeleted" + ], + "type": "object" + }, + "type": "array" + }, + "userData": { + "items": { + "additionalProperties": false, + "properties": { + "externalUserId": { + "type": "integer" + }, + "userAlias": { + "type": "string" + }, + "userName": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "userMapping": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "value": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "serverInfo" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Get External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/testConnection": { + "post": { + "description": "Get External System Configuration", + "operationId": "core.externalSystem.testConnection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.testConnection" + ], + "example": "core.externalSystem.testConnection", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "connectionString": { + "type": "string" + }, + "encryption": { + "nullable": true, + "type": "string" + }, + "externalSystemName": { + "enum": [ + "ldap", + "cbs", + "smtp", + "sms" + ] + }, + "password": { + "minLength": 1, + "type": "string" + }, + "port": { + "nullable": true, + "type": "integer" + }, + "service": { + "type": "string" + }, + "url": { + "minLength": 1, + "type": "string" + }, + "userSearchBase": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "externalSystemName", + "url", + "password" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.testConnection" + ], + "example": "core.externalSystem.testConnection", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "success": { + "type": "boolean" + }, + "warning": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Test External System Connection", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystemAttributes/get": { + "post": { + "description": "Fetch External System Attributes", + "operationId": "core.externalSystemAttributes.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemAttributes.get" + ], + "example": "core.externalSystemAttributes.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "typeId": { + "type": "integer" + } + }, + "required": [ + "typeId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemAttributes.get" + ], + "example": "core.externalSystemAttributes.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "defaultValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "number" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "defaultValue": { + "nullable": true, + "type": "string" + }, + "isMandatory": { + "type": "boolean" + }, + "isReadOnly": { + "type": "boolean" + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch External System Attributes", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystemType/list": { + "post": { + "description": "Fetch External System Types", + "operationId": "core.externalSystemType.list", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemType.list" + ], + "example": "core.externalSystemType.list", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemType.list" + ], + "example": "core.externalSystemType.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "externalSystemType": { + "items": { + "additionalProperties": false, + "properties": { + "depthKey": { + "nullable": true, + "type": "string" + }, + "externalSystemTypeId": { + "type": "number" + }, + "isBranchUnique": { + "type": "boolean" + }, + "isSingleUser": { + "type": "boolean" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "value": { + "nullable": true, + "type": "integer" + } + }, + "required": [ + "externalSystemTypeId", + "key", + "name", + "depthKey", + "value", + "isBranchUnique", + "isSingleUser" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch External System Types", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/add": { + "post": { + "description": "core.item.add", + "operationId": "core.item.add", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.add" + ], + "example": "core.item.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "nullable": true, + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "type": "string" + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "nullable": true, + "type": "number" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "nullable": true, + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "languageId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "item" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.add" + ], + "example": "core.item.add", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationLanguageId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "minLength": 1, + "nullable": true, + "type": "string" + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "type": "number" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Add item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/edit": { + "post": { + "description": "core.item.edit", + "operationId": "core.item.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.edit" + ], + "example": "core.item.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "nullable": true, + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "type": "string" + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemNameId", + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId", + "languageId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "item" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.edit" + ], + "example": "core.item.edit", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationLanguageId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "minLength": 1, + "nullable": true, + "type": "string" + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "type": "number" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Edit item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/fetch": { + "post": { + "description": "core.item.fetch", + "operationId": "core.item.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.fetch" + ], + "example": "core.item.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "isEnabled": { + "type": "boolean" + }, + "itemName": { + "type": "string" + }, + "itemTypeId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTypeName": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "keyValue": { + "type": "boolean" + }, + "languageId": { + "oneOf": [ + { + "type": "string" + }, + { + "minimum": 1, + "type": "number" + } + ] + }, + "organizationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "nullable": true, + "type": "string" + }, + "sortOrder": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.fetch" + ], + "example": "core.item.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "title": "Name", + "type": "string" + }, + "itemNameId": { + "title": "Item Id", + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "title": "Translation", + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "number" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "itemTranslationLanguageId": { + "nullable": true, + "title": "Language", + "type": "number" + }, + "itemTypeId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "nullable": true, + "title": "Business Unit", + "type": "string" + } + }, + "required": [ + "itemNameId", + "itemTypeName", + "itemTypeId", + "itemName", + "isEnabled" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch items", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/get": { + "post": { + "description": "core.item.get", + "operationId": "core.item.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.get" + ], + "example": "core.item.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemNameId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.get" + ], + "example": "core.item.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationLanguageId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "minLength": 1, + "nullable": true, + "type": "string" + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "type": "number" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Get item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemCode/fetch": { + "post": { + "description": "core.itemCode.fetch", + "operationId": "core.itemCode.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemCode.fetch" + ], + "example": "core.itemCode.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isEnabled": { + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemCode.fetch" + ], + "example": "core.itemCode.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "display": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "value": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "type", + "display" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch item codes", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemName/fetch": { + "post": { + "description": "core.itemName.fetch", + "operationId": "core.itemName.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemName.fetch" + ], + "example": "core.itemName.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isEnabled": { + "nullable": true, + "type": "boolean" + }, + "languageId": { + "type": "string" + }, + "organizationId": { + "type": "number" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemName.fetch" + ], + "example": "core.itemName.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "display": { + "minLength": 1, + "type": "string" + }, + "itemCode": { + "nullable": true, + "type": "string" + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemSyncId": { + "nullable": true, + "type": "string" + }, + "parentItemNameId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "type": { + "minLength": 1, + "type": "string" + }, + "value": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "type", + "display", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch item names", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameByItemType/fetch": { + "post": { + "description": "core.itemNameByItemType.fetch", + "operationId": "core.itemNameByItemType.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByItemType.fetch" + ], + "example": "core.itemNameByItemType.fetch", + "type": "string" + }, + "params": { + "additionalProperties": true, + "description": "Method parameters", + "properties": {}, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByItemType.fetch" + ], + "example": "core.itemNameByItemType.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameByType": { + "items": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "itemNameId", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch item name by item type", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameByParent/list": { + "post": { + "description": "core.itemNameByParent.list", + "operationId": "core.itemNameByParent.list", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByParent.list" + ], + "example": "core.itemNameByParent.list", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTypeName": { + "maxLength": 200, + "type": "string" + }, + "languageId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "parentItemNameId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByParent.list" + ], + "example": "core.itemNameByParent.list", + "type": "string" + }, + "result": { + "additionalProperties": true, + "properties": {}, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Get cascade dropdown data", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameItemTranslation/add": { + "post": { + "description": "core.itemNameItemTranslation.add", + "operationId": "core.itemNameItemTranslation.add", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.add" + ], + "example": "core.itemNameItemTranslation.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTT": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "nullable": true, + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "type": "string" + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemOrder": { + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "language": { + "nullable": true, + "type": "number" + }, + "languageId": { + "nullable": true, + "type": "number" + }, + "resultSet": { + "nullable": true, + "type": "boolean" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.add" + ], + "example": "core.itemNameItemTranslation.add", + "type": "string" + }, + "result": { + "oneOf": [ + { + "items": {}, + "maxItems": 0, + "minItems": 0, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "createdOn": { + "format": "date-time", + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "languageId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Add item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameItemTranslation/edit": { + "post": { + "description": "core.itemNameItemTranslation.edit", + "operationId": "core.itemNameItemTranslation.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.edit" + ], + "example": "core.itemNameItemTranslation.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTT": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "nullable": true, + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "type": "string" + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemNameId", + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "itemTranslationTT": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "nullable": true, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId", + "languageId" + ], + "type": "object" + }, + "resultSet": { + "nullable": true, + "type": "boolean" + } + }, + "required": [ + "itemNameTT" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.edit" + ], + "example": "core.itemNameItemTranslation.edit", + "type": "string" + }, + "result": { + "oneOf": [ + { + "items": {}, + "maxItems": 0, + "minItems": 0, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "item": { + "items": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationUpdatedOn": { + "format": "date-time", + "type": "string" + }, + "itemUpdatedOn": { + "format": "date-time", + "type": "string" + }, + "languageId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Edit item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameStatusChange": { + "post": { + "description": "core.itemNameStatusChange", + "operationId": "core.itemNameStatusChange", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameStatusChange" + ], + "example": "core.itemNameStatusChange", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameIds": { + "items": { + "type": "number" + }, + "type": "array" + }, + "newStatus": { + "type": "boolean" + } + }, + "required": [ + "newStatus" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameStatusChange" + ], + "example": "core.itemNameStatusChange", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameStatusChange": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemNameId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Status change", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameTranslation/get": { + "post": { + "description": "core.itemNameTranslation.get", + "operationId": "core.itemNameTranslation.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.get" + ], + "example": "core.itemNameTranslation.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemNameId": { + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.get" + ], + "example": "core.itemNameTranslation.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameTranslation": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "integer" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "itemTranslationLanguageId": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "minLength": 1, + "nullable": true, + "type": "string" + }, + "parentItemNameId": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "type": "number" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Get item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameTranslation/upload": { + "post": { + "description": "core.itemNameTranslation.upload", + "operationId": "core.itemNameTranslation.upload", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.upload" + ], + "example": "core.itemNameTranslation.upload", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTranslationTT": { + "items": {}, + "type": "array" + }, + "languageId": { + "type": "integer" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.upload" + ], + "example": "core.itemNameTranslation.upload", + "type": "string" + }, + "result": { + "items": {}, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch actor action", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemTranslation/fetch": { + "post": { + "description": "Core Item Translation", + "operationId": "core.itemTranslation.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemTranslation.fetch" + ], + "example": "core.itemTranslation.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "isEnabled": { + "type": "boolean" + }, + "itemName": { + "type": "string" + }, + "itemTypeId": { + "oneOf": [ + { + "type": "string" + }, + { + "minimum": 1, + "type": "number" + } + ] + }, + "itemTypeName": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "keyValue": { + "type": "boolean" + }, + "languageId": { + "oneOf": [ + { + "type": "string" + }, + { + "minimum": 1, + "type": "number" + } + ] + }, + "organizationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "nullable": true, + "type": "string" + }, + "sortOrder": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemTranslation.fetch" + ], + "example": "core.itemTranslation.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemTranslationFetch": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "nullable": true, + "title": "Abbreviation", + "type": "string" + }, + "itemName": { + "title": "Name", + "type": "string" + }, + "itemNameId": { + "title": "Item Id", + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "title": "Translation", + "type": "string" + }, + "itemOrder": { + "nullable": true, + "type": "number" + }, + "itemSyncId": { + "nullable": true, + "title": "External Id", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "itemTranslationLanguageId": { + "nullable": true, + "title": "Language", + "type": "number" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "organizationId": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ], + "title": "Business Unit" + }, + "organizationName": { + "nullable": true, + "title": "Business Unit", + "type": "string" + } + }, + "required": [ + "itemNameId", + "itemTypeName", + "itemTypeId", + "itemName", + "isEnabled" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Item Translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemType/fetch": { + "post": { + "description": "core.itemType.fetch", + "operationId": "core.itemType.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemType.fetch" + ], + "example": "core.itemType.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTypeId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "name": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemType.fetch" + ], + "example": "core.itemType.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "description": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "type": "number" + }, + "keyColumn": { + "nullable": true, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "nameColumn": { + "nullable": true, + "type": "string" + }, + "parentItemTypeId": { + "nullable": true, + "type": "number" + }, + "table": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "itemTypeId", + "alias", + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch item type", + "tags": [ + "core" + ] + } + }, + "/rpc/core/language/fetch": { + "post": { + "description": "Core Language Fetch", + "operationId": "core.language.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.language.fetch" + ], + "example": "core.language.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "iso2Code": { + "maxLength": 2, + "nullable": true, + "type": "string" + }, + "name": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.language.fetch" + ], + "example": "core.language.fetch", + "type": "string" + }, + "result": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "iso2Code": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "type": "number" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "languageId", + "iso2Code", + "name", + "locale" + ], + "type": "object" + }, + "type": "array" + }, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Language Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/add": { + "post": { + "description": "core.translation.add", + "operationId": "core.translation.add", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.add" + ], + "example": "core.translation.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "translation": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "nullable": true, + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "languageId", + "itemNameId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Add translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/byLanguageFetch": { + "post": { + "description": "Core Translation by Language Fetch", + "operationId": "core.translation.byLanguageFetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.byLanguageFetch" + ], + "example": "core.translation.byLanguageFetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "channel": { + "nullable": true, + "type": "string" + }, + "dictName": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + }, + "languages": { + "items": { + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "organizationId": { + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.byLanguageFetch" + ], + "example": "core.translation.byLanguageFetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translations": { + "items": { + "additionalProperties": false, + "properties": { + "dictionaryAlias": { + "minLength": 1, + "type": "string" + }, + "dictionaryCode": { + "nullable": true, + "type": "string" + }, + "dictionaryKey": { + "minLength": 1, + "type": "string" + }, + "dictionaryName": { + "minLength": 1, + "type": "string" + }, + "iso2Code": { + "maxLength": 2, + "minLength": 2, + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "languageId": { + "minLength": 1, + "type": "string" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "parentItemCode": { + "nullable": true, + "type": "string" + }, + "parentItemName": { + "nullable": true, + "type": "string" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + }, + "translatedValue": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "dictionaryKey", + "dictionaryName", + "dictionaryAlias", + "iso2Code", + "locale", + "languageId", + "translatedValue" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Translation by Language Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/edit": { + "post": { + "description": "core.translation.edit", + "operationId": "core.translation.edit", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.edit" + ], + "example": "core.translation.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "translation": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "type": "string" + }, + "itemTranslationId": { + "type": "number" + }, + "itemTypeId": { + "nullable": true, + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemTranslationId", + "languageId", + "itemNameId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Edit translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/fetch": { + "post": { + "description": "Core Translation", + "operationId": "core.translation.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.fetch" + ], + "example": "core.translation.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "dictName": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + }, + "languageId": { + "minimum": 1, + "type": "number" + }, + "orderByKey": { + "type": "number" + }, + "organizationId": { + "type": "string" + }, + "updatedAfter": { + "format": "date-time", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.fetch" + ], + "example": "core.translation.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translations": { + "items": { + "additionalProperties": false, + "properties": { + "dictionaryAlias": { + "minLength": 1, + "type": "string" + }, + "dictionaryCode": { + "nullable": true, + "type": "string" + }, + "dictionaryKey": { + "minLength": 1, + "type": "string" + }, + "dictionaryName": { + "minLength": 1, + "type": "string" + }, + "iso2Code": { + "maxLength": 2, + "minLength": 2, + "type": "string" + }, + "itemNameId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + }, + "languageId": { + "minLength": 1, + "type": "string" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "parentItemCode": { + "nullable": true, + "type": "string" + }, + "parentItemName": { + "nullable": true, + "type": "string" + }, + "parentItemTypeName": { + "nullable": true, + "type": "string" + }, + "translatedValue": { + "nullable": true, + "type": "string" + } + }, + "required": [ + "dictionaryKey", + "dictionaryName", + "dictionaryAlias", + "iso2Code", + "locale", + "languageId", + "translatedValue" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Core Translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/get": { + "post": { + "description": "core.translation.get", + "operationId": "core.translation.get", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.get" + ], + "example": "core.translation.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTranslationId": { + "oneOf": [ + { + "type": "integer" + }, + { + "pattern": "^[0-9]{1,19}$", + "type": "string" + } + ] + } + }, + "required": [ + "itemTranslationId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.get" + ], + "example": "core.translation.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemName": { + "title": "Item Name", + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "title": "Translation", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "language": { + "title": "Language", + "type": "string" + }, + "languageId": { + "nullable": true, + "type": "number" + } + }, + "required": [ + "itemTypeId", + "itemTypeName", + "language", + "itemNameId", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Get translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translations/fetch": { + "post": { + "description": "core.translations.fetch", + "operationId": "core.translations.fetch", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "oneOf": [ + { + "type": "number" + }, + { + "maxLength": 36, + "minLength": 1, + "type": "string" + } + ] + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translations.fetch" + ], + "example": "core.translations.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "hasTranslation": { + "nullable": true, + "type": "boolean" + }, + "itemName": { + "nullable": true, + "type": "string" + }, + "itemTypeId": { + "oneOf": [ + { + "type": "string" + }, + { + "minimum": 1, + "type": "number" + } + ] + }, + "languageId": { + "oneOf": [ + { + "type": "string" + }, + { + "minimum": 1, + "type": "number" + } + ] + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "nullable": true, + "type": "string" + }, + "sortOrder": { + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "nullable": true, + "type": "number" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translations.fetch" + ], + "example": "core.translations.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemName": { + "title": "Item Name", + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "nullable": true, + "title": "Translation", + "type": "string" + }, + "itemTranslationId": { + "nullable": true, + "type": "number" + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "language": { + "title": "Language", + "type": "string" + }, + "languageId": { + "nullable": true, + "type": "number" + } + }, + "required": [ + "itemTypeId", + "itemTypeName", + "language", + "itemNameId", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + }, + "description": "Successful response" + }, + "default": { + "content": {}, + "description": "Invalid request" + } + }, + "summary": "Fetch translations", + "tags": [ + "core" + ] + } + } + }, + "tags": [ + { + "description": "utCore.validation", + "name": "core" + } + ] +} \ No newline at end of file diff --git a/system/api/core/swagger.json b/system/api/core/swagger.json new file mode 100644 index 00000000..3f58bb47 --- /dev/null +++ b/system/api/core/swagger.json @@ -0,0 +1,8440 @@ +{ + "info": { + "description": "UT Microservice API", + "title": "core", + "version": "8.24.11" + }, + "paths": { + "/rpc/core/actor/addResult": { + "post": { + "description": "core.actor.addResult", + "operationId": "core.actor.addResult", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actor.addResult" + ], + "example": "core.actor.addResult", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorType": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "actorType" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actor.addResult" + ], + "example": "core.actor.addResult", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "actorId": { + "additionalProperties": false, + "properties": { + "": { + "type": "integer" + }, + "actorId": { + "type": "integer" + } + }, + "required": [ + "actorId", + "" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Generate core actor id and return in as result", + "tags": [ + "core" + ] + } + }, + "/rpc/core/actorHierarchy/addMS": { + "post": { + "description": "core.actorHierarchy.addMS", + "operationId": "core.actorHierarchy.addMS", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorHierarchy.addMS" + ], + "example": "core.actorHierarchy.addMS", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorHierarchy": { + "items": { + "additionalProperties": false, + "properties": { + "object": { + "type": "number" + }, + "predicate": { + "minLength": 1, + "type": "string" + }, + "subject": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "subject", + "predicate", + "object" + ], + "type": "object" + }, + "type": "array" + }, + "noResultSet": { + "type": [ + "boolean", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorHierarchy.addMS" + ], + "example": "core.actorHierarchy.addMS", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Add actorHierarchy", + "tags": [ + "core" + ] + } + }, + "/rpc/core/actorProperty/get": { + "post": { + "description": "core.actorProperty.get", + "operationId": "core.actorProperty.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorProperty.get" + ], + "example": "core.actorProperty.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "actorId": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.actorProperty.get" + ], + "example": "core.actorProperty.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "value": { + "type": "string" + } + }, + "type": [ + "object", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core ActorProperty get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/cbs/fetch": { + "post": { + "description": "core.cbs.fetch", + "operationId": "core.cbs.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.cbs.fetch" + ], + "example": "core.cbs.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.cbs.fetch" + ], + "example": "core.cbs.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "cbs": { + "items": { + "additionalProperties": false, + "properties": { + "cbsId": { + "type": "number" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "ut5Key": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "cbsId", + "name", + "itemNameId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "CBS Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/delete": { + "post": { + "description": "core.component.delete", + "operationId": "core.component.delete", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.delete" + ], + "example": "core.component.delete", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "componentId": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.delete" + ], + "example": "core.component.delete", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "items": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "component" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Component delete", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/edit": { + "post": { + "description": "core.component.edit", + "operationId": "core.component.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.edit" + ], + "example": "core.component.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "component": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method", + "params" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.edit" + ], + "example": "core.component.edit", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Set component configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/component/get": { + "post": { + "description": "core.component.get", + "operationId": "core.component.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.get" + ], + "example": "core.component.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.component.get" + ], + "example": "core.component.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "component": { + "additionalProperties": false, + "properties": { + "componentConfig": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "componentId": { + "maxLength": 100, + "minLength": 1, + "type": "string" + } + }, + "required": [ + "componentId" + ], + "type": [ + "object", + "null" + ] + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Component get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/edit": { + "post": { + "description": "Core Configuration Edit", + "operationId": "core.configuration.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.edit" + ], + "example": "core.configuration.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.edit" + ], + "example": "core.configuration.edit", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Configuration Edit", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/fetch": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.fetch" + ], + "example": "core.configuration.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "key": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.fetch" + ], + "example": "core.configuration.fetch", + "type": "string" + }, + "result": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + }, + "type": "array" + }, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/get": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.get" + ], + "example": "core.configuration.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configurationId": { + "type": "integer" + }, + "key": { + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.get" + ], + "example": "core.configuration.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/configuration/list": { + "post": { + "description": "Core Configuration Fetch", + "operationId": "core.configuration.list", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.list" + ], + "example": "core.configuration.list", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "configuration": { + "additionalProperties": false, + "properties": { + "key": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "orderBy": { + "items": { + "additionalProperties": false, + "properties": { + "dir": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + }, + "field": { + "maxLength": 128, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "paging": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.configuration.list" + ], + "example": "core.configuration.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "configuration": { + "items": { + "additionalProperties": false, + "properties": { + "configurationId": { + "type": "number" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "key": { + "minLength": 1, + "type": "string" + }, + "value": { + "minLength": 1, + "type": "string" + }, + "version": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "configurationId", + "key", + "value", + "version" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Configuration Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/country/fetch": { + "post": { + "description": "core.country.fetch", + "operationId": "core.country.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.country.fetch" + ], + "example": "core.country.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.country.fetch" + ], + "example": "core.country.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "country": { + "items": { + "additionalProperties": false, + "properties": { + "ageOfMajority": { + "type": [ + "integer", + "null" + ] + }, + "alpha3Code": { + "type": [ + "string", + "null" + ] + }, + "countryCode": { + "minLength": 1, + "type": "string" + }, + "countryId": { + "type": "number" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "numericCode": { + "type": [ + "string", + "null" + ] + }, + "phoneLength": { + "type": [ + "integer", + "null" + ] + }, + "phonePrefix": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "countryCode", + "countryId", + "itemNameId", + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Country fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/currency/fetch": { + "post": { + "description": "Core Currency Fetch", + "operationId": "core.currency.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.fetch" + ], + "example": "core.currency.fetch", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.fetch" + ], + "example": "core.currency.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "currency": { + "items": { + "additionalProperties": false, + "properties": { + "currency": { + "minLength": 1, + "type": "string" + }, + "currencyId": { + "type": "number" + }, + "isoCode": { + "minLength": 1, + "type": "string" + }, + "itemDescription": { + "minLength": 1, + "type": "string" + }, + "scale": { + "type": "number" + } + }, + "required": [ + "currencyId", + "scale", + "isoCode", + "currency", + "itemDescription" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Currency Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/currency/get": { + "post": { + "description": "core.currency.get", + "operationId": "core.currency.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.get" + ], + "example": "core.currency.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "currencyId": { + "type": "number" + } + }, + "required": [ + "currencyId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.currency.get" + ], + "example": "core.currency.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "currency": { + "items": { + "additionalProperties": false, + "properties": { + "currency": { + "minLength": 1, + "type": "string" + }, + "currencyId": { + "type": "number" + }, + "isoCode": { + "minLength": 1, + "type": "string" + }, + "itemDescription": { + "minLength": 1, + "type": "string" + }, + "scale": { + "type": "number" + } + }, + "required": [ + "currencyId", + "scale", + "isoCode", + "currency", + "itemDescription" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Currency get", + "tags": [ + "core" + ] + } + }, + "/rpc/core/dropdown/list": { + "post": { + "description": "list dropdown items", + "operationId": "core.dropdown.list", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.dropdown.list" + ], + "example": "core.dropdown.list", + "type": "string" + }, + "params": { + "additionalProperties": true, + "description": "Method parameters", + "properties": {}, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.dropdown.list" + ], + "example": "core.dropdown.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "core.country": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.currencyCode": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.externalSystemAttributes": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value", + "alias", + "systemType" + ], + "type": "object" + }, + "type": "array" + }, + "core.externalSystemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "core.itemName": { + "items": { + "additionalProperties": false, + "properties": { + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value", + "parent" + ], + "type": "object" + }, + "type": "array" + }, + "core.itemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "label": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "core.language": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "core.timeZone": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "label": { + "minLength": 1, + "type": "string" + }, + "parent": { + "type": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "label", + "value" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "list dropdown items", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/activateDeactivate": { + "post": { + "description": "Activate/Deactivate External Systems Configuration", + "operationId": "core.externalSystem.activateDeactivate", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.activateDeactivate" + ], + "example": "core.externalSystem.activateDeactivate", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "items": { + "type": "integer" + }, + "type": "array" + }, + "isActive": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "isActive" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method", + "params" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.activateDeactivate" + ], + "example": "core.externalSystem.activateDeactivate", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Activate/Deactivate External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/add": { + "post": { + "description": "Add External Systems Configuration", + "operationId": "core.externalSystem.add", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.add" + ], + "example": "core.externalSystem.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystem": { + "additionalProperties": false, + "properties": { + "encryptionType": { + "type": [ + "string", + "null" + ] + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "port": { + "type": [ + "integer", + "null" + ] + }, + "serverTimeout": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "organizationId", + "externalSystemTypeId" + ], + "type": "object" + }, + "externalSystemAttributesValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "value": {} + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "externalSystem" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.add" + ], + "example": "core.externalSystem.add", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "serverInfo": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": "string" + }, + "encryptionType": { + "type": [ + "string", + "null" + ] + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": [ + "string", + "null" + ] + }, + "isActive": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "organizationId": { + "type": "string" + }, + "organizationName": { + "type": "string" + }, + "port": { + "type": [ + "integer", + "null" + ] + }, + "serverTimeout": { + "type": [ + "integer", + "null" + ] + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "useSsl": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "type", + "systemType", + "isActive", + "isDeleted" + ], + "type": "object" + }, + "type": "array" + }, + "userData": { + "items": { + "additionalProperties": false, + "properties": { + "externalUserId": { + "type": "integer" + }, + "userAlias": { + "type": "string" + }, + "userName": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "userMapping": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "serverInfo" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Add External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/delete": { + "post": { + "description": "Delete External Systems Configuration", + "operationId": "core.externalSystem.delete", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.delete" + ], + "example": "core.externalSystem.delete", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "externalSystemId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.delete" + ], + "example": "core.externalSystem.delete", + "type": "string" + }, + "result": { + "items": {}, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Delete External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/edit": { + "post": { + "description": "Edit External Systems Configuration", + "operationId": "core.externalSystem.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.edit" + ], + "example": "core.externalSystem.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystem": { + "additionalProperties": false, + "properties": { + "encryptionType": { + "type": [ + "string", + "null" + ] + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": "string" + }, + "name": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "port": { + "type": [ + "integer", + "null" + ] + }, + "serverTimeout": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "externalSystemId", + "organizationId", + "externalSystemTypeId" + ], + "type": "object" + }, + "externalSystemAttributesValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "externalSystemId": { + "type": "integer" + }, + "value": {} + }, + "required": [ + "externalSystemId", + "attributeId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.edit" + ], + "example": "core.externalSystem.edit", + "type": "string" + }, + "result": {} + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Edit External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/fetch": { + "post": { + "description": "Fetch External Systems Configuration", + "operationId": "core.externalSystem.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.fetch" + ], + "example": "core.externalSystem.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "type": "string" + }, + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "businessUnitId": { + "type": "number" + }, + "isActive": { + "type": "boolean" + }, + "orderBy": { + "additionalProperties": false, + "properties": { + "dir": { + "minLength": 1, + "type": "string" + }, + "field": { + "type": "string" + } + }, + "required": [ + "dir" + ], + "type": "object" + }, + "paging": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "typeId": { + "type": "integer" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.fetch" + ], + "example": "core.externalSystem.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "externalSystems": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "externalSystemId": { + "type": "number" + }, + "externalSystemTypeId": { + "type": "number" + }, + "externalSystemTypeKey": { + "type": [ + "string", + "null" + ] + }, + "isActive": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "alias" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "externalSystems" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch External System Configurations", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/get": { + "post": { + "description": "Get External System Configuration", + "operationId": "core.externalSystem.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.get" + ], + "example": "core.externalSystem.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "externalSystemId": { + "type": "integer" + } + }, + "required": [ + "externalSystemId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.get" + ], + "example": "core.externalSystem.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "serverInfo": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "type": "string" + }, + "encryptionType": { + "type": [ + "string", + "null" + ] + }, + "externalSystemId": { + "type": "integer" + }, + "externalSystemTypeId": { + "type": "integer" + }, + "hostNameIp": { + "type": [ + "string", + "null" + ] + }, + "isActive": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "organizationId": { + "type": "string" + }, + "organizationName": { + "type": "string" + }, + "port": { + "type": [ + "integer", + "null" + ] + }, + "serverTimeout": { + "type": [ + "integer", + "null" + ] + }, + "systemType": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "useSsl": { + "type": "boolean" + } + }, + "required": [ + "externalSystemId", + "externalSystemTypeId", + "type", + "systemType", + "isActive", + "isDeleted" + ], + "type": "object" + }, + "type": "array" + }, + "userData": { + "items": { + "additionalProperties": false, + "properties": { + "externalUserId": { + "type": "integer" + }, + "userAlias": { + "type": "string" + }, + "userName": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "userMapping": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "integer" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "serverInfo" + ], + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Get External System Configuration", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystem/testConnection": { + "post": { + "description": "Get External System Configuration", + "operationId": "core.externalSystem.testConnection", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.testConnection" + ], + "example": "core.externalSystem.testConnection", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "connectionString": { + "type": "string" + }, + "encryption": { + "type": [ + "string", + "null" + ] + }, + "externalSystemName": { + "enum": [ + "ldap", + "cbs", + "smtp", + "sms" + ] + }, + "password": { + "minLength": 1, + "type": "string" + }, + "port": { + "type": [ + "integer", + "null" + ] + }, + "service": { + "type": "string" + }, + "url": { + "minLength": 1, + "type": "string" + }, + "userSearchBase": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "externalSystemName", + "url", + "password" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystem.testConnection" + ], + "example": "core.externalSystem.testConnection", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "error": { + "additionalProperties": true, + "properties": {}, + "type": "object" + }, + "success": { + "type": "boolean" + }, + "warning": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Test External System Connection", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystemAttributes/get": { + "post": { + "description": "Fetch External System Attributes", + "operationId": "core.externalSystemAttributes.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemAttributes.get" + ], + "example": "core.externalSystemAttributes.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "typeId": { + "type": "integer" + } + }, + "required": [ + "typeId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemAttributes.get" + ], + "example": "core.externalSystemAttributes.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "defaultValues": { + "items": { + "additionalProperties": false, + "properties": { + "attributeId": { + "type": "number" + }, + "attributeName": { + "minLength": 1, + "type": "string" + }, + "defaultValue": { + "type": [ + "string", + "null" + ] + }, + "isMandatory": { + "type": "boolean" + }, + "isReadOnly": { + "type": "boolean" + } + }, + "required": [ + "attributeId", + "attributeName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch External System Attributes", + "tags": [ + "core" + ] + } + }, + "/rpc/core/externalSystemType/list": { + "post": { + "description": "Fetch External System Types", + "operationId": "core.externalSystemType.list", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemType.list" + ], + "example": "core.externalSystemType.list", + "type": "string" + }, + "params": { + "description": "Method parameters" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.externalSystemType.list" + ], + "example": "core.externalSystemType.list", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "externalSystemType": { + "items": { + "additionalProperties": false, + "properties": { + "depthKey": { + "type": [ + "string", + "null" + ] + }, + "externalSystemTypeId": { + "type": "number" + }, + "isBranchUnique": { + "type": "boolean" + }, + "isSingleUser": { + "type": "boolean" + }, + "key": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "externalSystemTypeId", + "key", + "name", + "depthKey", + "value", + "isBranchUnique", + "isSingleUser" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch External System Types", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/add": { + "post": { + "description": "core.item.add", + "operationId": "core.item.add", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.add" + ], + "example": "core.item.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "itemCode": { + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "type": [ + "number", + "null" + ] + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "type": "integer" + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": "integer" + } + }, + "required": [ + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": [ + "number", + "null" + ] + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "languageId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "item" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.add" + ], + "example": "core.item.add", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "integer" + }, + "itemTranslationLanguageId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "minLength": 1, + "type": [ + "string", + "null" + ] + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": [ + "number", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": "integer" + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "type": "integer" + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "type": "integer" + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Add item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/edit": { + "post": { + "description": "core.item.edit", + "operationId": "core.item.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.edit" + ], + "example": "core.item.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "itemCode": { + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "type": "integer" + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": "integer" + } + }, + "required": [ + "itemNameId", + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId", + "languageId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "item" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.edit" + ], + "example": "core.item.edit", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "integer" + }, + "itemTranslationLanguageId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "minLength": 1, + "type": [ + "string", + "null" + ] + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": [ + "number", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": "integer" + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "type": "integer" + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "type": "integer" + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Edit item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/fetch": { + "post": { + "description": "core.item.fetch", + "operationId": "core.item.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.fetch" + ], + "example": "core.item.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "isEnabled": { + "type": "boolean" + }, + "itemName": { + "type": "string" + }, + "itemTypeId": { + "type": "integer" + }, + "itemTypeName": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "keyValue": { + "type": "boolean" + }, + "languageId": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "type": [ + "string", + "null" + ] + }, + "sortOrder": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.fetch" + ], + "example": "core.item.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "title": "Name", + "type": "string" + }, + "itemNameId": { + "title": "Item Id", + "type": "number" + }, + "itemNameTranslation": { + "title": "Translation", + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "number", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "itemTranslationLanguageId": { + "title": "Language", + "type": [ + "number", + "null" + ] + }, + "itemTypeId": { + "type": "integer" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "title": "Business Unit", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "itemNameId", + "itemTypeName", + "itemTypeId", + "itemName", + "isEnabled" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch items", + "tags": [ + "core" + ] + } + }, + "/rpc/core/item/get": { + "post": { + "description": "core.item.get", + "operationId": "core.item.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.get" + ], + "example": "core.item.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameId": { + "type": "integer" + } + }, + "required": [ + "itemNameId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.item.get" + ], + "example": "core.item.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "item": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "integer" + }, + "itemTranslationLanguageId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "minLength": 1, + "type": [ + "string", + "null" + ] + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": [ + "number", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": "integer" + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + }, + "itemTranslationId": { + "type": "integer" + }, + "language": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "type": "integer" + } + }, + "required": [ + "language", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Get item", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemCode/fetch": { + "post": { + "description": "core.itemCode.fetch", + "operationId": "core.itemCode.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemCode.fetch" + ], + "example": "core.itemCode.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isEnabled": { + "type": [ + "boolean", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemCode.fetch" + ], + "example": "core.itemCode.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "display": { + "minLength": 1, + "type": "string" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type", + "display" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch item codes", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemName/fetch": { + "post": { + "description": "core.itemName.fetch", + "operationId": "core.itemName.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemName.fetch" + ], + "example": "core.itemName.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "alias": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "languageId": { + "type": "string" + }, + "organizationId": { + "type": "number" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemName.fetch" + ], + "example": "core.itemName.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "display": { + "minLength": 1, + "type": "string" + }, + "itemCode": { + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemSyncId": { + "type": [ + "string", + "null" + ] + }, + "parentItemNameId": { + "type": "integer" + }, + "type": { + "minLength": 1, + "type": "string" + }, + "value": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "type", + "display", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch item names", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameByItemType/fetch": { + "post": { + "description": "core.itemNameByItemType.fetch", + "operationId": "core.itemNameByItemType.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByItemType.fetch" + ], + "example": "core.itemNameByItemType.fetch", + "type": "string" + }, + "params": { + "additionalProperties": true, + "description": "Method parameters", + "properties": {}, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByItemType.fetch" + ], + "example": "core.itemNameByItemType.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameByType": { + "items": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "itemNameId", + "itemNameTranslation" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch item name by item type", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameByParent/list": { + "post": { + "description": "core.itemNameByParent.list", + "operationId": "core.itemNameByParent.list", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByParent.list" + ], + "example": "core.itemNameByParent.list", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTypeName": { + "maxLength": 200, + "type": "string" + }, + "languageId": { + "type": "integer" + }, + "parentItemNameId": { + "type": "integer" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameByParent.list" + ], + "example": "core.itemNameByParent.list", + "type": "string" + }, + "result": { + "additionalProperties": true, + "properties": {}, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Get cascade dropdown data", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameItemTranslation/add": { + "post": { + "description": "core.itemNameItemTranslation.add", + "operationId": "core.itemNameItemTranslation.add", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.add" + ], + "example": "core.itemNameItemTranslation.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTT": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "itemCode": { + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemOrder": { + "minimum": 1, + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "type": "integer" + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": "integer" + } + }, + "required": [ + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "language": { + "type": [ + "number", + "null" + ] + }, + "languageId": { + "type": [ + "number", + "null" + ] + }, + "resultSet": { + "type": [ + "boolean", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.add" + ], + "example": "core.itemNameItemTranslation.add", + "type": "string" + }, + "result": { + "items": {}, + "maxItems": 0, + "minItems": 0, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Add item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameItemTranslation/edit": { + "post": { + "description": "core.itemNameItemTranslation.edit", + "operationId": "core.itemNameItemTranslation.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.edit" + ], + "example": "core.itemNameItemTranslation.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTT": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": [ + "boolean", + "null" + ] + }, + "itemCode": { + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "organizationId": { + "type": "integer" + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": "integer" + } + }, + "required": [ + "itemNameId", + "itemName", + "itemTypeId" + ], + "type": "object" + }, + "itemTranslationTT": { + "additionalProperties": false, + "properties": { + "itemDescriptionTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "integer" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId", + "languageId" + ], + "type": "object" + }, + "resultSet": { + "type": [ + "boolean", + "null" + ] + } + }, + "required": [ + "itemNameTT" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameItemTranslation.edit" + ], + "example": "core.itemNameItemTranslation.edit", + "type": "string" + }, + "result": { + "items": {}, + "maxItems": 0, + "minItems": 0, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Edit item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameStatusChange": { + "post": { + "description": "core.itemNameStatusChange", + "operationId": "core.itemNameStatusChange", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameStatusChange" + ], + "example": "core.itemNameStatusChange", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameIds": { + "items": { + "type": "number" + }, + "type": "array" + }, + "newStatus": { + "type": "boolean" + } + }, + "required": [ + "newStatus" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameStatusChange" + ], + "example": "core.itemNameStatusChange", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameStatusChange": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "isEnabled", + "itemNameId" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Status change", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameTranslation/get": { + "post": { + "description": "core.itemNameTranslation.get", + "operationId": "core.itemNameTranslation.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.get" + ], + "example": "core.itemNameTranslation.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemNameId": { + "type": "number" + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemNameId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.get" + ], + "example": "core.itemNameTranslation.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemNameTranslation": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "minLength": 1, + "title": "Name", + "type": "string" + }, + "itemNameId": { + "minLength": 1, + "type": "string" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "integer", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "integer" + }, + "itemTranslationLanguageId": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "minLength": 1, + "type": [ + "string", + "null" + ] + }, + "parentItemNameId": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": [ + "number", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "isEnabled", + "itemName", + "itemNameId", + "itemTypeId", + "itemTypeName", + "organizationName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Get item name", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemNameTranslation/upload": { + "post": { + "description": "core.itemNameTranslation.upload", + "operationId": "core.itemNameTranslation.upload", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.upload" + ], + "example": "core.itemNameTranslation.upload", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemNameTranslationTT": { + "items": {}, + "type": "array" + }, + "languageId": { + "type": "integer" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemNameTranslation.upload" + ], + "example": "core.itemNameTranslation.upload", + "type": "string" + }, + "result": { + "items": {}, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch actor action", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemTranslation/fetch": { + "post": { + "description": "Core Item Translation", + "operationId": "core.itemTranslation.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemTranslation.fetch" + ], + "example": "core.itemTranslation.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "breadcrumbs": { + "items": {}, + "type": "array" + }, + "isEnabled": { + "type": "boolean" + }, + "itemName": { + "type": "string" + }, + "itemTypeId": { + "type": "string" + }, + "itemTypeName": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "keyValue": { + "type": "boolean" + }, + "languageId": { + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "type": [ + "string", + "null" + ] + }, + "sortOrder": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemTranslation.fetch" + ], + "example": "core.itemTranslation.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemTranslationFetch": { + "items": { + "additionalProperties": false, + "properties": { + "isEnabled": { + "type": "boolean" + }, + "itemCode": { + "title": "Abbreviation", + "type": [ + "string", + "null" + ] + }, + "itemName": { + "title": "Name", + "type": "string" + }, + "itemNameId": { + "title": "Item Id", + "type": "number" + }, + "itemNameTranslation": { + "title": "Translation", + "type": [ + "string", + "null" + ] + }, + "itemOrder": { + "type": [ + "number", + "null" + ] + }, + "itemSyncId": { + "title": "External Id", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "itemTranslationLanguageId": { + "title": "Language", + "type": [ + "number", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "organizationId": { + "type": "integer" + }, + "organizationName": { + "title": "Business Unit", + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "itemNameId", + "itemTypeName", + "itemTypeId", + "itemName", + "isEnabled" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Item Translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/itemType/fetch": { + "post": { + "description": "core.itemType.fetch", + "operationId": "core.itemType.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemType.fetch" + ], + "example": "core.itemType.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTypeId": { + "type": "integer" + }, + "name": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.itemType.fetch" + ], + "example": "core.itemType.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "itemType": { + "items": { + "additionalProperties": false, + "properties": { + "alias": { + "minLength": 1, + "type": "string" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "keyColumn": { + "type": [ + "string", + "null" + ] + }, + "name": { + "minLength": 1, + "type": "string" + }, + "nameColumn": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeId": { + "type": [ + "number", + "null" + ] + }, + "table": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "itemTypeId", + "alias", + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch item type", + "tags": [ + "core" + ] + } + }, + "/rpc/core/language/fetch": { + "post": { + "description": "Core Language Fetch", + "operationId": "core.language.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.language.fetch" + ], + "example": "core.language.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "iso2Code": { + "maxLength": 2, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.language.fetch" + ], + "example": "core.language.fetch", + "type": "string" + }, + "result": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "iso2Code": { + "minLength": 1, + "type": "string" + }, + "languageId": { + "type": "number" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "name": { + "minLength": 1, + "type": "string" + } + }, + "required": [ + "languageId", + "iso2Code", + "name", + "locale" + ], + "type": "object" + }, + "type": "array" + }, + "type": "array" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Language Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/add": { + "post": { + "description": "core.translation.add", + "operationId": "core.translation.add", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.add" + ], + "example": "core.translation.add", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "translation": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": [ + "number", + "null" + ] + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "languageId", + "itemNameId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Add translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/byLanguageFetch": { + "post": { + "description": "Core Translation by Language Fetch", + "operationId": "core.translation.byLanguageFetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.byLanguageFetch" + ], + "example": "core.translation.byLanguageFetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "channel": { + "type": [ + "string", + "null" + ] + }, + "dictName": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + }, + "languages": { + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, + "organizationId": { + "type": "string" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.byLanguageFetch" + ], + "example": "core.translation.byLanguageFetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translations": { + "items": { + "additionalProperties": false, + "properties": { + "dictionaryAlias": { + "minLength": 1, + "type": "string" + }, + "dictionaryCode": { + "type": [ + "string", + "null" + ] + }, + "dictionaryKey": { + "minLength": 1, + "type": "string" + }, + "dictionaryName": { + "minLength": 1, + "type": "string" + }, + "iso2Code": { + "maxLength": 2, + "minLength": 2, + "type": "string" + }, + "itemNameId": { + "type": "integer" + }, + "languageId": { + "minLength": 1, + "type": "string" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "parentItemCode": { + "type": [ + "string", + "null" + ] + }, + "parentItemName": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + }, + "translatedValue": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "dictionaryKey", + "dictionaryName", + "dictionaryAlias", + "iso2Code", + "locale", + "languageId", + "translatedValue" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Translation by Language Fetch", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/edit": { + "post": { + "description": "core.translation.edit", + "operationId": "core.translation.edit", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.edit" + ], + "example": "core.translation.edit", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "translation": { + "additionalProperties": false, + "properties": { + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": "number" + }, + "itemTypeId": { + "type": [ + "number", + "null" + ] + }, + "languageId": { + "type": "number" + } + }, + "required": [ + "itemTranslationId", + "languageId", + "itemNameId" + ], + "type": "object" + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Edit translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/fetch": { + "post": { + "description": "Core Translation", + "operationId": "core.translation.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.fetch" + ], + "example": "core.translation.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "dictName": { + "items": { + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "type": "array" + }, + "languageId": { + "minimum": 1, + "type": "number" + }, + "orderByKey": { + "type": "number" + }, + "organizationId": { + "type": "string" + }, + "updatedAfter": { + "format": "date-time", + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.fetch" + ], + "example": "core.translation.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translations": { + "items": { + "additionalProperties": false, + "properties": { + "dictionaryAlias": { + "minLength": 1, + "type": "string" + }, + "dictionaryCode": { + "type": [ + "string", + "null" + ] + }, + "dictionaryKey": { + "minLength": 1, + "type": "string" + }, + "dictionaryName": { + "minLength": 1, + "type": "string" + }, + "iso2Code": { + "maxLength": 2, + "minLength": 2, + "type": "string" + }, + "itemNameId": { + "type": "integer" + }, + "languageId": { + "minLength": 1, + "type": "string" + }, + "locale": { + "minLength": 1, + "type": "string" + }, + "parentItemCode": { + "type": [ + "string", + "null" + ] + }, + "parentItemName": { + "type": [ + "string", + "null" + ] + }, + "parentItemTypeName": { + "type": [ + "string", + "null" + ] + }, + "translatedValue": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "dictionaryKey", + "dictionaryName", + "dictionaryAlias", + "iso2Code", + "locale", + "languageId", + "translatedValue" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Core Translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translation/get": { + "post": { + "description": "core.translation.get", + "operationId": "core.translation.get", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.get" + ], + "example": "core.translation.get", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "itemTranslationId": { + "type": "integer" + } + }, + "required": [ + "itemTranslationId" + ], + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translation.get" + ], + "example": "core.translation.get", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemName": { + "title": "Item Name", + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "title": "Translation", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "language": { + "title": "Language", + "type": "string" + }, + "languageId": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "itemTypeId", + "itemTypeName", + "language", + "itemNameId", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Get translation", + "tags": [ + "core" + ] + } + }, + "/rpc/core/translations/fetch": { + "post": { + "description": "core.translations.fetch", + "operationId": "core.translations.fetch", + "parameters": [ + { + "description": "body", + "in": "body", + "name": "body", + "required": true, + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "type": "number" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translations.fetch" + ], + "example": "core.translations.fetch", + "type": "string" + }, + "params": { + "additionalProperties": false, + "description": "Method parameters", + "properties": { + "hasTranslation": { + "type": [ + "boolean", + "null" + ] + }, + "itemName": { + "type": [ + "string", + "null" + ] + }, + "itemTypeId": { + "type": "string" + }, + "languageId": { + "type": "string" + }, + "pageNumber": { + "minimum": 1, + "type": "number" + }, + "pageSize": { + "minimum": 1, + "type": "number" + }, + "sortBy": { + "type": [ + "string", + "null" + ] + }, + "sortOrder": { + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "timeout": { + "description": "Timeout in milliseconds", + "example": null, + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "Successful response", + "schema": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Unique identifier of the request", + "example": "1", + "maxLength": 36, + "minLength": 1, + "type": "string" + }, + "jsonrpc": { + "description": "Version of the JSON-RPC protocol", + "enum": [ + "2.0" + ], + "example": "2.0", + "type": "string" + }, + "method": { + "description": "Name of the method", + "enum": [ + "core.translations.fetch" + ], + "example": "core.translations.fetch", + "type": "string" + }, + "result": { + "additionalProperties": false, + "properties": { + "pagination": { + "items": { + "additionalProperties": false, + "properties": { + "pageNumber": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "pagesTotal": { + "type": "integer" + }, + "recordsTotal": { + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + }, + "translation": { + "items": { + "additionalProperties": false, + "properties": { + "itemName": { + "title": "Item Name", + "type": "string" + }, + "itemNameId": { + "type": "number" + }, + "itemNameTranslation": { + "title": "Translation", + "type": [ + "string", + "null" + ] + }, + "itemTranslationId": { + "type": [ + "number", + "null" + ] + }, + "itemTypeId": { + "type": "number" + }, + "itemTypeName": { + "minLength": 1, + "title": "Item Type", + "type": "string" + }, + "language": { + "title": "Language", + "type": "string" + }, + "languageId": { + "type": [ + "number", + "null" + ] + } + }, + "required": [ + "itemTypeId", + "itemTypeName", + "language", + "itemNameId", + "itemName" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "required": [ + "jsonrpc", + "method" + ], + "type": "object" + } + }, + "default": { + "description": "Invalid request", + "schema": {} + } + }, + "summary": "Fetch translations", + "tags": [ + "core" + ] + } + } + }, + "swagger": "2.0", + "tags": [ + { + "description": "utCore.validation", + "name": "core" + } + ] +} \ No newline at end of file diff --git a/test/seed/800$rule.testData.sql b/test/seed/800-rule.testData.sql similarity index 100% rename from test/seed/800$rule.testData.sql rename to test/seed/800-rule.testData.sql diff --git a/test/seed/850-billPaymentRule.sql b/test/seed/850-billPaymentRule.sql new file mode 100644 index 00000000..101cf5ef --- /dev/null +++ b/test/seed/850-billPaymentRule.sql @@ -0,0 +1,67 @@ +DECLARE @condition [rule].conditionTT +DECLARE @conditionActor [rule].conditionActorTT +DECLARE @conditionItem [rule].conditionItemTT +DECLARE @conditionProperty [rule].conditionPropertyTT +DECLARE @limit [rule].limitTT +DECLARE @split XML + +IF NOT EXISTS (SELECT * FROM [rule].condition WHERE [priority] = 100) +BEGIN + INSERT INTO @condition ([priority], operationStartDate, operationEndDate, sourceAccountId, destinationAccountId) + VALUES (100, NULL, NULL, NULL, NULL) + + INSERT INTO @conditionItem (factor, itemNameId) + SELECT 'oc', itemNameId + FROM core.itemName cin + JOIN core.itemType cit ON cit.itemTypeId = cin.itemTypeId + WHERE cit.alias = 'operation' AND itemCode = 'bill' + + SET @split = N' + + + bill payment + |realtime| + + + 0 + USD + 100 + 0 + + + merchant_pool + ${destination.account.number} + 100 + bill payment + + + + + bill payment fee + |processor|fee| + + + 0 + USD + 0.25 + 10 + 0.08 + 0 + + + ${destination.account.number} + merchant_tax + 100 + bill payment fee + + + ' + + EXEC [rule].[rule.add] + @condition, + @conditionActor, + @conditionItem, + @conditionProperty, + @limit, + @split +END diff --git a/test/seed/851-accountProductRule.sql b/test/seed/851-accountProductRule.sql new file mode 100644 index 00000000..1a33bd8f --- /dev/null +++ b/test/seed/851-accountProductRule.sql @@ -0,0 +1,223 @@ +DECLARE @condition [rule].conditionTT +DECLARE @conditionActor [rule].conditionActorTT +DECLARE @conditionItem [rule].conditionItemTT +DECLARE @conditionProperty [rule].conditionPropertyTT +DECLARE @limit [rule].limitTT +DECLARE @split XML +DECLARE @currency VARCHAR(3) = CASE LEN('${utLedger.sqlStandard.defaultCurrency}') + WHEN 3 THEN '${utLedger.sqlStandard.defaultCurrency}' + ELSE 'USD' +END + +DECLARE @selfRegistrationProductId BIGINT, + @selfRegistrationItemNameId BIGINT, + @selfRegistrationSuffix VARCHAR(20), + @erpProductId BIGINT, + @erpItemNameId BIGINT, + @erpSuffix VARCHAR(20) + +SELECT + @selfRegistrationProductId = productId, + @selfRegistrationItemNameId = itemNameId +FROM [ledger].[product] +WHERE [name] = 'selfRegistration' + +SELECT + @erpProductId = productId, + @erpItemNameId = itemNameId +FROM [ledger].[product] +WHERE [name] = 'ERP GL Product' + +IF EXISTS(SELECT 1 FROM [ledger].[productSubAccountType] WHERE productId = @selfRegistrationProductId) + SET @selfRegistrationSuffix = 'available' +IF EXISTS(SELECT 1 FROM [ledger].[productSubAccountType] WHERE productId = @erpProductId) + SET @erpSuffix = 'available' + + +SET @selfRegistrationSuffix = ISNULL(@selfRegistrationSuffix, '') +SET @erpSuffix = ISNULL(@erpSuffix, '') + +IF NOT EXISTS (SELECT * FROM [rule].condition WHERE [priority] = 10) +BEGIN + INSERT INTO @condition ([priority], operationStartDate, operationEndDate, sourceAccountId, destinationAccountId) + VALUES (10, NULL, NULL, NULL, NULL) + + INSERT INTO @conditionItem (factor, itemNameId) + SELECT 'oc', itemNameId + FROM core.itemName cin + JOIN core.itemType cit ON cit.itemTypeId = cin.itemTypeId + WHERE cit.alias = 'operation' AND itemCode IN ('walletToWallet', 'requestMoney', 'qrPayment', 'adjustment', 'adjustmentDebit', 'adjustmentCredit') + UNION ALL + SELECT 'dc', @selfRegistrationItemNameId + UNION ALL + SELECT 'sc', @selfRegistrationItemNameId + + SET @split = N' + + + wallet pending payments + pending + + + 0 + ' + @currency + ' + 100 + 0 + + + $' + '{source.account.number}' + @selfRegistrationSuffix + N' + $' + '{destination.account.number}' + @selfRegistrationSuffix + N' + 100 + wallet pending payments + + + ' + + EXEC [rule].[rule.add] + @condition, + @conditionActor, + @conditionItem, + @conditionProperty, + @limit, + @split +END + +DELETE FROM @condition +DELETE FROM @conditionItem + +IF NOT EXISTS (SELECT * FROM [rule].condition WHERE [priority] = 11) +BEGIN + INSERT INTO @condition ([priority], operationStartDate, operationEndDate, sourceAccountId, destinationAccountId) + VALUES (11, NULL, NULL, NULL, NULL) + + INSERT INTO @conditionItem (factor, itemNameId) + SELECT 'oc', itemNameId + FROM core.itemName cin + JOIN core.itemType cit ON cit.itemTypeId = cin.itemTypeId + WHERE cit.alias = 'operation' AND itemCode IN ('refund') + UNION ALL + SELECT 'dc', @selfRegistrationItemNameId + + SET @split = N' + + + wallet push transfers + + + 0 + ' + @currency + ' + 100 + 0 + + + $' + '{source.account.number} + $' + '{destination.account.number}' + @selfRegistrationSuffix + N' + 100 + wallet push transfers + + + ' + + EXEC [rule].[rule.add] + @condition, + @conditionActor, + @conditionItem, + @conditionProperty, + @limit, + @split +END + +DELETE FROM @condition +DELETE FROM @conditionItem + +IF NOT EXISTS (SELECT * FROM [rule].condition WHERE [priority] = 12) +BEGIN + DECLARE @accountNumber VARCHAR(35) = (SELECT accountNumber FROM [ledger].[account] WHERE accountName = 'CBS GL') + + INSERT INTO @condition ([priority], operationStartDate, operationEndDate, sourceAccountId, destinationAccountId) + VALUES (12, NULL, NULL, NULL, NULL) + + INSERT INTO @conditionItem (factor, itemNameId) + SELECT 'oc', itemNameId + FROM core.itemName cin + JOIN core.itemType cit ON cit.itemTypeId = cin.itemTypeId + WHERE cit.alias = 'operation' AND itemCode IN ('walletToAccount') + UNION ALL + SELECT 'sc', @selfRegistrationItemNameId + + SET @split = N' + + + Wallet To Account + + + 0 + ' + @currency + ' + 100 + 0 + + + $' + '{source.account.number}' + @selfRegistrationSuffix + N' + ' + @accountNumber + N' + 100 + Wallet To Account + + + ' + + EXEC [rule].[rule.add] + @condition, + @conditionActor, + @conditionItem, + @conditionProperty, + @limit, + @split +END + +DELETE FROM @condition +DELETE FROM @conditionItem + +IF NOT EXISTS (SELECT * FROM [rule].condition WHERE [priority] = 13) AND @erpItemNameId IS NOT NULL +BEGIN + INSERT INTO @condition ([priority], operationStartDate, operationEndDate, sourceAccountId, destinationAccountId) + VALUES (13, NULL, NULL, NULL, NULL) + + INSERT INTO @conditionItem (factor, itemNameId) + SELECT 'oc', itemNameId + FROM core.itemName cin + JOIN core.itemType cit ON cit.itemTypeId = cin.itemTypeId + WHERE cit.alias = 'operation' AND itemCode IN ('walletToWallet', 'requestMoney', 'qrPayment') + UNION ALL + SELECT 'dc', @erpItemNameId + UNION ALL + SELECT 'sc', @selfRegistrationItemNameId + + SET @split = N' + + + wallet pending erp payments + pending + + + 0 + ' + @currency + ' + 100 + 0 + + + $' + '{source.account.number}' + @selfRegistrationSuffix + N' + $' + '{destination.account.number}' + @erpSuffix + N' + 100 + wallet pending erp payments + + + ' + + EXEC [rule].[rule.add] + @condition, + @conditionActor, + @conditionItem, + @conditionProperty, + @limit, + @split +END diff --git a/ui/react/components/Grid/index.js b/ui/react/components/Grid/index.js index 40835ac0..7f8ced7c 100644 --- a/ui/react/components/Grid/index.js +++ b/ui/react/components/Grid/index.js @@ -1,12 +1,13 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {fromJS} from 'immutable'; -import {SimpleGrid} from 'ut-front-react/components/SimpleGrid'; +import { fromJS } from 'immutable'; +import { SimpleGrid } from 'ut-front-react/components/SimpleGrid'; import { updateGridColumnStorage, prepareGridFields } from 'ut-front-react/components/GridMenu/helpers'; import Text from 'ut-front-react/components/Text'; import style from './style.css'; import { Link } from 'react-router-dom'; + const propInStorage = 'rule_grid_fields'; export default class Grid extends React.Component { @@ -22,13 +23,17 @@ export default class Grid extends React.Component { state = { expandedGridColumns: [], columns: this.props.columns, - fields: prepareGridFields(propInStorage, [ - {title: this.props.columns.priority.title, name: 'priority'}, - {title: this.props.columns.channel.title, name: 'channel'}, - {title: this.props.columns.operation.title, name: 'operation'}, - {title: this.props.columns.source.title, name: 'source'}, - {title: this.props.columns.destination.title, name: 'destination'}, - {title: this.props.columns.limit.title, name: 'limit'}, + fields: this.prepareFields() + }; + + prepareFields() { + const fields = prepareGridFields(propInStorage, [ + { title: this.props.columns.priority.title, name: 'priority' }, + { title: this.props.columns.channel.title, name: 'channel' }, + { title: this.props.columns.operation.title, name: 'operation' }, + { title: this.props.columns.source.title, name: 'source' }, + { title: this.props.columns.destination.title, name: 'destination' }, + { title: this.props.columns.limit.title, name: 'limit' }, { title: 'Expansion', name: 'expansion' @@ -36,8 +41,19 @@ export default class Grid extends React.Component { ].map(f => { f.key = f.name; return f; - })) - }; + })); + + const findStatus = fields.filter(item => item.name === 'status'); + if (findStatus.length === 0) { + fields.splice(2, 0, { title: this.props.columns.status.title, name: 'status' }); // insert column to the 3rd position + } + + const findLock = fields.filter(item => item.name === 'isEnabled'); + if (findLock.length === 0) { + fields.splice(5, 0, { title: this.props.columns.lock.title, name: 'isEnabled' }); // insert column to the 6th position + } + return fields; + } handleGridExpansion = (id) => { const expandedGridColumns = this.state.expandedGridColumns; @@ -47,7 +63,7 @@ export default class Grid extends React.Component { } else { expandedGridColumns.push(id); } - this.setState({expandedGridColumns}); + this.setState({ expandedGridColumns }); }; renderGridColumn = (condition, keysToInclude, row, column) => { @@ -55,6 +71,7 @@ export default class Grid extends React.Component { for (const keyToInclude of keysToInclude) { if (Array.isArray(condition[keyToInclude])) { for (const index in condition[keyToInclude]) { + // console.log('conditionssss', condition); const record = condition[keyToInclude][index]; if (index > 4 && !this.state.expandedGridColumns.some(v => v === row.priority)) break; result.push(
@@ -84,13 +101,20 @@ export default class Grid extends React.Component {
); } - if (row.priority && column === 'priority') { + if (row.priority && column === 'priority' && row.status === 'approved' && row.isEnabled !== 'Locked') { result.push(
{row.priority}
); + } else { + result.push( +
+ {row.priority} +
+ ); } + return (
{result} @@ -120,7 +144,7 @@ export default class Grid extends React.Component { }); col.visible = col.visible === false ? !0 : !1; updateGridColumnStorage(propInStorage, col); - this.setState({fields: newFields}); + this.setState({ fields: newFields }); } }; @@ -134,6 +158,8 @@ export default class Grid extends React.Component { destinationAccountId: condition.destinationAccountId, operationEndDate: condition.operationEndDate, operationStartDate: condition.operationStartDate, + status: condition.status, + isEnabled: !condition.isEnabled ? 'Unlocked' : 'Locked', priority: columns.priority.visible && condition.priority, channel: columns.channel.visible && this.props.formatedGridData[conditionId], operation: columns.operation.visible && this.props.formatedGridData[conditionId], @@ -148,6 +174,7 @@ export default class Grid extends React.Component { }; transformCellValue = (value, header, row, isHeader) => { + // console.log('new value', value); if (isHeader) { return value; } else { @@ -170,8 +197,20 @@ export default class Grid extends React.Component { case 'priority': return this.renderGridColumn(value, ['priority'], row, 'priority'); case 'expansion': { - const expansionText = this.state.expandedGridColumns.some(v => v === row.priority) ? 'See less...' : 'See more...'; - return { e.preventDefault(); this.handleGridExpansion(row.priority); }}>{expansionText}; + let showText; + Object.values(row?.channel).every(data => { + if (data.length >= 10) { + showText = true; + return false; + } + return true; + }); + if (showText) { + const expansionText = this.state.expandedGridColumns.some(v => v === row.priority) ? 'See less...' : 'See more...'; + return { e.preventDefault(); this.handleGridExpansion(row.priority); }}>{expansionText}; + } else { + return ''; + } } default: return value; @@ -183,6 +222,7 @@ export default class Grid extends React.Component { const data = fromJS(this.getData()).sort((a, b) => { return a.get('priority') - b.get('priority'); }).toJS(); + // console.log('fields', data); return ( 0) { + // const user = currentValues.getIn(['person']); + // const id = user.get('actorId'); + // const pathname = getLink('ut-user:userValidate', { id }); + // const newTitle = baseTabTitle + // this.props.updateTabTitle(pathname, newTitle); + // this.setState({ + // updatedTitle: true + // }); + // } + } + + handleApproval() { + const conditionId = this.props.match.params.id; + const { canApprove } = this.permissions; + if (canApprove) { + this.props.approveRule({ conditionId: conditionId }); + this.props.removeTab(this.props.activeTab.pathname); + this.props.closeConfirmDialog(); + } + } + + handleRejection() { + const cd = this.props.confirmDialog.toJS(); + const conditionId = this.props.match.params.id; + const { canReject } = this.permissions; + if (canReject) { + this.props.rejectRuleChanges(conditionId, cd.value); + this.props.closeConfirmDialog(); + this.props.removeTab(this.props.activeTab.pathname); + } + } + + handleDialogOpen(config) { + return () => this.props.openConfirmDialog(config); + } + + handleDiscard(conditionId) { + const { canDiscard } = this.permissions; + if (canDiscard) { + return () => { + this.props.discardRuleChanges(conditionId); + this.props.closeConfirmDialog(); + this.props.removeTab(this.props.activeTab.pathname); + }; + } + } + + handleClose() { + this.props.removeTab(this.props.activeTab.pathname); + } + + getButtons() { + const { canApprove, canEdit } = this.permissions; + const { currentValues, newValues } = this.props; + const conditionId = newValues.getIn(['condition', 'conditionId']); + const isRejected = newValues.getIn(['condition', 'status']) === 'rejected'; + const isDeleted = newValues.getIn(['condition', 'isDeleted']); + const isLocked = !currentValues.getIn(['condition', 'isEnabled']); + const approveDialogConfig = { + isOpen: true, + showInput: false, + message: messages.approve, + buttons: [ + { label: 'Confirm', onClick: this.handleApproval }, + { label: 'Cancel', onClick: this.props.closeConfirmDialog } + ] + }; + const rejectReasonDialogConfig = { + isOpen: true, + showInput: true, + title: 'enter reject reason', + message: '', + buttons: [ + { label: 'Submit', onClick: this.handleRejection, disabled: !this.props.canSubmit }, + { label: 'Cancel', onClick: this.props.closeConfirmDialog } + ] + }; + const rejectDialogConfig = { + isOpen: true, + title: 'confirm rejection', + message: messages.reject, + showInput: false, + canSubmit: true, + buttons: [ + { label: 'Reject', onClick: this.handleDialogOpen(rejectReasonDialogConfig) }, + { label: 'Cancel', onClick: this.props.closeConfirmDialog } + ] + }; + + const discardChangesDialogConfig = { + isOpen: true, + title: 'DISCARD CHANGES MADE', + message: messages.discard, + showInput: false, + canSubmit: true, + buttons: [ + { label: 'Discard', onClick: this.handleDiscard(conditionId) }, + { label: 'Cancel', onClick: this.props.closeConfirmDialog } + ] + }; + + const buttonsMaker = [ + { + text: 'Discard changes', + onClick: this.handleDialogOpen(discardChangesDialogConfig) + }, + { + text: 'Cancel', + onClick: this.handleClose + } + ]; + + if (!isDeleted || !isLocked) { + buttonsMaker.unshift({ + text: 'Edit', + href: getLink('ut-rule:edit', { id: conditionId }) + }); + } + + const buttonsCheker = [ + { + text: 'Approve', + onClick: this.handleDialogOpen(approveDialogConfig) + }, + { + text: 'Reject', + onClick: this.handleDialogOpen(rejectDialogConfig) + }, + { + text: 'Close', + onClick: this.handleClose + } + ]; + if (canApprove && !isRejected) { + return buttonsCheker; + } else if (canEdit && isRejected) { + return buttonsMaker; + } else { + return [ + { + text: 'Cancel', + href: getLink('ut-rule:rules') + } + ]; + } + } + + getMakerCheckerValues() { + let { currentValues, newValues } = this.props; + // console.log('this.props current', currentValues.toJS()); + // console.log('this.props new', newValues.toJS()); + const isNew = newValues.getIn(['condition', 'isNew']); + const isDeleted = newValues.getIn(['condition', 'isDeleted']); + const isRejected = currentValues.getIn(['condition', 'status']) === 'rejected'; + + if (isNew) { + newValues = currentValues; + } + if (isDeleted || isRejected) { + newValues = currentValues; + } + if (currentValues.getIn(['condition', 'isEnabled'])) { + newValues = currentValues.set('condition', newValues.get('condition')); + } + + const options = { isNew, isDeleted }; + + return immutable.fromJS([ + mapGeneralInfoData(currentValues, newValues, options), + operationInfoData(currentValues, newValues, options), + sourceInfoData(currentValues, newValues, options), + destinationInfoData(currentValues, newValues, options), + ...splitCheckers.map(item => splitInfoData(currentValues, newValues, options, item.title, item.key)) + ]).filter(result => result); + } + + render() { + const { id, newValues, location, confirmDialog, value, errors, canSubmit, updateErrors, changeConfirmDialogValue } = this.props; + + const rejectReason = newValues.getIn(['condition', 'rejectReason']); + const isNew = newValues.getIn(['condition', 'isNew']) || null; + const isDeleted = newValues.getIn(['condition', 'isDeleted']) || null; + const isRejected = newValues.getIn(['condition', 'status']) === 'rejected'; + const compareGridStaticStrings = { + headingIsNew: 'New Rule', + headingWillBeDeleted: 'Rule will be deleted' + }; + + const pathname = getLink('ut-rule:validate', { id }); + // const rule = currentValues.condition || newValues.condition + + const title = confirmDialog.get('title'); + const buttons = confirmDialog.get('buttons'); + const isOpen = confirmDialog.get('isOpen'); + const showInput = confirmDialog.get('showInput'); + const message = confirmDialog.get('message'); + + return ( + + + + } + > + + + + + + + + + ); + } +} + +RuleApprove.contextTypes = { + checkPermission: PropTypes.func +}; + +RuleApprove.propTypes = { + // actions + getSingleRule: PropTypes.func, + setActiveTab: PropTypes.func, + changeConfirmDialogValue: PropTypes.func, + openConfirmDialog: PropTypes.func, + closeConfirmDialog: PropTypes.func, + removeTab: PropTypes.func, + updateErrors: PropTypes.func, + approveRule: PropTypes.func, + rejectRuleChanges: PropTypes.func, + updateTabTitle: PropTypes.func, + discardRuleChanges: PropTypes.func, + // data + location: PropTypes.object.isRequired, + match: PropTypes.object.isRequired, + id: PropTypes.any, + newValues: PropTypes.object, + value: PropTypes.string, + activeTab: PropTypes.object, + activeTabData: PropTypes.any, + currentValues: PropTypes.object, + confirmDialog: PropTypes.object, + languages: PropTypes.object, + canSubmit: PropTypes.bool, + errors: PropTypes.object + +}; + +const mapStateToProps = (state, ownProps) => { + // console.log('state in rule approve', state.ruleProfileReducer.toJS()); + // console.log('state in rule state', state); + const tab = state.ruleProfileReducer.getIn(['approve', ownProps.match.params.id]) || immutable.fromJS(defaultState); + + const currentValues = immutable.fromJS({ + condition: tab.getIn(['localData', 'condition']), + conditionActor: tab.getIn(['localData', 'conditionActor']), + conditionProperty: tab.getIn(['localData', 'conditionProperty']), + conditionItem: tab.getIn(['localData', 'conditionItem']), + limit: tab.getIn(['localData', 'limit']), + splitName: tab.getIn(['localData', 'splitName']), + splitAssignment: tab.getIn(['localData', 'splitAssignment']), + splitAnalytic: tab.getIn(['localData', 'splitAnalytic']), + splitRange: tab.getIn(['localData', 'splitRange']) + }); + + const newValues = immutable.fromJS({ + condition: tab.getIn(['localData', 'conditionUnapproved']), + conditionActor: tab.getIn(['localData', 'conditionActorUnapproved']), + conditionProperty: tab.getIn(['localData', 'conditionPropertyUnapproved']), + conditionItem: tab.getIn(['localData', 'conditionItemUnapproved']), + limit: tab.getIn(['localData', 'limitUnapproved']), + splitName: tab.getIn(['localData', 'splitNameUnapproved']), + splitAssignment: tab.getIn(['localData', 'splitAssignmentUnapproved']), + splitAnalytic: tab.getIn(['localData', 'splitAnalyticUnapproved']), + splitRange: tab.getIn(['localData', 'splitRangeUnapproved']) + }); + + // console.log('state currentvalues', currentValues.toJS()); + // console.log('state newvalues', newValues.toJS()); + + return { + id: ownProps.match.params.id, + currentValues, + newValues, + activeTab: state.tabMenu.active, + activeTabData: state.ruleProfileReducer.get('activeTab'), + confirmDialog: state.ruleProfileReducer.getIn(['common', 'confirmDialog']), + canSubmit: state.ruleProfileReducer.getIn(['common', 'confirmDialog', 'canSubmit']), + value: state.ruleProfileReducer.getIn(['common', 'confirmDialog', 'value']), + errors: tab.getIn(['errors']) || immutable.fromJS({}) + }; +}; + +export default connect( + mapStateToProps, + { + getSingleRule, + setActiveTab, + removeTab, + closeConfirmDialog, + openConfirmDialog, + changeConfirmDialogValue, + updateErrors, + approveRule, + rejectRuleChanges, + updateTabTitle, + discardRuleChanges + } +)(RuleApprove); diff --git a/ui/react/pages/RuleProfile/Tabs/Channel/index.js b/ui/react/pages/RuleProfile/Tabs/Channel/index.js index 8efb8560..b69d841f 100644 --- a/ui/react/pages/RuleProfile/Tabs/Channel/index.js +++ b/ui/react/pages/RuleProfile/Tabs/Channel/index.js @@ -5,7 +5,6 @@ import { bindActionCreators } from 'redux'; import { fromJS } from 'immutable'; import MultiSelectDropdown from 'ut-front-react/components/Input/MultiSelectDropdown'; import TitledContentBox from 'ut-front-react/components/TitledContentBox'; -import Dropdown from 'ut-front-react/components/Input/Dropdown'; import Input from 'ut-front-react/components/Input'; import Property from '../../../../components/Property'; import style from '../style.css'; @@ -120,7 +119,7 @@ class ChannelTab extends Component { />
} {fields.organization.visible &&
- ({ export const createRule = (params) => ({ type: actionTypes.CREATE_RULE, - method: 'rule.rule.add', + method: 'rule.rule.addUnapproved', params: params || {} }); +export const closeConfirmDialog = () => ({ + type: actionTypes.CLOSE_CONFIRM_DIALOG +}); + +export function updateErrors(errors, id) { + return { + type: actionTypes.UPDATE_USER_ERRORS, + params: { + errors, + id + } + }; +} + +export const approveRule = (params) => ({ + type: actionTypes.APPROVE_RULE, + method: 'rule.rule.approve', + params +}); + +export const rejectRuleChanges = (conditionId, rejectReason) => ({ + type: actionTypes.REJECT_RULE, + method: 'rule.rule.reject', + params: { conditionId, rejectReason } +}); + +export function openConfirmDialog(config) { + return { + type: actionTypes.OPEN_CONFIRM_DIALOG, + params: { config } + }; +} + +export const discardRuleChanges = (conditionId) => ({ + type: actionTypes.DISCARD_RULE, + method: 'rule.rule.discard', + params: { conditionId } +}); + +export function changeConfirmDialogValue(value, canSubmit) { + return { + type: actionTypes.CHANGE_CONFIRM_DIALOG_VALUE, + params: { value, canSubmit } + }; +} + export const editRule = (params) => ({ type: actionTypes.EDIT_RULE, method: 'rule.rule.edit', params: params || {} }); +export const getSingleRule = (params) => ({ + type: actionTypes.GET_SINGLE_RULE, + method: 'rule.rule.get', + params +}); + +export function setActiveTab({ mode, id }) { + return { + type: actionTypes.SET_ACTIVE_TAB, + params: { mode, id } + }; +}; + export const resetRuleState = (params) => ({ type: actionTypes.RESET_RULE_STATE }); export const changeRuleProfile = (mode, id) => ({ type: actionTypes.CHANGE_RULE_PROFILE, - params: {mode, id} + params: { mode, id } }); export const changeActiveTab = (tab) => ({ type: actionTypes.CHANGE_ACTIVE_TAB, - params: {...tab} + params: { ...tab } }); // channel actions @@ -53,7 +112,7 @@ export const addProperty = (destinationProp) => ({ export const removeProperty = (propertyId, destinationProp) => ({ type: actionTypes.REMOVE_PROPERTY, - params: {propertyId}, + params: { propertyId }, destinationProp }); @@ -65,39 +124,39 @@ export const addLimit = () => { export const removeLimit = (limitId) => ({ type: actionTypes.REMOVE_LIMIT, - params: {limitId} + params: { limitId } }); export const addAssignment = (splitIndex) => ({ type: actionTypes.ADD_ASSIGNMENT, - params: {splitIndex} + params: { splitIndex } }); export const removeAssignment = (splitIndex, propertyId) => ({ type: actionTypes.REMOVE_ASSIGNMENT, - params: {splitIndex, propertyId} + params: { splitIndex, propertyId } }); export const addCumulative = (splitIndex) => { return { type: actionTypes.ADD_CUMULATIVE, - params: {splitIndex} + params: { splitIndex } }; }; export const removeCumulative = (splitIndex, cumulativeId) => ({ type: actionTypes.REMOVE_CUMULATIVE, - params: {splitIndex, cumulativeId} + params: { splitIndex, cumulativeId } }); export const addCumulativeRange = (splitIndex, cumulativeId) => ({ type: actionTypes.ADD_CUMULATIVE_RANGE, - params: {splitIndex, cumulativeId} + params: { splitIndex, cumulativeId } }); export const removeCumulativeRange = (splitIndex, cumulativeId, rangeId) => ({ type: actionTypes.REMOVE_CUMULATIVE_RANGE, - params: {splitIndex, cumulativeId, rangeId} + params: { splitIndex, cumulativeId, rangeId } }); export const addSplit = () => ({ @@ -106,10 +165,10 @@ export const addSplit = () => ({ export const removeSplit = (splitIndex) => ({ type: actionTypes.REMOVE_SPLIT, - params: {splitIndex} + params: { splitIndex } }); export const updateRuleErrors = (errors) => ({ type: actionTypes.UPDATE_RULE_ERRORS, - params: {errors} + params: { errors } }); diff --git a/ui/react/pages/RuleProfile/helpers.js b/ui/react/pages/RuleProfile/helpers.js index 3059da40..3f893a79 100644 --- a/ui/react/pages/RuleProfile/helpers.js +++ b/ui/react/pages/RuleProfile/helpers.js @@ -72,20 +72,30 @@ export const prepareRuleToSave = (rule) => { priority: channel.priority, operationStartDate: operation.startDate || null, operationEndDate: operation.endDate || null, - sourceAccontId: null, + sourceAccountId: null, destinationAccountId: null }]; formattedRule.conditionActor = []; ['channel', 'source', 'destination'].forEach(function(keyProp) { const value = rule[keyProp]; ['organization', 'role'].forEach((type) => { - value[type] && formattedRule.conditionActor.push( - { - actorId: value[type], - conditionId, - factor: conditionActorFactor[keyProp] - } - ); + if (value[type] && value[type] instanceof Array) { + value[type].forEach(function(ci) { + ci.key && formattedRule.conditionActor.push({ + actorId: ci.key, + conditionId, + factor: conditionActorFactor[keyProp] + }); + }); + } else { + value[type] && formattedRule.conditionActor.push( + { + actorId: value[type], + conditionId, + factor: conditionActorFactor[keyProp] + } + ); + } }); }); diff --git a/ui/react/pages/RuleProfile/markerCheckerHelper.js b/ui/react/pages/RuleProfile/markerCheckerHelper.js new file mode 100644 index 00000000..23939966 --- /dev/null +++ b/ui/react/pages/RuleProfile/markerCheckerHelper.js @@ -0,0 +1,186 @@ +import { compare } from 'ut-front-react/components/CompareGrid/helpers'; +import immutable from 'immutable'; + +export function capitalizeFirstLetter(str) { + try { + return str.charAt(0).toUpperCase() + str.slice(1); + } catch (error) { + return str; + } +} + +export function formatDate(dateString) { + if (dateString === undefined) { + return undefined; + } + const date = new Date(dateString); + return date.toUTCString(); +} + +const parseConditionItemData = (conditionItems, factor) => { + if (conditionItems === undefined) { + return immutable.fromJS([]); + } + return conditionItems.map(item => { + switch (factor) { + case item.get('factor'): + return { + key: capitalizeFirstLetter(item.get('itemTypeName')), + value: capitalizeFirstLetter(item.get('itemName')) + }; + default: + break; + } + }).filter(item => item !== undefined).toJS(); +}; + +const parseConditionActorData = (conditionActors, factor) => { + if (conditionActors === undefined) { + return immutable.fromJS([]); + } + return conditionActors.map(item => { + // console.log('currentOperationactors=====', item.toJS()); + switch (factor) { + case item.get('factor'): + return { + key: capitalizeFirstLetter(item.get('type')), + value: item.getIn(['actorId', 1]) // && item.get('actorId').length > 0 ? item.get('actorId')[0] : undefined + }; + default: + break; + } + }).filter(item => item !== undefined).toJS(); +}; + +const parseConditionPropertyData = (conditionProperty, factor) => { + if (conditionProperty === undefined) { + return immutable.fromJS([]); + } + return conditionProperty.map(item => { + switch (factor) { + case item.get('factor'): + return { + key: capitalizeFirstLetter(item.get('name')), + value: capitalizeFirstLetter(item.get('value')) + }; + default: + break; + } + }).filter(item => item !== undefined).toJS(); +}; + +const generalInfoMapper = (values) => { + // console.log('parsed state=================', parseConditionItemData(values.get('conditionItem'), 'cs')) + return immutable.fromJS([ + { + key: 'Priority', + value: values.getIn(['condition', 'priority']) + }, + { + key: 'Status', + value: capitalizeFirstLetter(values.getIn(['condition', 'status'])) + }, + { + key: 'Lock', + value: values.getIn(['condition', 'isEnabled']) ? 'Lock' : 'Unlock' + }, + ...parseConditionItemData(values.get('conditionItem'), 'cs'), + ...parseConditionPropertyData(values.get('conditionProperty'), 'co'), + ...parseConditionActorData(values.get('conditionActor'), 'co') + ].filter(item => item.value !== undefined)); +}; + +export function mapGeneralInfoData(currentValues, newValues, options) { + const generalInfoCurrent = generalInfoMapper(currentValues); + const generalInfoUnapproved = generalInfoMapper(newValues); + return compare('Channel')(generalInfoCurrent, generalInfoUnapproved, options); +} + +const operationItemDataMapper = (values) => { + // console.log('currentOperation============', values.toJS()) + return immutable.fromJS([ + ...parseConditionItemData(values.get('conditionItem'), 'oc'), + { + key: 'Operation Start Date', + value: formatDate(values.getIn(['condition', 'operationStartDate'])) + }, + { + key: 'Operation End Date', + value: formatDate(values.getIn(['condition', 'operationEndDate'])) + }, + ...parseConditionPropertyData(values.get('conditionProperty'), 'oc') + // ...cnditionItemStatusParser(values.get('conditionItem'), 'oc'), + ].filter(item => item.value !== undefined)); +}; + +export function operationInfoData(currentValues, newValues, options) { + const currentOperation = operationItemDataMapper(currentValues); + const newOperation = operationItemDataMapper(newValues); + return compare('Operation')(currentOperation, newOperation, options); +} + +const sourceDataMapper = (values) => { + return immutable.fromJS([ + ...parseConditionItemData(values.get('conditionItem'), 'ss'), + ...parseConditionItemData(values.get('conditionItem'), 'sc'), + ...parseConditionPropertyData(values.get('conditionProperty'), 'so'), + ...parseConditionActorData(values.get('conditionActor'), 'so') + ].filter(item => item.value !== undefined)); +}; + +export function sourceInfoData(currentValues, newValues, options) { + const currentSource = sourceDataMapper(currentValues); + const newSource = sourceDataMapper(newValues); + return compare('Source')(currentSource, newSource, options); +} + +const destinationDataMapper = (values) => { + return immutable.fromJS([ + ...parseConditionItemData(values.get('conditionItem'), 'ds'), + ...parseConditionItemData(values.get('conditionItem'), 'dc'), + ...parseConditionPropertyData(values.get('conditionProperty'), 'do'), + ...parseConditionActorData(values.get('conditionActor'), 'do') + ].filter(item => item.value !== undefined)); +}; + +export function destinationInfoData(currentValues, newValues, options) { + const currentDestination = destinationDataMapper(currentValues); + const newDestination = destinationDataMapper(newValues); + return compare('Destination')(currentDestination, newDestination, options); +} + +const seperateUpperCaseWords = (word) => { + try { + return capitalizeFirstLetter(word).match(/[A-Z][a-z]+|[0-9]+/g).join(' '); + } catch (error) { + if (word !== undefined) { + return capitalizeFirstLetter(word); + } + return word; + } +}; + +const splitDataMapper = (values, key) => { + if (values.has(key) && values.get(key) !== undefined && values.get(key).size > 0) { + const results = []; + values.get(key).map(split => { + // console.log('currentOperation============//', split.toJS()); + Object.keys(split.toJS()).forEach(key => { + results.push({ + key: seperateUpperCaseWords(key), + value: capitalizeFirstLetter(typeof (split.get(key)) === 'boolean' ? split.get(key).toString() : split.get(key)) + }); + }); + }); + // console.log('########', results); + return immutable.fromJS(results.filter(item => item.value !== null && !(item.key.includes('Id') || item.key.startsWith('id')))); + } + return immutable.fromJS([]); +}; + +export function splitInfoData(currentValues, newValues, options, title, key) { + // console.log('currentOperation============', newValues.toJS()); + const currentSplit = splitDataMapper(currentValues, key); + const newSplit = splitDataMapper(newValues, key); + return compare(title)(currentSplit, newSplit, options); +} diff --git a/ui/react/pages/RuleProfile/reducer.js b/ui/react/pages/RuleProfile/reducer.js index b2120b6f..618d9245 100644 --- a/ui/react/pages/RuleProfile/reducer.js +++ b/ui/react/pages/RuleProfile/reducer.js @@ -1,9 +1,32 @@ -import { fromJS } from 'immutable'; +import immutable, { fromJS } from 'immutable'; import * as actionTypes from './actionTypes'; import * as reducerHelper from './reducerHelper'; import { REMOVE_TAB } from 'ut-front-react/containers/TabMenu/actionTypes'; import { removeRules as DELETE_RULE } from '../Rules/actionTypes'; -const defaultState = { + +export const localDataObj = { + condition: {}, + conditionActor: [], + conditionProperty: [], + conditionItem: [], + limit: [], + splitName: [], + splitAssignment: [], + splitAnalytic: [], + splitRange: [] +}; + +export const confirmDialogObj = { + isOpen: false, + title: '', + value: '', + message: '', + showInput: false, + buttons: [], + canSubmit: true +}; + +export const defaultState = { nomenclatures: { accountProduct: [], cardProduct: [], @@ -21,12 +44,30 @@ const defaultState = { mode: null, id: null }, - rules: {} + rules: {}, + remoteData: {}, + localData: localDataObj, + errors: fromJS({}), + common: { + confirmDialog: confirmDialogObj + } }; export const ruleProfileReducer = (state = fromJS(defaultState), action) => { const options = state.get('config').toJS(); switch (action.type) { + case actionTypes.CLOSE_CONFIRM_DIALOG: + return reducerHelper.closeConfirmDialog(state, action, options); + case actionTypes.UPDATE_USER_ERRORS: + return reducerHelper.updateRuleErrors(state, action, options); + case actionTypes.CHANGE_CONFIRM_DIALOG_VALUE: + return reducerHelper.changeConfirmDialogValue(state, action, options); + case actionTypes.OPEN_CONFIRM_DIALOG: + return reducerHelper.openConfirmDialog(state, action, options); + case actionTypes.SET_ACTIVE_TAB: + return state.set('activeTab', immutable.fromJS(action.params)); + case actionTypes.GET_SINGLE_RULE: + return reducerHelper.getSingleRule(state, action, options); case actionTypes.CHANGE_RULE_PROFILE: return reducerHelper.changeRuleProfile(state, action, options); case actionTypes.FETCH_NOMENCLATURES: @@ -34,7 +75,10 @@ export const ruleProfileReducer = (state = fromJS(defaultState), action) => { case actionTypes.EDIT_RULE: case actionTypes.CREATE_RULE: return reducerHelper.saveRule(state, action, options); + case actionTypes.APPROVE_RULE: + return state; case actionTypes.GET_RULE: + case actionTypes.REJECT_RULE: return reducerHelper.getRule(state, action, options); case actionTypes.RESET_RULE_STATE: return reducerHelper.resetRuleProfile(state, action, options); diff --git a/ui/react/pages/RuleProfile/reducerHelper.js b/ui/react/pages/RuleProfile/reducerHelper.js index 17ecd3a6..064001b4 100644 --- a/ui/react/pages/RuleProfile/reducerHelper.js +++ b/ui/react/pages/RuleProfile/reducerHelper.js @@ -3,6 +3,7 @@ import { formatNomenclatures, prepareRuleModel } from './helpers'; import { fromJS } from 'immutable'; import { getLink } from 'ut-front-react/routerHelper'; import { defaultTabState, emptyLimit, emptySplit, emptyAssignment, emptyRange, defaultErrorState, emptyCumulative } from './Tabs/defaultState'; +import { confirmDialogObj } from './reducer'; const __placeholder__ = '__placeholder__'; export function changeRuleProfile(state, action, options) { @@ -14,7 +15,32 @@ export function changeRuleProfile(state, action, options) { return state; } +export function getSingleRule(state, action, options) { + if (action.methodRequestState === methodRequestState.FINISHED) { + const id = action.params.conditionId; + // console.log('response from action', action); + return state + .setIn(['approve', id, 'localData'], fromJS(action.result)); + } + return state; +} + +export const changeConfirmDialogValue = (state, action, options) => { + return state + .setIn(['common', 'confirmDialog', 'value'], action.params.value.value) + .setIn(['common', 'confirmDialog', 'canSubmit'], action.params.value.canSubmit); +}; + +export const closeConfirmDialog = (state, action, options) => { + return state.setIn(['common', 'confirmDialog'], fromJS(confirmDialogObj)); +}; + +export const openConfirmDialog = (state, action, options) => { + return state.setIn(['common', 'confirmDialog'], fromJS(action.params.config)); +}; + export function fetchNomenclatures(state, action, options) { + // console.log('fetched nomenclatures', action.result); if (action.methodRequestState === methodRequestState.FINISHED) { return state.set('nomenclatures', fromJS(formatNomenclatures(action.result.items))) .setIn(['config', 'nomenclaturesFetched'], true); @@ -91,7 +117,8 @@ export function changeActiveTab(state, action, options) { } // error update export function updateRuleErrors(state, action, options) { - const { mode, id } = options; + const mode = options.mode || state.getIn(['activeTab', 'mode']); + const id = options.id || state.getIn(['activeTab', 'id']); return state.setIn([mode, id, 'errors'], fromJS(action.params.errors)); } // common tab actions diff --git a/ui/react/pages/Rules/actionCreators.js b/ui/react/pages/Rules/actionCreators.js index d5f61be7..911c4479 100644 --- a/ui/react/pages/Rules/actionCreators.js +++ b/ui/react/pages/Rules/actionCreators.js @@ -8,7 +8,7 @@ const removeEmpty = (obj) => { return obj; }; -export const updatePagination = (params) => ({type: actionTypes.updatePagination, params}); +export const updatePagination = (params) => ({ type: actionTypes.updatePagination, params }); export function fetchRules(params, showDeleted) { return { @@ -394,3 +394,11 @@ export function toggleRuleOption(key, value) { } }; }; + +export function lockUnlockRule(params) { + return { + type: actionTypes.lockUnlockRule, + method: 'rule.rule.lock', + params + }; +} diff --git a/ui/react/pages/Rules/actionTypes.js b/ui/react/pages/Rules/actionTypes.js index 4f91a0b3..bbf5ee9b 100644 --- a/ui/react/pages/Rules/actionTypes.js +++ b/ui/react/pages/Rules/actionTypes.js @@ -9,3 +9,4 @@ export const fetchNomenclatures = Symbol.for('fetchNomenclatures'); export const reset = Symbol.for('reset'); export const updatePagination = Symbol.for('updatePagination'); export const toggleRuleOption = Symbol.for('toggleRuleOption'); +export const lockUnlockRule = Symbol.for('logUnlockRule'); diff --git a/ui/react/pages/Rules/index.js b/ui/react/pages/Rules/index.js index e6d57d2e..ddfed083 100644 --- a/ui/react/pages/Rules/index.js +++ b/ui/react/pages/Rules/index.js @@ -17,7 +17,7 @@ import style from './style.css'; import * as actionCreators from './actionCreators'; class Main extends React.Component { - static displayName = 'Main' + static displayName = 'Main'; static propTypes = { rules: PropTypes.object, @@ -28,11 +28,11 @@ class Main extends React.Component { uiConfig: PropTypes.object, pagination: PropTypes.object, showDeleted: PropTypes.bool - } + }; static contextTypes = { checkPermission: PropTypes.func.isRequired - } + }; constructor(props, context) { super(props, context); @@ -40,20 +40,23 @@ class Main extends React.Component { selectedConditions: {}, canEdit: false, canDelete: false, - uiConfig: props.uiConfig.toJS() + uiConfig: props.uiConfig.toJS(), + selectedData: {} }; this.handleCheckboxSelect = this.handleCheckboxSelect.bind(this); this.handleHeaderCheckboxSelect = this.handleHeaderCheckboxSelect.bind(this); this.showConfirm = this.showConfirm.bind(this); this.removeRules = this.removeRules.bind(this); + this.showRuleLockConfirm = this.showRuleLockConfirm.bind(this); + this.lockRule = this.lockRule.bind(this); } fetchData(props) { - const {pageSize, pageNumber} = props.pagination; + const { pageSize, pageNumber } = props.pagination; const showDeleted = props.showDeleted; - this.props.actions.fetchRules({pageSize, pageNumber}, showDeleted); + this.props.actions.fetchRules({ pageSize, pageNumber }, showDeleted); this.props.actions.fetchNomenclatures(this.state.uiConfig.nomenclatures); } @@ -72,7 +75,8 @@ class Main extends React.Component { selectedConditions: {}, canEdit: false, canDelete: false, - uiConfig: this.props.uiConfig.toJS() + uiConfig: this.props.uiConfig.toJS(), + selectedData: {} }; } @@ -81,6 +85,7 @@ class Main extends React.Component { } handleCheckboxSelect(isSelected, data) { + // console.log('selected', isSelected, 'data', data); const selectedConditions = this.state.selectedConditions; if (isSelected === null) { isSelected = selectedConditions[data.id]; @@ -92,9 +97,10 @@ class Main extends React.Component { } const count = Object.keys(selectedConditions).length; this.setState({ - selectedConditions: selectedConditions, + selectedConditions, canEdit: count === 1, - canDelete: count > 0 + canDelete: count > 0, + selectedData: !isSelected ? data : {} }); return !isSelected; } @@ -114,6 +120,19 @@ class Main extends React.Component { })); } + lockRule() { + const id = Object.keys(this.state.selectedConditions)[0]; + const selectedData = this.state.selectedData; + this.props.actions.lockUnlockRule({ conditionId: id, isEnabled: Number(Boolean(!(selectedData.isEnabled === 'Locked'))) }).then(() => { + this.refresh(); + this.fetchData(this.props); + }); + } + + showRuleLockConfirm() { + this.refs.showRuleLockDialog && this.refs.showRuleLockDialog.open(); + } + refresh() { this.setState(this.getInitialState(), () => this.props.actions.reset()); } @@ -125,7 +144,7 @@ class Main extends React.Component { getHeaderButtons() { const buttons = []; this.context.checkPermission('rule.rule.add') && - buttons.push({text: 'Create Rule', href: getLink('ut-rule:create'), styleType: 'primaryLight'}); + buttons.push({ text: 'Create Rule', href: getLink('ut-rule:create'), styleType: 'primaryLight' }); return buttons; } @@ -136,22 +155,32 @@ class Main extends React.Component { const uiConfig = this.state.uiConfig; const columns = uiConfig.main.grid.columns; + // console.log('columns for grid', columns); const id = Object.keys(this.state.selectedConditions)[0]; + // console.log('this.state.selectedConditions', this.state.selectedData); + const selectedStatus = this.state.selectedData.status || ''; + const selectedData = this.state.selectedData; + const isLocked = this.state.selectedData.isEnabled === 'Locked'; const showDeleted = this.props.showDeleted; const content = [ - {this.context.checkPermission('rule.rule.edit') && !showDeleted && - (