@hectare/platform.clients.trading 1.1.1

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.
Files changed (121) hide show
  1. package/index.d.ts +59 -0
  2. package/index.js +1 -0
  3. package/models/AcceptBid.d.ts +5 -0
  4. package/models/AcceptBid.js +1 -0
  5. package/models/AdvancePayContractSchema.d.ts +133 -0
  6. package/models/AdvancePayContractSchema.js +1 -0
  7. package/models/AdvancePayOfferSchema.d.ts +62 -0
  8. package/models/AdvancePayOfferSchema.js +1 -0
  9. package/models/AdvancePayUploadCollectionReceiptSchema.d.ts +12 -0
  10. package/models/AdvancePayUploadCollectionReceiptSchema.js +1 -0
  11. package/models/Availability.d.ts +17 -0
  12. package/models/Availability.js +1 -0
  13. package/models/BidAlerts.d.ts +10 -0
  14. package/models/BidAlerts.js +1 -0
  15. package/models/BidContract.d.ts +12 -0
  16. package/models/BidContract.js +1 -0
  17. package/models/BidDetail.d.ts +371 -0
  18. package/models/BidDetail.js +1 -0
  19. package/models/BuyerDashboard.d.ts +6 -0
  20. package/models/BuyerDashboard.js +1 -0
  21. package/models/CommodityPrices.d.ts +24 -0
  22. package/models/CommodityPrices.js +1 -0
  23. package/models/CommodityTradedInfo.d.ts +24 -0
  24. package/models/CommodityTradedInfo.js +1 -0
  25. package/models/ContractDeliverySchema.d.ts +87 -0
  26. package/models/ContractDeliverySchema.js +1 -0
  27. package/models/ContractDeliverySettlementDeductionSchema.d.ts +8 -0
  28. package/models/ContractDeliverySettlementDeductionSchema.js +1 -0
  29. package/models/ContractDeliverySettlementSchema.d.ts +48 -0
  30. package/models/ContractDeliverySettlementSchema.js +1 -0
  31. package/models/ContractDetail.d.ts +387 -0
  32. package/models/ContractDetail.js +1 -0
  33. package/models/ContractMovementPeriodSchema.d.ts +113 -0
  34. package/models/ContractMovementPeriodSchema.js +1 -0
  35. package/models/ContractRollOverSchema.d.ts +13 -0
  36. package/models/ContractRollOverSchema.js +1 -0
  37. package/models/ContractsAvailability.d.ts +112 -0
  38. package/models/ContractsAvailability.js +1 -0
  39. package/models/ContractsTraded.d.ts +76 -0
  40. package/models/ContractsTraded.js +1 -0
  41. package/models/ContractsTradedByMonth.d.ts +20 -0
  42. package/models/ContractsTradedByMonth.js +1 -0
  43. package/models/ContractsTradedPeriod.d.ts +18 -0
  44. package/models/ContractsTradedPeriod.js +1 -0
  45. package/models/CreateBid.d.ts +36 -0
  46. package/models/CreateBid.js +1 -0
  47. package/models/CreateContractDeliverySchema.d.ts +10 -0
  48. package/models/CreateContractDeliverySchema.js +1 -0
  49. package/models/CreateContractRequest.d.ts +59 -0
  50. package/models/CreateContractRequest.js +1 -0
  51. package/models/CreateListing.d.ts +68 -0
  52. package/models/CreateListing.js +1 -0
  53. package/models/CreateMarketUpdateRequest.d.ts +21 -0
  54. package/models/CreateMarketUpdateRequest.js +1 -0
  55. package/models/CreateOrUpdateTargetPriceSchema.d.ts +12 -0
  56. package/models/CreateOrUpdateTargetPriceSchema.js +1 -0
  57. package/models/CreateOrUpdateTargetPricesSchema.d.ts +12 -0
  58. package/models/CreateOrUpdateTargetPricesSchema.js +1 -0
  59. package/models/CreateTradeRequest.d.ts +31 -0
  60. package/models/CreateTradeRequest.js +1 -0
  61. package/models/ExFarmPriceCommodity.d.ts +7 -0
  62. package/models/ExFarmPriceCommodity.js +1 -0
  63. package/models/ExFarmPricesRegionSchema.d.ts +13 -0
  64. package/models/ExFarmPricesRegionSchema.js +1 -0
  65. package/models/ExFarmPricesSchema.d.ts +45 -0
  66. package/models/ExFarmPricesSchema.js +1 -0
  67. package/models/ExpiredBidOffer.d.ts +4 -0
  68. package/models/ExpiredBidOffer.js +1 -0
  69. package/models/FeedItem.d.ts +8 -0
  70. package/models/FeedItem.js +1 -0
  71. package/models/FinMidWebhook.d.ts +10 -0
  72. package/models/FinMidWebhook.js +1 -0
  73. package/models/FinMidWebhookEvent.d.ts +6 -0
  74. package/models/FinMidWebhookEvent.js +1 -0
  75. package/models/InsightPrices.d.ts +17 -0
  76. package/models/InsightPrices.js +1 -0
  77. package/models/InsightsLivestockTaxonomySchema.d.ts +18 -0
  78. package/models/InsightsLivestockTaxonomySchema.js +1 -0
  79. package/models/LinkContractSchema.d.ts +7 -0
  80. package/models/LinkContractSchema.js +1 -0
  81. package/models/ListingBidInfoBid.d.ts +13 -0
  82. package/models/ListingBidInfoBid.js +1 -0
  83. package/models/ListingDetail.d.ts +571 -0
  84. package/models/ListingDetail.js +1 -0
  85. package/models/ListingNextAutoCloseDateSchema.d.ts +3 -0
  86. package/models/ListingNextAutoCloseDateSchema.js +1 -0
  87. package/models/ListingSummary.d.ts +158 -0
  88. package/models/ListingSummary.js +1 -0
  89. package/models/MarketBuyers.d.ts +10 -0
  90. package/models/MarketBuyers.js +1 -0
  91. package/models/MarketUpdateDetail.d.ts +15 -0
  92. package/models/MarketUpdateDetail.js +1 -0
  93. package/models/NewsFeed.d.ts +8 -0
  94. package/models/NewsFeed.js +1 -0
  95. package/models/PatchBid.d.ts +26 -0
  96. package/models/PatchBid.js +1 -0
  97. package/models/PatchBidOption.d.ts +12 -0
  98. package/models/PatchBidOption.js +1 -0
  99. package/models/PatchContractDeliverySchema.d.ts +42 -0
  100. package/models/PatchContractDeliverySchema.js +1 -0
  101. package/models/PatchContractPricingSchema.d.ts +13 -0
  102. package/models/PatchContractPricingSchema.js +1 -0
  103. package/models/PatchContractRequest.d.ts +47 -0
  104. package/models/PatchContractRequest.js +1 -0
  105. package/models/PatchMarketUpdateRequest.d.ts +14 -0
  106. package/models/PatchMarketUpdateRequest.js +1 -0
  107. package/models/PublishExFarmPricingSchema.d.ts +16 -0
  108. package/models/PublishExFarmPricingSchema.js +1 -0
  109. package/models/PutContractFile.d.ts +9 -0
  110. package/models/PutContractFile.js +1 -0
  111. package/models/TargetPriceDetailSchema.d.ts +12 -0
  112. package/models/TargetPriceDetailSchema.js +1 -0
  113. package/models/Templates.d.ts +9 -0
  114. package/models/Templates.js +1 -0
  115. package/models/TradeRequestDetail.d.ts +64 -0
  116. package/models/TradeRequestDetail.js +1 -0
  117. package/models/TradingConfig.d.ts +21 -0
  118. package/models/TradingConfig.js +1 -0
  119. package/models/UnlinkContractSchema.d.ts +4 -0
  120. package/models/UnlinkContractSchema.js +1 -0
  121. package/package.json +13 -0
@@ -0,0 +1,158 @@
1
+ export type ListingSummary = {
2
+ id: string;
3
+ public: boolean;
4
+ status: 'active' | 'closed' | 'traded';
5
+ substatus: 'unsold' | 'archived' | null;
6
+ business: {
7
+ organisationId?: string;
8
+ organisationCreatedAtUTC?: string;
9
+ organisationName?: string;
10
+ organisationLogo?: string;
11
+ organisationVetted?: boolean;
12
+ businessUnitId?: string;
13
+ businessUnitName?: string;
14
+ id?: string;
15
+ name: string;
16
+ email: string;
17
+ phone: {
18
+ callingCode: string;
19
+ number: string;
20
+ };
21
+ location: {
22
+ what3words: string | null;
23
+ address: {
24
+ name?: string | null;
25
+ line1: string;
26
+ line2?: string | null;
27
+ line3?: string | null;
28
+ city?: string | null;
29
+ region?: string | null;
30
+ regionISO?: string | null;
31
+ postcode: string;
32
+ countryName?: string | null;
33
+ countryISO: 'GB' | 'US' | 'ZA' | 'FR';
34
+ };
35
+ coordinates: {
36
+ lat: number;
37
+ lon: number;
38
+ };
39
+ } | null;
40
+ holdingNumber?: string;
41
+ assuranceScheme?: 'RT' | 'SQC';
42
+ sqc?: {
43
+ number: string;
44
+ isAssured: boolean;
45
+ } | null;
46
+ };
47
+ details: {
48
+ startDateUTC: string;
49
+ endDateUTC: string | null;
50
+ price: {
51
+ amount: number;
52
+ currency: string;
53
+ } | null;
54
+ movementPeriod: {
55
+ startDateUTC: string;
56
+ endDateUTC: string;
57
+ type: 'date' | 'month';
58
+ };
59
+ buyerNotes: string | null;
60
+ files?: Array<{
61
+ name?: string;
62
+ id: string;
63
+ url?: string | null;
64
+ userId?: string | null;
65
+ userName?: string | null;
66
+ organisationId?: string | null;
67
+ createdAtUTC?: string | null;
68
+ } | null>;
69
+ targetPrice: {
70
+ amount: number;
71
+ currency: string;
72
+ } | null;
73
+ guidePrice: {
74
+ amount: number;
75
+ currency: string;
76
+ } | null;
77
+ };
78
+ inventory: {
79
+ type: 'crop' | 'produce';
80
+ harvestYear: string;
81
+ commodity: {
82
+ commodity: {
83
+ id: number;
84
+ name: string;
85
+ };
86
+ type: {
87
+ id: number;
88
+ name: string;
89
+ };
90
+ grade: {
91
+ id: number;
92
+ name: string;
93
+ };
94
+ variety: string;
95
+ tags: Array<number>;
96
+ weight: {
97
+ name: string;
98
+ conversion: number;
99
+ weight?: number;
100
+ };
101
+ };
102
+ weight: {
103
+ min: {
104
+ name: string;
105
+ conversion: number;
106
+ weight?: number;
107
+ };
108
+ max: {
109
+ name: string;
110
+ conversion: number;
111
+ weight?: number;
112
+ };
113
+ };
114
+ measures: Array<{
115
+ specification: {
116
+ id: number;
117
+ name: string;
118
+ unit: string;
119
+ };
120
+ min: number | null;
121
+ max: number | null;
122
+ }> | null;
123
+ };
124
+ activeBids: number;
125
+ bidInfo?: {
126
+ count: number;
127
+ acceptedCount: number;
128
+ activeCount: number;
129
+ expiredCount: number;
130
+ nextExpiryUTC: string | null;
131
+ prevExpiryUTC: string | null;
132
+ minPrice: {
133
+ amount: number;
134
+ currency: string;
135
+ } | null;
136
+ maxPrice: {
137
+ amount: number;
138
+ currency: string;
139
+ } | null;
140
+ soldWeight: number | null;
141
+ bids: Record<string, {
142
+ userId: string;
143
+ status: 'active' | 'accepted' | 'withdrawn' | 'expired' | 'expiredOffered' | 'expiredOfferDeclined';
144
+ weight: {
145
+ min: number;
146
+ max: number;
147
+ };
148
+ options: Array<{
149
+ id: number;
150
+ soldWeightKG?: number | null;
151
+ soldWeight: number | null;
152
+ }>;
153
+ }>;
154
+ };
155
+ tradeRequestId?: string;
156
+ relistedFromListingId?: string;
157
+ pending?: boolean;
158
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export type MarketBuyers = {
2
+ marketBuyers: Array<{
3
+ authPlatformId: string;
4
+ emailAddress: string;
5
+ fullName: string;
6
+ mobileNumber: string | null;
7
+ organisationId?: string | null;
8
+ userId: string;
9
+ }> | null;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ export type MarketUpdateDetail = {
2
+ id: string;
3
+ title: string;
4
+ content: string;
5
+ visibleUntil: string;
6
+ publishedAt: string;
7
+ visibleInProduct: boolean;
8
+ notification: boolean;
9
+ url: string;
10
+ utmCampaignId?: string | null;
11
+ audienceUserType: string | null;
12
+ audienceCommodityIds: Array<number> | null;
13
+ audienceRegionISOs: Array<string> | null;
14
+ templateId: string;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type NewsFeed = Array<{
2
+ title: string;
3
+ summary?: string;
4
+ imageUrl?: string;
5
+ articleUrl: string;
6
+ source: 'AHDB' | 'FW' | 'HCTR';
7
+ publishDate?: string;
8
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ export type PatchBid = {
2
+ expiresAtUTC: string;
3
+ options: Array<{
4
+ id: number | null;
5
+ movementPeriod: {
6
+ startDateUTC: string;
7
+ endDateUTC: string;
8
+ type: 'date' | 'month';
9
+ };
10
+ pricePerUnit: {
11
+ amount: number;
12
+ currency: string;
13
+ };
14
+ }>;
15
+ terms: {
16
+ weight: {
17
+ min: number;
18
+ max: number;
19
+ };
20
+ paymentDays: number;
21
+ paymentType: 'base' | 'fixed' | 'unpriced' | 'premium';
22
+ haulageType: 'ex-farm' | 'delivered';
23
+ deliveryPostcode?: string | null;
24
+ sellerNotes?: string | null;
25
+ };
26
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export type PatchBidOption = {
2
+ id: number | null;
3
+ movementPeriod: {
4
+ startDateUTC: string;
5
+ endDateUTC: string;
6
+ type: 'date' | 'month';
7
+ };
8
+ pricePerUnit: {
9
+ amount: number;
10
+ currency: string;
11
+ };
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ export type PatchContractDeliverySchema = {
2
+ reference: string | null;
3
+ moveAtUTC: string;
4
+ vehicleRegistration: string | null;
5
+ weightActual: number;
6
+ settlement: {
7
+ reference: string | null;
8
+ pricePerUnit: {
9
+ amount: number;
10
+ currency: string;
11
+ };
12
+ priceVAT: {
13
+ amount: number;
14
+ currency: string;
15
+ } | null;
16
+ invoiceDateUTC: string;
17
+ invoiceDueDateUTC: string;
18
+ deductions: Array<{
19
+ reasonId: number;
20
+ amount: {
21
+ amount: number;
22
+ currency: string;
23
+ };
24
+ }> | null;
25
+ bonuses?: Array<{
26
+ reasonId: number;
27
+ amount: {
28
+ amount: number;
29
+ currency: string;
30
+ };
31
+ }> | null;
32
+ files: Array<{
33
+ name?: string;
34
+ id: string;
35
+ url?: string | null;
36
+ userId?: string | null;
37
+ userName?: string | null;
38
+ organisationId?: string | null;
39
+ createdAtUTC?: string | null;
40
+ } | null>;
41
+ };
42
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export type PatchContractPricingSchema = {
2
+ commodityGrade: number;
3
+ priceType: 'base' | 'fixed' | 'unpriced' | 'premium';
4
+ totalWeight: number;
5
+ pricePerUnit: {
6
+ amount: number;
7
+ currency: string;
8
+ } | null;
9
+ premiumPrice: {
10
+ amount: number;
11
+ currency: string;
12
+ } | null;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ export type PatchContractRequest = {
2
+ businessUnitIds?: Array<string>;
3
+ details: {
4
+ reference?: string | null;
5
+ priceType: 'base' | 'fixed' | 'unpriced' | 'premium';
6
+ paymentDays?: number;
7
+ haulageType?: 'ex-farm' | 'delivered';
8
+ contractDateUTC?: string;
9
+ contractDateISO?: string;
10
+ movementPeriod: {
11
+ startDateUTC: string;
12
+ endDateUTC: string;
13
+ type: 'date' | 'month';
14
+ totalWeight?: number;
15
+ pricePerUnit?: {
16
+ amount: number;
17
+ currency: string;
18
+ } | null;
19
+ premiumPrice?: {
20
+ amount: number;
21
+ currency: string;
22
+ } | null;
23
+ notes?: string | null;
24
+ premiumPriceMax?: {
25
+ amount: number;
26
+ currency: string;
27
+ } | null;
28
+ };
29
+ files?: Array<{
30
+ name?: string;
31
+ id: string;
32
+ url?: string | null;
33
+ userId?: string | null;
34
+ userName?: string | null;
35
+ organisationId?: string | null;
36
+ createdAtUTC?: string | null;
37
+ } | null>;
38
+ terms?: string | null;
39
+ premiumContractId?: string | null;
40
+ };
41
+ commodityGrade?: number;
42
+ measures?: Array<{
43
+ specificationId: number;
44
+ min: number | null;
45
+ max: number | null;
46
+ }> | null;
47
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ export type PatchMarketUpdateRequest = {
2
+ title?: string;
3
+ content?: string;
4
+ audience?: {
5
+ userType?: 'buyer' | 'seller' | 'all';
6
+ commodities?: Array<number> | null;
7
+ regionISOs?: Array<string> | null;
8
+ } | null;
9
+ notification?: boolean;
10
+ visibleUntil?: string;
11
+ url?: string;
12
+ visibleInProduct?: string;
13
+ utmCampaignId?: string;
14
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export type PublishExFarmPricingSchema = {
2
+ commodities: Array<{
3
+ commodity: 'Milling Wheat' | 'Feed Wheat' | 'Feed Barley' | 'Oilseed Rape';
4
+ price: number;
5
+ }>;
6
+ dates: Array<{
7
+ commodity: 'Milling Wheat' | 'Feed Wheat' | 'Feed Barley' | 'Oilseed Rape';
8
+ date: string;
9
+ carryPrice: number;
10
+ }>;
11
+ regionGroups: Array<{
12
+ commodity: 'Milling Wheat' | 'Feed Wheat' | 'Feed Barley' | 'Oilseed Rape';
13
+ groups: Array<string>;
14
+ differentialPrice: number;
15
+ }>;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export type PutContractFile = Array<{
2
+ name?: string;
3
+ id: string;
4
+ url?: string | null;
5
+ userId?: string | null;
6
+ userName?: string | null;
7
+ organisationId?: string | null;
8
+ createdAtUTC?: string | null;
9
+ } | null>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export type TargetPriceDetailSchema = Record<string, Array<{
2
+ exFarmCommodityId: number;
3
+ minPrice: {
4
+ amount: number;
5
+ currency: string;
6
+ } | null;
7
+ maxPrice: {
8
+ amount: number;
9
+ currency: string;
10
+ } | null;
11
+ receiveAlerts: boolean;
12
+ }>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export type Templates = {
2
+ id: string;
3
+ templates: Array<{
4
+ templateId?: string;
5
+ variables?: Array<{
6
+ name?: string;
7
+ }>;
8
+ }>;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,64 @@
1
+ export type TradeRequestDetail = {
2
+ id: string;
3
+ status: 'active' | 'closed';
4
+ commodityName?: string;
5
+ commodity: {
6
+ commodity: {
7
+ id: number;
8
+ name: string;
9
+ };
10
+ type: {
11
+ id: number;
12
+ name: string;
13
+ };
14
+ grade: {
15
+ id: number;
16
+ name: string;
17
+ };
18
+ variety: string;
19
+ tags: Array<number>;
20
+ weight: {
21
+ name: string;
22
+ conversion: number;
23
+ weight?: number;
24
+ };
25
+ };
26
+ harvestYear: string;
27
+ type: 'crop' | 'produce';
28
+ farmAssured?: boolean;
29
+ sellerNotes?: string | null;
30
+ regions?: Array<string>;
31
+ listingsReceived?: number;
32
+ movementPeriod: {
33
+ startDateUTC: string;
34
+ endDateUTC: string;
35
+ type: 'date' | 'month';
36
+ };
37
+ haulageTerms: {
38
+ haulageType?: 'ex-farm' | 'delivered';
39
+ deliveryPostcode?: string | null;
40
+ };
41
+ weight: {
42
+ name: string;
43
+ conversion: number;
44
+ weight?: number;
45
+ };
46
+ buyer: {
47
+ authPlatformId?: string;
48
+ emailAddress?: string;
49
+ fullName?: string;
50
+ mobileNumber?: {
51
+ callingCode: string;
52
+ number: string;
53
+ };
54
+ organisationId?: string | null;
55
+ organisationName?: string | null;
56
+ userId: string;
57
+ };
58
+ createdAtUTC?: string;
59
+ requestType?: 'everyone' | 'farms' | 'merchants';
60
+ guidePrice: {
61
+ amount: number;
62
+ currency: string;
63
+ } | null;
64
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ export type TradingConfig = {
2
+ settlementDeductionReasons?: Array<{
3
+ id?: number;
4
+ description?: string;
5
+ }>;
6
+ settlementBonusReasons?: Array<{
7
+ id?: number;
8
+ description?: string;
9
+ }>;
10
+ exFarmPriceCommodities?: Array<{
11
+ id?: number;
12
+ name?: string;
13
+ commodityId?: number;
14
+ grades?: Array<number>;
15
+ default?: boolean;
16
+ }>;
17
+ closeListingReasons?: Array<{
18
+ id?: number;
19
+ description?: string;
20
+ }>;
21
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type UnlinkContractSchema = {
2
+ premiumContractId: string;
3
+ baseContractId: string;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@hectare/platform.clients.trading",
3
+ "version": "1.1.1",
4
+ "main": "index.js",
5
+ "exported": true,
6
+ "types": "index.d.ts",
7
+ "type": "commonjs",
8
+ "author": "engineering@wearehectare.com",
9
+ "source": "index.js",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ }
13
+ }