@deepintel-ltd/farmpro-contracts 1.15.3 → 1.15.5
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/routes/commodity-deals.routes.d.ts +632 -6
- package/dist/routes/commodity-deals.routes.d.ts.map +1 -1
- package/dist/routes/commodity-deals.routes.js +17 -1
- package/dist/schemas/commodity-deals.schemas.d.ts +776 -8
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.js +73 -0
- package/package.json +1 -1
|
@@ -122,6 +122,8 @@ export declare const commodityDealAttributesSchema: z.ZodObject<{
|
|
|
122
122
|
email?: string | undefined;
|
|
123
123
|
name?: string | undefined;
|
|
124
124
|
}>, "many">>;
|
|
125
|
+
/** When staff commission was marked paid out to staff (null = unpaid / N/A). */
|
|
126
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
127
|
computed: z.ZodObject<{
|
|
126
128
|
totalCost: z.ZodNumber;
|
|
127
129
|
saleAmount: z.ZodNullable<z.ZodNumber>;
|
|
@@ -225,6 +227,7 @@ export declare const commodityDealAttributesSchema: z.ZodObject<{
|
|
|
225
227
|
email?: string | undefined;
|
|
226
228
|
name?: string | undefined;
|
|
227
229
|
}[] | undefined;
|
|
230
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
228
231
|
}, {
|
|
229
232
|
status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
|
|
230
233
|
createdAt: string;
|
|
@@ -272,6 +275,7 @@ export declare const commodityDealAttributesSchema: z.ZodObject<{
|
|
|
272
275
|
email?: string | undefined;
|
|
273
276
|
name?: string | undefined;
|
|
274
277
|
}[] | undefined;
|
|
278
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
275
279
|
}>;
|
|
276
280
|
export declare const createCommodityDealAttributesSchema: z.ZodObject<{
|
|
277
281
|
waybillId: z.ZodString;
|
|
@@ -322,6 +326,8 @@ export declare const updateCommodityDealAttributesSchema: z.ZodObject<{
|
|
|
322
326
|
dealCapital: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
323
327
|
companyFeeMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percent_of_invoice", "per_kg"]>>>;
|
|
324
328
|
companyFeeValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
329
|
+
/** Set ISO datetime to mark paid out; null to mark unpaid. */
|
|
330
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
331
|
}, "strip", z.ZodTypeAny, {
|
|
326
332
|
status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
|
|
327
333
|
currency?: string | undefined;
|
|
@@ -334,6 +340,7 @@ export declare const updateCommodityDealAttributesSchema: z.ZodObject<{
|
|
|
334
340
|
dealCapital?: number | null | undefined;
|
|
335
341
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
336
342
|
companyFeeValue?: number | null | undefined;
|
|
343
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
337
344
|
}, {
|
|
338
345
|
status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
|
|
339
346
|
currency?: string | undefined;
|
|
@@ -346,6 +353,7 @@ export declare const updateCommodityDealAttributesSchema: z.ZodObject<{
|
|
|
346
353
|
dealCapital?: number | null | undefined;
|
|
347
354
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
348
355
|
companyFeeValue?: number | null | undefined;
|
|
356
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
349
357
|
}>;
|
|
350
358
|
export declare const createCommodityDealSchema: z.ZodObject<{
|
|
351
359
|
type: z.ZodLiteral<"commodity-deals">;
|
|
@@ -432,6 +440,8 @@ export declare const updateCommodityDealSchema: z.ZodObject<{
|
|
|
432
440
|
dealCapital: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
433
441
|
companyFeeMode: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percent_of_invoice", "per_kg"]>>>;
|
|
434
442
|
companyFeeValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
443
|
+
/** Set ISO datetime to mark paid out; null to mark unpaid. */
|
|
444
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
435
445
|
}, "strip", z.ZodTypeAny, {
|
|
436
446
|
status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
|
|
437
447
|
currency?: string | undefined;
|
|
@@ -444,6 +454,7 @@ export declare const updateCommodityDealSchema: z.ZodObject<{
|
|
|
444
454
|
dealCapital?: number | null | undefined;
|
|
445
455
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
446
456
|
companyFeeValue?: number | null | undefined;
|
|
457
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
447
458
|
}, {
|
|
448
459
|
status?: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced" | undefined;
|
|
449
460
|
currency?: string | undefined;
|
|
@@ -456,6 +467,7 @@ export declare const updateCommodityDealSchema: z.ZodObject<{
|
|
|
456
467
|
dealCapital?: number | null | undefined;
|
|
457
468
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
458
469
|
companyFeeValue?: number | null | undefined;
|
|
470
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
459
471
|
}>;
|
|
460
472
|
}, "strip", z.ZodTypeAny, {
|
|
461
473
|
type: "commodity-deals";
|
|
@@ -471,6 +483,7 @@ export declare const updateCommodityDealSchema: z.ZodObject<{
|
|
|
471
483
|
dealCapital?: number | null | undefined;
|
|
472
484
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
473
485
|
companyFeeValue?: number | null | undefined;
|
|
486
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
474
487
|
};
|
|
475
488
|
id?: string | undefined;
|
|
476
489
|
}, {
|
|
@@ -487,6 +500,7 @@ export declare const updateCommodityDealSchema: z.ZodObject<{
|
|
|
487
500
|
dealCapital?: number | null | undefined;
|
|
488
501
|
companyFeeMode?: "percent_of_invoice" | "per_kg" | null | undefined;
|
|
489
502
|
companyFeeValue?: number | null | undefined;
|
|
503
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
490
504
|
};
|
|
491
505
|
id?: string | undefined;
|
|
492
506
|
}>;
|
|
@@ -601,6 +615,8 @@ export declare const commodityDealResourceSchema: z.ZodObject<{
|
|
|
601
615
|
email?: string | undefined;
|
|
602
616
|
name?: string | undefined;
|
|
603
617
|
}>, "many">>;
|
|
618
|
+
/** When staff commission was marked paid out to staff (null = unpaid / N/A). */
|
|
619
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
604
620
|
computed: z.ZodObject<{
|
|
605
621
|
totalCost: z.ZodNumber;
|
|
606
622
|
saleAmount: z.ZodNullable<z.ZodNumber>;
|
|
@@ -704,6 +720,7 @@ export declare const commodityDealResourceSchema: z.ZodObject<{
|
|
|
704
720
|
email?: string | undefined;
|
|
705
721
|
name?: string | undefined;
|
|
706
722
|
}[] | undefined;
|
|
723
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
707
724
|
}, {
|
|
708
725
|
status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
|
|
709
726
|
createdAt: string;
|
|
@@ -751,6 +768,7 @@ export declare const commodityDealResourceSchema: z.ZodObject<{
|
|
|
751
768
|
email?: string | undefined;
|
|
752
769
|
name?: string | undefined;
|
|
753
770
|
}[] | undefined;
|
|
771
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
754
772
|
}>;
|
|
755
773
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
756
774
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -805,6 +823,7 @@ export declare const commodityDealResourceSchema: z.ZodObject<{
|
|
|
805
823
|
email?: string | undefined;
|
|
806
824
|
name?: string | undefined;
|
|
807
825
|
}[] | undefined;
|
|
826
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
808
827
|
};
|
|
809
828
|
relationships?: Record<string, unknown> | undefined;
|
|
810
829
|
links?: Record<string, string> | undefined;
|
|
@@ -859,6 +878,7 @@ export declare const commodityDealResourceSchema: z.ZodObject<{
|
|
|
859
878
|
email?: string | undefined;
|
|
860
879
|
name?: string | undefined;
|
|
861
880
|
}[] | undefined;
|
|
881
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
862
882
|
};
|
|
863
883
|
relationships?: Record<string, unknown> | undefined;
|
|
864
884
|
links?: Record<string, string> | undefined;
|
|
@@ -911,6 +931,8 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
911
931
|
email?: string | undefined;
|
|
912
932
|
name?: string | undefined;
|
|
913
933
|
}>, "many">>;
|
|
934
|
+
/** When staff commission was marked paid out to staff (null = unpaid / N/A). */
|
|
935
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
914
936
|
computed: z.ZodObject<{
|
|
915
937
|
totalCost: z.ZodNumber;
|
|
916
938
|
saleAmount: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1014,6 +1036,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1014
1036
|
email?: string | undefined;
|
|
1015
1037
|
name?: string | undefined;
|
|
1016
1038
|
}[] | undefined;
|
|
1039
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1017
1040
|
}, {
|
|
1018
1041
|
status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
|
|
1019
1042
|
createdAt: string;
|
|
@@ -1061,6 +1084,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1061
1084
|
email?: string | undefined;
|
|
1062
1085
|
name?: string | undefined;
|
|
1063
1086
|
}[] | undefined;
|
|
1087
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1064
1088
|
}>;
|
|
1065
1089
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1066
1090
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -1115,6 +1139,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1115
1139
|
email?: string | undefined;
|
|
1116
1140
|
name?: string | undefined;
|
|
1117
1141
|
}[] | undefined;
|
|
1142
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1118
1143
|
};
|
|
1119
1144
|
relationships?: Record<string, unknown> | undefined;
|
|
1120
1145
|
links?: Record<string, string> | undefined;
|
|
@@ -1169,6 +1194,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1169
1194
|
email?: string | undefined;
|
|
1170
1195
|
name?: string | undefined;
|
|
1171
1196
|
}[] | undefined;
|
|
1197
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1172
1198
|
};
|
|
1173
1199
|
relationships?: Record<string, unknown> | undefined;
|
|
1174
1200
|
links?: Record<string, string> | undefined;
|
|
@@ -1249,6 +1275,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1249
1275
|
email?: string | undefined;
|
|
1250
1276
|
name?: string | undefined;
|
|
1251
1277
|
}[] | undefined;
|
|
1278
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1252
1279
|
};
|
|
1253
1280
|
relationships?: Record<string, unknown> | undefined;
|
|
1254
1281
|
links?: Record<string, string> | undefined;
|
|
@@ -1315,6 +1342,7 @@ export declare const commodityDealResponseSchema: z.ZodObject<{
|
|
|
1315
1342
|
email?: string | undefined;
|
|
1316
1343
|
name?: string | undefined;
|
|
1317
1344
|
}[] | undefined;
|
|
1345
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1318
1346
|
};
|
|
1319
1347
|
relationships?: Record<string, unknown> | undefined;
|
|
1320
1348
|
links?: Record<string, string> | undefined;
|
|
@@ -1378,6 +1406,8 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1378
1406
|
email?: string | undefined;
|
|
1379
1407
|
name?: string | undefined;
|
|
1380
1408
|
}>, "many">>;
|
|
1409
|
+
/** When staff commission was marked paid out to staff (null = unpaid / N/A). */
|
|
1410
|
+
staffCommissionPaidAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1381
1411
|
computed: z.ZodObject<{
|
|
1382
1412
|
totalCost: z.ZodNumber;
|
|
1383
1413
|
saleAmount: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1481,6 +1511,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1481
1511
|
email?: string | undefined;
|
|
1482
1512
|
name?: string | undefined;
|
|
1483
1513
|
}[] | undefined;
|
|
1514
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1484
1515
|
}, {
|
|
1485
1516
|
status: "cancelled" | "paid" | "draft" | "in_transit" | "invoiced";
|
|
1486
1517
|
createdAt: string;
|
|
@@ -1528,6 +1559,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1528
1559
|
email?: string | undefined;
|
|
1529
1560
|
name?: string | undefined;
|
|
1530
1561
|
}[] | undefined;
|
|
1562
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1531
1563
|
}>;
|
|
1532
1564
|
relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1533
1565
|
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -1582,6 +1614,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1582
1614
|
email?: string | undefined;
|
|
1583
1615
|
name?: string | undefined;
|
|
1584
1616
|
}[] | undefined;
|
|
1617
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1585
1618
|
};
|
|
1586
1619
|
relationships?: Record<string, unknown> | undefined;
|
|
1587
1620
|
links?: Record<string, string> | undefined;
|
|
@@ -1636,6 +1669,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1636
1669
|
email?: string | undefined;
|
|
1637
1670
|
name?: string | undefined;
|
|
1638
1671
|
}[] | undefined;
|
|
1672
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1639
1673
|
};
|
|
1640
1674
|
relationships?: Record<string, unknown> | undefined;
|
|
1641
1675
|
links?: Record<string, string> | undefined;
|
|
@@ -1716,6 +1750,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1716
1750
|
email?: string | undefined;
|
|
1717
1751
|
name?: string | undefined;
|
|
1718
1752
|
}[] | undefined;
|
|
1753
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1719
1754
|
};
|
|
1720
1755
|
relationships?: Record<string, unknown> | undefined;
|
|
1721
1756
|
links?: Record<string, string> | undefined;
|
|
@@ -1782,6 +1817,7 @@ export declare const commodityDealListResponseSchema: z.ZodObject<{
|
|
|
1782
1817
|
email?: string | undefined;
|
|
1783
1818
|
name?: string | undefined;
|
|
1784
1819
|
}[] | undefined;
|
|
1820
|
+
staffCommissionPaidAt?: string | null | undefined;
|
|
1785
1821
|
};
|
|
1786
1822
|
relationships?: Record<string, unknown> | undefined;
|
|
1787
1823
|
links?: Record<string, string> | undefined;
|
|
@@ -1805,6 +1841,12 @@ export declare const commodityDealSummarySchema: z.ZodObject<{
|
|
|
1805
1841
|
totalCostsOnPaidDeals: z.ZodNumber;
|
|
1806
1842
|
grossProfitOnPaidDeals: z.ZodNumber;
|
|
1807
1843
|
totalCommissionOnPaidDeals: z.ZodNumber;
|
|
1844
|
+
/** Accrued staff commission on paid deals that has been marked paid out. */
|
|
1845
|
+
totalStaffCommissionPaidOut: z.ZodOptional<z.ZodNumber>;
|
|
1846
|
+
/** Accrued staff commission on paid deals still unpaid to staff. */
|
|
1847
|
+
totalStaffCommissionUnpaid: z.ZodOptional<z.ZodNumber>;
|
|
1848
|
+
/** True when org staff commission rate is set and > 0. */
|
|
1849
|
+
staffCommissionsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1808
1850
|
companyNetOnPaidDeals: z.ZodNumber;
|
|
1809
1851
|
totalCompanyCommissionOnPaidDeals: z.ZodOptional<z.ZodNumber>;
|
|
1810
1852
|
totalInvestorPoolOnPaidDeals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1820,6 +1862,9 @@ export declare const commodityDealSummarySchema: z.ZodObject<{
|
|
|
1820
1862
|
totalCommissionOnPaidDeals: number;
|
|
1821
1863
|
companyNetOnPaidDeals: number;
|
|
1822
1864
|
unrealizedGrossProfit: number;
|
|
1865
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1866
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1867
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1823
1868
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1824
1869
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1825
1870
|
}, {
|
|
@@ -1832,6 +1877,9 @@ export declare const commodityDealSummarySchema: z.ZodObject<{
|
|
|
1832
1877
|
companyNetOnPaidDeals: number;
|
|
1833
1878
|
unrealizedGrossProfit: number;
|
|
1834
1879
|
currency?: string | undefined;
|
|
1880
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1881
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1882
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1835
1883
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1836
1884
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1837
1885
|
}>;
|
|
@@ -1843,6 +1891,12 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1843
1891
|
totalCostsOnPaidDeals: z.ZodNumber;
|
|
1844
1892
|
grossProfitOnPaidDeals: z.ZodNumber;
|
|
1845
1893
|
totalCommissionOnPaidDeals: z.ZodNumber;
|
|
1894
|
+
/** Accrued staff commission on paid deals that has been marked paid out. */
|
|
1895
|
+
totalStaffCommissionPaidOut: z.ZodOptional<z.ZodNumber>;
|
|
1896
|
+
/** Accrued staff commission on paid deals still unpaid to staff. */
|
|
1897
|
+
totalStaffCommissionUnpaid: z.ZodOptional<z.ZodNumber>;
|
|
1898
|
+
/** True when org staff commission rate is set and > 0. */
|
|
1899
|
+
staffCommissionsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
1846
1900
|
companyNetOnPaidDeals: z.ZodNumber;
|
|
1847
1901
|
totalCompanyCommissionOnPaidDeals: z.ZodOptional<z.ZodNumber>;
|
|
1848
1902
|
totalInvestorPoolOnPaidDeals: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1858,6 +1912,9 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1858
1912
|
totalCommissionOnPaidDeals: number;
|
|
1859
1913
|
companyNetOnPaidDeals: number;
|
|
1860
1914
|
unrealizedGrossProfit: number;
|
|
1915
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1916
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1917
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1861
1918
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1862
1919
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1863
1920
|
}, {
|
|
@@ -1870,6 +1927,9 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1870
1927
|
companyNetOnPaidDeals: number;
|
|
1871
1928
|
unrealizedGrossProfit: number;
|
|
1872
1929
|
currency?: string | undefined;
|
|
1930
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1931
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1932
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1873
1933
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1874
1934
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1875
1935
|
}>;
|
|
@@ -1884,6 +1944,9 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1884
1944
|
totalCommissionOnPaidDeals: number;
|
|
1885
1945
|
companyNetOnPaidDeals: number;
|
|
1886
1946
|
unrealizedGrossProfit: number;
|
|
1947
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1948
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1949
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1887
1950
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1888
1951
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1889
1952
|
};
|
|
@@ -1898,10 +1961,711 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1898
1961
|
companyNetOnPaidDeals: number;
|
|
1899
1962
|
unrealizedGrossProfit: number;
|
|
1900
1963
|
currency?: string | undefined;
|
|
1964
|
+
totalStaffCommissionPaidOut?: number | undefined;
|
|
1965
|
+
totalStaffCommissionUnpaid?: number | undefined;
|
|
1966
|
+
staffCommissionsEnabled?: boolean | undefined;
|
|
1901
1967
|
totalCompanyCommissionOnPaidDeals?: number | undefined;
|
|
1902
1968
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1903
1969
|
};
|
|
1904
1970
|
}>;
|
|
1971
|
+
export declare const commodityDealInsightsPeriodSchema: z.ZodEnum<["this_month", "last_3_months", "ytd", "all"]>;
|
|
1972
|
+
export declare const commodityDealInsightsTotalsSchema: z.ZodObject<{
|
|
1973
|
+
paidDealCount: z.ZodNumber;
|
|
1974
|
+
paidRevenue: z.ZodNumber;
|
|
1975
|
+
totalCost: z.ZodNumber;
|
|
1976
|
+
grossProfit: z.ZodNumber;
|
|
1977
|
+
companyKeep: z.ZodNumber;
|
|
1978
|
+
investorPool: z.ZodNumber;
|
|
1979
|
+
staffCommission: z.ZodNumber;
|
|
1980
|
+
/** Gross / revenue * 100 when revenue > 0; otherwise null. */
|
|
1981
|
+
avgMarginPct: z.ZodNullable<z.ZodNumber>;
|
|
1982
|
+
}, "strip", z.ZodTypeAny, {
|
|
1983
|
+
totalCost: number;
|
|
1984
|
+
grossProfit: number;
|
|
1985
|
+
investorPool: number;
|
|
1986
|
+
paidDealCount: number;
|
|
1987
|
+
paidRevenue: number;
|
|
1988
|
+
companyKeep: number;
|
|
1989
|
+
staffCommission: number;
|
|
1990
|
+
avgMarginPct: number | null;
|
|
1991
|
+
}, {
|
|
1992
|
+
totalCost: number;
|
|
1993
|
+
grossProfit: number;
|
|
1994
|
+
investorPool: number;
|
|
1995
|
+
paidDealCount: number;
|
|
1996
|
+
paidRevenue: number;
|
|
1997
|
+
companyKeep: number;
|
|
1998
|
+
staffCommission: number;
|
|
1999
|
+
avgMarginPct: number | null;
|
|
2000
|
+
}>;
|
|
2001
|
+
export declare const commodityDealInsightsMonthlySchema: z.ZodObject<{
|
|
2002
|
+
month: z.ZodString;
|
|
2003
|
+
paidRevenue: z.ZodNumber;
|
|
2004
|
+
companyKeep: z.ZodNumber;
|
|
2005
|
+
grossProfit: z.ZodNumber;
|
|
2006
|
+
dealCount: z.ZodNumber;
|
|
2007
|
+
}, "strip", z.ZodTypeAny, {
|
|
2008
|
+
month: string;
|
|
2009
|
+
grossProfit: number;
|
|
2010
|
+
paidRevenue: number;
|
|
2011
|
+
companyKeep: number;
|
|
2012
|
+
dealCount: number;
|
|
2013
|
+
}, {
|
|
2014
|
+
month: string;
|
|
2015
|
+
grossProfit: number;
|
|
2016
|
+
paidRevenue: number;
|
|
2017
|
+
companyKeep: number;
|
|
2018
|
+
dealCount: number;
|
|
2019
|
+
}>;
|
|
2020
|
+
export declare const commodityDealInsightsBuyerSchema: z.ZodObject<{
|
|
2021
|
+
buyerId: z.ZodString;
|
|
2022
|
+
buyerName: z.ZodString;
|
|
2023
|
+
paidRevenue: z.ZodNumber;
|
|
2024
|
+
companyKeep: z.ZodNumber;
|
|
2025
|
+
dealCount: z.ZodNumber;
|
|
2026
|
+
marginPct: z.ZodNullable<z.ZodNumber>;
|
|
2027
|
+
}, "strip", z.ZodTypeAny, {
|
|
2028
|
+
buyerName: string;
|
|
2029
|
+
buyerId: string;
|
|
2030
|
+
paidRevenue: number;
|
|
2031
|
+
companyKeep: number;
|
|
2032
|
+
dealCount: number;
|
|
2033
|
+
marginPct: number | null;
|
|
2034
|
+
}, {
|
|
2035
|
+
buyerName: string;
|
|
2036
|
+
buyerId: string;
|
|
2037
|
+
paidRevenue: number;
|
|
2038
|
+
companyKeep: number;
|
|
2039
|
+
dealCount: number;
|
|
2040
|
+
marginPct: number | null;
|
|
2041
|
+
}>;
|
|
2042
|
+
export declare const commodityDealInsightsPipelineSchema: z.ZodObject<{
|
|
2043
|
+
invoicedUnpaidCount: z.ZodNumber;
|
|
2044
|
+
overdueCount: z.ZodNumber;
|
|
2045
|
+
unrealizedGrossProfit: z.ZodNumber;
|
|
2046
|
+
unpaidInvoiceTotal: z.ZodNumber;
|
|
2047
|
+
overdueInvoiceTotal: z.ZodNumber;
|
|
2048
|
+
}, "strip", z.ZodTypeAny, {
|
|
2049
|
+
invoicedUnpaidCount: number;
|
|
2050
|
+
unrealizedGrossProfit: number;
|
|
2051
|
+
overdueCount: number;
|
|
2052
|
+
unpaidInvoiceTotal: number;
|
|
2053
|
+
overdueInvoiceTotal: number;
|
|
2054
|
+
}, {
|
|
2055
|
+
invoicedUnpaidCount: number;
|
|
2056
|
+
unrealizedGrossProfit: number;
|
|
2057
|
+
overdueCount: number;
|
|
2058
|
+
unpaidInvoiceTotal: number;
|
|
2059
|
+
overdueInvoiceTotal: number;
|
|
2060
|
+
}>;
|
|
2061
|
+
export declare const commodityDealInsightsSchema: z.ZodObject<{
|
|
2062
|
+
period: z.ZodEnum<["this_month", "last_3_months", "ytd", "all"]>;
|
|
2063
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
2064
|
+
/** Non-cancelled deals in the org (for empty-state branching). */
|
|
2065
|
+
totalDealCount: z.ZodNumber;
|
|
2066
|
+
totals: z.ZodObject<{
|
|
2067
|
+
paidDealCount: z.ZodNumber;
|
|
2068
|
+
paidRevenue: z.ZodNumber;
|
|
2069
|
+
totalCost: z.ZodNumber;
|
|
2070
|
+
grossProfit: z.ZodNumber;
|
|
2071
|
+
companyKeep: z.ZodNumber;
|
|
2072
|
+
investorPool: z.ZodNumber;
|
|
2073
|
+
staffCommission: z.ZodNumber;
|
|
2074
|
+
/** Gross / revenue * 100 when revenue > 0; otherwise null. */
|
|
2075
|
+
avgMarginPct: z.ZodNullable<z.ZodNumber>;
|
|
2076
|
+
}, "strip", z.ZodTypeAny, {
|
|
2077
|
+
totalCost: number;
|
|
2078
|
+
grossProfit: number;
|
|
2079
|
+
investorPool: number;
|
|
2080
|
+
paidDealCount: number;
|
|
2081
|
+
paidRevenue: number;
|
|
2082
|
+
companyKeep: number;
|
|
2083
|
+
staffCommission: number;
|
|
2084
|
+
avgMarginPct: number | null;
|
|
2085
|
+
}, {
|
|
2086
|
+
totalCost: number;
|
|
2087
|
+
grossProfit: number;
|
|
2088
|
+
investorPool: number;
|
|
2089
|
+
paidDealCount: number;
|
|
2090
|
+
paidRevenue: number;
|
|
2091
|
+
companyKeep: number;
|
|
2092
|
+
staffCommission: number;
|
|
2093
|
+
avgMarginPct: number | null;
|
|
2094
|
+
}>;
|
|
2095
|
+
prior: z.ZodNullable<z.ZodObject<{
|
|
2096
|
+
paidDealCount: z.ZodNumber;
|
|
2097
|
+
paidRevenue: z.ZodNumber;
|
|
2098
|
+
totalCost: z.ZodNumber;
|
|
2099
|
+
grossProfit: z.ZodNumber;
|
|
2100
|
+
companyKeep: z.ZodNumber;
|
|
2101
|
+
investorPool: z.ZodNumber;
|
|
2102
|
+
staffCommission: z.ZodNumber;
|
|
2103
|
+
/** Gross / revenue * 100 when revenue > 0; otherwise null. */
|
|
2104
|
+
avgMarginPct: z.ZodNullable<z.ZodNumber>;
|
|
2105
|
+
}, "strip", z.ZodTypeAny, {
|
|
2106
|
+
totalCost: number;
|
|
2107
|
+
grossProfit: number;
|
|
2108
|
+
investorPool: number;
|
|
2109
|
+
paidDealCount: number;
|
|
2110
|
+
paidRevenue: number;
|
|
2111
|
+
companyKeep: number;
|
|
2112
|
+
staffCommission: number;
|
|
2113
|
+
avgMarginPct: number | null;
|
|
2114
|
+
}, {
|
|
2115
|
+
totalCost: number;
|
|
2116
|
+
grossProfit: number;
|
|
2117
|
+
investorPool: number;
|
|
2118
|
+
paidDealCount: number;
|
|
2119
|
+
paidRevenue: number;
|
|
2120
|
+
companyKeep: number;
|
|
2121
|
+
staffCommission: number;
|
|
2122
|
+
avgMarginPct: number | null;
|
|
2123
|
+
}>>;
|
|
2124
|
+
monthly: z.ZodArray<z.ZodObject<{
|
|
2125
|
+
month: z.ZodString;
|
|
2126
|
+
paidRevenue: z.ZodNumber;
|
|
2127
|
+
companyKeep: z.ZodNumber;
|
|
2128
|
+
grossProfit: z.ZodNumber;
|
|
2129
|
+
dealCount: z.ZodNumber;
|
|
2130
|
+
}, "strip", z.ZodTypeAny, {
|
|
2131
|
+
month: string;
|
|
2132
|
+
grossProfit: number;
|
|
2133
|
+
paidRevenue: number;
|
|
2134
|
+
companyKeep: number;
|
|
2135
|
+
dealCount: number;
|
|
2136
|
+
}, {
|
|
2137
|
+
month: string;
|
|
2138
|
+
grossProfit: number;
|
|
2139
|
+
paidRevenue: number;
|
|
2140
|
+
companyKeep: number;
|
|
2141
|
+
dealCount: number;
|
|
2142
|
+
}>, "many">;
|
|
2143
|
+
profitSplit: z.ZodObject<{
|
|
2144
|
+
companyKeep: z.ZodNumber;
|
|
2145
|
+
investorPool: z.ZodNumber;
|
|
2146
|
+
staffCommission: z.ZodNumber;
|
|
2147
|
+
}, "strip", z.ZodTypeAny, {
|
|
2148
|
+
investorPool: number;
|
|
2149
|
+
companyKeep: number;
|
|
2150
|
+
staffCommission: number;
|
|
2151
|
+
}, {
|
|
2152
|
+
investorPool: number;
|
|
2153
|
+
companyKeep: number;
|
|
2154
|
+
staffCommission: number;
|
|
2155
|
+
}>;
|
|
2156
|
+
byBuyer: z.ZodArray<z.ZodObject<{
|
|
2157
|
+
buyerId: z.ZodString;
|
|
2158
|
+
buyerName: z.ZodString;
|
|
2159
|
+
paidRevenue: z.ZodNumber;
|
|
2160
|
+
companyKeep: z.ZodNumber;
|
|
2161
|
+
dealCount: z.ZodNumber;
|
|
2162
|
+
marginPct: z.ZodNullable<z.ZodNumber>;
|
|
2163
|
+
}, "strip", z.ZodTypeAny, {
|
|
2164
|
+
buyerName: string;
|
|
2165
|
+
buyerId: string;
|
|
2166
|
+
paidRevenue: number;
|
|
2167
|
+
companyKeep: number;
|
|
2168
|
+
dealCount: number;
|
|
2169
|
+
marginPct: number | null;
|
|
2170
|
+
}, {
|
|
2171
|
+
buyerName: string;
|
|
2172
|
+
buyerId: string;
|
|
2173
|
+
paidRevenue: number;
|
|
2174
|
+
companyKeep: number;
|
|
2175
|
+
dealCount: number;
|
|
2176
|
+
marginPct: number | null;
|
|
2177
|
+
}>, "many">;
|
|
2178
|
+
/** Current open pipeline — not filtered by `period`. */
|
|
2179
|
+
pipeline: z.ZodObject<{
|
|
2180
|
+
invoicedUnpaidCount: z.ZodNumber;
|
|
2181
|
+
overdueCount: z.ZodNumber;
|
|
2182
|
+
unrealizedGrossProfit: z.ZodNumber;
|
|
2183
|
+
unpaidInvoiceTotal: z.ZodNumber;
|
|
2184
|
+
overdueInvoiceTotal: z.ZodNumber;
|
|
2185
|
+
}, "strip", z.ZodTypeAny, {
|
|
2186
|
+
invoicedUnpaidCount: number;
|
|
2187
|
+
unrealizedGrossProfit: number;
|
|
2188
|
+
overdueCount: number;
|
|
2189
|
+
unpaidInvoiceTotal: number;
|
|
2190
|
+
overdueInvoiceTotal: number;
|
|
2191
|
+
}, {
|
|
2192
|
+
invoicedUnpaidCount: number;
|
|
2193
|
+
unrealizedGrossProfit: number;
|
|
2194
|
+
overdueCount: number;
|
|
2195
|
+
unpaidInvoiceTotal: number;
|
|
2196
|
+
overdueInvoiceTotal: number;
|
|
2197
|
+
}>;
|
|
2198
|
+
/** Accrued staff commission on paid deals still unpaid to staff (current, not period-filtered). */
|
|
2199
|
+
staffCommissionUnpaid: z.ZodNumber;
|
|
2200
|
+
/** Derived the same way as summary: org rate > 0 or paid deals accrued commission. */
|
|
2201
|
+
staffCommissionsEnabled: z.ZodBoolean;
|
|
2202
|
+
}, "strip", z.ZodTypeAny, {
|
|
2203
|
+
currency: string;
|
|
2204
|
+
monthly: {
|
|
2205
|
+
month: string;
|
|
2206
|
+
grossProfit: number;
|
|
2207
|
+
paidRevenue: number;
|
|
2208
|
+
companyKeep: number;
|
|
2209
|
+
dealCount: number;
|
|
2210
|
+
}[];
|
|
2211
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2212
|
+
staffCommissionsEnabled: boolean;
|
|
2213
|
+
totalDealCount: number;
|
|
2214
|
+
totals: {
|
|
2215
|
+
totalCost: number;
|
|
2216
|
+
grossProfit: number;
|
|
2217
|
+
investorPool: number;
|
|
2218
|
+
paidDealCount: number;
|
|
2219
|
+
paidRevenue: number;
|
|
2220
|
+
companyKeep: number;
|
|
2221
|
+
staffCommission: number;
|
|
2222
|
+
avgMarginPct: number | null;
|
|
2223
|
+
};
|
|
2224
|
+
prior: {
|
|
2225
|
+
totalCost: number;
|
|
2226
|
+
grossProfit: number;
|
|
2227
|
+
investorPool: number;
|
|
2228
|
+
paidDealCount: number;
|
|
2229
|
+
paidRevenue: number;
|
|
2230
|
+
companyKeep: number;
|
|
2231
|
+
staffCommission: number;
|
|
2232
|
+
avgMarginPct: number | null;
|
|
2233
|
+
} | null;
|
|
2234
|
+
profitSplit: {
|
|
2235
|
+
investorPool: number;
|
|
2236
|
+
companyKeep: number;
|
|
2237
|
+
staffCommission: number;
|
|
2238
|
+
};
|
|
2239
|
+
byBuyer: {
|
|
2240
|
+
buyerName: string;
|
|
2241
|
+
buyerId: string;
|
|
2242
|
+
paidRevenue: number;
|
|
2243
|
+
companyKeep: number;
|
|
2244
|
+
dealCount: number;
|
|
2245
|
+
marginPct: number | null;
|
|
2246
|
+
}[];
|
|
2247
|
+
pipeline: {
|
|
2248
|
+
invoicedUnpaidCount: number;
|
|
2249
|
+
unrealizedGrossProfit: number;
|
|
2250
|
+
overdueCount: number;
|
|
2251
|
+
unpaidInvoiceTotal: number;
|
|
2252
|
+
overdueInvoiceTotal: number;
|
|
2253
|
+
};
|
|
2254
|
+
staffCommissionUnpaid: number;
|
|
2255
|
+
}, {
|
|
2256
|
+
monthly: {
|
|
2257
|
+
month: string;
|
|
2258
|
+
grossProfit: number;
|
|
2259
|
+
paidRevenue: number;
|
|
2260
|
+
companyKeep: number;
|
|
2261
|
+
dealCount: number;
|
|
2262
|
+
}[];
|
|
2263
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2264
|
+
staffCommissionsEnabled: boolean;
|
|
2265
|
+
totalDealCount: number;
|
|
2266
|
+
totals: {
|
|
2267
|
+
totalCost: number;
|
|
2268
|
+
grossProfit: number;
|
|
2269
|
+
investorPool: number;
|
|
2270
|
+
paidDealCount: number;
|
|
2271
|
+
paidRevenue: number;
|
|
2272
|
+
companyKeep: number;
|
|
2273
|
+
staffCommission: number;
|
|
2274
|
+
avgMarginPct: number | null;
|
|
2275
|
+
};
|
|
2276
|
+
prior: {
|
|
2277
|
+
totalCost: number;
|
|
2278
|
+
grossProfit: number;
|
|
2279
|
+
investorPool: number;
|
|
2280
|
+
paidDealCount: number;
|
|
2281
|
+
paidRevenue: number;
|
|
2282
|
+
companyKeep: number;
|
|
2283
|
+
staffCommission: number;
|
|
2284
|
+
avgMarginPct: number | null;
|
|
2285
|
+
} | null;
|
|
2286
|
+
profitSplit: {
|
|
2287
|
+
investorPool: number;
|
|
2288
|
+
companyKeep: number;
|
|
2289
|
+
staffCommission: number;
|
|
2290
|
+
};
|
|
2291
|
+
byBuyer: {
|
|
2292
|
+
buyerName: string;
|
|
2293
|
+
buyerId: string;
|
|
2294
|
+
paidRevenue: number;
|
|
2295
|
+
companyKeep: number;
|
|
2296
|
+
dealCount: number;
|
|
2297
|
+
marginPct: number | null;
|
|
2298
|
+
}[];
|
|
2299
|
+
pipeline: {
|
|
2300
|
+
invoicedUnpaidCount: number;
|
|
2301
|
+
unrealizedGrossProfit: number;
|
|
2302
|
+
overdueCount: number;
|
|
2303
|
+
unpaidInvoiceTotal: number;
|
|
2304
|
+
overdueInvoiceTotal: number;
|
|
2305
|
+
};
|
|
2306
|
+
staffCommissionUnpaid: number;
|
|
2307
|
+
currency?: string | undefined;
|
|
2308
|
+
}>;
|
|
2309
|
+
export declare const commodityDealInsightsResponseSchema: z.ZodObject<{
|
|
2310
|
+
data: z.ZodObject<{
|
|
2311
|
+
period: z.ZodEnum<["this_month", "last_3_months", "ytd", "all"]>;
|
|
2312
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
2313
|
+
/** Non-cancelled deals in the org (for empty-state branching). */
|
|
2314
|
+
totalDealCount: z.ZodNumber;
|
|
2315
|
+
totals: z.ZodObject<{
|
|
2316
|
+
paidDealCount: z.ZodNumber;
|
|
2317
|
+
paidRevenue: z.ZodNumber;
|
|
2318
|
+
totalCost: z.ZodNumber;
|
|
2319
|
+
grossProfit: z.ZodNumber;
|
|
2320
|
+
companyKeep: z.ZodNumber;
|
|
2321
|
+
investorPool: z.ZodNumber;
|
|
2322
|
+
staffCommission: z.ZodNumber;
|
|
2323
|
+
/** Gross / revenue * 100 when revenue > 0; otherwise null. */
|
|
2324
|
+
avgMarginPct: z.ZodNullable<z.ZodNumber>;
|
|
2325
|
+
}, "strip", z.ZodTypeAny, {
|
|
2326
|
+
totalCost: number;
|
|
2327
|
+
grossProfit: number;
|
|
2328
|
+
investorPool: number;
|
|
2329
|
+
paidDealCount: number;
|
|
2330
|
+
paidRevenue: number;
|
|
2331
|
+
companyKeep: number;
|
|
2332
|
+
staffCommission: number;
|
|
2333
|
+
avgMarginPct: number | null;
|
|
2334
|
+
}, {
|
|
2335
|
+
totalCost: number;
|
|
2336
|
+
grossProfit: number;
|
|
2337
|
+
investorPool: number;
|
|
2338
|
+
paidDealCount: number;
|
|
2339
|
+
paidRevenue: number;
|
|
2340
|
+
companyKeep: number;
|
|
2341
|
+
staffCommission: number;
|
|
2342
|
+
avgMarginPct: number | null;
|
|
2343
|
+
}>;
|
|
2344
|
+
prior: z.ZodNullable<z.ZodObject<{
|
|
2345
|
+
paidDealCount: z.ZodNumber;
|
|
2346
|
+
paidRevenue: z.ZodNumber;
|
|
2347
|
+
totalCost: z.ZodNumber;
|
|
2348
|
+
grossProfit: z.ZodNumber;
|
|
2349
|
+
companyKeep: z.ZodNumber;
|
|
2350
|
+
investorPool: z.ZodNumber;
|
|
2351
|
+
staffCommission: z.ZodNumber;
|
|
2352
|
+
/** Gross / revenue * 100 when revenue > 0; otherwise null. */
|
|
2353
|
+
avgMarginPct: z.ZodNullable<z.ZodNumber>;
|
|
2354
|
+
}, "strip", z.ZodTypeAny, {
|
|
2355
|
+
totalCost: number;
|
|
2356
|
+
grossProfit: number;
|
|
2357
|
+
investorPool: number;
|
|
2358
|
+
paidDealCount: number;
|
|
2359
|
+
paidRevenue: number;
|
|
2360
|
+
companyKeep: number;
|
|
2361
|
+
staffCommission: number;
|
|
2362
|
+
avgMarginPct: number | null;
|
|
2363
|
+
}, {
|
|
2364
|
+
totalCost: number;
|
|
2365
|
+
grossProfit: number;
|
|
2366
|
+
investorPool: number;
|
|
2367
|
+
paidDealCount: number;
|
|
2368
|
+
paidRevenue: number;
|
|
2369
|
+
companyKeep: number;
|
|
2370
|
+
staffCommission: number;
|
|
2371
|
+
avgMarginPct: number | null;
|
|
2372
|
+
}>>;
|
|
2373
|
+
monthly: z.ZodArray<z.ZodObject<{
|
|
2374
|
+
month: z.ZodString;
|
|
2375
|
+
paidRevenue: z.ZodNumber;
|
|
2376
|
+
companyKeep: z.ZodNumber;
|
|
2377
|
+
grossProfit: z.ZodNumber;
|
|
2378
|
+
dealCount: z.ZodNumber;
|
|
2379
|
+
}, "strip", z.ZodTypeAny, {
|
|
2380
|
+
month: string;
|
|
2381
|
+
grossProfit: number;
|
|
2382
|
+
paidRevenue: number;
|
|
2383
|
+
companyKeep: number;
|
|
2384
|
+
dealCount: number;
|
|
2385
|
+
}, {
|
|
2386
|
+
month: string;
|
|
2387
|
+
grossProfit: number;
|
|
2388
|
+
paidRevenue: number;
|
|
2389
|
+
companyKeep: number;
|
|
2390
|
+
dealCount: number;
|
|
2391
|
+
}>, "many">;
|
|
2392
|
+
profitSplit: z.ZodObject<{
|
|
2393
|
+
companyKeep: z.ZodNumber;
|
|
2394
|
+
investorPool: z.ZodNumber;
|
|
2395
|
+
staffCommission: z.ZodNumber;
|
|
2396
|
+
}, "strip", z.ZodTypeAny, {
|
|
2397
|
+
investorPool: number;
|
|
2398
|
+
companyKeep: number;
|
|
2399
|
+
staffCommission: number;
|
|
2400
|
+
}, {
|
|
2401
|
+
investorPool: number;
|
|
2402
|
+
companyKeep: number;
|
|
2403
|
+
staffCommission: number;
|
|
2404
|
+
}>;
|
|
2405
|
+
byBuyer: z.ZodArray<z.ZodObject<{
|
|
2406
|
+
buyerId: z.ZodString;
|
|
2407
|
+
buyerName: z.ZodString;
|
|
2408
|
+
paidRevenue: z.ZodNumber;
|
|
2409
|
+
companyKeep: z.ZodNumber;
|
|
2410
|
+
dealCount: z.ZodNumber;
|
|
2411
|
+
marginPct: z.ZodNullable<z.ZodNumber>;
|
|
2412
|
+
}, "strip", z.ZodTypeAny, {
|
|
2413
|
+
buyerName: string;
|
|
2414
|
+
buyerId: string;
|
|
2415
|
+
paidRevenue: number;
|
|
2416
|
+
companyKeep: number;
|
|
2417
|
+
dealCount: number;
|
|
2418
|
+
marginPct: number | null;
|
|
2419
|
+
}, {
|
|
2420
|
+
buyerName: string;
|
|
2421
|
+
buyerId: string;
|
|
2422
|
+
paidRevenue: number;
|
|
2423
|
+
companyKeep: number;
|
|
2424
|
+
dealCount: number;
|
|
2425
|
+
marginPct: number | null;
|
|
2426
|
+
}>, "many">;
|
|
2427
|
+
/** Current open pipeline — not filtered by `period`. */
|
|
2428
|
+
pipeline: z.ZodObject<{
|
|
2429
|
+
invoicedUnpaidCount: z.ZodNumber;
|
|
2430
|
+
overdueCount: z.ZodNumber;
|
|
2431
|
+
unrealizedGrossProfit: z.ZodNumber;
|
|
2432
|
+
unpaidInvoiceTotal: z.ZodNumber;
|
|
2433
|
+
overdueInvoiceTotal: z.ZodNumber;
|
|
2434
|
+
}, "strip", z.ZodTypeAny, {
|
|
2435
|
+
invoicedUnpaidCount: number;
|
|
2436
|
+
unrealizedGrossProfit: number;
|
|
2437
|
+
overdueCount: number;
|
|
2438
|
+
unpaidInvoiceTotal: number;
|
|
2439
|
+
overdueInvoiceTotal: number;
|
|
2440
|
+
}, {
|
|
2441
|
+
invoicedUnpaidCount: number;
|
|
2442
|
+
unrealizedGrossProfit: number;
|
|
2443
|
+
overdueCount: number;
|
|
2444
|
+
unpaidInvoiceTotal: number;
|
|
2445
|
+
overdueInvoiceTotal: number;
|
|
2446
|
+
}>;
|
|
2447
|
+
/** Accrued staff commission on paid deals still unpaid to staff (current, not period-filtered). */
|
|
2448
|
+
staffCommissionUnpaid: z.ZodNumber;
|
|
2449
|
+
/** Derived the same way as summary: org rate > 0 or paid deals accrued commission. */
|
|
2450
|
+
staffCommissionsEnabled: z.ZodBoolean;
|
|
2451
|
+
}, "strip", z.ZodTypeAny, {
|
|
2452
|
+
currency: string;
|
|
2453
|
+
monthly: {
|
|
2454
|
+
month: string;
|
|
2455
|
+
grossProfit: number;
|
|
2456
|
+
paidRevenue: number;
|
|
2457
|
+
companyKeep: number;
|
|
2458
|
+
dealCount: number;
|
|
2459
|
+
}[];
|
|
2460
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2461
|
+
staffCommissionsEnabled: boolean;
|
|
2462
|
+
totalDealCount: number;
|
|
2463
|
+
totals: {
|
|
2464
|
+
totalCost: number;
|
|
2465
|
+
grossProfit: number;
|
|
2466
|
+
investorPool: number;
|
|
2467
|
+
paidDealCount: number;
|
|
2468
|
+
paidRevenue: number;
|
|
2469
|
+
companyKeep: number;
|
|
2470
|
+
staffCommission: number;
|
|
2471
|
+
avgMarginPct: number | null;
|
|
2472
|
+
};
|
|
2473
|
+
prior: {
|
|
2474
|
+
totalCost: number;
|
|
2475
|
+
grossProfit: number;
|
|
2476
|
+
investorPool: number;
|
|
2477
|
+
paidDealCount: number;
|
|
2478
|
+
paidRevenue: number;
|
|
2479
|
+
companyKeep: number;
|
|
2480
|
+
staffCommission: number;
|
|
2481
|
+
avgMarginPct: number | null;
|
|
2482
|
+
} | null;
|
|
2483
|
+
profitSplit: {
|
|
2484
|
+
investorPool: number;
|
|
2485
|
+
companyKeep: number;
|
|
2486
|
+
staffCommission: number;
|
|
2487
|
+
};
|
|
2488
|
+
byBuyer: {
|
|
2489
|
+
buyerName: string;
|
|
2490
|
+
buyerId: string;
|
|
2491
|
+
paidRevenue: number;
|
|
2492
|
+
companyKeep: number;
|
|
2493
|
+
dealCount: number;
|
|
2494
|
+
marginPct: number | null;
|
|
2495
|
+
}[];
|
|
2496
|
+
pipeline: {
|
|
2497
|
+
invoicedUnpaidCount: number;
|
|
2498
|
+
unrealizedGrossProfit: number;
|
|
2499
|
+
overdueCount: number;
|
|
2500
|
+
unpaidInvoiceTotal: number;
|
|
2501
|
+
overdueInvoiceTotal: number;
|
|
2502
|
+
};
|
|
2503
|
+
staffCommissionUnpaid: number;
|
|
2504
|
+
}, {
|
|
2505
|
+
monthly: {
|
|
2506
|
+
month: string;
|
|
2507
|
+
grossProfit: number;
|
|
2508
|
+
paidRevenue: number;
|
|
2509
|
+
companyKeep: number;
|
|
2510
|
+
dealCount: number;
|
|
2511
|
+
}[];
|
|
2512
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2513
|
+
staffCommissionsEnabled: boolean;
|
|
2514
|
+
totalDealCount: number;
|
|
2515
|
+
totals: {
|
|
2516
|
+
totalCost: number;
|
|
2517
|
+
grossProfit: number;
|
|
2518
|
+
investorPool: number;
|
|
2519
|
+
paidDealCount: number;
|
|
2520
|
+
paidRevenue: number;
|
|
2521
|
+
companyKeep: number;
|
|
2522
|
+
staffCommission: number;
|
|
2523
|
+
avgMarginPct: number | null;
|
|
2524
|
+
};
|
|
2525
|
+
prior: {
|
|
2526
|
+
totalCost: number;
|
|
2527
|
+
grossProfit: number;
|
|
2528
|
+
investorPool: number;
|
|
2529
|
+
paidDealCount: number;
|
|
2530
|
+
paidRevenue: number;
|
|
2531
|
+
companyKeep: number;
|
|
2532
|
+
staffCommission: number;
|
|
2533
|
+
avgMarginPct: number | null;
|
|
2534
|
+
} | null;
|
|
2535
|
+
profitSplit: {
|
|
2536
|
+
investorPool: number;
|
|
2537
|
+
companyKeep: number;
|
|
2538
|
+
staffCommission: number;
|
|
2539
|
+
};
|
|
2540
|
+
byBuyer: {
|
|
2541
|
+
buyerName: string;
|
|
2542
|
+
buyerId: string;
|
|
2543
|
+
paidRevenue: number;
|
|
2544
|
+
companyKeep: number;
|
|
2545
|
+
dealCount: number;
|
|
2546
|
+
marginPct: number | null;
|
|
2547
|
+
}[];
|
|
2548
|
+
pipeline: {
|
|
2549
|
+
invoicedUnpaidCount: number;
|
|
2550
|
+
unrealizedGrossProfit: number;
|
|
2551
|
+
overdueCount: number;
|
|
2552
|
+
unpaidInvoiceTotal: number;
|
|
2553
|
+
overdueInvoiceTotal: number;
|
|
2554
|
+
};
|
|
2555
|
+
staffCommissionUnpaid: number;
|
|
2556
|
+
currency?: string | undefined;
|
|
2557
|
+
}>;
|
|
2558
|
+
}, "strip", z.ZodTypeAny, {
|
|
2559
|
+
data: {
|
|
2560
|
+
currency: string;
|
|
2561
|
+
monthly: {
|
|
2562
|
+
month: string;
|
|
2563
|
+
grossProfit: number;
|
|
2564
|
+
paidRevenue: number;
|
|
2565
|
+
companyKeep: number;
|
|
2566
|
+
dealCount: number;
|
|
2567
|
+
}[];
|
|
2568
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2569
|
+
staffCommissionsEnabled: boolean;
|
|
2570
|
+
totalDealCount: number;
|
|
2571
|
+
totals: {
|
|
2572
|
+
totalCost: number;
|
|
2573
|
+
grossProfit: number;
|
|
2574
|
+
investorPool: number;
|
|
2575
|
+
paidDealCount: number;
|
|
2576
|
+
paidRevenue: number;
|
|
2577
|
+
companyKeep: number;
|
|
2578
|
+
staffCommission: number;
|
|
2579
|
+
avgMarginPct: number | null;
|
|
2580
|
+
};
|
|
2581
|
+
prior: {
|
|
2582
|
+
totalCost: number;
|
|
2583
|
+
grossProfit: number;
|
|
2584
|
+
investorPool: number;
|
|
2585
|
+
paidDealCount: number;
|
|
2586
|
+
paidRevenue: number;
|
|
2587
|
+
companyKeep: number;
|
|
2588
|
+
staffCommission: number;
|
|
2589
|
+
avgMarginPct: number | null;
|
|
2590
|
+
} | null;
|
|
2591
|
+
profitSplit: {
|
|
2592
|
+
investorPool: number;
|
|
2593
|
+
companyKeep: number;
|
|
2594
|
+
staffCommission: number;
|
|
2595
|
+
};
|
|
2596
|
+
byBuyer: {
|
|
2597
|
+
buyerName: string;
|
|
2598
|
+
buyerId: string;
|
|
2599
|
+
paidRevenue: number;
|
|
2600
|
+
companyKeep: number;
|
|
2601
|
+
dealCount: number;
|
|
2602
|
+
marginPct: number | null;
|
|
2603
|
+
}[];
|
|
2604
|
+
pipeline: {
|
|
2605
|
+
invoicedUnpaidCount: number;
|
|
2606
|
+
unrealizedGrossProfit: number;
|
|
2607
|
+
overdueCount: number;
|
|
2608
|
+
unpaidInvoiceTotal: number;
|
|
2609
|
+
overdueInvoiceTotal: number;
|
|
2610
|
+
};
|
|
2611
|
+
staffCommissionUnpaid: number;
|
|
2612
|
+
};
|
|
2613
|
+
}, {
|
|
2614
|
+
data: {
|
|
2615
|
+
monthly: {
|
|
2616
|
+
month: string;
|
|
2617
|
+
grossProfit: number;
|
|
2618
|
+
paidRevenue: number;
|
|
2619
|
+
companyKeep: number;
|
|
2620
|
+
dealCount: number;
|
|
2621
|
+
}[];
|
|
2622
|
+
period: "all" | "this_month" | "last_3_months" | "ytd";
|
|
2623
|
+
staffCommissionsEnabled: boolean;
|
|
2624
|
+
totalDealCount: number;
|
|
2625
|
+
totals: {
|
|
2626
|
+
totalCost: number;
|
|
2627
|
+
grossProfit: number;
|
|
2628
|
+
investorPool: number;
|
|
2629
|
+
paidDealCount: number;
|
|
2630
|
+
paidRevenue: number;
|
|
2631
|
+
companyKeep: number;
|
|
2632
|
+
staffCommission: number;
|
|
2633
|
+
avgMarginPct: number | null;
|
|
2634
|
+
};
|
|
2635
|
+
prior: {
|
|
2636
|
+
totalCost: number;
|
|
2637
|
+
grossProfit: number;
|
|
2638
|
+
investorPool: number;
|
|
2639
|
+
paidDealCount: number;
|
|
2640
|
+
paidRevenue: number;
|
|
2641
|
+
companyKeep: number;
|
|
2642
|
+
staffCommission: number;
|
|
2643
|
+
avgMarginPct: number | null;
|
|
2644
|
+
} | null;
|
|
2645
|
+
profitSplit: {
|
|
2646
|
+
investorPool: number;
|
|
2647
|
+
companyKeep: number;
|
|
2648
|
+
staffCommission: number;
|
|
2649
|
+
};
|
|
2650
|
+
byBuyer: {
|
|
2651
|
+
buyerName: string;
|
|
2652
|
+
buyerId: string;
|
|
2653
|
+
paidRevenue: number;
|
|
2654
|
+
companyKeep: number;
|
|
2655
|
+
dealCount: number;
|
|
2656
|
+
marginPct: number | null;
|
|
2657
|
+
}[];
|
|
2658
|
+
pipeline: {
|
|
2659
|
+
invoicedUnpaidCount: number;
|
|
2660
|
+
unrealizedGrossProfit: number;
|
|
2661
|
+
overdueCount: number;
|
|
2662
|
+
unpaidInvoiceTotal: number;
|
|
2663
|
+
overdueInvoiceTotal: number;
|
|
2664
|
+
};
|
|
2665
|
+
staffCommissionUnpaid: number;
|
|
2666
|
+
currency?: string | undefined;
|
|
2667
|
+
};
|
|
2668
|
+
}>;
|
|
1905
2669
|
export declare const myEarningsAttributesSchema: z.ZodObject<{
|
|
1906
2670
|
realizedEarnings: z.ZodNumber;
|
|
1907
2671
|
projectedEarnings: z.ZodNumber;
|
|
@@ -1910,15 +2674,15 @@ export declare const myEarningsAttributesSchema: z.ZodObject<{
|
|
|
1910
2674
|
currency: z.ZodDefault<z.ZodString>;
|
|
1911
2675
|
}, "strip", z.ZodTypeAny, {
|
|
1912
2676
|
currency: string;
|
|
2677
|
+
dealCount: number;
|
|
1913
2678
|
realizedEarnings: number;
|
|
1914
2679
|
projectedEarnings: number;
|
|
1915
2680
|
capitalDeployed: number;
|
|
1916
|
-
dealCount: number;
|
|
1917
2681
|
}, {
|
|
2682
|
+
dealCount: number;
|
|
1918
2683
|
realizedEarnings: number;
|
|
1919
2684
|
projectedEarnings: number;
|
|
1920
2685
|
capitalDeployed: number;
|
|
1921
|
-
dealCount: number;
|
|
1922
2686
|
currency?: string | undefined;
|
|
1923
2687
|
}>;
|
|
1924
2688
|
export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
@@ -1933,15 +2697,15 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
1933
2697
|
currency: z.ZodDefault<z.ZodString>;
|
|
1934
2698
|
}, "strip", z.ZodTypeAny, {
|
|
1935
2699
|
currency: string;
|
|
2700
|
+
dealCount: number;
|
|
1936
2701
|
realizedEarnings: number;
|
|
1937
2702
|
projectedEarnings: number;
|
|
1938
2703
|
capitalDeployed: number;
|
|
1939
|
-
dealCount: number;
|
|
1940
2704
|
}, {
|
|
2705
|
+
dealCount: number;
|
|
1941
2706
|
realizedEarnings: number;
|
|
1942
2707
|
projectedEarnings: number;
|
|
1943
2708
|
capitalDeployed: number;
|
|
1944
|
-
dealCount: number;
|
|
1945
2709
|
currency?: string | undefined;
|
|
1946
2710
|
}>;
|
|
1947
2711
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1949,19 +2713,19 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
1949
2713
|
id: string;
|
|
1950
2714
|
attributes: {
|
|
1951
2715
|
currency: string;
|
|
2716
|
+
dealCount: number;
|
|
1952
2717
|
realizedEarnings: number;
|
|
1953
2718
|
projectedEarnings: number;
|
|
1954
2719
|
capitalDeployed: number;
|
|
1955
|
-
dealCount: number;
|
|
1956
2720
|
};
|
|
1957
2721
|
}, {
|
|
1958
2722
|
type: "investor-earnings";
|
|
1959
2723
|
id: string;
|
|
1960
2724
|
attributes: {
|
|
2725
|
+
dealCount: number;
|
|
1961
2726
|
realizedEarnings: number;
|
|
1962
2727
|
projectedEarnings: number;
|
|
1963
2728
|
capitalDeployed: number;
|
|
1964
|
-
dealCount: number;
|
|
1965
2729
|
currency?: string | undefined;
|
|
1966
2730
|
};
|
|
1967
2731
|
}>;
|
|
@@ -1971,10 +2735,10 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
1971
2735
|
id: string;
|
|
1972
2736
|
attributes: {
|
|
1973
2737
|
currency: string;
|
|
2738
|
+
dealCount: number;
|
|
1974
2739
|
realizedEarnings: number;
|
|
1975
2740
|
projectedEarnings: number;
|
|
1976
2741
|
capitalDeployed: number;
|
|
1977
|
-
dealCount: number;
|
|
1978
2742
|
};
|
|
1979
2743
|
};
|
|
1980
2744
|
}, {
|
|
@@ -1982,10 +2746,10 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
1982
2746
|
type: "investor-earnings";
|
|
1983
2747
|
id: string;
|
|
1984
2748
|
attributes: {
|
|
2749
|
+
dealCount: number;
|
|
1985
2750
|
realizedEarnings: number;
|
|
1986
2751
|
projectedEarnings: number;
|
|
1987
2752
|
capitalDeployed: number;
|
|
1988
|
-
dealCount: number;
|
|
1989
2753
|
currency?: string | undefined;
|
|
1990
2754
|
};
|
|
1991
2755
|
};
|
|
@@ -2002,6 +2766,10 @@ export type CommodityDealResponse = z.infer<typeof commodityDealResponseSchema>;
|
|
|
2002
2766
|
export type CommodityDealListResponse = z.infer<typeof commodityDealListResponseSchema>;
|
|
2003
2767
|
export type CommodityDealSummary = z.infer<typeof commodityDealSummarySchema>;
|
|
2004
2768
|
export type CommodityDealSummaryResponse = z.infer<typeof commodityDealSummaryResponseSchema>;
|
|
2769
|
+
export type CommodityDealInsightsPeriod = z.infer<typeof commodityDealInsightsPeriodSchema>;
|
|
2770
|
+
export type CommodityDealInsightsTotals = z.infer<typeof commodityDealInsightsTotalsSchema>;
|
|
2771
|
+
export type CommodityDealInsights = z.infer<typeof commodityDealInsightsSchema>;
|
|
2772
|
+
export type CommodityDealInsightsResponse = z.infer<typeof commodityDealInsightsResponseSchema>;
|
|
2005
2773
|
export type CreateDealParticipantInput = z.infer<typeof createDealParticipantSchema>;
|
|
2006
2774
|
export type UpdateDealParticipantInput = z.infer<typeof updateDealParticipantSchema>;
|
|
2007
2775
|
export type MyEarningsResponse = z.infer<typeof myEarningsResponseSchema>;
|