Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: APP-1186 added maker checker for agency paas project needs (approve, reject, discard etc) #232

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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/
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)
)
Loading