@marteye/studiojs 1.1.41 → 1.1.43
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 +108 -20
- package/dist/index.esm.js +191 -28
- package/dist/index.js +191 -27
- package/dist/resources/adjustments.d.ts +2 -2
- package/dist/resources/bidderApplications.d.ts +13 -0
- package/dist/resources/customers.d.ts +15 -3
- package/dist/resources/invoices.d.ts +2 -2
- package/dist/resources/ledger.d.ts +2 -1
- package/dist/resources/lots.d.ts +2 -2
- package/dist/resources/markets.d.ts +2 -2
- package/dist/resources/productCodes.d.ts +2 -2
- package/dist/resources/sales.d.ts +2 -2
- package/dist/resources/settings.d.ts +2 -2
- package/dist/resources.d.ts +10 -8
- package/dist/studio.d.ts +10 -8
- package/dist/types.d.ts +20 -0
- package/dist/utils/cattlePassport.d.ts +49 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { AdjustmentsConfiguration } from "../types";
|
|
2
|
+
import { AdjustmentsConfiguration, ReadOptions } from "../types";
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
4
|
list: (marketId: string) => Promise<AdjustmentsConfiguration[]>;
|
|
5
|
-
get: (marketId: string, id: string) => Promise<AdjustmentsConfiguration>;
|
|
5
|
+
get: (marketId: string, id: string, options?: ReadOptions) => Promise<AdjustmentsConfiguration>;
|
|
6
6
|
create: (marketId: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
7
7
|
update: (marketId: string, id: string, data: Partial<AdjustmentsConfiguration>) => Promise<AdjustmentsConfiguration>;
|
|
8
8
|
};
|
|
@@ -89,5 +89,18 @@ export default function create(httpClient: HttpClient): {
|
|
|
89
89
|
* @throws Error if the application is not in pending status
|
|
90
90
|
*/
|
|
91
91
|
reject: (marketId: string, applicationId: string, notes?: string) => Promise<Application>;
|
|
92
|
+
/**
|
|
93
|
+
* Unlink an application from its customer/contact
|
|
94
|
+
* @param marketId - ID of the market
|
|
95
|
+
* @param applicationId - ID of the application to unlink
|
|
96
|
+
* @returns The unlinked application (reset to pending)
|
|
97
|
+
*/
|
|
98
|
+
unlink: (marketId: string, applicationId: string) => Promise<Application>;
|
|
99
|
+
/**
|
|
100
|
+
* Delete an application
|
|
101
|
+
* @param marketId - ID of the market
|
|
102
|
+
* @param applicationId - ID of the application to delete
|
|
103
|
+
*/
|
|
104
|
+
delete: (marketId: string, applicationId: string) => Promise<void>;
|
|
92
105
|
};
|
|
93
106
|
export type Applications = ReturnType<typeof create>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Customer, InvoiceDeliveryPreference, PayoutMethod } from "../types";
|
|
2
|
+
import { Customer, InvoiceDeliveryPreference, PayoutMethod, ReadOptions } from "../types";
|
|
3
3
|
export interface CreateCustomerPayload {
|
|
4
4
|
displayName: string;
|
|
5
5
|
email?: string;
|
|
@@ -8,7 +8,9 @@ export interface CreateCustomerPayload {
|
|
|
8
8
|
accountNumber?: string;
|
|
9
9
|
cphNumber?: string;
|
|
10
10
|
farmName?: string;
|
|
11
|
-
|
|
11
|
+
herdNumber?: string;
|
|
12
|
+
flockNumber?: string;
|
|
13
|
+
address?: {
|
|
12
14
|
company?: string;
|
|
13
15
|
firstName?: string;
|
|
14
16
|
lastName?: string;
|
|
@@ -20,6 +22,16 @@ export interface CreateCustomerPayload {
|
|
|
20
22
|
country: string;
|
|
21
23
|
};
|
|
22
24
|
marteyeUid?: string;
|
|
25
|
+
bankDetails?: {
|
|
26
|
+
sortCode?: string;
|
|
27
|
+
accountNumber?: string;
|
|
28
|
+
accountName?: string;
|
|
29
|
+
};
|
|
30
|
+
vatNumber?: string;
|
|
31
|
+
invoiceDeliveryPreference?: string;
|
|
32
|
+
statementDeliveryPreference?: string;
|
|
33
|
+
payoutPreference?: string;
|
|
34
|
+
notes?: string;
|
|
23
35
|
}
|
|
24
36
|
export interface FarmAssuranceUpdate {
|
|
25
37
|
number?: string | null;
|
|
@@ -81,7 +93,7 @@ export interface CustomersListResponse {
|
|
|
81
93
|
}
|
|
82
94
|
export default function create(httpClient: HttpClient): {
|
|
83
95
|
list: (marketId: string, lastId?: string | null) => Promise<CustomersListResponse>;
|
|
84
|
-
get: (marketId: string, customerId: string) => Promise<Customer>;
|
|
96
|
+
get: (marketId: string, customerId: string, options?: ReadOptions) => Promise<Customer>;
|
|
85
97
|
avatar: (marketId: string, customerId: string) => Promise<Customer>;
|
|
86
98
|
create: (marketId: string, customerData: CreateCustomerPayload) => Promise<Customer>;
|
|
87
99
|
update: (marketId: string, customerId: string, customerData: UpdateCustomerPayload) => Promise<Customer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Invoice } from "../types";
|
|
2
|
+
import { Invoice, ReadOptions } from "../types";
|
|
3
3
|
export interface InvoicesListResponse {
|
|
4
4
|
invoices: Invoice[];
|
|
5
5
|
lastId: string | null;
|
|
@@ -19,6 +19,6 @@ export default function create(httpClient: HttpClient): {
|
|
|
19
19
|
* @param invoiceId - ID of the invoice to fetch
|
|
20
20
|
* @returns The invoice details
|
|
21
21
|
*/
|
|
22
|
-
get: (marketId: string, invoiceId: string) => Promise<Invoice>;
|
|
22
|
+
get: (marketId: string, invoiceId: string, options?: ReadOptions) => Promise<Invoice>;
|
|
23
23
|
};
|
|
24
24
|
export type Invoices = ReturnType<typeof create>;
|
package/dist/resources/lots.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Lot, LotSaleStatus } from "../types";
|
|
2
|
+
import { Lot, LotSaleStatus, ReadOptions } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Defines the possible status values for a lot in a sale
|
|
5
5
|
*/
|
|
6
6
|
export default function create(httpClient: HttpClient): {
|
|
7
|
-
get: (marketId: string, saleId: string, lotId: string) => Promise<Lot>;
|
|
7
|
+
get: (marketId: string, saleId: string, lotId: string, options?: ReadOptions) => Promise<Lot>;
|
|
8
8
|
list: (marketId: string, saleId: string, filters?: {
|
|
9
9
|
group?: string;
|
|
10
10
|
productCode?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Market } from "../types";
|
|
2
|
+
import { Market, ReadOptions } from "../types";
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
|
-
get: (marketId: string) => Promise<Market>;
|
|
4
|
+
get: (marketId: string, options?: ReadOptions) => Promise<Market>;
|
|
5
5
|
};
|
|
6
6
|
export type Markets = ReturnType<typeof create>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { ProductCodeConfiguration } from "../types";
|
|
2
|
+
import { ProductCodeConfiguration, ReadOptions } from "../types";
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
4
|
list: (marketId: string) => Promise<ProductCodeConfiguration[]>;
|
|
5
|
-
get: (marketId: string, id: string) => Promise<ProductCodeConfiguration>;
|
|
5
|
+
get: (marketId: string, id: string, options?: ReadOptions) => Promise<ProductCodeConfiguration>;
|
|
6
6
|
create: (marketId: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
7
7
|
update: (marketId: string, id: string, data: Partial<ProductCodeConfiguration>) => Promise<ProductCodeConfiguration>;
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { Sale, SalePublishStatus } from "../types";
|
|
2
|
+
import { Sale, SalePublishStatus, ReadOptions } from "../types";
|
|
3
3
|
type SalesListResponse = {
|
|
4
4
|
start: string;
|
|
5
5
|
end: string;
|
|
@@ -24,7 +24,7 @@ type CreateSaleRequest = {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export default function create(httpClient: HttpClient): {
|
|
27
|
-
get: (marketId: string, saleId: string) => Promise<Sale>;
|
|
27
|
+
get: (marketId: string, saleId: string, options?: ReadOptions) => Promise<Sale>;
|
|
28
28
|
list: (marketId: string, opts: {
|
|
29
29
|
start?: string;
|
|
30
30
|
end?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient } from "../net/http";
|
|
2
|
-
import { SettingsMarketDefaults } from "../types";
|
|
2
|
+
import { SettingsMarketDefaults, ReadOptions } from "../types";
|
|
3
3
|
export default function create(httpClient: HttpClient): {
|
|
4
|
-
get: (marketId: string) => Promise<SettingsMarketDefaults>;
|
|
4
|
+
get: (marketId: string, options?: ReadOptions) => Promise<SettingsMarketDefaults>;
|
|
5
5
|
};
|
|
6
6
|
export type Settings = ReturnType<typeof create>;
|
package/dist/resources.d.ts
CHANGED
|
@@ -5,14 +5,14 @@ export default function resources(httpClient: HttpClient): {
|
|
|
5
5
|
get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
|
|
6
6
|
};
|
|
7
7
|
markets: {
|
|
8
|
-
get: (marketId: string) => Promise<import("./types").Market>;
|
|
8
|
+
get: (marketId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Market>;
|
|
9
9
|
};
|
|
10
10
|
members: {
|
|
11
11
|
list: (marketId: string, params?: import("./resources/members").MembersListParams) => Promise<import("./resources/members").MembersListResponse>;
|
|
12
12
|
get: (marketId: string, memberId: string) => Promise<import("./resources/members").Member>;
|
|
13
13
|
};
|
|
14
14
|
sales: {
|
|
15
|
-
get: (marketId: string, saleId: string) => Promise<import("./types").Sale>;
|
|
15
|
+
get: (marketId: string, saleId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Sale>;
|
|
16
16
|
list: (marketId: string, opts: {
|
|
17
17
|
start?: string;
|
|
18
18
|
end?: string;
|
|
@@ -82,7 +82,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
82
82
|
}) => Promise<import("./types").Sale>;
|
|
83
83
|
};
|
|
84
84
|
lots: {
|
|
85
|
-
get: (marketId: string, saleId: string, lotId: string) => Promise<import("./types").Lot>;
|
|
85
|
+
get: (marketId: string, saleId: string, lotId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Lot>;
|
|
86
86
|
list: (marketId: string, saleId: string, filters?: {
|
|
87
87
|
group?: string;
|
|
88
88
|
productCode?: string;
|
|
@@ -165,13 +165,15 @@ export default function resources(httpClient: HttpClient): {
|
|
|
165
165
|
update: (marketId: string, applicationId: string, updateData: import("./resources/bidderApplications").UpdateApplicationPayload) => Promise<import("./types").Application>;
|
|
166
166
|
approve: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
|
|
167
167
|
reject: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
|
|
168
|
+
unlink: (marketId: string, applicationId: string) => Promise<import("./types").Application>;
|
|
169
|
+
delete: (marketId: string, applicationId: string) => Promise<void>;
|
|
168
170
|
};
|
|
169
171
|
settings: {
|
|
170
|
-
get: (marketId: string) => Promise<import("./types").SettingsMarketDefaults>;
|
|
172
|
+
get: (marketId: string, options?: import("./types").ReadOptions) => Promise<import("./types").SettingsMarketDefaults>;
|
|
171
173
|
};
|
|
172
174
|
adjustments: {
|
|
173
175
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
174
|
-
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
176
|
+
get: (marketId: string, id: string, options?: import("./types").ReadOptions) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
175
177
|
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
176
178
|
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
177
179
|
};
|
|
@@ -183,7 +185,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
183
185
|
};
|
|
184
186
|
productCodes: {
|
|
185
187
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
186
|
-
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
188
|
+
get: (marketId: string, id: string, options?: import("./types").ReadOptions) => Promise<import("./types").ProductCodeConfiguration>;
|
|
187
189
|
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
188
190
|
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
189
191
|
};
|
|
@@ -217,7 +219,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
217
219
|
};
|
|
218
220
|
customers: {
|
|
219
221
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
220
|
-
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
222
|
+
get: (marketId: string, customerId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Customer>;
|
|
221
223
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
222
224
|
create: (marketId: string, customerData: import("./resources/customers").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
223
225
|
update: (marketId: string, customerId: string, customerData: import("./resources/customers").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
@@ -226,7 +228,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
226
228
|
};
|
|
227
229
|
invoices: {
|
|
228
230
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
229
|
-
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
231
|
+
get: (marketId: string, invoiceId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Invoice>;
|
|
230
232
|
};
|
|
231
233
|
payments: {
|
|
232
234
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
package/dist/studio.d.ts
CHANGED
|
@@ -14,14 +14,14 @@ export declare function Studio(info?: {
|
|
|
14
14
|
get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
|
|
15
15
|
};
|
|
16
16
|
markets: {
|
|
17
|
-
get: (marketId: string) => Promise<import("./types").Market>;
|
|
17
|
+
get: (marketId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Market>;
|
|
18
18
|
};
|
|
19
19
|
members: {
|
|
20
20
|
list: (marketId: string, params?: import("./resources/members").MembersListParams) => Promise<import("./resources/members").MembersListResponse>;
|
|
21
21
|
get: (marketId: string, memberId: string) => Promise<import("./resources/members").Member>;
|
|
22
22
|
};
|
|
23
23
|
sales: {
|
|
24
|
-
get: (marketId: string, saleId: string) => Promise<import("./types").Sale>;
|
|
24
|
+
get: (marketId: string, saleId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Sale>;
|
|
25
25
|
list: (marketId: string, opts: {
|
|
26
26
|
start?: string;
|
|
27
27
|
end?: string;
|
|
@@ -91,7 +91,7 @@ export declare function Studio(info?: {
|
|
|
91
91
|
}) => Promise<import("./types").Sale>;
|
|
92
92
|
};
|
|
93
93
|
lots: {
|
|
94
|
-
get: (marketId: string, saleId: string, lotId: string) => Promise<import("./types").Lot>;
|
|
94
|
+
get: (marketId: string, saleId: string, lotId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Lot>;
|
|
95
95
|
list: (marketId: string, saleId: string, filters?: {
|
|
96
96
|
group?: string;
|
|
97
97
|
productCode?: string;
|
|
@@ -174,13 +174,15 @@ export declare function Studio(info?: {
|
|
|
174
174
|
update: (marketId: string, applicationId: string, updateData: import("./resources/bidderApplications").UpdateApplicationPayload) => Promise<import("./types").Application>;
|
|
175
175
|
approve: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
|
|
176
176
|
reject: (marketId: string, applicationId: string, notes?: string) => Promise<import("./types").Application>;
|
|
177
|
+
unlink: (marketId: string, applicationId: string) => Promise<import("./types").Application>;
|
|
178
|
+
delete: (marketId: string, applicationId: string) => Promise<void>;
|
|
177
179
|
};
|
|
178
180
|
settings: {
|
|
179
|
-
get: (marketId: string) => Promise<import("./types").SettingsMarketDefaults>;
|
|
181
|
+
get: (marketId: string, options?: import("./types").ReadOptions) => Promise<import("./types").SettingsMarketDefaults>;
|
|
180
182
|
};
|
|
181
183
|
adjustments: {
|
|
182
184
|
list: (marketId: string) => Promise<import("./types").AdjustmentsConfiguration[]>;
|
|
183
|
-
get: (marketId: string, id: string) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
185
|
+
get: (marketId: string, id: string, options?: import("./types").ReadOptions) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
184
186
|
create: (marketId: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
185
187
|
update: (marketId: string, id: string, data: Partial<import("./types").AdjustmentsConfiguration>) => Promise<import("./types").AdjustmentsConfiguration>;
|
|
186
188
|
};
|
|
@@ -192,7 +194,7 @@ export declare function Studio(info?: {
|
|
|
192
194
|
};
|
|
193
195
|
productCodes: {
|
|
194
196
|
list: (marketId: string) => Promise<import("./types").ProductCodeConfiguration[]>;
|
|
195
|
-
get: (marketId: string, id: string) => Promise<import("./types").ProductCodeConfiguration>;
|
|
197
|
+
get: (marketId: string, id: string, options?: import("./types").ReadOptions) => Promise<import("./types").ProductCodeConfiguration>;
|
|
196
198
|
create: (marketId: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
197
199
|
update: (marketId: string, id: string, data: Partial<import("./types").ProductCodeConfiguration>) => Promise<import("./types").ProductCodeConfiguration>;
|
|
198
200
|
};
|
|
@@ -226,7 +228,7 @@ export declare function Studio(info?: {
|
|
|
226
228
|
};
|
|
227
229
|
customers: {
|
|
228
230
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/customers").CustomersListResponse>;
|
|
229
|
-
get: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
231
|
+
get: (marketId: string, customerId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Customer>;
|
|
230
232
|
avatar: (marketId: string, customerId: string) => Promise<import("./types").Customer>;
|
|
231
233
|
create: (marketId: string, customerData: import(".").CreateCustomerPayload) => Promise<import("./types").Customer>;
|
|
232
234
|
update: (marketId: string, customerId: string, customerData: import(".").UpdateCustomerPayload) => Promise<import("./types").Customer>;
|
|
@@ -235,7 +237,7 @@ export declare function Studio(info?: {
|
|
|
235
237
|
};
|
|
236
238
|
invoices: {
|
|
237
239
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/invoices").InvoicesListResponse>;
|
|
238
|
-
get: (marketId: string, invoiceId: string) => Promise<import("./types").Invoice>;
|
|
240
|
+
get: (marketId: string, invoiceId: string, options?: import("./types").ReadOptions) => Promise<import("./types").Invoice>;
|
|
239
241
|
};
|
|
240
242
|
payments: {
|
|
241
243
|
list: (marketId: string, lastId?: string | null) => Promise<import("./resources/payments").PaymentsListResponse>;
|
package/dist/types.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export interface SettingsMarketDefaults {
|
|
|
58
58
|
selectDocumentIdsMap: {
|
|
59
59
|
[supertype: string]: string[];
|
|
60
60
|
};
|
|
61
|
+
enableLuckMoney?: boolean;
|
|
61
62
|
}
|
|
62
63
|
export interface SettingsProductCodes {
|
|
63
64
|
[code: string]: ProductCodeConfiguration;
|
|
@@ -209,6 +210,7 @@ export interface Sale {
|
|
|
209
210
|
* - saleAndCatalog: Sale and catalog information synced
|
|
210
211
|
*/
|
|
211
212
|
publishStatus?: SalePublishStatus;
|
|
213
|
+
enableLuckMoney?: boolean;
|
|
212
214
|
}
|
|
213
215
|
export interface TemplateSaleData {
|
|
214
216
|
name?: string;
|
|
@@ -222,6 +224,7 @@ export interface TemplateSaleData {
|
|
|
222
224
|
[attributekey: string]: AttributeValueType;
|
|
223
225
|
};
|
|
224
226
|
marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
|
|
227
|
+
enableLuckMoney?: boolean;
|
|
225
228
|
}
|
|
226
229
|
export interface SaleTemplate {
|
|
227
230
|
id: string;
|
|
@@ -345,6 +348,7 @@ export interface Lot {
|
|
|
345
348
|
unitOfSale: UnitOfSale;
|
|
346
349
|
reservePriceInCents?: number | null;
|
|
347
350
|
startingPriceInCents?: number | null;
|
|
351
|
+
luckMoneyInCents?: number | null;
|
|
348
352
|
unitPriceInCents?: number;
|
|
349
353
|
buyerCasual?: string | null;
|
|
350
354
|
buyerCustomerId: string | null;
|
|
@@ -524,6 +528,9 @@ export interface Cart {
|
|
|
524
528
|
itemsById: {
|
|
525
529
|
[itemId: string]: CartItem;
|
|
526
530
|
};
|
|
531
|
+
checkoutPrefs?: {
|
|
532
|
+
[key: string]: any;
|
|
533
|
+
};
|
|
527
534
|
}
|
|
528
535
|
export interface EmailWrapper {
|
|
529
536
|
email: string;
|
|
@@ -681,6 +688,9 @@ export interface Application {
|
|
|
681
688
|
isApprovedAtOtherMarkets?: boolean;
|
|
682
689
|
marteyeUid: string;
|
|
683
690
|
notes?: string;
|
|
691
|
+
customerId?: string;
|
|
692
|
+
contactId?: string;
|
|
693
|
+
accountNumber?: string;
|
|
684
694
|
approvedBy?: string;
|
|
685
695
|
rejectedBy?: string;
|
|
686
696
|
approvedAt?: Timestamp;
|
|
@@ -987,6 +997,12 @@ export interface Invoice extends Omit<Omit<Omit<Omit<DraftInvoice, "ledgerAccoun
|
|
|
987
997
|
status: "sent" | "delivered" | "opened" | "bounced";
|
|
988
998
|
timestamp: Timestamp;
|
|
989
999
|
}[];
|
|
1000
|
+
printHistory?: {
|
|
1001
|
+
printedAt: Timestamp;
|
|
1002
|
+
printedBy: string;
|
|
1003
|
+
deviceId: string;
|
|
1004
|
+
documentIds: string[];
|
|
1005
|
+
}[];
|
|
990
1006
|
pitchPayLink: string | null;
|
|
991
1007
|
}
|
|
992
1008
|
export interface Printer {
|
|
@@ -1021,6 +1037,7 @@ export interface InvoiceLineItem {
|
|
|
1021
1037
|
productObfusicate?: boolean;
|
|
1022
1038
|
passthroughFundsToCustomerId?: string | null;
|
|
1023
1039
|
adjustmentConfig?: AdjustmentsConfiguration;
|
|
1040
|
+
isLuckMoney?: boolean;
|
|
1024
1041
|
metadata: {
|
|
1025
1042
|
[key: string]: string | number | boolean | Timestamp | Media | {
|
|
1026
1043
|
[key: string]: string | number | boolean | Timestamp;
|
|
@@ -1122,6 +1139,9 @@ export interface ActivityChange {
|
|
|
1122
1139
|
before?: any;
|
|
1123
1140
|
after?: any;
|
|
1124
1141
|
}
|
|
1142
|
+
export type ReadOptions = {
|
|
1143
|
+
at?: string;
|
|
1144
|
+
};
|
|
1125
1145
|
export interface ActivityLog {
|
|
1126
1146
|
id: string;
|
|
1127
1147
|
firstEventAt: Timestamp;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the bottom barcode on a UK cattle passport.
|
|
3
|
+
*
|
|
4
|
+
* The barcode is a 30-character fixed-width positional format:
|
|
5
|
+
* [0-13] Eartag — 2 alpha country code + 12 char national ID (space-padded for shorter foreign tags)
|
|
6
|
+
* [14-21] Date of birth — ddMMyyyy
|
|
7
|
+
* [22] Sex — F or M
|
|
8
|
+
* [23-27] Breed code — left-justified, space-padded to 5 chars
|
|
9
|
+
* [28-29] Passport version — 2 digits
|
|
10
|
+
*
|
|
11
|
+
* UK animals fill all 12 digits of the national ID. Imported animals (DE, FR, BE, etc.)
|
|
12
|
+
* have shorter national IDs so the field is right-padded with spaces.
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* UK12345671004215032023MHER 01 ← UK tag, breed HER
|
|
16
|
+
* UK98765430018722112022FLIMX 01 ← UK tag, breed LIMX
|
|
17
|
+
* DE04821 9315614092018FHF 01 ← German import, 10-digit national ID
|
|
18
|
+
* FR72341 6850203052020FHF 01 ← French import, 10-digit national ID
|
|
19
|
+
*/
|
|
20
|
+
export default class CattlePassport {
|
|
21
|
+
static BARCODE_LENGTH: number;
|
|
22
|
+
private _raw;
|
|
23
|
+
private _earTag;
|
|
24
|
+
private _dateOfBirth;
|
|
25
|
+
private _sex;
|
|
26
|
+
private _breed;
|
|
27
|
+
private _passportVersion;
|
|
28
|
+
private constructor();
|
|
29
|
+
static parse(code: string): CattlePassport | null;
|
|
30
|
+
/** The original raw barcode string */
|
|
31
|
+
get raw(): string;
|
|
32
|
+
/** The eartag extracted from the barcode, e.g. "UK705946601313" or "DE0359581730" */
|
|
33
|
+
get earTag(): string;
|
|
34
|
+
/** Date of birth (UTC) */
|
|
35
|
+
get dateOfBirth(): Date;
|
|
36
|
+
/** Male or Female */
|
|
37
|
+
get sex(): "Male" | "Female";
|
|
38
|
+
/** Breed code, e.g. "AA", "HF", "LIMX" */
|
|
39
|
+
get breed(): string;
|
|
40
|
+
/** Passport version number */
|
|
41
|
+
get passportVersion(): number;
|
|
42
|
+
/** 2-letter country code, e.g. "UK", "DE", "FR" */
|
|
43
|
+
get countryCode(): string;
|
|
44
|
+
/** Format the eartag via the EarTag class. Falls back to the raw tag string. */
|
|
45
|
+
get formattedEarTag(): string;
|
|
46
|
+
/** Date of birth as DD/MM/YYYY */
|
|
47
|
+
get formattedDateOfBirth(): string;
|
|
48
|
+
toString(): string;
|
|
49
|
+
}
|