@develit-services/bank 0.3.41 → 0.3.42

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.
@@ -694,7 +694,7 @@ let BankServiceBase = class extends backendSdk.develitWorker(cloudflare_workers.
694
694
  accountId: acc.id
695
695
  });
696
696
  const availableBatch = openBatches.find(
697
- (batch) => batch.payments.length >= acc.batchSizeLimit
697
+ (batch) => batch.payments.length < acc.batchSizeLimit
698
698
  );
699
699
  this.log({
700
700
  message: availableBatch ? `\u{1F504} Found existing OPEN batches for account ${acc.id}, merging ${availableBatch.payments.length} existing + ${newPayments.length} new payments` : `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
@@ -1518,9 +1518,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
1518
1518
  limit: z.ZodNumber;
1519
1519
  sort: z.ZodObject<{
1520
1520
  column: z.ZodEnum<{
1521
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1522
1521
  createdAt: "createdAt";
1523
1522
  updatedAt: "updatedAt";
1523
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1524
1524
  }>;
1525
1525
  direction: z.ZodEnum<{
1526
1526
  asc: "asc";
@@ -1644,7 +1644,7 @@ type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>
1644
1644
 
1645
1645
  declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
1646
  batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<string>;
1647
+ eventType: z.ZodLiteral<"batch-authorized">;
1648
1648
  payload: z.ZodObject<{
1649
1649
  authorized: z.ZodBoolean;
1650
1650
  }, z.core.$strip>;
@@ -2468,14 +2468,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2468
2468
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2469
  paymentsToBatch: SendPaymentInput[];
2470
2470
  }): Promise<IRPCResponse<{
2471
- batchPaymentInitiatedAt: Date | null;
2472
- authorizationUrls: string[] | null;
2473
2471
  status: "OPEN" | "FULL" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
2474
2472
  id: string;
2475
2473
  createdAt: Date | null;
2476
2474
  updatedAt: Date | null;
2477
2475
  deletedAt: Date | null;
2478
2476
  accountId: string | null;
2477
+ batchPaymentInitiatedAt: Date | null;
2478
+ authorizationUrls: string[] | null;
2479
2479
  payments: PaymentInsertType[];
2480
2480
  metadata: BatchMetadata | null;
2481
2481
  paymentsChecksum: string | null;
@@ -1518,9 +1518,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
1518
1518
  limit: z.ZodNumber;
1519
1519
  sort: z.ZodObject<{
1520
1520
  column: z.ZodEnum<{
1521
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1522
1521
  createdAt: "createdAt";
1523
1522
  updatedAt: "updatedAt";
1523
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1524
1524
  }>;
1525
1525
  direction: z.ZodEnum<{
1526
1526
  asc: "asc";
@@ -1644,7 +1644,7 @@ type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>
1644
1644
 
1645
1645
  declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
1646
  batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<string>;
1647
+ eventType: z.ZodLiteral<"batch-authorized">;
1648
1648
  payload: z.ZodObject<{
1649
1649
  authorized: z.ZodBoolean;
1650
1650
  }, z.core.$strip>;
@@ -2468,14 +2468,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2468
2468
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2469
  paymentsToBatch: SendPaymentInput[];
2470
2470
  }): Promise<IRPCResponse<{
2471
- batchPaymentInitiatedAt: Date | null;
2472
- authorizationUrls: string[] | null;
2473
2471
  status: "OPEN" | "FULL" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
2474
2472
  id: string;
2475
2473
  createdAt: Date | null;
2476
2474
  updatedAt: Date | null;
2477
2475
  deletedAt: Date | null;
2478
2476
  accountId: string | null;
2477
+ batchPaymentInitiatedAt: Date | null;
2478
+ authorizationUrls: string[] | null;
2479
2479
  payments: PaymentInsertType[];
2480
2480
  metadata: BatchMetadata | null;
2481
2481
  paymentsChecksum: string | null;
@@ -1518,9 +1518,9 @@ declare const getBatchesInputSchema: z.ZodObject<{
1518
1518
  limit: z.ZodNumber;
1519
1519
  sort: z.ZodObject<{
1520
1520
  column: z.ZodEnum<{
1521
- batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1522
1521
  createdAt: "createdAt";
1523
1522
  updatedAt: "updatedAt";
1523
+ batchPaymentInitiatedAt: "batchPaymentInitiatedAt";
1524
1524
  }>;
1525
1525
  direction: z.ZodEnum<{
1526
1526
  asc: "asc";
@@ -1644,7 +1644,7 @@ type ProcessBatchRestartOutput = z.infer<typeof processBatchRestartOutputSchema>
1644
1644
 
1645
1645
  declare const processBatchEventInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1646
1646
  batchId: z.ZodUUID;
1647
- eventType: z.ZodLiteral<string>;
1647
+ eventType: z.ZodLiteral<"batch-authorized">;
1648
1648
  payload: z.ZodObject<{
1649
1649
  authorized: z.ZodBoolean;
1650
1650
  }, z.core.$strip>;
@@ -2468,14 +2468,14 @@ declare class BankServiceBase extends BankServiceBase_base {
2468
2468
  addPaymentsToBatch({ paymentsToBatch, }: {
2469
2469
  paymentsToBatch: SendPaymentInput[];
2470
2470
  }): Promise<IRPCResponse<{
2471
- batchPaymentInitiatedAt: Date | null;
2472
- authorizationUrls: string[] | null;
2473
2471
  status: "OPEN" | "FULL" | "PROCESSING" | "READY_TO_SIGN" | "SIGNED" | "SIGNATURE_FAILED" | "FAILED" | null;
2474
2472
  id: string;
2475
2473
  createdAt: Date | null;
2476
2474
  updatedAt: Date | null;
2477
2475
  deletedAt: Date | null;
2478
2476
  accountId: string | null;
2477
+ batchPaymentInitiatedAt: Date | null;
2478
+ authorizationUrls: string[] | null;
2479
2479
  payments: PaymentInsertType[];
2480
2480
  metadata: BatchMetadata | null;
2481
2481
  paymentsChecksum: string | null;
@@ -692,7 +692,7 @@ let BankServiceBase = class extends develitWorker(WorkerEntrypoint) {
692
692
  accountId: acc.id
693
693
  });
694
694
  const availableBatch = openBatches.find(
695
- (batch) => batch.payments.length >= acc.batchSizeLimit
695
+ (batch) => batch.payments.length < acc.batchSizeLimit
696
696
  );
697
697
  this.log({
698
698
  message: availableBatch ? `\u{1F504} Found existing OPEN batches for account ${acc.id}, merging ${availableBatch.payments.length} existing + ${newPayments.length} new payments` : `\u2728 Creating new batch for account ${acc.id} with ${newPayments.length} payments`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-services/bank",
3
- "version": "0.3.41",
3
+ "version": "0.3.42",
4
4
  "author": "Develit.io s.r.o.",
5
5
  "type": "module",
6
6
  "exports": {