@develit-services/ledger 0.0.7 → 0.0.9
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/database/schema.d.cts +2 -2
- package/dist/database/schema.d.mts +2 -2
- package/dist/database/schema.d.ts +2 -2
- package/dist/export/worker.cjs +25 -26
- package/dist/export/worker.d.cts +3 -3
- package/dist/export/worker.d.mts +3 -3
- package/dist/export/worker.d.ts +3 -3
- package/dist/export/worker.mjs +25 -26
- package/dist/export/wrangler.d.cts +0 -1
- package/dist/export/wrangler.d.mts +0 -1
- package/dist/export/wrangler.d.ts +0 -1
- package/dist/shared/{ledger._YlR4Uxg.d.mts → ledger.BEYBX0jI.d.cts} +21 -29
- package/dist/shared/{ledger._YlR4Uxg.d.ts → ledger.BEYBX0jI.d.mts} +21 -29
- package/dist/shared/{ledger._YlR4Uxg.d.cts → ledger.BEYBX0jI.d.ts} +21 -29
- package/dist/shared/{ledger.CSKqugjV.d.ts → ledger.BMjN2CMY.d.mts} +547 -3
- package/dist/shared/{ledger.BGDeCrA0.d.mts → ledger.Bagnlywy.d.ts} +547 -3
- package/dist/shared/{ledger.CSi5bWgX.d.cts → ledger.Dif5Euam.d.cts} +547 -3
- package/dist/{@types.d.cts → types.d.cts} +6 -10
- package/dist/{@types.d.mts → types.d.mts} +6 -10
- package/dist/{@types.d.ts → types.d.ts} +6 -10
- package/package.json +5 -5
- /package/dist/{@types.cjs → types.cjs} +0 -0
- /package/dist/{@types.mjs → types.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.BEYBX0jI.cjs';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
|
-
import '@develit-io/general-codes';
|
|
5
4
|
import '@develit-io/backend-sdk';
|
|
5
|
+
import '@develit-io/general-codes';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.BEYBX0jI.mjs';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
|
-
import '@develit-io/general-codes';
|
|
5
4
|
import '@develit-io/backend-sdk';
|
|
5
|
+
import '@develit-io/general-codes';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.
|
|
1
|
+
export { F as account, G as accountIdentifier, H as accountIdentifierMapping, L as accountIdentifierMappingRelations, K as accountIdentifierRelations, J as accountRelations, M as entry, N as transaction } from '../shared/ledger.BEYBX0jI.js';
|
|
2
2
|
import 'drizzle-orm';
|
|
3
3
|
import 'drizzle-orm/sqlite-core';
|
|
4
|
-
import '@develit-io/general-codes';
|
|
5
4
|
import '@develit-io/backend-sdk';
|
|
5
|
+
import '@develit-io/general-codes';
|
package/dist/export/worker.cjs
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const cloudflare_workers = require('cloudflare:workers');
|
|
6
5
|
const backendSdk = require('@develit-io/backend-sdk');
|
|
7
|
-
const
|
|
8
|
-
require('
|
|
6
|
+
const cloudflare_workers = require('cloudflare:workers');
|
|
7
|
+
const d1 = require('drizzle-orm/d1');
|
|
9
8
|
const database_schema = require('../shared/ledger.DGu3Pj-Y.cjs');
|
|
10
9
|
const drizzleOrm = require('drizzle-orm');
|
|
11
|
-
const
|
|
12
|
-
require('
|
|
10
|
+
const updateTransactionConfirmationSentAt = require('../shared/ledger.D1MIlhpb.cjs');
|
|
11
|
+
require('@develit-io/general-codes');
|
|
13
12
|
require('drizzle-orm/sqlite-core');
|
|
13
|
+
require('zod');
|
|
14
14
|
|
|
15
15
|
const tables = database_schema.schema;
|
|
16
16
|
|
|
@@ -220,20 +220,6 @@ const listAccountsQuery = async (db, filters = {}, pagination = { limit: 100, of
|
|
|
220
220
|
return { accounts, total };
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
-
const buildSearchConditions = (search, columns, opts = {}) => {
|
|
224
|
-
const { wrap = "both" } = opts;
|
|
225
|
-
if (!search || search.trim() === "" || columns.length === 0) return void 0;
|
|
226
|
-
const searchTerm = search.toLowerCase();
|
|
227
|
-
const pattern = wrap === "both" ? `%${searchTerm}%` : wrap === "prefix" ? `%${searchTerm}` : wrap === "suffix" ? `${searchTerm}%` : searchTerm;
|
|
228
|
-
const parts = columns.map((col) => drizzleOrm.sql`LOWER(${col} || '') LIKE ${pattern}`);
|
|
229
|
-
return parts.length === 1 ? parts[0] : drizzleOrm.or(...parts);
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const resolveColumn = (table, column, fallback = "updatedAt") => {
|
|
233
|
-
const key = column && column in table ? column : fallback;
|
|
234
|
-
return table[key];
|
|
235
|
-
};
|
|
236
|
-
|
|
237
223
|
const getTransactionsWithPaginationQuery = async ({
|
|
238
224
|
db,
|
|
239
225
|
pagination: {
|
|
@@ -292,6 +278,20 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
292
278
|
};
|
|
293
279
|
};
|
|
294
280
|
|
|
281
|
+
const buildSearchConditions = (search, columns, opts = {}) => {
|
|
282
|
+
const { wrap = "both" } = opts;
|
|
283
|
+
if (!search || search.trim() === "" || columns.length === 0) return void 0;
|
|
284
|
+
const searchTerm = search.toLowerCase();
|
|
285
|
+
const pattern = wrap === "both" ? `%${searchTerm}%` : wrap === "prefix" ? `%${searchTerm}` : wrap === "suffix" ? `${searchTerm}%` : searchTerm;
|
|
286
|
+
const parts = columns.map((col) => drizzleOrm.sql`LOWER(${col} || '') LIKE ${pattern}`);
|
|
287
|
+
return parts.length === 1 ? parts[0] : drizzleOrm.or(...parts);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const resolveColumn = (table, column, fallback = "updatedAt") => {
|
|
291
|
+
const key = column && column in table ? column : fallback;
|
|
292
|
+
return table[key];
|
|
293
|
+
};
|
|
294
|
+
|
|
295
295
|
var __defProp = Object.defineProperty;
|
|
296
296
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
297
297
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -302,13 +302,13 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
302
302
|
if (kind && result) __defProp(target, key, result);
|
|
303
303
|
return result;
|
|
304
304
|
};
|
|
305
|
-
let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
305
|
+
let LedgerServiceBase = class extends backendSdk.develitWorker(
|
|
306
|
+
cloudflare_workers.WorkerEntrypoint
|
|
307
|
+
) {
|
|
306
308
|
constructor(ctx, env) {
|
|
307
309
|
super(ctx, env);
|
|
308
310
|
this.db = d1.drizzle(this.env.LEDGER_D1, { schema: tables });
|
|
309
311
|
}
|
|
310
|
-
async queue(_batch) {
|
|
311
|
-
}
|
|
312
312
|
async createTransaction(input) {
|
|
313
313
|
return this.handleAction(
|
|
314
314
|
{
|
|
@@ -356,7 +356,8 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(cloudflare_worker
|
|
|
356
356
|
throw backendSdk.createInternalError(null, {
|
|
357
357
|
message: "Failed to create transaction",
|
|
358
358
|
status: 500,
|
|
359
|
-
code: "
|
|
359
|
+
code: "DB-L-01"
|
|
360
|
+
// database, ledger, error 01
|
|
360
361
|
});
|
|
361
362
|
}
|
|
362
363
|
const result = {
|
|
@@ -697,9 +698,6 @@ let LedgerServiceBase = class extends backendSdk.develitWorker(cloudflare_worker
|
|
|
697
698
|
);
|
|
698
699
|
}
|
|
699
700
|
};
|
|
700
|
-
__decorateClass([
|
|
701
|
-
backendSdk.cloudflareQueue({ baseDelay: 60 })
|
|
702
|
-
], LedgerServiceBase.prototype, "queue", 1);
|
|
703
701
|
__decorateClass([
|
|
704
702
|
backendSdk.action("create-transaction")
|
|
705
703
|
], LedgerServiceBase.prototype, "createTransaction", 1);
|
|
@@ -758,6 +756,7 @@ function defineLedgerService() {
|
|
|
758
756
|
}
|
|
759
757
|
};
|
|
760
758
|
}
|
|
759
|
+
|
|
761
760
|
const LedgerService = defineLedgerService();
|
|
762
761
|
|
|
763
762
|
exports.default = LedgerService;
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.CSi5bWgX.cjs';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.Dif5Euam.cjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.BEYBX0jI.cjs';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
@@ -13,7 +13,6 @@ declare const LedgerServiceBase_base: (abstract new (ctx: ExecutionContext, env:
|
|
|
13
13
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
15
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
|
16
|
-
queue(_batch: MessageBatch<unknown>): Promise<void>;
|
|
17
16
|
createTransaction(input: CreateTransactionInput): Promise<IRPCResponse<CreateTransactionOutput>>;
|
|
18
17
|
updateTransaction(input: UpdateTransactionInput): Promise<IRPCResponse<UpdateTransactionOutput>>;
|
|
19
18
|
getTransactionById(input: GetTransactionByIdInput): Promise<IRPCResponse<GetTransactionByIdOutput | undefined>>;
|
|
@@ -32,6 +31,7 @@ declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
|
32
31
|
updateTransactionConfirmationSentAt(input: UpdateTransactionConfirmationSentAtInput): Promise<IRPCResponse<UpdateTransactionConfirmationSentAtOutput>>;
|
|
33
32
|
}
|
|
34
33
|
declare function defineLedgerService(): new (ctx: ExecutionContext, env: LedgerEnv) => LedgerServiceBase;
|
|
34
|
+
|
|
35
35
|
declare const _default: new (ctx: ExecutionContext, env: LedgerEnv) => WorkerEntrypoint<LedgerEnv>;
|
|
36
36
|
|
|
37
37
|
// @ts-ignore
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.BGDeCrA0.mjs';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.BMjN2CMY.mjs';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.BEYBX0jI.mjs';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
@@ -13,7 +13,6 @@ declare const LedgerServiceBase_base: (abstract new (ctx: ExecutionContext, env:
|
|
|
13
13
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
15
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
|
16
|
-
queue(_batch: MessageBatch<unknown>): Promise<void>;
|
|
17
16
|
createTransaction(input: CreateTransactionInput): Promise<IRPCResponse<CreateTransactionOutput>>;
|
|
18
17
|
updateTransaction(input: UpdateTransactionInput): Promise<IRPCResponse<UpdateTransactionOutput>>;
|
|
19
18
|
getTransactionById(input: GetTransactionByIdInput): Promise<IRPCResponse<GetTransactionByIdOutput | undefined>>;
|
|
@@ -32,6 +31,7 @@ declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
|
32
31
|
updateTransactionConfirmationSentAt(input: UpdateTransactionConfirmationSentAtInput): Promise<IRPCResponse<UpdateTransactionConfirmationSentAtOutput>>;
|
|
33
32
|
}
|
|
34
33
|
declare function defineLedgerService(): new (ctx: ExecutionContext, env: LedgerEnv) => LedgerServiceBase;
|
|
34
|
+
|
|
35
35
|
declare const _default: new (ctx: ExecutionContext, env: LedgerEnv) => WorkerEntrypoint<LedgerEnv>;
|
|
36
36
|
|
|
37
37
|
export { _default as default, defineLedgerService };
|
package/dist/export/worker.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
2
2
|
import { IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
4
|
-
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.CSKqugjV.js';
|
|
5
4
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
5
|
+
import { t as tables, C as CreateTransactionInput, a as CreateTransactionOutput, U as UpdateTransactionInput, b as UpdateTransactionOutput, G as GetTransactionByIdInput, c as GetTransactionByIdOutput, d as GetTransactionsByIdReferenceInput, e as GetTransactionsByReferenceIdOutput, f as GetTransactionsInput, g as GetTransactionsOutput, h as CreateAccountInput, i as CreateAccountOutput, j as UpdateAccountInput, k as UpdateAccountOutput, D as DeleteAccountInput, l as DeleteAccountOutput, m as GetAccountInput, n as GetAccountOutput, o as GetAccountsByOwnerInput, p as GetAccountsByOwnerOutput, L as ListAccountsInput, q as ListAccountsOutput, r as GetAccountIdentifierInput, s as GetAccountIdentifierOutput, u as ListAccountIdentifiersInput, v as ListAccountIdentifiersOutput, F as FindAccountByIdentifierInput, w as FindAccountByIdentifierOutput, x as GetAccountBalanceInput, y as GetAccountBalanceOutput, z as UpdateTransactionConfirmationSentAtInput, A as UpdateTransactionConfirmationSentAtOutput } from '../shared/ledger.Bagnlywy.js';
|
|
6
6
|
import 'zod';
|
|
7
|
-
import '../shared/ledger.
|
|
7
|
+
import '../shared/ledger.BEYBX0jI.js';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import 'drizzle-orm/sqlite-core';
|
|
10
10
|
import '@develit-io/general-codes';
|
|
@@ -13,7 +13,6 @@ declare const LedgerServiceBase_base: (abstract new (ctx: ExecutionContext, env:
|
|
|
13
13
|
declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
14
14
|
readonly db: DrizzleD1Database<typeof tables>;
|
|
15
15
|
constructor(ctx: ExecutionContext, env: LedgerEnv);
|
|
16
|
-
queue(_batch: MessageBatch<unknown>): Promise<void>;
|
|
17
16
|
createTransaction(input: CreateTransactionInput): Promise<IRPCResponse<CreateTransactionOutput>>;
|
|
18
17
|
updateTransaction(input: UpdateTransactionInput): Promise<IRPCResponse<UpdateTransactionOutput>>;
|
|
19
18
|
getTransactionById(input: GetTransactionByIdInput): Promise<IRPCResponse<GetTransactionByIdOutput | undefined>>;
|
|
@@ -32,6 +31,7 @@ declare class LedgerServiceBase extends LedgerServiceBase_base {
|
|
|
32
31
|
updateTransactionConfirmationSentAt(input: UpdateTransactionConfirmationSentAtInput): Promise<IRPCResponse<UpdateTransactionConfirmationSentAtOutput>>;
|
|
33
32
|
}
|
|
34
33
|
declare function defineLedgerService(): new (ctx: ExecutionContext, env: LedgerEnv) => LedgerServiceBase;
|
|
34
|
+
|
|
35
35
|
declare const _default: new (ctx: ExecutionContext, env: LedgerEnv) => WorkerEntrypoint<LedgerEnv>;
|
|
36
36
|
|
|
37
37
|
// @ts-ignore
|
package/dist/export/worker.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { first, develitWorker, uuidv4, useResult, createInternalError, action, service } from '@develit-io/backend-sdk';
|
|
1
2
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
2
|
-
import {
|
|
3
|
+
import { drizzle } from 'drizzle-orm/d1';
|
|
4
|
+
import { s as schema } from '../shared/ledger.Bl4HgQDw.mjs';
|
|
5
|
+
import { eq, and, inArray, or, count, gte, lte, sql, asc, desc } from 'drizzle-orm';
|
|
3
6
|
import { e as createTransactionInputSchema, n as updateTransactionInputSchema, o as getTransactionByIdInputSchema, p as getTransactionsByReferenceIdInputSchema, q as getTransactionsInputSchema, d as createAccountInputSchema, u as updateAccountInputSchema, f as deleteAccountInputSchema, h as getAccountInputSchema, k as getAccountsByOwnerInputSchema, m as listAccountsInputSchema, j as getAccountIdentifierInputSchema, l as listAccountIdentifiersInputSchema, g as findAccountByIdentifierInputSchema, i as getAccountBalanceInputSchema, r as updateTransactionConfirmationSentAtInputSchema } from '../shared/ledger.ByUO4e44.mjs';
|
|
4
7
|
import '@develit-io/general-codes';
|
|
5
|
-
import { s as schema } from '../shared/ledger.Bl4HgQDw.mjs';
|
|
6
|
-
import { eq, and, inArray, or, count, sql, gte, lte, asc, desc } from 'drizzle-orm';
|
|
7
|
-
import { drizzle } from 'drizzle-orm/d1';
|
|
8
|
-
import 'zod';
|
|
9
8
|
import 'drizzle-orm/sqlite-core';
|
|
9
|
+
import 'zod';
|
|
10
10
|
|
|
11
11
|
const tables = schema;
|
|
12
12
|
|
|
@@ -216,20 +216,6 @@ const listAccountsQuery = async (db, filters = {}, pagination = { limit: 100, of
|
|
|
216
216
|
return { accounts, total };
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
const buildSearchConditions = (search, columns, opts = {}) => {
|
|
220
|
-
const { wrap = "both" } = opts;
|
|
221
|
-
if (!search || search.trim() === "" || columns.length === 0) return void 0;
|
|
222
|
-
const searchTerm = search.toLowerCase();
|
|
223
|
-
const pattern = wrap === "both" ? `%${searchTerm}%` : wrap === "prefix" ? `%${searchTerm}` : wrap === "suffix" ? `${searchTerm}%` : searchTerm;
|
|
224
|
-
const parts = columns.map((col) => sql`LOWER(${col} || '') LIKE ${pattern}`);
|
|
225
|
-
return parts.length === 1 ? parts[0] : or(...parts);
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const resolveColumn = (table, column, fallback = "updatedAt") => {
|
|
229
|
-
const key = column && column in table ? column : fallback;
|
|
230
|
-
return table[key];
|
|
231
|
-
};
|
|
232
|
-
|
|
233
219
|
const getTransactionsWithPaginationQuery = async ({
|
|
234
220
|
db,
|
|
235
221
|
pagination: {
|
|
@@ -288,6 +274,20 @@ const getTransactionsWithPaginationQuery = async ({
|
|
|
288
274
|
};
|
|
289
275
|
};
|
|
290
276
|
|
|
277
|
+
const buildSearchConditions = (search, columns, opts = {}) => {
|
|
278
|
+
const { wrap = "both" } = opts;
|
|
279
|
+
if (!search || search.trim() === "" || columns.length === 0) return void 0;
|
|
280
|
+
const searchTerm = search.toLowerCase();
|
|
281
|
+
const pattern = wrap === "both" ? `%${searchTerm}%` : wrap === "prefix" ? `%${searchTerm}` : wrap === "suffix" ? `${searchTerm}%` : searchTerm;
|
|
282
|
+
const parts = columns.map((col) => sql`LOWER(${col} || '') LIKE ${pattern}`);
|
|
283
|
+
return parts.length === 1 ? parts[0] : or(...parts);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const resolveColumn = (table, column, fallback = "updatedAt") => {
|
|
287
|
+
const key = column && column in table ? column : fallback;
|
|
288
|
+
return table[key];
|
|
289
|
+
};
|
|
290
|
+
|
|
291
291
|
var __defProp = Object.defineProperty;
|
|
292
292
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
293
293
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -298,13 +298,13 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
298
298
|
if (kind && result) __defProp(target, key, result);
|
|
299
299
|
return result;
|
|
300
300
|
};
|
|
301
|
-
let LedgerServiceBase = class extends develitWorker(
|
|
301
|
+
let LedgerServiceBase = class extends develitWorker(
|
|
302
|
+
WorkerEntrypoint
|
|
303
|
+
) {
|
|
302
304
|
constructor(ctx, env) {
|
|
303
305
|
super(ctx, env);
|
|
304
306
|
this.db = drizzle(this.env.LEDGER_D1, { schema: tables });
|
|
305
307
|
}
|
|
306
|
-
async queue(_batch) {
|
|
307
|
-
}
|
|
308
308
|
async createTransaction(input) {
|
|
309
309
|
return this.handleAction(
|
|
310
310
|
{
|
|
@@ -352,7 +352,8 @@ let LedgerServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
352
352
|
throw createInternalError(null, {
|
|
353
353
|
message: "Failed to create transaction",
|
|
354
354
|
status: 500,
|
|
355
|
-
code: "
|
|
355
|
+
code: "DB-L-01"
|
|
356
|
+
// database, ledger, error 01
|
|
356
357
|
});
|
|
357
358
|
}
|
|
358
359
|
const result = {
|
|
@@ -693,9 +694,6 @@ let LedgerServiceBase = class extends develitWorker(WorkerEntrypoint) {
|
|
|
693
694
|
);
|
|
694
695
|
}
|
|
695
696
|
};
|
|
696
|
-
__decorateClass([
|
|
697
|
-
cloudflareQueue({ baseDelay: 60 })
|
|
698
|
-
], LedgerServiceBase.prototype, "queue", 1);
|
|
699
697
|
__decorateClass([
|
|
700
698
|
action("create-transaction")
|
|
701
699
|
], LedgerServiceBase.prototype, "createTransaction", 1);
|
|
@@ -754,6 +752,7 @@ function defineLedgerService() {
|
|
|
754
752
|
}
|
|
755
753
|
};
|
|
756
754
|
}
|
|
755
|
+
|
|
757
756
|
const LedgerService = defineLedgerService();
|
|
758
757
|
|
|
759
758
|
export { LedgerService as default, defineLedgerService };
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import * as drizzle_orm from 'drizzle-orm';
|
|
2
2
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
3
|
-
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
4
3
|
import { BankAccountMetadata } from '@develit-io/backend-sdk';
|
|
5
|
-
|
|
6
|
-
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
7
|
-
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
8
|
-
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
9
|
-
type AssetType = (typeof ASSET_TYPES)[number];
|
|
10
|
-
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
11
|
-
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
12
|
-
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
13
|
-
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
14
|
-
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
15
|
-
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
16
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
17
|
-
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
18
|
-
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
19
|
-
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
20
|
-
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
21
|
-
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
22
|
-
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
23
|
-
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
4
|
+
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
24
5
|
|
|
25
6
|
declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
26
7
|
name: "account";
|
|
@@ -599,6 +580,25 @@ declare const accountIdentifierMappingRelations: drizzle_orm.Relations<"account_
|
|
|
599
580
|
identifier: drizzle_orm.One<"account_identifier", true>;
|
|
600
581
|
}>;
|
|
601
582
|
|
|
583
|
+
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
584
|
+
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
585
|
+
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
586
|
+
type AssetType = (typeof ASSET_TYPES)[number];
|
|
587
|
+
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
588
|
+
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
589
|
+
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
590
|
+
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
591
|
+
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
592
|
+
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
593
|
+
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
594
|
+
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
595
|
+
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
596
|
+
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
597
|
+
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
598
|
+
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
599
|
+
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
600
|
+
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
601
|
+
|
|
602
602
|
declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
603
603
|
type PaymentType = (typeof PAYMENT_TYPES)[number];
|
|
604
604
|
|
|
@@ -624,14 +624,6 @@ declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "
|
|
|
624
624
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
625
625
|
|
|
626
626
|
interface TransactionMetadata {
|
|
627
|
-
/**
|
|
628
|
-
* Tags for categorization or grouping of the transaction
|
|
629
|
-
*/
|
|
630
|
-
tags?: string[];
|
|
631
|
-
/**
|
|
632
|
-
* Additional notes or comments about the transaction
|
|
633
|
-
*/
|
|
634
|
-
note?: string;
|
|
635
627
|
/**
|
|
636
628
|
* Payment processing information for bank payment matching and initiation
|
|
637
629
|
*/
|
|
@@ -640,8 +632,8 @@ interface TransactionMetadata {
|
|
|
640
632
|
ss?: string;
|
|
641
633
|
ks?: string;
|
|
642
634
|
message?: string;
|
|
643
|
-
paymentReason?: string;
|
|
644
635
|
paymentChargeType?: PaymentChargeType;
|
|
636
|
+
expressPayment?: boolean;
|
|
645
637
|
reference?: string;
|
|
646
638
|
creditor?: BankAccountMetadata;
|
|
647
639
|
debtor?: BankAccountMetadata;
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import * as drizzle_orm from 'drizzle-orm';
|
|
2
2
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
3
|
-
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
4
3
|
import { BankAccountMetadata } from '@develit-io/backend-sdk';
|
|
5
|
-
|
|
6
|
-
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
7
|
-
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
8
|
-
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
9
|
-
type AssetType = (typeof ASSET_TYPES)[number];
|
|
10
|
-
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
11
|
-
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
12
|
-
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
13
|
-
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
14
|
-
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
15
|
-
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
16
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
17
|
-
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
18
|
-
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
19
|
-
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
20
|
-
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
21
|
-
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
22
|
-
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
23
|
-
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
4
|
+
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
24
5
|
|
|
25
6
|
declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
26
7
|
name: "account";
|
|
@@ -599,6 +580,25 @@ declare const accountIdentifierMappingRelations: drizzle_orm.Relations<"account_
|
|
|
599
580
|
identifier: drizzle_orm.One<"account_identifier", true>;
|
|
600
581
|
}>;
|
|
601
582
|
|
|
583
|
+
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
584
|
+
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
585
|
+
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
586
|
+
type AssetType = (typeof ASSET_TYPES)[number];
|
|
587
|
+
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
588
|
+
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
589
|
+
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
590
|
+
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
591
|
+
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
592
|
+
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
593
|
+
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
594
|
+
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
595
|
+
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
596
|
+
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
597
|
+
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
598
|
+
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
599
|
+
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
600
|
+
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
601
|
+
|
|
602
602
|
declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
603
603
|
type PaymentType = (typeof PAYMENT_TYPES)[number];
|
|
604
604
|
|
|
@@ -624,14 +624,6 @@ declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "
|
|
|
624
624
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
625
625
|
|
|
626
626
|
interface TransactionMetadata {
|
|
627
|
-
/**
|
|
628
|
-
* Tags for categorization or grouping of the transaction
|
|
629
|
-
*/
|
|
630
|
-
tags?: string[];
|
|
631
|
-
/**
|
|
632
|
-
* Additional notes or comments about the transaction
|
|
633
|
-
*/
|
|
634
|
-
note?: string;
|
|
635
627
|
/**
|
|
636
628
|
* Payment processing information for bank payment matching and initiation
|
|
637
629
|
*/
|
|
@@ -640,8 +632,8 @@ interface TransactionMetadata {
|
|
|
640
632
|
ss?: string;
|
|
641
633
|
ks?: string;
|
|
642
634
|
message?: string;
|
|
643
|
-
paymentReason?: string;
|
|
644
635
|
paymentChargeType?: PaymentChargeType;
|
|
636
|
+
expressPayment?: boolean;
|
|
645
637
|
reference?: string;
|
|
646
638
|
creditor?: BankAccountMetadata;
|
|
647
639
|
debtor?: BankAccountMetadata;
|
|
@@ -1,26 +1,7 @@
|
|
|
1
1
|
import * as drizzle_orm from 'drizzle-orm';
|
|
2
2
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
3
|
-
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
4
3
|
import { BankAccountMetadata } from '@develit-io/backend-sdk';
|
|
5
|
-
|
|
6
|
-
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
7
|
-
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
8
|
-
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
9
|
-
type AssetType = (typeof ASSET_TYPES)[number];
|
|
10
|
-
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
11
|
-
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
12
|
-
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
13
|
-
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
14
|
-
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
15
|
-
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
16
|
-
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
17
|
-
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
18
|
-
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
19
|
-
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
20
|
-
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
21
|
-
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
22
|
-
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
23
|
-
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
4
|
+
import { CURRENCY_CODES, CRYPTO_NETWORK_CODES, CODES, BANK_CODES } from '@develit-io/general-codes';
|
|
24
5
|
|
|
25
6
|
declare const account: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
26
7
|
name: "account";
|
|
@@ -599,6 +580,25 @@ declare const accountIdentifierMappingRelations: drizzle_orm.Relations<"account_
|
|
|
599
580
|
identifier: drizzle_orm.One<"account_identifier", true>;
|
|
600
581
|
}>;
|
|
601
582
|
|
|
583
|
+
declare const ACCOUNT_TYPES: readonly ["INTERNAL", "EXTERNAL", "NOSTRO", "TECHNICAL", "SETTLEMENT", "FX", "FEE", "REVENUE", "LOSS", "TRANSPORT", "HOLD", "SYSTEM", "TEST"];
|
|
584
|
+
type AccountType = (typeof ACCOUNT_TYPES)[number];
|
|
585
|
+
declare const ASSET_TYPES: readonly ["FIAT", "CRYPTO", "TOKEN", "STOCK", "COMMODITY", "OTHER"];
|
|
586
|
+
type AssetType = (typeof ASSET_TYPES)[number];
|
|
587
|
+
declare const BALANCE_STRATEGIES: readonly ["SNAPSHOT", "COMPUTED"];
|
|
588
|
+
type BalanceStrategy = (typeof BALANCE_STRATEGIES)[number];
|
|
589
|
+
declare const IDENTIFIER_KINDS: readonly ["IBAN", "LOCAL_CZ", "SWIFT", "CRYPTO_ADDRESS"];
|
|
590
|
+
type IdentifierKind = (typeof IDENTIFIER_KINDS)[number];
|
|
591
|
+
declare const ENTRY_STATUSES: readonly ["PENDING", "REALIZED", "FAILED", "CANCELED"];
|
|
592
|
+
type EntryStatus = (typeof ENTRY_STATUSES)[number];
|
|
593
|
+
declare const TRANSACTION_STATUSES: readonly ["WAITING_FOR_PAYMENT", "PAUSED", "WAITING_FOR_MANUAL_PROCESSING", "MATCHED", "RETURNING", "RETURNED", "FAILED", "CANCELLED", "COMPLETED"];
|
|
594
|
+
type TransactionStatus = (typeof TRANSACTION_STATUSES)[number];
|
|
595
|
+
declare const TRANSACTION_TYPES: readonly ["CLIENT_FUND_IN", "CLIENT_FUND_OUT", "PROVIDER_FUND_IN", "PROVIDER_FUND_OUT", "EXCHANGE", "UNMATCHED", "ADJUSTMENT", "TRANSFER"];
|
|
596
|
+
type TransactionType = (typeof TRANSACTION_TYPES)[number];
|
|
597
|
+
declare const REFERENCE_TYPES: readonly ["PAYMENT", "EXCHANGE", "ORDER"];
|
|
598
|
+
type ReferenceType = (typeof REFERENCE_TYPES)[number];
|
|
599
|
+
declare const PAYMENT_CHARGE_TYPES: readonly ["SHA", "OUR", "BEN"];
|
|
600
|
+
type PaymentChargeType = (typeof PAYMENT_CHARGE_TYPES)[number];
|
|
601
|
+
|
|
602
602
|
declare const PAYMENT_TYPES: readonly ["SEPA", "SWIFT", "IFSC", "DOMESTIC"];
|
|
603
603
|
type PaymentType = (typeof PAYMENT_TYPES)[number];
|
|
604
604
|
|
|
@@ -624,14 +624,6 @@ declare const COUNTRY_CODES: ["AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AG" | "
|
|
|
624
624
|
type CountryCode = (typeof COUNTRY_CODES)[number];
|
|
625
625
|
|
|
626
626
|
interface TransactionMetadata {
|
|
627
|
-
/**
|
|
628
|
-
* Tags for categorization or grouping of the transaction
|
|
629
|
-
*/
|
|
630
|
-
tags?: string[];
|
|
631
|
-
/**
|
|
632
|
-
* Additional notes or comments about the transaction
|
|
633
|
-
*/
|
|
634
|
-
note?: string;
|
|
635
627
|
/**
|
|
636
628
|
* Payment processing information for bank payment matching and initiation
|
|
637
629
|
*/
|
|
@@ -640,8 +632,8 @@ interface TransactionMetadata {
|
|
|
640
632
|
ss?: string;
|
|
641
633
|
ks?: string;
|
|
642
634
|
message?: string;
|
|
643
|
-
paymentReason?: string;
|
|
644
635
|
paymentChargeType?: PaymentChargeType;
|
|
636
|
+
expressPayment?: boolean;
|
|
645
637
|
reference?: string;
|
|
646
638
|
creditor?: BankAccountMetadata;
|
|
647
639
|
debtor?: BankAccountMetadata;
|