@budgetbuddyde/types 1.0.11 → 1.0.14

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.
@@ -7,3 +7,4 @@ export declare const ZDate: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, D
7
7
  export type TDate = z.infer<typeof ZDate>;
8
8
  export declare const ZEmail: z.ZodString;
9
9
  export type TEmail = z.infer<typeof ZEmail>;
10
+ export type TServiceResponse<T> = [T, null] | [null, Error];
@@ -25,6 +25,26 @@ export declare const ZTransactionFile: z.ZodObject<{
25
25
  mimeType: string;
26
26
  }>;
27
27
  export type TTransactionFile = z.infer<typeof ZTransactionFile>;
28
+ export declare const ZCreateTransactionFilePayload: z.ZodObject<{
29
+ transactionId: z.ZodNumber;
30
+ fileName: z.ZodString;
31
+ fileSize: z.ZodNumber;
32
+ mimeType: z.ZodString;
33
+ fileUrl: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ fileName: string;
36
+ fileSize: number;
37
+ mimeType: string;
38
+ transactionId: number;
39
+ fileUrl: string;
40
+ }, {
41
+ fileName: string;
42
+ fileSize: number;
43
+ mimeType: string;
44
+ transactionId: number;
45
+ fileUrl: string;
46
+ }>;
47
+ export type TCreateTransactionFilePayload = z.infer<typeof ZCreateTransactionFilePayload>;
28
48
  export declare const ZTransaction: z.ZodObject<{
29
49
  id: z.ZodNumber;
30
50
  owner: z.ZodObject<{
@@ -520,22 +540,55 @@ export declare const ZUpdateTransactionPayload: z.ZodObject<{
520
540
  receiver: z.ZodString;
521
541
  description: z.ZodDefault<z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>>;
522
542
  transferAmount: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodString]>, number, string | number>;
543
+ attachedFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
544
+ transactionId: z.ZodNumber;
545
+ fileName: z.ZodString;
546
+ fileSize: z.ZodNumber;
547
+ mimeType: z.ZodString;
548
+ fileUrl: z.ZodString;
549
+ }, "strip", z.ZodTypeAny, {
550
+ fileName: string;
551
+ fileSize: number;
552
+ mimeType: string;
553
+ transactionId: number;
554
+ fileUrl: string;
555
+ }, {
556
+ fileName: string;
557
+ fileSize: number;
558
+ mimeType: string;
559
+ transactionId: number;
560
+ fileUrl: string;
561
+ }>, "many">>;
523
562
  }, "strip", z.ZodTypeAny, {
524
563
  receiver: string;
525
564
  description: string | null;
526
565
  categoryId: number;
527
566
  paymentMethodId: number;
567
+ transactionId: number;
528
568
  processedAt: Date;
529
569
  transferAmount: number;
530
- transactionId: number;
570
+ attachedFiles: {
571
+ fileName: string;
572
+ fileSize: number;
573
+ mimeType: string;
574
+ transactionId: number;
575
+ fileUrl: string;
576
+ }[];
531
577
  }, {
532
578
  receiver: string;
533
579
  categoryId: number;
534
580
  paymentMethodId: number;
581
+ transactionId: number;
535
582
  processedAt: (number | Date) & (number | Date | undefined);
536
583
  transferAmount: string | number;
537
- transactionId: number;
538
584
  description?: string | null | undefined;
585
+ attachedFiles?: {
586
+ fileName: string;
587
+ fileSize: number;
588
+ mimeType: string;
589
+ transactionId: number;
590
+ fileUrl: string;
591
+ }[] | undefined;
539
592
  }>;
540
593
  export type TUpdateTransactionPayload = z.infer<typeof ZUpdateTransactionPayload>;
541
594
  export declare const ZDeleteTransactionPayload: z.ZodArray<z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZDeleteTransactionResponsePayload = exports.ZDeleteTransactionPayload = exports.ZUpdateTransactionPayload = exports.ZCreateTransactionPayload = exports.ZTransaction = exports.ZTransactionFile = void 0;
3
+ exports.ZDeleteTransactionResponsePayload = exports.ZDeleteTransactionPayload = exports.ZUpdateTransactionPayload = exports.ZCreateTransactionPayload = exports.ZTransaction = exports.ZCreateTransactionFilePayload = exports.ZTransactionFile = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const User_type_1 = require("./User.type");
6
6
  const Category_type_1 = require("./Category.type");
@@ -16,9 +16,16 @@ exports.ZTransactionFile = zod_1.z.object({
16
16
  fileName: zod_1.z.string(),
17
17
  fileSize: zod_1.z.number(),
18
18
  mimeType: zod_1.z.string().max(20, { message: 'Mimetype is too long' }),
19
- location: zod_1.z.string().max(100, { message: 'Location is too long' }),
19
+ location: zod_1.z.string().max(255, { message: 'Location is too long' }),
20
20
  createdAt: Base_type_1.ZCreatedAt,
21
21
  });
22
+ exports.ZCreateTransactionFilePayload = zod_1.z.object({
23
+ transactionId: zod_1.z.number(),
24
+ fileName: zod_1.z.string(),
25
+ fileSize: zod_1.z.number(),
26
+ mimeType: zod_1.z.string().max(20, { message: 'Mimetype is too long' }),
27
+ fileUrl: zod_1.z.string().max(255, { message: 'FileURL is too long' }),
28
+ });
22
29
  /**
23
30
  * Transaction
24
31
  */
@@ -55,6 +62,7 @@ exports.ZUpdateTransactionPayload = zod_1.z.object({
55
62
  receiver: zod_1.z.string(),
56
63
  description: Base_type_1.ZDescription,
57
64
  transferAmount: ZTransferAmount,
65
+ attachedFiles: zod_1.z.array(exports.ZCreateTransactionFilePayload).default([]),
58
66
  });
59
67
  exports.ZDeleteTransactionPayload = zod_1.z.array(zod_1.z.object({
60
68
  transactionId: zod_1.z.number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budgetbuddyde/types",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "description": "Budget Buddy Typescript Types",