@deepintel-ltd/farmpro-contracts 1.15.4 → 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 +561 -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 +710 -8
- package/dist/schemas/commodity-deals.schemas.d.ts.map +1 -1
- package/dist/schemas/commodity-deals.schemas.js +63 -0
- package/package.json +1 -1
|
@@ -1968,6 +1968,704 @@ export declare const commodityDealSummaryResponseSchema: z.ZodObject<{
|
|
|
1968
1968
|
totalInvestorPoolOnPaidDeals?: number | undefined;
|
|
1969
1969
|
};
|
|
1970
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
|
+
}>;
|
|
1971
2669
|
export declare const myEarningsAttributesSchema: z.ZodObject<{
|
|
1972
2670
|
realizedEarnings: z.ZodNumber;
|
|
1973
2671
|
projectedEarnings: z.ZodNumber;
|
|
@@ -1976,15 +2674,15 @@ export declare const myEarningsAttributesSchema: z.ZodObject<{
|
|
|
1976
2674
|
currency: z.ZodDefault<z.ZodString>;
|
|
1977
2675
|
}, "strip", z.ZodTypeAny, {
|
|
1978
2676
|
currency: string;
|
|
2677
|
+
dealCount: number;
|
|
1979
2678
|
realizedEarnings: number;
|
|
1980
2679
|
projectedEarnings: number;
|
|
1981
2680
|
capitalDeployed: number;
|
|
1982
|
-
dealCount: number;
|
|
1983
2681
|
}, {
|
|
2682
|
+
dealCount: number;
|
|
1984
2683
|
realizedEarnings: number;
|
|
1985
2684
|
projectedEarnings: number;
|
|
1986
2685
|
capitalDeployed: number;
|
|
1987
|
-
dealCount: number;
|
|
1988
2686
|
currency?: string | undefined;
|
|
1989
2687
|
}>;
|
|
1990
2688
|
export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
@@ -1999,15 +2697,15 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
1999
2697
|
currency: z.ZodDefault<z.ZodString>;
|
|
2000
2698
|
}, "strip", z.ZodTypeAny, {
|
|
2001
2699
|
currency: string;
|
|
2700
|
+
dealCount: number;
|
|
2002
2701
|
realizedEarnings: number;
|
|
2003
2702
|
projectedEarnings: number;
|
|
2004
2703
|
capitalDeployed: number;
|
|
2005
|
-
dealCount: number;
|
|
2006
2704
|
}, {
|
|
2705
|
+
dealCount: number;
|
|
2007
2706
|
realizedEarnings: number;
|
|
2008
2707
|
projectedEarnings: number;
|
|
2009
2708
|
capitalDeployed: number;
|
|
2010
|
-
dealCount: number;
|
|
2011
2709
|
currency?: string | undefined;
|
|
2012
2710
|
}>;
|
|
2013
2711
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2015,19 +2713,19 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
2015
2713
|
id: string;
|
|
2016
2714
|
attributes: {
|
|
2017
2715
|
currency: string;
|
|
2716
|
+
dealCount: number;
|
|
2018
2717
|
realizedEarnings: number;
|
|
2019
2718
|
projectedEarnings: number;
|
|
2020
2719
|
capitalDeployed: number;
|
|
2021
|
-
dealCount: number;
|
|
2022
2720
|
};
|
|
2023
2721
|
}, {
|
|
2024
2722
|
type: "investor-earnings";
|
|
2025
2723
|
id: string;
|
|
2026
2724
|
attributes: {
|
|
2725
|
+
dealCount: number;
|
|
2027
2726
|
realizedEarnings: number;
|
|
2028
2727
|
projectedEarnings: number;
|
|
2029
2728
|
capitalDeployed: number;
|
|
2030
|
-
dealCount: number;
|
|
2031
2729
|
currency?: string | undefined;
|
|
2032
2730
|
};
|
|
2033
2731
|
}>;
|
|
@@ -2037,10 +2735,10 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
2037
2735
|
id: string;
|
|
2038
2736
|
attributes: {
|
|
2039
2737
|
currency: string;
|
|
2738
|
+
dealCount: number;
|
|
2040
2739
|
realizedEarnings: number;
|
|
2041
2740
|
projectedEarnings: number;
|
|
2042
2741
|
capitalDeployed: number;
|
|
2043
|
-
dealCount: number;
|
|
2044
2742
|
};
|
|
2045
2743
|
};
|
|
2046
2744
|
}, {
|
|
@@ -2048,10 +2746,10 @@ export declare const myEarningsResponseSchema: z.ZodObject<{
|
|
|
2048
2746
|
type: "investor-earnings";
|
|
2049
2747
|
id: string;
|
|
2050
2748
|
attributes: {
|
|
2749
|
+
dealCount: number;
|
|
2051
2750
|
realizedEarnings: number;
|
|
2052
2751
|
projectedEarnings: number;
|
|
2053
2752
|
capitalDeployed: number;
|
|
2054
|
-
dealCount: number;
|
|
2055
2753
|
currency?: string | undefined;
|
|
2056
2754
|
};
|
|
2057
2755
|
};
|
|
@@ -2068,6 +2766,10 @@ export type CommodityDealResponse = z.infer<typeof commodityDealResponseSchema>;
|
|
|
2068
2766
|
export type CommodityDealListResponse = z.infer<typeof commodityDealListResponseSchema>;
|
|
2069
2767
|
export type CommodityDealSummary = z.infer<typeof commodityDealSummarySchema>;
|
|
2070
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>;
|
|
2071
2773
|
export type CreateDealParticipantInput = z.infer<typeof createDealParticipantSchema>;
|
|
2072
2774
|
export type UpdateDealParticipantInput = z.infer<typeof updateDealParticipantSchema>;
|
|
2073
2775
|
export type MyEarningsResponse = z.infer<typeof myEarningsResponseSchema>;
|