@marmot-systems/common 2.0.40 → 2.0.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.
package/dist/index.d.cts CHANGED
@@ -1,31 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
3
3
 
4
- declare const RegisterFormSchema: z.ZodObject<{
5
- companyData: z.ZodObject<{
6
- company_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
7
- company_address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
8
- company_phone_number: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>;
9
- iso_country_code: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodEnum<{
10
- US: "US";
11
- HN: "HN";
12
- }>>;
13
- }, z.core.$strict>;
14
- adminUserData: z.ZodObject<{
15
- user_first_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
16
- user_last_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
17
- user_email: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>;
18
- password: z.ZodString;
19
- }, z.core.$strict>;
20
- }, z.core.$strict>;
21
-
22
- declare const CustomerFormSchema: z.ZodObject<{
23
- customer_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
24
- customer_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
25
- customer_phone_number: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
26
- customer_email_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>>>;
27
- }, z.core.$strict>;
28
-
29
4
  type RoundType = "half_up";
30
5
  interface ToFixedOptions {
31
6
  roundType?: RoundType;
@@ -107,6 +82,124 @@ type CreatedLocation = (typeof CREATED_LOCATION)[number];
107
82
  type IntBool = 0 | 1;
108
83
  declare const uuidSchema: z.ZodUUID;
109
84
  type UUID = z.infer<typeof uuidSchema>;
85
+ type status = "active" | "inactive";
86
+
87
+ declare const RegisterFormSchema: z.ZodObject<{
88
+ companyData: z.ZodObject<{
89
+ company_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
90
+ company_address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
91
+ company_phone_number: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>;
92
+ iso_country_code: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodEnum<{
93
+ US: "US";
94
+ HN: "HN";
95
+ }>>;
96
+ }, z.core.$strict>;
97
+ adminUserData: z.ZodObject<{
98
+ user_first_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
99
+ user_last_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
100
+ user_email: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>;
101
+ password: z.ZodString;
102
+ }, z.core.$strict>;
103
+ }, z.core.$strict>;
104
+
105
+ declare const CustomerFormSchema: z.ZodObject<{
106
+ customer_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
107
+ customer_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
108
+ customer_phone_number: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
109
+ customer_email_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>>>;
110
+ }, z.core.$strict>;
111
+
112
+ type CustomerSnapshot = {
113
+ customer_id: UUID;
114
+ customer_name: string;
115
+ customer_address: string | null;
116
+ customer_phone_number: string | null;
117
+ customer_email_address: string | null;
118
+ customer_status: status;
119
+ created_location: CreatedLocation;
120
+ company_id: number;
121
+ };
122
+ type MappedCustomers = {
123
+ customer_id: string;
124
+ customer_name: string;
125
+ customer_address?: string;
126
+ customer_phone_number?: string;
127
+ customer_email_address?: string;
128
+ };
129
+
130
+ type MappedVendors = {
131
+ vendor_id: string;
132
+ vendor_name: string;
133
+ vendor_address: string;
134
+ vendor_phone_number: string;
135
+ vendor_email_address: string;
136
+ tax_rate: number;
137
+ };
138
+
139
+ declare const ProductFormSchema: z.ZodObject<{
140
+ product_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
141
+ product_description: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
142
+ product_sku: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
143
+ product_upc: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
144
+ product_gtin_14: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
145
+ product_type: z.ZodEnum<{
146
+ unit: "unit";
147
+ weight: "weight";
148
+ case: "case";
149
+ }>;
150
+ weight_unit: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodEnum<{
151
+ kg: "kg";
152
+ lb: "lb";
153
+ g: "g";
154
+ oz: "oz";
155
+ }>>>;
156
+ price: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
157
+ cost: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
158
+ }, z.core.$strict>;
159
+
160
+ type ProductType = "unit" | "weight" | "case";
161
+ type WeightUnit = "kg" | "lb" | "g" | "oz";
162
+ type ProductSnapshot = {
163
+ product_id: UUID;
164
+ product_name: string;
165
+ product_description: string | null;
166
+ product_sku: string | null;
167
+ product_type: ProductType;
168
+ price: string;
169
+ weight_unit: WeightUnit | null;
170
+ created_location: CreatedLocation;
171
+ company_id: number;
172
+ product_upc: string | null;
173
+ product_gtin_14: string | null;
174
+ product_status: status;
175
+ };
176
+
177
+ type WarehouseSnapshot = {
178
+ warehouse_id: UUID;
179
+ warehouse_name: string;
180
+ warehouse_address: string;
181
+ created_location: CreatedLocation;
182
+ is_deleted: IntBool | null;
183
+ deleted_at: string | null;
184
+ created_at: string | null;
185
+ updated_at: string | null;
186
+ company_id: number;
187
+ created_by_user_id: number;
188
+ };
189
+
190
+ type LocationType = "warehouse" | "employee";
191
+ type InventoryLocationSnapshot = {
192
+ location_id: UUID;
193
+ location_type: LocationType;
194
+ reference_id: UUID;
195
+ name: string;
196
+ created_location: CreatedLocation;
197
+ is_deleted: IntBool | null;
198
+ deleted_at: string | null;
199
+ created_at: string | null;
200
+ updated_at: string | null;
201
+ company_id: number;
202
+ };
110
203
 
111
204
  declare const SalesInvoiceSchema: z.ZodObject<{
112
205
  invoice_date: z.ZodString;
@@ -327,76 +420,56 @@ declare const INVOICE_STATUS: readonly ["finalized", "voided"];
327
420
  type InvoiceStatus = (typeof INVOICE_STATUS)[number];
328
421
  declare const CREDIT_TYPE: readonly ["dump", "return"];
329
422
  type CreditType = (typeof CREDIT_TYPE)[number];
330
-
331
- type SyncInvoice = {
423
+ type InvoiceSnapshot = {
332
424
  invoice_id: UUID;
333
425
  invoice_type: InvoiceType;
334
426
  subtotal: string;
335
427
  tax_amount: string;
336
428
  total_amount: string;
337
429
  remaining_balance: string;
338
- due_date: Date;
430
+ due_date: string;
339
431
  tax_rate: string;
340
432
  created_location: CreatedLocation;
341
- is_new: IntBool;
342
433
  customer_id: UUID;
343
434
  company_id: number;
344
435
  short_invoice_id: string;
345
436
  invoice_date: string;
346
437
  invoice_status: InvoiceStatus;
438
+ occurred_at_ms: string;
347
439
  };
348
440
 
349
- type MappedCustomers = {
350
- customer_id: string;
351
- customer_name: string;
352
- customer_address?: string;
353
- customer_phone_number?: string;
354
- customer_email_address?: string;
355
- };
356
-
357
- type MappedVendors = {
358
- vendor_id: string;
359
- vendor_name: string;
360
- vendor_address: string;
361
- vendor_phone_number: string;
362
- vendor_email_address: string;
363
- tax_rate: number;
441
+ type InvoiceItemStatus = "finalized" | "voided";
442
+ type InvoiceItemSnapshot = {
443
+ invoice_item_id: UUID;
444
+ invoice_id: UUID;
445
+ product_id: UUID;
446
+ quantity: string;
447
+ price: string;
448
+ amount: string;
449
+ credit_type: CreditType | null;
450
+ company_id: number;
451
+ invoice_type: InvoiceType;
452
+ invoice_item_status: InvoiceItemStatus;
453
+ line_number: number;
364
454
  };
365
455
 
366
- declare function todayLocalYmd(): string;
367
- declare function addDaysLocalYmd(ymd: string, days: number): string;
368
- declare function formatYmdLong(ymd: string, locale?: string): string;
369
- declare function localDateFromYmd(ymd: string): Date;
370
- declare function ymdFromLocalDate(dt: Date): string;
371
-
372
- type RHFError = string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
373
- declare const getErrorMessage: (err: RHFError) => string | undefined;
374
-
375
- declare const exceedsTwoDecimals: (raw: string) => boolean;
376
-
377
- declare const ProductFormSchema: z.ZodObject<{
378
- product_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
379
- product_description: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
380
- product_sku: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
381
- product_upc: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
382
- product_gtin_14: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
383
- product_type: z.ZodEnum<{
384
- unit: "unit";
385
- weight: "weight";
386
- case: "case";
387
- }>;
388
- weight_unit: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodEnum<{
389
- kg: "kg";
390
- lb: "lb";
391
- g: "g";
392
- oz: "oz";
393
- }>>>;
394
- price: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
395
- cost: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
456
+ declare const CreditApplicationSchema: z.ZodObject<{
457
+ credit_invoice_id: z.ZodUUID;
458
+ applied_amount: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
396
459
  }, z.core.$strict>;
397
460
 
398
- type ProductType = "unit" | "weight" | "case";
399
- type WeightUnit = "kg" | "lb" | "g" | "oz";
461
+ type CreditApplicationStatus = "finalized" | "voided";
462
+ type CreditApplicationSnapshot = {
463
+ credit_application_id: UUID;
464
+ credit_invoice_id: UUID;
465
+ sales_invoice_id: UUID;
466
+ applied_amount: string;
467
+ created_location: CreatedLocation;
468
+ company_id: number;
469
+ credit_application_status: CreditApplicationStatus;
470
+ applied_date: string;
471
+ occurred_at_ms: string;
472
+ };
400
473
 
401
474
  declare const PaymentFormSchema: z.ZodObject<{
402
475
  payment_method: z.ZodEnum<{
@@ -411,10 +484,51 @@ declare const PaymentFormSchema: z.ZodObject<{
411
484
 
412
485
  declare const PAYMENT_METHOD: readonly ["check", "cash", "bank_transfer", "digital_wallet"];
413
486
  type PaymentMethod = (typeof PAYMENT_METHOD)[number];
487
+ type PaymentStatus = "finalized" | "voided";
488
+ type PaymentSnapshot = {
489
+ payment_id: UUID;
490
+ invoice_id: UUID;
491
+ payment_amount: string;
492
+ payment_date: string;
493
+ payment_method: PaymentMethod;
494
+ check_number: string | null;
495
+ created_location: CreatedLocation;
496
+ company_id: number;
497
+ short_invoice_id: string;
498
+ payment_status: PaymentStatus;
499
+ occurred_at_ms: string;
500
+ };
414
501
 
415
- declare const CreditApplicationSchema: z.ZodObject<{
416
- credit_invoice_id: z.ZodUUID;
417
- applied_amount: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
418
- }, z.core.$strict>;
502
+ type DriverCustomerSnapshot = {
503
+ driver_customer_id: number;
504
+ is_active: IntBool;
505
+ user_id: number;
506
+ company_id: number;
507
+ customer_id: UUID;
508
+ created_at: string;
509
+ };
510
+
511
+ type InvoiceFilter = "all" | "unpaid";
512
+ type PaymentFilter = "all" | "none";
513
+ type DriverSettingSnapshot = {
514
+ driver_setting_id: number;
515
+ invoice_filter: InvoiceFilter;
516
+ payment_filter: PaymentFilter;
517
+ user_id: number;
518
+ company_id: number;
519
+ created_at: string;
520
+ updated_at: string;
521
+ };
522
+
523
+ declare const exceedsTwoDecimals: (raw: string) => boolean;
524
+
525
+ declare function todayLocalYmd(): string;
526
+ declare function addDaysLocalYmd(ymd: string, days: number): string;
527
+ declare function formatYmdLong(ymd: string, locale?: string): string;
528
+ declare function localDateFromYmd(ymd: string): Date;
529
+ declare function ymdFromLocalDate(dt: Date): string;
530
+
531
+ type RHFError = string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
532
+ declare const getErrorMessage: (err: RHFError) => string | undefined;
419
533
 
420
- export { type AnyInvoiceOut, AnyInvoiceSchema, CREDIT_TYPE, type CreatedLocation, CreditApplicationSchema, type CreditInvoice, CreditInvoiceSchema, type CreditType, CustomerFormSchema, INVOICE_STATUS, INVOICE_TYPE, type InventorySystem, type InvoiceStatus, type InvoiceType, type IsoCountryCode, type IsoCurrencyCode, type MappedCustomers, type MappedVendors, PAYMENT_METHOD, PaymentFormSchema, type PaymentMethod, ProductFormSchema, type ProductType, type PurchaseInvoice, PurchaseInvoiceSchema, RegisterFormSchema, type SalesInvoice, SalesInvoiceSchema, type SyncInvoice, type UUID, type UserRole, type WeightUnit, addDaysLocalYmd, countryToCurrency, currencyToLocale, exceedsTwoDecimals, formatMoneyCurrency, formatYmdLong, getCurrencyFromCountry, getErrorMessage, handleZodCurrency, localDateFromYmd, normalizeSpaces, removeAllWhitespace, removeDashesAndPlusSign, roundWithPrecision, todayLocalYmd, transformEmptyStringToUndefined, ymdFromLocalDate };
534
+ export { type AnyInvoiceOut, AnyInvoiceSchema, CREDIT_TYPE, type CreatedLocation, CreditApplicationSchema, type CreditApplicationSnapshot, type CreditApplicationStatus, type CreditInvoice, CreditInvoiceSchema, type CreditType, CustomerFormSchema, type CustomerSnapshot, type DriverCustomerSnapshot, type DriverSettingSnapshot, INVOICE_STATUS, INVOICE_TYPE, ISO_COUNTRY_CODES, type InventoryLocationSnapshot, type InventorySystem, type InvoiceFilter, type InvoiceItemSnapshot, type InvoiceItemStatus, type InvoiceSnapshot, type InvoiceStatus, type InvoiceType, type IsoCountryCode, type IsoCurrencyCode, type MappedCustomers, type MappedVendors, PAYMENT_METHOD, type PaymentFilter, PaymentFormSchema, type PaymentMethod, type PaymentSnapshot, type PaymentStatus, ProductFormSchema, type ProductSnapshot, type ProductType, type PurchaseInvoice, PurchaseInvoiceSchema, RegisterFormSchema, type SalesInvoice, SalesInvoiceSchema, USER_ROLES, type UUID, type UserRole, type WarehouseSnapshot, type WeightUnit, addDaysLocalYmd, countryToCurrency, currencyToLocale, exceedsTwoDecimals, formatMoneyCurrency, formatYmdLong, getCurrencyFromCountry, getErrorMessage, handleZodCurrency, localDateFromYmd, normalizeSpaces, removeAllWhitespace, removeDashesAndPlusSign, roundWithPrecision, todayLocalYmd, transformEmptyStringToUndefined, ymdFromLocalDate };
package/dist/index.d.ts CHANGED
@@ -1,31 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
3
3
 
4
- declare const RegisterFormSchema: z.ZodObject<{
5
- companyData: z.ZodObject<{
6
- company_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
7
- company_address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
8
- company_phone_number: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>;
9
- iso_country_code: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodEnum<{
10
- US: "US";
11
- HN: "HN";
12
- }>>;
13
- }, z.core.$strict>;
14
- adminUserData: z.ZodObject<{
15
- user_first_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
16
- user_last_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
17
- user_email: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>;
18
- password: z.ZodString;
19
- }, z.core.$strict>;
20
- }, z.core.$strict>;
21
-
22
- declare const CustomerFormSchema: z.ZodObject<{
23
- customer_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
24
- customer_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
25
- customer_phone_number: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
26
- customer_email_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>>>;
27
- }, z.core.$strict>;
28
-
29
4
  type RoundType = "half_up";
30
5
  interface ToFixedOptions {
31
6
  roundType?: RoundType;
@@ -107,6 +82,124 @@ type CreatedLocation = (typeof CREATED_LOCATION)[number];
107
82
  type IntBool = 0 | 1;
108
83
  declare const uuidSchema: z.ZodUUID;
109
84
  type UUID = z.infer<typeof uuidSchema>;
85
+ type status = "active" | "inactive";
86
+
87
+ declare const RegisterFormSchema: z.ZodObject<{
88
+ companyData: z.ZodObject<{
89
+ company_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
90
+ company_address: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
91
+ company_phone_number: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>;
92
+ iso_country_code: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodEnum<{
93
+ US: "US";
94
+ HN: "HN";
95
+ }>>;
96
+ }, z.core.$strict>;
97
+ adminUserData: z.ZodObject<{
98
+ user_first_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
99
+ user_last_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
100
+ user_email: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>;
101
+ password: z.ZodString;
102
+ }, z.core.$strict>;
103
+ }, z.core.$strict>;
104
+
105
+ declare const CustomerFormSchema: z.ZodObject<{
106
+ customer_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
107
+ customer_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
108
+ customer_phone_number: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
109
+ customer_email_address: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>>>>;
110
+ }, z.core.$strict>;
111
+
112
+ type CustomerSnapshot = {
113
+ customer_id: UUID;
114
+ customer_name: string;
115
+ customer_address: string | null;
116
+ customer_phone_number: string | null;
117
+ customer_email_address: string | null;
118
+ customer_status: status;
119
+ created_location: CreatedLocation;
120
+ company_id: number;
121
+ };
122
+ type MappedCustomers = {
123
+ customer_id: string;
124
+ customer_name: string;
125
+ customer_address?: string;
126
+ customer_phone_number?: string;
127
+ customer_email_address?: string;
128
+ };
129
+
130
+ type MappedVendors = {
131
+ vendor_id: string;
132
+ vendor_name: string;
133
+ vendor_address: string;
134
+ vendor_phone_number: string;
135
+ vendor_email_address: string;
136
+ tax_rate: number;
137
+ };
138
+
139
+ declare const ProductFormSchema: z.ZodObject<{
140
+ product_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
141
+ product_description: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
142
+ product_sku: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
143
+ product_upc: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
144
+ product_gtin_14: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
145
+ product_type: z.ZodEnum<{
146
+ unit: "unit";
147
+ weight: "weight";
148
+ case: "case";
149
+ }>;
150
+ weight_unit: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodEnum<{
151
+ kg: "kg";
152
+ lb: "lb";
153
+ g: "g";
154
+ oz: "oz";
155
+ }>>>;
156
+ price: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
157
+ cost: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
158
+ }, z.core.$strict>;
159
+
160
+ type ProductType = "unit" | "weight" | "case";
161
+ type WeightUnit = "kg" | "lb" | "g" | "oz";
162
+ type ProductSnapshot = {
163
+ product_id: UUID;
164
+ product_name: string;
165
+ product_description: string | null;
166
+ product_sku: string | null;
167
+ product_type: ProductType;
168
+ price: string;
169
+ weight_unit: WeightUnit | null;
170
+ created_location: CreatedLocation;
171
+ company_id: number;
172
+ product_upc: string | null;
173
+ product_gtin_14: string | null;
174
+ product_status: status;
175
+ };
176
+
177
+ type WarehouseSnapshot = {
178
+ warehouse_id: UUID;
179
+ warehouse_name: string;
180
+ warehouse_address: string;
181
+ created_location: CreatedLocation;
182
+ is_deleted: IntBool | null;
183
+ deleted_at: string | null;
184
+ created_at: string | null;
185
+ updated_at: string | null;
186
+ company_id: number;
187
+ created_by_user_id: number;
188
+ };
189
+
190
+ type LocationType = "warehouse" | "employee";
191
+ type InventoryLocationSnapshot = {
192
+ location_id: UUID;
193
+ location_type: LocationType;
194
+ reference_id: UUID;
195
+ name: string;
196
+ created_location: CreatedLocation;
197
+ is_deleted: IntBool | null;
198
+ deleted_at: string | null;
199
+ created_at: string | null;
200
+ updated_at: string | null;
201
+ company_id: number;
202
+ };
110
203
 
111
204
  declare const SalesInvoiceSchema: z.ZodObject<{
112
205
  invoice_date: z.ZodString;
@@ -327,76 +420,56 @@ declare const INVOICE_STATUS: readonly ["finalized", "voided"];
327
420
  type InvoiceStatus = (typeof INVOICE_STATUS)[number];
328
421
  declare const CREDIT_TYPE: readonly ["dump", "return"];
329
422
  type CreditType = (typeof CREDIT_TYPE)[number];
330
-
331
- type SyncInvoice = {
423
+ type InvoiceSnapshot = {
332
424
  invoice_id: UUID;
333
425
  invoice_type: InvoiceType;
334
426
  subtotal: string;
335
427
  tax_amount: string;
336
428
  total_amount: string;
337
429
  remaining_balance: string;
338
- due_date: Date;
430
+ due_date: string;
339
431
  tax_rate: string;
340
432
  created_location: CreatedLocation;
341
- is_new: IntBool;
342
433
  customer_id: UUID;
343
434
  company_id: number;
344
435
  short_invoice_id: string;
345
436
  invoice_date: string;
346
437
  invoice_status: InvoiceStatus;
438
+ occurred_at_ms: string;
347
439
  };
348
440
 
349
- type MappedCustomers = {
350
- customer_id: string;
351
- customer_name: string;
352
- customer_address?: string;
353
- customer_phone_number?: string;
354
- customer_email_address?: string;
355
- };
356
-
357
- type MappedVendors = {
358
- vendor_id: string;
359
- vendor_name: string;
360
- vendor_address: string;
361
- vendor_phone_number: string;
362
- vendor_email_address: string;
363
- tax_rate: number;
441
+ type InvoiceItemStatus = "finalized" | "voided";
442
+ type InvoiceItemSnapshot = {
443
+ invoice_item_id: UUID;
444
+ invoice_id: UUID;
445
+ product_id: UUID;
446
+ quantity: string;
447
+ price: string;
448
+ amount: string;
449
+ credit_type: CreditType | null;
450
+ company_id: number;
451
+ invoice_type: InvoiceType;
452
+ invoice_item_status: InvoiceItemStatus;
453
+ line_number: number;
364
454
  };
365
455
 
366
- declare function todayLocalYmd(): string;
367
- declare function addDaysLocalYmd(ymd: string, days: number): string;
368
- declare function formatYmdLong(ymd: string, locale?: string): string;
369
- declare function localDateFromYmd(ymd: string): Date;
370
- declare function ymdFromLocalDate(dt: Date): string;
371
-
372
- type RHFError = string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
373
- declare const getErrorMessage: (err: RHFError) => string | undefined;
374
-
375
- declare const exceedsTwoDecimals: (raw: string) => boolean;
376
-
377
- declare const ProductFormSchema: z.ZodObject<{
378
- product_name: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
379
- product_description: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
380
- product_sku: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>, z.ZodTransform<string | undefined, string>>>;
381
- product_upc: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
382
- product_gtin_14: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<string | undefined, string>>>;
383
- product_type: z.ZodEnum<{
384
- unit: "unit";
385
- weight: "weight";
386
- case: "case";
387
- }>;
388
- weight_unit: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodEnum<{
389
- kg: "kg";
390
- lb: "lb";
391
- g: "g";
392
- oz: "oz";
393
- }>>>;
394
- price: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
395
- cost: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
456
+ declare const CreditApplicationSchema: z.ZodObject<{
457
+ credit_invoice_id: z.ZodUUID;
458
+ applied_amount: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
396
459
  }, z.core.$strict>;
397
460
 
398
- type ProductType = "unit" | "weight" | "case";
399
- type WeightUnit = "kg" | "lb" | "g" | "oz";
461
+ type CreditApplicationStatus = "finalized" | "voided";
462
+ type CreditApplicationSnapshot = {
463
+ credit_application_id: UUID;
464
+ credit_invoice_id: UUID;
465
+ sales_invoice_id: UUID;
466
+ applied_amount: string;
467
+ created_location: CreatedLocation;
468
+ company_id: number;
469
+ credit_application_status: CreditApplicationStatus;
470
+ applied_date: string;
471
+ occurred_at_ms: string;
472
+ };
400
473
 
401
474
  declare const PaymentFormSchema: z.ZodObject<{
402
475
  payment_method: z.ZodEnum<{
@@ -411,10 +484,51 @@ declare const PaymentFormSchema: z.ZodObject<{
411
484
 
412
485
  declare const PAYMENT_METHOD: readonly ["check", "cash", "bank_transfer", "digital_wallet"];
413
486
  type PaymentMethod = (typeof PAYMENT_METHOD)[number];
487
+ type PaymentStatus = "finalized" | "voided";
488
+ type PaymentSnapshot = {
489
+ payment_id: UUID;
490
+ invoice_id: UUID;
491
+ payment_amount: string;
492
+ payment_date: string;
493
+ payment_method: PaymentMethod;
494
+ check_number: string | null;
495
+ created_location: CreatedLocation;
496
+ company_id: number;
497
+ short_invoice_id: string;
498
+ payment_status: PaymentStatus;
499
+ occurred_at_ms: string;
500
+ };
414
501
 
415
- declare const CreditApplicationSchema: z.ZodObject<{
416
- credit_invoice_id: z.ZodUUID;
417
- applied_amount: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodTransform<number, string>>, z.ZodNumber]>, z.ZodTransform<number, number>>;
418
- }, z.core.$strict>;
502
+ type DriverCustomerSnapshot = {
503
+ driver_customer_id: number;
504
+ is_active: IntBool;
505
+ user_id: number;
506
+ company_id: number;
507
+ customer_id: UUID;
508
+ created_at: string;
509
+ };
510
+
511
+ type InvoiceFilter = "all" | "unpaid";
512
+ type PaymentFilter = "all" | "none";
513
+ type DriverSettingSnapshot = {
514
+ driver_setting_id: number;
515
+ invoice_filter: InvoiceFilter;
516
+ payment_filter: PaymentFilter;
517
+ user_id: number;
518
+ company_id: number;
519
+ created_at: string;
520
+ updated_at: string;
521
+ };
522
+
523
+ declare const exceedsTwoDecimals: (raw: string) => boolean;
524
+
525
+ declare function todayLocalYmd(): string;
526
+ declare function addDaysLocalYmd(ymd: string, days: number): string;
527
+ declare function formatYmdLong(ymd: string, locale?: string): string;
528
+ declare function localDateFromYmd(ymd: string): Date;
529
+ declare function ymdFromLocalDate(dt: Date): string;
530
+
531
+ type RHFError = string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined;
532
+ declare const getErrorMessage: (err: RHFError) => string | undefined;
419
533
 
420
- export { type AnyInvoiceOut, AnyInvoiceSchema, CREDIT_TYPE, type CreatedLocation, CreditApplicationSchema, type CreditInvoice, CreditInvoiceSchema, type CreditType, CustomerFormSchema, INVOICE_STATUS, INVOICE_TYPE, type InventorySystem, type InvoiceStatus, type InvoiceType, type IsoCountryCode, type IsoCurrencyCode, type MappedCustomers, type MappedVendors, PAYMENT_METHOD, PaymentFormSchema, type PaymentMethod, ProductFormSchema, type ProductType, type PurchaseInvoice, PurchaseInvoiceSchema, RegisterFormSchema, type SalesInvoice, SalesInvoiceSchema, type SyncInvoice, type UUID, type UserRole, type WeightUnit, addDaysLocalYmd, countryToCurrency, currencyToLocale, exceedsTwoDecimals, formatMoneyCurrency, formatYmdLong, getCurrencyFromCountry, getErrorMessage, handleZodCurrency, localDateFromYmd, normalizeSpaces, removeAllWhitespace, removeDashesAndPlusSign, roundWithPrecision, todayLocalYmd, transformEmptyStringToUndefined, ymdFromLocalDate };
534
+ export { type AnyInvoiceOut, AnyInvoiceSchema, CREDIT_TYPE, type CreatedLocation, CreditApplicationSchema, type CreditApplicationSnapshot, type CreditApplicationStatus, type CreditInvoice, CreditInvoiceSchema, type CreditType, CustomerFormSchema, type CustomerSnapshot, type DriverCustomerSnapshot, type DriverSettingSnapshot, INVOICE_STATUS, INVOICE_TYPE, ISO_COUNTRY_CODES, type InventoryLocationSnapshot, type InventorySystem, type InvoiceFilter, type InvoiceItemSnapshot, type InvoiceItemStatus, type InvoiceSnapshot, type InvoiceStatus, type InvoiceType, type IsoCountryCode, type IsoCurrencyCode, type MappedCustomers, type MappedVendors, PAYMENT_METHOD, type PaymentFilter, PaymentFormSchema, type PaymentMethod, type PaymentSnapshot, type PaymentStatus, ProductFormSchema, type ProductSnapshot, type ProductType, type PurchaseInvoice, PurchaseInvoiceSchema, RegisterFormSchema, type SalesInvoice, SalesInvoiceSchema, USER_ROLES, type UUID, type UserRole, type WarehouseSnapshot, type WeightUnit, addDaysLocalYmd, countryToCurrency, currencyToLocale, exceedsTwoDecimals, formatMoneyCurrency, formatYmdLong, getCurrencyFromCountry, getErrorMessage, handleZodCurrency, localDateFromYmd, normalizeSpaces, removeAllWhitespace, removeDashesAndPlusSign, roundWithPrecision, todayLocalYmd, transformEmptyStringToUndefined, ymdFromLocalDate };