av6-core 1.8.2 → 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.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +12 -9
- package/dist/index.mjs +12 -9
- package/package.json +2 -2
- package/dist/prisma-client.d.ts +0 -28
- package/prisma-client.d.ts +0 -28
- package/scripts/prepare-prisma-types.mjs +0 -26
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "av6-core",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"author": "Aniket Sarkar",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "npm run format && tsup
|
|
11
|
+
"build": "npm run format && tsup",
|
|
12
12
|
"p:gen": "prisma generate",
|
|
13
13
|
"format": "prettier --write **/*.ts"
|
|
14
14
|
},
|
package/dist/prisma-client.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare module "@prisma/client" {
|
|
2
|
-
export class PrismaClient {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export namespace Prisma {
|
|
7
|
-
export type TransactionClient = any;
|
|
8
|
-
export type JsonValue = any;
|
|
9
|
-
export type JsonObject = any;
|
|
10
|
-
export type JsonArray = any;
|
|
11
|
-
|
|
12
|
-
export interface Sql {
|
|
13
|
-
readonly values: unknown[];
|
|
14
|
-
readonly strings: string[];
|
|
15
|
-
readonly sql: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const empty: Sql;
|
|
19
|
-
export function sql(strings: readonly string[], ...values: unknown[]): Sql;
|
|
20
|
-
export function join(
|
|
21
|
-
values: readonly unknown[],
|
|
22
|
-
separator?: string,
|
|
23
|
-
prefix?: string,
|
|
24
|
-
suffix?: string
|
|
25
|
-
): Sql;
|
|
26
|
-
export function raw(value: string): Sql;
|
|
27
|
-
}
|
|
28
|
-
}
|
package/prisma-client.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
declare module "@prisma/client" {
|
|
2
|
-
export class PrismaClient {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export namespace Prisma {
|
|
7
|
-
export type TransactionClient = any;
|
|
8
|
-
export type JsonValue = any;
|
|
9
|
-
export type JsonObject = any;
|
|
10
|
-
export type JsonArray = any;
|
|
11
|
-
|
|
12
|
-
export interface Sql {
|
|
13
|
-
readonly values: unknown[];
|
|
14
|
-
readonly strings: string[];
|
|
15
|
-
readonly sql: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const empty: Sql;
|
|
19
|
-
export function sql(strings: readonly string[], ...values: unknown[]): Sql;
|
|
20
|
-
export function join(
|
|
21
|
-
values: readonly unknown[],
|
|
22
|
-
separator?: string,
|
|
23
|
-
prefix?: string,
|
|
24
|
-
suffix?: string
|
|
25
|
-
): Sql;
|
|
26
|
-
export function raw(value: string): Sql;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
const rootDir = dirname(fileURLToPath(new URL("../package.json", import.meta.url)));
|
|
6
|
-
const distDir = join(rootDir, "dist");
|
|
7
|
-
const sourceShim = join(rootDir, "prisma-client.d.ts");
|
|
8
|
-
const distShim = join(distDir, "prisma-client.d.ts");
|
|
9
|
-
const reference = '/// <reference path="./prisma-client.d.ts" />\n';
|
|
10
|
-
|
|
11
|
-
mkdirSync(distDir, { recursive: true });
|
|
12
|
-
copyFileSync(sourceShim, distShim);
|
|
13
|
-
|
|
14
|
-
for (const fileName of ["index.d.ts", "index.d.mts"]) {
|
|
15
|
-
const declarationPath = join(distDir, fileName);
|
|
16
|
-
|
|
17
|
-
if (!existsSync(declarationPath)) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const declaration = readFileSync(declarationPath, "utf8");
|
|
22
|
-
|
|
23
|
-
if (!declaration.startsWith(reference)) {
|
|
24
|
-
writeFileSync(declarationPath, `${reference}${declaration}`);
|
|
25
|
-
}
|
|
26
|
-
}
|