@marteye/studiojs 1.1.36 → 1.1.38
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.ts +407 -67
- package/dist/index.esm.js +277 -72
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +277 -72
- package/dist/index.js.map +1 -1
- package/dist/net/http.d.ts +1 -0
- package/dist/resources/adjustments.d.ts +2 -0
- package/dist/resources/carts.d.ts +35 -0
- package/dist/resources/contacts.d.ts +28 -0
- package/dist/resources/cph.d.ts +6 -0
- package/dist/resources/customers.d.ts +56 -2
- package/dist/resources/extras.d.ts +32 -0
- package/dist/resources/invoices.d.ts +1 -1
- package/dist/resources/ledger.d.ts +15 -0
- package/dist/resources/payments.d.ts +1 -1
- package/dist/resources/payouts.d.ts +1 -1
- package/dist/resources/productCodes.d.ts +2 -0
- package/dist/resources/saleTemplates.d.ts +30 -0
- package/dist/resources/sales.d.ts +3 -1
- package/dist/resources.d.ts +62 -4
- package/dist/studio.d.ts +63 -5
- package/dist/types.d.ts +119 -26
- package/dist/utils/lots.d.ts +7 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type CurrenciesWithGuinea = Currency | "GUINEA-GBP";
|
|
|
10
10
|
export type UnitOfSale = "Per KG" | "Per Item" | "Per Lot" | "Per 1000KG";
|
|
11
11
|
export declare const SupportedUnitsOfSale: UnitOfSale[];
|
|
12
12
|
export type PaymentMethod = "BACS" | "Cheque" | "BankTransfer" | "Cash" | "Card" | "Credit";
|
|
13
|
+
export type InvoiceDeliveryPreference = "email" | "printed" | "both";
|
|
13
14
|
export type PayoutMethod = "BACS" | "Cheque" | "Cash";
|
|
14
15
|
export declare const SupportedPaymentMethods: PaymentMethod[];
|
|
15
16
|
export interface Market {
|
|
@@ -44,6 +45,8 @@ export interface SettingsMarketDefaults {
|
|
|
44
45
|
defaultPayoutPreference: PayoutMethod;
|
|
45
46
|
defaultUnitOfSale: UnitOfSale;
|
|
46
47
|
defaultSuperType?: SuperType | null;
|
|
48
|
+
defaultSettleDebtsFirst?: boolean;
|
|
49
|
+
liveEmailsEnabled?: boolean;
|
|
47
50
|
lotDescriptionTemplateMap?: {
|
|
48
51
|
default: string | undefined;
|
|
49
52
|
[supertype: string]: string | undefined;
|
|
@@ -98,6 +101,10 @@ export interface Printer {
|
|
|
98
101
|
*/
|
|
99
102
|
name: string;
|
|
100
103
|
friendlyName: string;
|
|
104
|
+
/**
|
|
105
|
+
* Optional single IPP URI if linked by IP discovery
|
|
106
|
+
*/
|
|
107
|
+
uri?: string;
|
|
101
108
|
chequePrinter?: boolean;
|
|
102
109
|
/**
|
|
103
110
|
* The next cheque number to use when printing a cheque
|
|
@@ -127,6 +134,7 @@ export type DisplayBoardMode = "off" | "live" | "manual" | {
|
|
|
127
134
|
type: "focused";
|
|
128
135
|
field: string;
|
|
129
136
|
};
|
|
137
|
+
export type SalePublishStatus = "unpublished" | "sale" | "catalogPublished";
|
|
130
138
|
export interface Sale {
|
|
131
139
|
id: string;
|
|
132
140
|
createdAt: Timestamp;
|
|
@@ -194,6 +202,47 @@ export interface Sale {
|
|
|
194
202
|
};
|
|
195
203
|
};
|
|
196
204
|
editedBy?: string[];
|
|
205
|
+
/**
|
|
206
|
+
* Publishing status for external systems
|
|
207
|
+
* - unpublished: Not listed in external system
|
|
208
|
+
* - sale: Sale date is listed externally
|
|
209
|
+
* - catalogPublished: Sale and catalog information synced
|
|
210
|
+
*/
|
|
211
|
+
publishStatus?: SalePublishStatus;
|
|
212
|
+
}
|
|
213
|
+
export interface TemplateSaleData {
|
|
214
|
+
name?: string;
|
|
215
|
+
description?: string | null;
|
|
216
|
+
image?: string | null;
|
|
217
|
+
location?: string | null;
|
|
218
|
+
martEyeSaleType?: "LIVE" | "TIMED" | null;
|
|
219
|
+
cover?: string | null;
|
|
220
|
+
availableProductCodes: string[];
|
|
221
|
+
attributeDefaults?: {
|
|
222
|
+
[attributekey: string]: AttributeValueType;
|
|
223
|
+
};
|
|
224
|
+
marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
|
|
225
|
+
}
|
|
226
|
+
export interface SaleTemplate {
|
|
227
|
+
id: string;
|
|
228
|
+
marketId: string;
|
|
229
|
+
name: string;
|
|
230
|
+
description?: string | null;
|
|
231
|
+
sourceSaleId?: string;
|
|
232
|
+
createdAt: Timestamp;
|
|
233
|
+
updatedAt: Timestamp;
|
|
234
|
+
createdBy: string;
|
|
235
|
+
saleData: TemplateSaleData;
|
|
236
|
+
lotGridConfigs?: {
|
|
237
|
+
[configId: string]: StoredDataGridConfig;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export interface StoredDataGridConfig {
|
|
241
|
+
widths?: {
|
|
242
|
+
[key: string]: number;
|
|
243
|
+
};
|
|
244
|
+
hiddenColumnIds: string[];
|
|
245
|
+
columnOrder: string[];
|
|
197
246
|
}
|
|
198
247
|
export interface MartEyeLiveSaleSettings {
|
|
199
248
|
description?: string;
|
|
@@ -398,6 +447,11 @@ export interface Product {
|
|
|
398
447
|
subtotalGroup?: SubtotalGroups | null | undefined;
|
|
399
448
|
passThroughFundsToAnotherCustomer?: boolean;
|
|
400
449
|
isEnabled?: boolean;
|
|
450
|
+
relatedTo?: {
|
|
451
|
+
lotId: string;
|
|
452
|
+
saleId: string;
|
|
453
|
+
} | null;
|
|
454
|
+
obfusicate?: boolean;
|
|
401
455
|
metadata: {
|
|
402
456
|
[key: string]: string | number | boolean | Timestamp | Media;
|
|
403
457
|
};
|
|
@@ -464,31 +518,6 @@ export interface ProductCodeConfiguration {
|
|
|
464
518
|
export interface ProductConfiguration {
|
|
465
519
|
[id: string]: Product;
|
|
466
520
|
}
|
|
467
|
-
/***
|
|
468
|
-
* A market may offer other products and services. This is a way to track those.
|
|
469
|
-
* They simply create a line item on the invoice
|
|
470
|
-
*/
|
|
471
|
-
export interface Product {
|
|
472
|
-
id: string;
|
|
473
|
-
createdAt: Timestamp;
|
|
474
|
-
updatedAt: Timestamp;
|
|
475
|
-
marketId: string;
|
|
476
|
-
name: string;
|
|
477
|
-
taxRateId: string;
|
|
478
|
-
defaultUnitPriceInCents: number;
|
|
479
|
-
unitPriceIncludesVat?: boolean;
|
|
480
|
-
applyToClients: ClientType[];
|
|
481
|
-
subtotalGroup?: SubtotalGroups | null | undefined;
|
|
482
|
-
passThroughFundsToAnotherCustomer?: boolean;
|
|
483
|
-
relatedTo?: {
|
|
484
|
-
lotId: string;
|
|
485
|
-
saleId: string;
|
|
486
|
-
} | null;
|
|
487
|
-
obfusicate?: boolean;
|
|
488
|
-
metadata: {
|
|
489
|
-
[key: string]: string | number | boolean | Timestamp | Media;
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
521
|
export interface Cart {
|
|
493
522
|
customerId: string;
|
|
494
523
|
updatedAt: Timestamp;
|
|
@@ -531,6 +560,37 @@ export type BankDetails = {
|
|
|
531
560
|
accountNumber?: never;
|
|
532
561
|
sortCode?: never;
|
|
533
562
|
});
|
|
563
|
+
export type CustomerBankDetails = BankDetails & {
|
|
564
|
+
id?: string;
|
|
565
|
+
createdAt?: Timestamp;
|
|
566
|
+
updatedAt?: Timestamp;
|
|
567
|
+
updatedBy?: string | null;
|
|
568
|
+
};
|
|
569
|
+
export interface CustomerContact {
|
|
570
|
+
id: string;
|
|
571
|
+
createdAt: Timestamp;
|
|
572
|
+
updatedAt: Timestamp;
|
|
573
|
+
updatedBy?: string | null;
|
|
574
|
+
marketId: string;
|
|
575
|
+
displayName: string;
|
|
576
|
+
email?: string | null;
|
|
577
|
+
phoneNumber?: string | null;
|
|
578
|
+
/** @deprecated */
|
|
579
|
+
landlineNumber?: string | null;
|
|
580
|
+
/** @deprecated */
|
|
581
|
+
address?: Address;
|
|
582
|
+
isPrimary?: boolean;
|
|
583
|
+
isActive?: boolean;
|
|
584
|
+
isDeleted?: boolean;
|
|
585
|
+
isVerified?: boolean;
|
|
586
|
+
accountEmails?: boolean;
|
|
587
|
+
marketingEmails?: boolean;
|
|
588
|
+
marteyeUid?: string | null;
|
|
589
|
+
notes?: string | null;
|
|
590
|
+
metadata?: {
|
|
591
|
+
[key: string]: string | number | boolean | Timestamp | Media;
|
|
592
|
+
};
|
|
593
|
+
}
|
|
534
594
|
/**
|
|
535
595
|
* Used to store the bank details for a market
|
|
536
596
|
*/
|
|
@@ -556,19 +616,25 @@ export interface Customer {
|
|
|
556
616
|
isMarketAccount?: boolean;
|
|
557
617
|
accountNumber?: string;
|
|
558
618
|
bidderNumber?: number | null;
|
|
619
|
+
displayName?: string | null;
|
|
559
620
|
firstName?: string | null;
|
|
560
621
|
lastName?: string | null;
|
|
561
622
|
tradingName?: string | null;
|
|
562
623
|
email?: EmailWrapper;
|
|
563
624
|
phoneNumber?: PhoneNumberWrapper;
|
|
625
|
+
/** @deprecated */
|
|
564
626
|
otherPhoneNumbers?: PhoneNumberWrapper[];
|
|
565
627
|
address: AddressWrapper;
|
|
628
|
+
/** @deprecated */
|
|
566
629
|
otherAddresses: {
|
|
567
630
|
[addressId: string]: AddressWrapper;
|
|
568
631
|
};
|
|
569
632
|
photoURL?: string | null;
|
|
570
633
|
payoutPreference?: PayoutMethod;
|
|
571
|
-
|
|
634
|
+
invoiceDeliveryPreference?: InvoiceDeliveryPreference;
|
|
635
|
+
statementDeliveryPreference?: InvoiceDeliveryPreference;
|
|
636
|
+
bankDetails?: CustomerBankDetails | CustomerBankDetails[] | null;
|
|
637
|
+
contacts?: CustomerContact[];
|
|
572
638
|
attributeDefaultsBuyer?: {
|
|
573
639
|
[attributekey: string]: AttributeValueType[];
|
|
574
640
|
};
|
|
@@ -585,6 +651,8 @@ export interface Customer {
|
|
|
585
651
|
hasPurchasedItems?: boolean;
|
|
586
652
|
hasSoldItems?: boolean;
|
|
587
653
|
notes?: string;
|
|
654
|
+
status?: "archived" | "deleted" | null;
|
|
655
|
+
deleteAfter?: Timestamp;
|
|
588
656
|
}
|
|
589
657
|
export interface CustomerFromSearch extends Omit<Customer, "createdAt" | "updatedAt" | "lastItemPurchaseDate" | "lastItemSaleDate"> {
|
|
590
658
|
createdAt: number;
|
|
@@ -756,6 +824,10 @@ export interface Payment {
|
|
|
756
824
|
voidedBy?: string | null;
|
|
757
825
|
voidReason?: string | null;
|
|
758
826
|
invoiceIds: string[];
|
|
827
|
+
invoices?: Array<{
|
|
828
|
+
id: string;
|
|
829
|
+
amountAppliedInCents?: number;
|
|
830
|
+
}>;
|
|
759
831
|
transactionIds: string[];
|
|
760
832
|
}
|
|
761
833
|
export interface Payout {
|
|
@@ -767,6 +839,10 @@ export interface Payout {
|
|
|
767
839
|
customerId: string;
|
|
768
840
|
method: PayoutMethod | "Credit";
|
|
769
841
|
amountInCents: number;
|
|
842
|
+
invoices?: Array<{
|
|
843
|
+
id: string;
|
|
844
|
+
amountAppliedInCents?: number;
|
|
845
|
+
}>;
|
|
770
846
|
accountName?: string;
|
|
771
847
|
accountNumber?: string;
|
|
772
848
|
sortCode?: string;
|
|
@@ -1022,4 +1098,21 @@ export type AppParameterConfig = {
|
|
|
1022
1098
|
required?: boolean;
|
|
1023
1099
|
defaultValue?: string | number | boolean | string[];
|
|
1024
1100
|
};
|
|
1101
|
+
export interface CphLookupResponse {
|
|
1102
|
+
cph: string;
|
|
1103
|
+
county: string;
|
|
1104
|
+
parish: string;
|
|
1105
|
+
holding: string;
|
|
1106
|
+
subLocation?: string;
|
|
1107
|
+
country: string;
|
|
1108
|
+
region: string | null;
|
|
1109
|
+
spatialUnit: string | null;
|
|
1110
|
+
office: string | null;
|
|
1111
|
+
ahdoNumber: string | null;
|
|
1112
|
+
parishName: string;
|
|
1113
|
+
tbTestingInterval: string | null;
|
|
1114
|
+
tbArea: string | null;
|
|
1115
|
+
cphValid?: boolean | null;
|
|
1116
|
+
farmName?: string | null;
|
|
1117
|
+
}
|
|
1025
1118
|
export {};
|
package/dist/utils/lots.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ export declare function sortByLotNumber<T extends {
|
|
|
5
5
|
lotNumber: string;
|
|
6
6
|
}>(lots: T[]): T[];
|
|
7
7
|
/***
|
|
8
|
-
* Generate the next lot number in a sequence
|
|
8
|
+
* Generate the next lot number in a sequence.
|
|
9
|
+
* Handles various formats:
|
|
10
|
+
* - Simple: "7" -> "8"
|
|
11
|
+
* - Alphanumeric: "7A" -> "7B"
|
|
12
|
+
* - Range: "1-3" -> "4", "1 - 3" -> "4" (flexible whitespace)
|
|
13
|
+
* - Range with alpha: "1-3A" -> "3B"
|
|
14
|
+
* - Compound: "1-3, 10" -> "11", "1-5, 7-9" -> "10"
|
|
9
15
|
*/
|
|
10
16
|
export declare function nextLotNumber(previousLotNumber: string): string;
|