Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
0dbffdb
fix(MSA-419): udpate dates from local datetime to utc
kalinkrustev Feb 11, 2022
854ac93
[ci-skip][ci skip] version incremented to 12.0.0-timezone.0
ut-jenkins Feb 11, 2022
c74c279
fix: outcome date in UTC #UTCORE-121
kalinkrustev Feb 21, 2022
22133f3
docs: release notes #UTCORE-121
kalinkrustev Feb 21, 2022
0695ae3
chore: build
kalinkrustev Feb 21, 2022
0a912b9
[ci-skip][ci skip] version incremented to 12.0.0-timezone.1
ut-jenkins Feb 21, 2022
e0e4137
Merge pull request #225 from softwaregroup-bg/major/timezone
kalinkrustev Feb 21, 2022
be10dc7
[ci-skip][ci skip] version incremented to 12.0.0
ut-jenkins Feb 21, 2022
cab1945
chore: disable unused config
kalinkrustev Feb 21, 2022
6134c3a
[ci-skip][ci skip] version incremented to 12.0.1
ut-jenkins Feb 21, 2022
f8336df
fix: add microservice config
kalinkrustev Feb 21, 2022
a16791b
[ci-skip][ci skip] version incremented to 12.0.2
ut-jenkins Feb 21, 2022
e300e67
feat: PS-261 - Support multiple selection for Channel organization in…
beyrul Mar 4, 2022
3bb6971
[ci-skip][ci skip] version incremented to 12.1.0
ut-jenkins Mar 4, 2022
3ed3f90
chore: #UTCORE-121 config
kalinkrustev Mar 13, 2022
3178b9e
[ci-skip][ci skip] version incremented to 12.1.1
ut-jenkins Mar 13, 2022
7d97ee1
test: add test data #UTCORE-121
kalinkrustev Mar 30, 2022
6ef9279
[ci-skip][ci skip] version incremented to 12.1.2
ut-jenkins Mar 30, 2022
487dc37
fix: wallet to erp rule, #UTCORE-121 (#227)
Apr 6, 2022
202c583
[ci-skip][ci skip] version incremented to 12.1.3
ut-jenkins Apr 6, 2022
90d18df
fix(MSA-2182): edit amount type rounding is not correct (#228)
behrindzhambaz Apr 21, 2022
9eeaf92
[ci-skip][ci skip] version incremented to 12.1.4
ut-jenkins Apr 21, 2022
4253849
chore: ut-model^8 #UTCORE-121
kalinkrustev May 3, 2022
dd10763
[ci-skip][ci skip] version incremented to 12.1.5
ut-jenkins May 3, 2022
bb564a6
fix(ECNT2-1263): rounding (#229)
behrindzhambaz May 5, 2022
82bfe1c
[ci-skip][ci skip] version incremented to 12.1.6
ut-jenkins May 5, 2022
9011c28
fix: Run ERP seed if only exist. BPS-57 (#230)
beyrul May 25, 2022
6e9d31d
[ci-skip][ci skip] version incremented to 12.1.7
ut-jenkins May 25, 2022
39e36b8
chore(ut-rule) added create, accept, discard, reject APP-1186
raymondadutwumagyei May 31, 2022
fbb0b93
updated package version to 12.1.6-paas.0
raymondadutwumagyei Jun 1, 2022
0b67ca9
fix: hide table titles #UTCORE-121
kalinkrustev Jun 1, 2022
0c4c9fc
[ci-skip][ci skip] version incremented to 12.1.8
ut-jenkins Jun 1, 2022
0f37ee8
Merge branch 'master' into paas/APP-1186
luhfluh Jun 1, 2022
3f699e0
updated code for pr APP-1186
raymondadutwumagyei Jun 3, 2022
05b71ef
added lock/unlock feature APP-1186
raymondadutwumagyei Jun 13, 2022
74f960b
code updates and improvements
raymondadutwumagyei Jun 23, 2022
98ae54e
chore: processor fee, adjustment test rule (#235)
Aug 1, 2022
2a1745b
[ci-skip][ci skip] version incremented to 12.1.9
ut-jenkins Aug 1, 2022
439fa4e
feat: bill payment test data (#238)
Aug 24, 2022
ed0576b
[ci-skip][ci skip] version incremented to 12.2.0
ut-jenkins Aug 24, 2022
53ca795
fix: renamed account (#239)
Sep 7, 2022
65956ac
[ci-skip][ci skip] version incremented to 12.2.1
ut-jenkins Sep 7, 2022
f61f3fb
chore: deps
kalinkrustev Oct 23, 2022
146256e
chore: remove eslint files
kalinkrustev Oct 24, 2022
2eacc09
chore: lin
kalinkrustev Oct 24, 2022
0bca73b
chore: storybook
kalinkrustev Oct 24, 2022
65a4c71
[ci-skip][ci skip] version incremented to 12.2.2
ut-jenkins Oct 24, 2022
d17e86f
fix: hide 'see more' action BPS-229 (#242)
mshumankov Nov 1, 2022
017906c
[ci-skip][ci skip] version incremented to 12.2.3
ut-jenkins Nov 1, 2022
865867d
Merge branch 'master' into paas/APP-1186
kalinkrustev Nov 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ npm-debug.*
package-lock.json
yarn.lock
.scannerwork
.lint/
118 changes: 118 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
5 changes: 2 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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'
17 changes: 17 additions & 0 deletions api/sql/schema/350-rule.conditionUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
11 changes: 11 additions & 0 deletions api/sql/schema/350-rule.conditionUnapprovedActor.sql
Original file line number Diff line number Diff line change
@@ -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)
)
11 changes: 11 additions & 0 deletions api/sql/schema/350-rule.conditionUnapprovedItem.sql
Original file line number Diff line number Diff line change
@@ -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)
)
12 changes: 12 additions & 0 deletions api/sql/schema/350-rule.conditionUnapprovedProperty.sql
Original file line number Diff line number Diff line change
@@ -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)
)
21 changes: 21 additions & 0 deletions api/sql/schema/360-rule.limitUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
11 changes: 11 additions & 0 deletions api/sql/schema/360-rule.splitNameUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
14 changes: 14 additions & 0 deletions api/sql/schema/370-rule.splitAssignmentUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
22 changes: 22 additions & 0 deletions api/sql/schema/370-rule.splitRangeUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
11 changes: 11 additions & 0 deletions api/sql/schema/380-rule.splitAnalyticUnapproved.sql
Original file line number Diff line number Diff line change
@@ -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)
)
33 changes: 23 additions & 10 deletions api/sql/schema/750-rule.decision.fetch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand All @@ -34,7 +41,7 @@ BEGIN
countMonthly BIGINT
)

SET @operationDate = ISNULL(@operationDate, GETDATE())
SET @operationDate = ISNULL(@operationDate, GETUTCDATE())

DECLARE
@calcCommission MONEY,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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
6 changes: 3 additions & 3 deletions api/sql/schema/750-rule.decision.lookup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -179,7 +179,7 @@ BEGIN
@operationDate = @operationDate,
@sourceAccountId = @sourceAccountId,
@destinationAccountId = @destinationAccountId,
@amount = @amount,
@amountString = @amount,
@totals = @totals,
@currency = @currency,
@isSourceAmount = @isSourceAmount,
Expand Down
2 changes: 1 addition & 1 deletion api/sql/schema/750-rule.operation.lookup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading