av6-core 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -9
- package/dist/index.mjs +12 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2334,7 +2334,7 @@ var import_client = require("@prisma/client");
|
|
|
2334
2334
|
var approvalRepository = (helpers) => {
|
|
2335
2335
|
return {
|
|
2336
2336
|
async findMatchingFlow(tx, type, service, ccId, netTotal, level = 1) {
|
|
2337
|
-
const result = await tx.$queryRaw
|
|
2337
|
+
const result = await tx.$queryRaw`
|
|
2338
2338
|
SELECT af.id AS flowId,
|
|
2339
2339
|
s.id AS stepId,
|
|
2340
2340
|
s.level,
|
|
@@ -2342,18 +2342,21 @@ var approvalRepository = (helpers) => {
|
|
|
2342
2342
|
s.max_amount AS maxAmount,
|
|
2343
2343
|
s.step_type AS stepType,
|
|
2344
2344
|
af.service
|
|
2345
|
-
FROM core_approval_flow
|
|
2346
|
-
JOIN core_approval_step
|
|
2345
|
+
FROM core_approval_flow AS af
|
|
2346
|
+
JOIN core_approval_step AS s
|
|
2347
|
+
ON s.flow_id = af.id AND s.level = ${level}
|
|
2347
2348
|
WHERE af.subject_type = ${type}
|
|
2348
2349
|
AND af.service = ${service}
|
|
2349
|
-
AND af.is_active
|
|
2350
|
-
AND s.is_active
|
|
2351
|
-
AND (
|
|
2350
|
+
AND af.is_active = TRUE
|
|
2351
|
+
AND s.is_active = TRUE
|
|
2352
|
+
AND (
|
|
2353
|
+
(s.step_type = 'MIN_MAX'
|
|
2352
2354
|
AND s.min_amount <= ${netTotal}
|
|
2353
2355
|
AND s.max_amount >= ${netTotal})
|
|
2354
|
-
OR (s.step_type = 'NORMAL')
|
|
2355
|
-
|
|
2356
|
-
|
|
2356
|
+
OR (s.step_type = 'NORMAL')
|
|
2357
|
+
)
|
|
2358
|
+
LIMIT 1;
|
|
2359
|
+
`;
|
|
2357
2360
|
if (result.length === 0) {
|
|
2358
2361
|
throw new helpers.ErrorHandler(400, "No matching flow found.");
|
|
2359
2362
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2273,7 +2273,7 @@ import { Prisma } from "@prisma/client";
|
|
|
2273
2273
|
var approvalRepository = (helpers) => {
|
|
2274
2274
|
return {
|
|
2275
2275
|
async findMatchingFlow(tx, type, service, ccId, netTotal, level = 1) {
|
|
2276
|
-
const result = await tx.$queryRaw
|
|
2276
|
+
const result = await tx.$queryRaw`
|
|
2277
2277
|
SELECT af.id AS flowId,
|
|
2278
2278
|
s.id AS stepId,
|
|
2279
2279
|
s.level,
|
|
@@ -2281,18 +2281,21 @@ var approvalRepository = (helpers) => {
|
|
|
2281
2281
|
s.max_amount AS maxAmount,
|
|
2282
2282
|
s.step_type AS stepType,
|
|
2283
2283
|
af.service
|
|
2284
|
-
FROM core_approval_flow
|
|
2285
|
-
JOIN core_approval_step
|
|
2284
|
+
FROM core_approval_flow AS af
|
|
2285
|
+
JOIN core_approval_step AS s
|
|
2286
|
+
ON s.flow_id = af.id AND s.level = ${level}
|
|
2286
2287
|
WHERE af.subject_type = ${type}
|
|
2287
2288
|
AND af.service = ${service}
|
|
2288
|
-
AND af.is_active
|
|
2289
|
-
AND s.is_active
|
|
2290
|
-
AND (
|
|
2289
|
+
AND af.is_active = TRUE
|
|
2290
|
+
AND s.is_active = TRUE
|
|
2291
|
+
AND (
|
|
2292
|
+
(s.step_type = 'MIN_MAX'
|
|
2291
2293
|
AND s.min_amount <= ${netTotal}
|
|
2292
2294
|
AND s.max_amount >= ${netTotal})
|
|
2293
|
-
OR (s.step_type = 'NORMAL')
|
|
2294
|
-
|
|
2295
|
-
|
|
2295
|
+
OR (s.step_type = 'NORMAL')
|
|
2296
|
+
)
|
|
2297
|
+
LIMIT 1;
|
|
2298
|
+
`;
|
|
2296
2299
|
if (result.length === 0) {
|
|
2297
2300
|
throw new helpers.ErrorHandler(400, "No matching flow found.");
|
|
2298
2301
|
}
|