@deepintel-ltd/farmpro-contracts 1.3.4 → 1.4.0

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.
@@ -865,6 +865,510 @@ export declare const documentsRouter: {
865
865
  }>;
866
866
  };
867
867
  };
868
+ uploadFileToDocument: {
869
+ pathParams: z.ZodObject<{
870
+ farmId: z.ZodString;
871
+ id: z.ZodString;
872
+ }, "strip", z.ZodTypeAny, {
873
+ id: string;
874
+ farmId: string;
875
+ }, {
876
+ id: string;
877
+ farmId: string;
878
+ }>;
879
+ summary: "Upload file to existing document";
880
+ description: "Upload a file to an existing document record and update it with the file URL";
881
+ method: "POST";
882
+ contentType: "multipart/form-data";
883
+ body: import("@ts-rest/core").ContractPlainType<{
884
+ file: File;
885
+ }>;
886
+ path: "/farms/:farmId/documents/:id/upload";
887
+ responses: {
888
+ 200: z.ZodObject<{
889
+ data: z.ZodObject<{
890
+ type: z.ZodLiteral<string>;
891
+ id: z.ZodString;
892
+ attributes: z.ZodObject<{
893
+ farmId: z.ZodString;
894
+ name: z.ZodString;
895
+ type: z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>;
896
+ category: z.ZodNullable<z.ZodString>;
897
+ fileUrl: z.ZodString;
898
+ fileSize: z.ZodNullable<z.ZodNumber>;
899
+ uploadedDate: z.ZodString;
900
+ uploadedBy: z.ZodNullable<z.ZodString>;
901
+ relatedTo: z.ZodNullable<z.ZodObject<{
902
+ type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
903
+ id: z.ZodString;
904
+ }, "strip", z.ZodTypeAny, {
905
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
906
+ id: string;
907
+ }, {
908
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
909
+ id: string;
910
+ }>>;
911
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
912
+ description: z.ZodNullable<z.ZodString>;
913
+ } & {
914
+ createdAt: z.ZodString;
915
+ updatedAt: z.ZodString;
916
+ }, "strip", z.ZodTypeAny, {
917
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
918
+ createdAt: string;
919
+ updatedAt: string;
920
+ name: string;
921
+ description: string | null;
922
+ farmId: string;
923
+ category: string | null;
924
+ fileUrl: string;
925
+ fileSize: number | null;
926
+ uploadedDate: string;
927
+ uploadedBy: string | null;
928
+ relatedTo: {
929
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
930
+ id: string;
931
+ } | null;
932
+ tags?: string[] | undefined;
933
+ }, {
934
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
935
+ createdAt: string;
936
+ updatedAt: string;
937
+ name: string;
938
+ description: string | null;
939
+ farmId: string;
940
+ category: string | null;
941
+ fileUrl: string;
942
+ fileSize: number | null;
943
+ uploadedDate: string;
944
+ uploadedBy: string | null;
945
+ relatedTo: {
946
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
947
+ id: string;
948
+ } | null;
949
+ tags?: string[] | undefined;
950
+ }>;
951
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
952
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
953
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
954
+ }, "strip", z.ZodTypeAny, {
955
+ type: string;
956
+ id: string;
957
+ attributes: {
958
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
959
+ createdAt: string;
960
+ updatedAt: string;
961
+ name: string;
962
+ description: string | null;
963
+ farmId: string;
964
+ category: string | null;
965
+ fileUrl: string;
966
+ fileSize: number | null;
967
+ uploadedDate: string;
968
+ uploadedBy: string | null;
969
+ relatedTo: {
970
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
971
+ id: string;
972
+ } | null;
973
+ tags?: string[] | undefined;
974
+ };
975
+ relationships?: Record<string, unknown> | undefined;
976
+ links?: Record<string, string> | undefined;
977
+ meta?: Record<string, unknown> | undefined;
978
+ }, {
979
+ type: string;
980
+ id: string;
981
+ attributes: {
982
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
983
+ createdAt: string;
984
+ updatedAt: string;
985
+ name: string;
986
+ description: string | null;
987
+ farmId: string;
988
+ category: string | null;
989
+ fileUrl: string;
990
+ fileSize: number | null;
991
+ uploadedDate: string;
992
+ uploadedBy: string | null;
993
+ relatedTo: {
994
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
995
+ id: string;
996
+ } | null;
997
+ tags?: string[] | undefined;
998
+ };
999
+ relationships?: Record<string, unknown> | undefined;
1000
+ links?: Record<string, string> | undefined;
1001
+ meta?: Record<string, unknown> | undefined;
1002
+ }>;
1003
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1004
+ type: z.ZodString;
1005
+ id: z.ZodString;
1006
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1007
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1008
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1009
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1010
+ }, "strip", z.ZodTypeAny, {
1011
+ type: string;
1012
+ id: string;
1013
+ attributes?: Record<string, unknown> | undefined;
1014
+ relationships?: Record<string, unknown> | undefined;
1015
+ links?: Record<string, string> | undefined;
1016
+ meta?: Record<string, unknown> | undefined;
1017
+ }, {
1018
+ type: string;
1019
+ id: string;
1020
+ attributes?: Record<string, unknown> | undefined;
1021
+ relationships?: Record<string, unknown> | undefined;
1022
+ links?: Record<string, string> | undefined;
1023
+ meta?: Record<string, unknown> | undefined;
1024
+ }>, "many">>;
1025
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1026
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1027
+ }, "strip", z.ZodTypeAny, {
1028
+ data: {
1029
+ type: string;
1030
+ id: string;
1031
+ attributes: {
1032
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
1033
+ createdAt: string;
1034
+ updatedAt: string;
1035
+ name: string;
1036
+ description: string | null;
1037
+ farmId: string;
1038
+ category: string | null;
1039
+ fileUrl: string;
1040
+ fileSize: number | null;
1041
+ uploadedDate: string;
1042
+ uploadedBy: string | null;
1043
+ relatedTo: {
1044
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
1045
+ id: string;
1046
+ } | null;
1047
+ tags?: string[] | undefined;
1048
+ };
1049
+ relationships?: Record<string, unknown> | undefined;
1050
+ links?: Record<string, string> | undefined;
1051
+ meta?: Record<string, unknown> | undefined;
1052
+ };
1053
+ links?: Record<string, string> | undefined;
1054
+ meta?: Record<string, unknown> | undefined;
1055
+ included?: {
1056
+ type: string;
1057
+ id: string;
1058
+ attributes?: Record<string, unknown> | undefined;
1059
+ relationships?: Record<string, unknown> | undefined;
1060
+ links?: Record<string, string> | undefined;
1061
+ meta?: Record<string, unknown> | undefined;
1062
+ }[] | undefined;
1063
+ }, {
1064
+ data: {
1065
+ type: string;
1066
+ id: string;
1067
+ attributes: {
1068
+ type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
1069
+ createdAt: string;
1070
+ updatedAt: string;
1071
+ name: string;
1072
+ description: string | null;
1073
+ farmId: string;
1074
+ category: string | null;
1075
+ fileUrl: string;
1076
+ fileSize: number | null;
1077
+ uploadedDate: string;
1078
+ uploadedBy: string | null;
1079
+ relatedTo: {
1080
+ type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
1081
+ id: string;
1082
+ } | null;
1083
+ tags?: string[] | undefined;
1084
+ };
1085
+ relationships?: Record<string, unknown> | undefined;
1086
+ links?: Record<string, string> | undefined;
1087
+ meta?: Record<string, unknown> | undefined;
1088
+ };
1089
+ links?: Record<string, string> | undefined;
1090
+ meta?: Record<string, unknown> | undefined;
1091
+ included?: {
1092
+ type: string;
1093
+ id: string;
1094
+ attributes?: Record<string, unknown> | undefined;
1095
+ relationships?: Record<string, unknown> | undefined;
1096
+ links?: Record<string, string> | undefined;
1097
+ meta?: Record<string, unknown> | undefined;
1098
+ }[] | undefined;
1099
+ }>;
1100
+ 400: z.ZodObject<{
1101
+ errors: z.ZodArray<z.ZodObject<{
1102
+ id: z.ZodOptional<z.ZodString>;
1103
+ links: z.ZodOptional<z.ZodObject<{
1104
+ about: z.ZodOptional<z.ZodString>;
1105
+ }, "strip", z.ZodTypeAny, {
1106
+ about?: string | undefined;
1107
+ }, {
1108
+ about?: string | undefined;
1109
+ }>>;
1110
+ status: z.ZodOptional<z.ZodString>;
1111
+ code: z.ZodOptional<z.ZodString>;
1112
+ title: z.ZodOptional<z.ZodString>;
1113
+ detail: z.ZodOptional<z.ZodString>;
1114
+ source: z.ZodOptional<z.ZodObject<{
1115
+ pointer: z.ZodOptional<z.ZodString>;
1116
+ parameter: z.ZodOptional<z.ZodString>;
1117
+ }, "strip", z.ZodTypeAny, {
1118
+ pointer?: string | undefined;
1119
+ parameter?: string | undefined;
1120
+ }, {
1121
+ pointer?: string | undefined;
1122
+ parameter?: string | undefined;
1123
+ }>>;
1124
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1125
+ }, "strip", z.ZodTypeAny, {
1126
+ status?: string | undefined;
1127
+ code?: string | undefined;
1128
+ id?: string | undefined;
1129
+ links?: {
1130
+ about?: string | undefined;
1131
+ } | undefined;
1132
+ meta?: Record<string, unknown> | undefined;
1133
+ title?: string | undefined;
1134
+ detail?: string | undefined;
1135
+ source?: {
1136
+ pointer?: string | undefined;
1137
+ parameter?: string | undefined;
1138
+ } | undefined;
1139
+ }, {
1140
+ status?: string | undefined;
1141
+ code?: string | undefined;
1142
+ id?: string | undefined;
1143
+ links?: {
1144
+ about?: string | undefined;
1145
+ } | undefined;
1146
+ meta?: Record<string, unknown> | undefined;
1147
+ title?: string | undefined;
1148
+ detail?: string | undefined;
1149
+ source?: {
1150
+ pointer?: string | undefined;
1151
+ parameter?: string | undefined;
1152
+ } | undefined;
1153
+ }>, "many">;
1154
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1155
+ }, "strip", z.ZodTypeAny, {
1156
+ errors: {
1157
+ status?: string | undefined;
1158
+ code?: string | undefined;
1159
+ id?: string | undefined;
1160
+ links?: {
1161
+ about?: string | undefined;
1162
+ } | undefined;
1163
+ meta?: Record<string, unknown> | undefined;
1164
+ title?: string | undefined;
1165
+ detail?: string | undefined;
1166
+ source?: {
1167
+ pointer?: string | undefined;
1168
+ parameter?: string | undefined;
1169
+ } | undefined;
1170
+ }[];
1171
+ meta?: Record<string, unknown> | undefined;
1172
+ }, {
1173
+ errors: {
1174
+ status?: string | undefined;
1175
+ code?: string | undefined;
1176
+ id?: string | undefined;
1177
+ links?: {
1178
+ about?: string | undefined;
1179
+ } | undefined;
1180
+ meta?: Record<string, unknown> | undefined;
1181
+ title?: string | undefined;
1182
+ detail?: string | undefined;
1183
+ source?: {
1184
+ pointer?: string | undefined;
1185
+ parameter?: string | undefined;
1186
+ } | undefined;
1187
+ }[];
1188
+ meta?: Record<string, unknown> | undefined;
1189
+ }>;
1190
+ 404: z.ZodObject<{
1191
+ errors: z.ZodArray<z.ZodObject<{
1192
+ id: z.ZodOptional<z.ZodString>;
1193
+ links: z.ZodOptional<z.ZodObject<{
1194
+ about: z.ZodOptional<z.ZodString>;
1195
+ }, "strip", z.ZodTypeAny, {
1196
+ about?: string | undefined;
1197
+ }, {
1198
+ about?: string | undefined;
1199
+ }>>;
1200
+ status: z.ZodOptional<z.ZodString>;
1201
+ code: z.ZodOptional<z.ZodString>;
1202
+ title: z.ZodOptional<z.ZodString>;
1203
+ detail: z.ZodOptional<z.ZodString>;
1204
+ source: z.ZodOptional<z.ZodObject<{
1205
+ pointer: z.ZodOptional<z.ZodString>;
1206
+ parameter: z.ZodOptional<z.ZodString>;
1207
+ }, "strip", z.ZodTypeAny, {
1208
+ pointer?: string | undefined;
1209
+ parameter?: string | undefined;
1210
+ }, {
1211
+ pointer?: string | undefined;
1212
+ parameter?: string | undefined;
1213
+ }>>;
1214
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1215
+ }, "strip", z.ZodTypeAny, {
1216
+ status?: string | undefined;
1217
+ code?: string | undefined;
1218
+ id?: string | undefined;
1219
+ links?: {
1220
+ about?: string | undefined;
1221
+ } | undefined;
1222
+ meta?: Record<string, unknown> | undefined;
1223
+ title?: string | undefined;
1224
+ detail?: string | undefined;
1225
+ source?: {
1226
+ pointer?: string | undefined;
1227
+ parameter?: string | undefined;
1228
+ } | undefined;
1229
+ }, {
1230
+ status?: string | undefined;
1231
+ code?: string | undefined;
1232
+ id?: string | undefined;
1233
+ links?: {
1234
+ about?: string | undefined;
1235
+ } | undefined;
1236
+ meta?: Record<string, unknown> | undefined;
1237
+ title?: string | undefined;
1238
+ detail?: string | undefined;
1239
+ source?: {
1240
+ pointer?: string | undefined;
1241
+ parameter?: string | undefined;
1242
+ } | undefined;
1243
+ }>, "many">;
1244
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1245
+ }, "strip", z.ZodTypeAny, {
1246
+ errors: {
1247
+ status?: string | undefined;
1248
+ code?: string | undefined;
1249
+ id?: string | undefined;
1250
+ links?: {
1251
+ about?: string | undefined;
1252
+ } | undefined;
1253
+ meta?: Record<string, unknown> | undefined;
1254
+ title?: string | undefined;
1255
+ detail?: string | undefined;
1256
+ source?: {
1257
+ pointer?: string | undefined;
1258
+ parameter?: string | undefined;
1259
+ } | undefined;
1260
+ }[];
1261
+ meta?: Record<string, unknown> | undefined;
1262
+ }, {
1263
+ errors: {
1264
+ status?: string | undefined;
1265
+ code?: string | undefined;
1266
+ id?: string | undefined;
1267
+ links?: {
1268
+ about?: string | undefined;
1269
+ } | undefined;
1270
+ meta?: Record<string, unknown> | undefined;
1271
+ title?: string | undefined;
1272
+ detail?: string | undefined;
1273
+ source?: {
1274
+ pointer?: string | undefined;
1275
+ parameter?: string | undefined;
1276
+ } | undefined;
1277
+ }[];
1278
+ meta?: Record<string, unknown> | undefined;
1279
+ }>;
1280
+ 401: z.ZodObject<{
1281
+ errors: z.ZodArray<z.ZodObject<{
1282
+ id: z.ZodOptional<z.ZodString>;
1283
+ links: z.ZodOptional<z.ZodObject<{
1284
+ about: z.ZodOptional<z.ZodString>;
1285
+ }, "strip", z.ZodTypeAny, {
1286
+ about?: string | undefined;
1287
+ }, {
1288
+ about?: string | undefined;
1289
+ }>>;
1290
+ status: z.ZodOptional<z.ZodString>;
1291
+ code: z.ZodOptional<z.ZodString>;
1292
+ title: z.ZodOptional<z.ZodString>;
1293
+ detail: z.ZodOptional<z.ZodString>;
1294
+ source: z.ZodOptional<z.ZodObject<{
1295
+ pointer: z.ZodOptional<z.ZodString>;
1296
+ parameter: z.ZodOptional<z.ZodString>;
1297
+ }, "strip", z.ZodTypeAny, {
1298
+ pointer?: string | undefined;
1299
+ parameter?: string | undefined;
1300
+ }, {
1301
+ pointer?: string | undefined;
1302
+ parameter?: string | undefined;
1303
+ }>>;
1304
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1305
+ }, "strip", z.ZodTypeAny, {
1306
+ status?: string | undefined;
1307
+ code?: string | undefined;
1308
+ id?: string | undefined;
1309
+ links?: {
1310
+ about?: string | undefined;
1311
+ } | undefined;
1312
+ meta?: Record<string, unknown> | undefined;
1313
+ title?: string | undefined;
1314
+ detail?: string | undefined;
1315
+ source?: {
1316
+ pointer?: string | undefined;
1317
+ parameter?: string | undefined;
1318
+ } | undefined;
1319
+ }, {
1320
+ status?: string | undefined;
1321
+ code?: string | undefined;
1322
+ id?: string | undefined;
1323
+ links?: {
1324
+ about?: string | undefined;
1325
+ } | undefined;
1326
+ meta?: Record<string, unknown> | undefined;
1327
+ title?: string | undefined;
1328
+ detail?: string | undefined;
1329
+ source?: {
1330
+ pointer?: string | undefined;
1331
+ parameter?: string | undefined;
1332
+ } | undefined;
1333
+ }>, "many">;
1334
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1335
+ }, "strip", z.ZodTypeAny, {
1336
+ errors: {
1337
+ status?: string | undefined;
1338
+ code?: string | undefined;
1339
+ id?: string | undefined;
1340
+ links?: {
1341
+ about?: string | undefined;
1342
+ } | undefined;
1343
+ meta?: Record<string, unknown> | undefined;
1344
+ title?: string | undefined;
1345
+ detail?: string | undefined;
1346
+ source?: {
1347
+ pointer?: string | undefined;
1348
+ parameter?: string | undefined;
1349
+ } | undefined;
1350
+ }[];
1351
+ meta?: Record<string, unknown> | undefined;
1352
+ }, {
1353
+ errors: {
1354
+ status?: string | undefined;
1355
+ code?: string | undefined;
1356
+ id?: string | undefined;
1357
+ links?: {
1358
+ about?: string | undefined;
1359
+ } | undefined;
1360
+ meta?: Record<string, unknown> | undefined;
1361
+ title?: string | undefined;
1362
+ detail?: string | undefined;
1363
+ source?: {
1364
+ pointer?: string | undefined;
1365
+ parameter?: string | undefined;
1366
+ } | undefined;
1367
+ }[];
1368
+ meta?: Record<string, unknown> | undefined;
1369
+ }>;
1370
+ };
1371
+ };
868
1372
  createDocument: {
869
1373
  pathParams: z.ZodObject<{
870
1374
  farmId: z.ZodString;
@@ -883,7 +1387,7 @@ export declare const documentsRouter: {
883
1387
  name: z.ZodString;
884
1388
  type: z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>;
885
1389
  category: z.ZodOptional<z.ZodString>;
886
- fileUrl: z.ZodString;
1390
+ fileUrl: z.ZodOptional<z.ZodString>;
887
1391
  fileSize: z.ZodOptional<z.ZodNumber>;
888
1392
  relatedTo: z.ZodOptional<z.ZodObject<{
889
1393
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
@@ -900,9 +1404,9 @@ export declare const documentsRouter: {
900
1404
  }, "strip", z.ZodTypeAny, {
901
1405
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
902
1406
  name: string;
903
- fileUrl: string;
904
1407
  description?: string | undefined;
905
1408
  category?: string | undefined;
1409
+ fileUrl?: string | undefined;
906
1410
  fileSize?: number | undefined;
907
1411
  relatedTo?: {
908
1412
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -912,9 +1416,9 @@ export declare const documentsRouter: {
912
1416
  }, {
913
1417
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
914
1418
  name: string;
915
- fileUrl: string;
916
1419
  description?: string | undefined;
917
1420
  category?: string | undefined;
1421
+ fileUrl?: string | undefined;
918
1422
  fileSize?: number | undefined;
919
1423
  relatedTo?: {
920
1424
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -927,9 +1431,9 @@ export declare const documentsRouter: {
927
1431
  attributes: {
928
1432
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
929
1433
  name: string;
930
- fileUrl: string;
931
1434
  description?: string | undefined;
932
1435
  category?: string | undefined;
1436
+ fileUrl?: string | undefined;
933
1437
  fileSize?: number | undefined;
934
1438
  relatedTo?: {
935
1439
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -942,9 +1446,9 @@ export declare const documentsRouter: {
942
1446
  attributes: {
943
1447
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
944
1448
  name: string;
945
- fileUrl: string;
946
1449
  description?: string | undefined;
947
1450
  category?: string | undefined;
1451
+ fileUrl?: string | undefined;
948
1452
  fileSize?: number | undefined;
949
1453
  relatedTo?: {
950
1454
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -959,9 +1463,9 @@ export declare const documentsRouter: {
959
1463
  attributes: {
960
1464
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
961
1465
  name: string;
962
- fileUrl: string;
963
1466
  description?: string | undefined;
964
1467
  category?: string | undefined;
1468
+ fileUrl?: string | undefined;
965
1469
  fileSize?: number | undefined;
966
1470
  relatedTo?: {
967
1471
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -976,9 +1480,9 @@ export declare const documentsRouter: {
976
1480
  attributes: {
977
1481
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
978
1482
  name: string;
979
- fileUrl: string;
980
1483
  description?: string | undefined;
981
1484
  category?: string | undefined;
1485
+ fileUrl?: string | undefined;
982
1486
  fileSize?: number | undefined;
983
1487
  relatedTo?: {
984
1488
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -2003,6 +2507,8 @@ export declare const documentsRouter: {
2003
2507
  name: z.ZodOptional<z.ZodString>;
2004
2508
  type: z.ZodOptional<z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>>;
2005
2509
  category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2510
+ fileUrl: z.ZodOptional<z.ZodString>;
2511
+ fileSize: z.ZodOptional<z.ZodNumber>;
2006
2512
  relatedTo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2007
2513
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
2008
2514
  id: z.ZodString;
@@ -2020,6 +2526,8 @@ export declare const documentsRouter: {
2020
2526
  name?: string | undefined;
2021
2527
  description?: string | null | undefined;
2022
2528
  category?: string | null | undefined;
2529
+ fileUrl?: string | undefined;
2530
+ fileSize?: number | undefined;
2023
2531
  relatedTo?: {
2024
2532
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2025
2533
  id: string;
@@ -2030,6 +2538,8 @@ export declare const documentsRouter: {
2030
2538
  name?: string | undefined;
2031
2539
  description?: string | null | undefined;
2032
2540
  category?: string | null | undefined;
2541
+ fileUrl?: string | undefined;
2542
+ fileSize?: number | undefined;
2033
2543
  relatedTo?: {
2034
2544
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2035
2545
  id: string;
@@ -2044,6 +2554,8 @@ export declare const documentsRouter: {
2044
2554
  name?: string | undefined;
2045
2555
  description?: string | null | undefined;
2046
2556
  category?: string | null | undefined;
2557
+ fileUrl?: string | undefined;
2558
+ fileSize?: number | undefined;
2047
2559
  relatedTo?: {
2048
2560
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2049
2561
  id: string;
@@ -2058,6 +2570,8 @@ export declare const documentsRouter: {
2058
2570
  name?: string | undefined;
2059
2571
  description?: string | null | undefined;
2060
2572
  category?: string | null | undefined;
2573
+ fileUrl?: string | undefined;
2574
+ fileSize?: number | undefined;
2061
2575
  relatedTo?: {
2062
2576
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2063
2577
  id: string;
@@ -2074,6 +2588,8 @@ export declare const documentsRouter: {
2074
2588
  name?: string | undefined;
2075
2589
  description?: string | null | undefined;
2076
2590
  category?: string | null | undefined;
2591
+ fileUrl?: string | undefined;
2592
+ fileSize?: number | undefined;
2077
2593
  relatedTo?: {
2078
2594
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2079
2595
  id: string;
@@ -2090,6 +2606,8 @@ export declare const documentsRouter: {
2090
2606
  name?: string | undefined;
2091
2607
  description?: string | null | undefined;
2092
2608
  category?: string | null | undefined;
2609
+ fileUrl?: string | undefined;
2610
+ fileSize?: number | undefined;
2093
2611
  relatedTo?: {
2094
2612
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
2095
2613
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"documents.routes.d.ts","sourceRoot":"","sources":["../../src/routes/documents.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkF3B,CAAC"}
@@ -29,7 +29,7 @@ exports.documentsRouter = c.router({
29
29
  summary: 'List documents',
30
30
  description: 'Get all documents for a farm with optional filtering',
31
31
  },
32
- // Upload document file
32
+ // Upload document file (standalone - returns fileUrl)
33
33
  uploadDocumentFile: {
34
34
  method: 'POST',
35
35
  path: '/farms/:farmId/documents/upload',
@@ -45,6 +45,25 @@ exports.documentsRouter = c.router({
45
45
  summary: 'Upload document file',
46
46
  description: 'Upload a file and get back the file URL in JSON:API format',
47
47
  },
48
+ // Upload file to existing document
49
+ uploadFileToDocument: {
50
+ method: 'POST',
51
+ path: '/farms/:farmId/documents/:id/upload',
52
+ contentType: 'multipart/form-data',
53
+ pathParams: zod_1.z.object({
54
+ farmId: zod_1.z.string().uuid(),
55
+ id: zod_1.z.string().uuid(),
56
+ }),
57
+ body: c.type(),
58
+ responses: {
59
+ 200: documents_schemas_1.documentResponseSchema,
60
+ 400: common_schemas_1.jsonApiErrorResponseSchema,
61
+ 404: common_schemas_1.jsonApiErrorResponseSchema,
62
+ 401: common_schemas_1.jsonApiErrorResponseSchema,
63
+ },
64
+ summary: 'Upload file to existing document',
65
+ description: 'Upload a file to an existing document record and update it with the file URL',
66
+ },
48
67
  // Create document
49
68
  createDocument: {
50
69
  method: 'POST',
@@ -77,7 +77,7 @@ export declare const createDocumentAttributesSchema: z.ZodObject<{
77
77
  name: z.ZodString;
78
78
  type: z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>;
79
79
  category: z.ZodOptional<z.ZodString>;
80
- fileUrl: z.ZodString;
80
+ fileUrl: z.ZodOptional<z.ZodString>;
81
81
  fileSize: z.ZodOptional<z.ZodNumber>;
82
82
  relatedTo: z.ZodOptional<z.ZodObject<{
83
83
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
@@ -94,9 +94,9 @@ export declare const createDocumentAttributesSchema: z.ZodObject<{
94
94
  }, "strip", z.ZodTypeAny, {
95
95
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
96
96
  name: string;
97
- fileUrl: string;
98
97
  description?: string | undefined;
99
98
  category?: string | undefined;
99
+ fileUrl?: string | undefined;
100
100
  fileSize?: number | undefined;
101
101
  relatedTo?: {
102
102
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -106,9 +106,9 @@ export declare const createDocumentAttributesSchema: z.ZodObject<{
106
106
  }, {
107
107
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
108
108
  name: string;
109
- fileUrl: string;
110
109
  description?: string | undefined;
111
110
  category?: string | undefined;
111
+ fileUrl?: string | undefined;
112
112
  fileSize?: number | undefined;
113
113
  relatedTo?: {
114
114
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -120,6 +120,8 @@ export declare const updateDocumentAttributesSchema: z.ZodObject<{
120
120
  name: z.ZodOptional<z.ZodString>;
121
121
  type: z.ZodOptional<z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>>;
122
122
  category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ fileUrl: z.ZodOptional<z.ZodString>;
124
+ fileSize: z.ZodOptional<z.ZodNumber>;
123
125
  relatedTo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
124
126
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
125
127
  id: z.ZodString;
@@ -137,6 +139,8 @@ export declare const updateDocumentAttributesSchema: z.ZodObject<{
137
139
  name?: string | undefined;
138
140
  description?: string | null | undefined;
139
141
  category?: string | null | undefined;
142
+ fileUrl?: string | undefined;
143
+ fileSize?: number | undefined;
140
144
  relatedTo?: {
141
145
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
142
146
  id: string;
@@ -147,6 +151,8 @@ export declare const updateDocumentAttributesSchema: z.ZodObject<{
147
151
  name?: string | undefined;
148
152
  description?: string | null | undefined;
149
153
  category?: string | null | undefined;
154
+ fileUrl?: string | undefined;
155
+ fileSize?: number | undefined;
150
156
  relatedTo?: {
151
157
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
152
158
  id: string;
@@ -159,7 +165,7 @@ export declare const createDocumentSchema: z.ZodObject<{
159
165
  name: z.ZodString;
160
166
  type: z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>;
161
167
  category: z.ZodOptional<z.ZodString>;
162
- fileUrl: z.ZodString;
168
+ fileUrl: z.ZodOptional<z.ZodString>;
163
169
  fileSize: z.ZodOptional<z.ZodNumber>;
164
170
  relatedTo: z.ZodOptional<z.ZodObject<{
165
171
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
@@ -176,9 +182,9 @@ export declare const createDocumentSchema: z.ZodObject<{
176
182
  }, "strip", z.ZodTypeAny, {
177
183
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
178
184
  name: string;
179
- fileUrl: string;
180
185
  description?: string | undefined;
181
186
  category?: string | undefined;
187
+ fileUrl?: string | undefined;
182
188
  fileSize?: number | undefined;
183
189
  relatedTo?: {
184
190
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -188,9 +194,9 @@ export declare const createDocumentSchema: z.ZodObject<{
188
194
  }, {
189
195
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
190
196
  name: string;
191
- fileUrl: string;
192
197
  description?: string | undefined;
193
198
  category?: string | undefined;
199
+ fileUrl?: string | undefined;
194
200
  fileSize?: number | undefined;
195
201
  relatedTo?: {
196
202
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -203,9 +209,9 @@ export declare const createDocumentSchema: z.ZodObject<{
203
209
  attributes: {
204
210
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
205
211
  name: string;
206
- fileUrl: string;
207
212
  description?: string | undefined;
208
213
  category?: string | undefined;
214
+ fileUrl?: string | undefined;
209
215
  fileSize?: number | undefined;
210
216
  relatedTo?: {
211
217
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -218,9 +224,9 @@ export declare const createDocumentSchema: z.ZodObject<{
218
224
  attributes: {
219
225
  type: "other" | "receipt" | "certificate" | "land-document" | "insurance" | "contract" | "invoice";
220
226
  name: string;
221
- fileUrl: string;
222
227
  description?: string | undefined;
223
228
  category?: string | undefined;
229
+ fileUrl?: string | undefined;
224
230
  fileSize?: number | undefined;
225
231
  relatedTo?: {
226
232
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
@@ -236,6 +242,8 @@ export declare const updateDocumentSchema: z.ZodObject<{
236
242
  name: z.ZodOptional<z.ZodString>;
237
243
  type: z.ZodOptional<z.ZodEnum<["receipt", "certificate", "land-document", "insurance", "contract", "invoice", "other"]>>;
238
244
  category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ fileUrl: z.ZodOptional<z.ZodString>;
246
+ fileSize: z.ZodOptional<z.ZodNumber>;
239
247
  relatedTo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
240
248
  type: z.ZodEnum<["farm", "field", "purchase", "expense", "equipment", "other"]>;
241
249
  id: z.ZodString;
@@ -253,6 +261,8 @@ export declare const updateDocumentSchema: z.ZodObject<{
253
261
  name?: string | undefined;
254
262
  description?: string | null | undefined;
255
263
  category?: string | null | undefined;
264
+ fileUrl?: string | undefined;
265
+ fileSize?: number | undefined;
256
266
  relatedTo?: {
257
267
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
258
268
  id: string;
@@ -263,6 +273,8 @@ export declare const updateDocumentSchema: z.ZodObject<{
263
273
  name?: string | undefined;
264
274
  description?: string | null | undefined;
265
275
  category?: string | null | undefined;
276
+ fileUrl?: string | undefined;
277
+ fileSize?: number | undefined;
266
278
  relatedTo?: {
267
279
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
268
280
  id: string;
@@ -277,6 +289,8 @@ export declare const updateDocumentSchema: z.ZodObject<{
277
289
  name?: string | undefined;
278
290
  description?: string | null | undefined;
279
291
  category?: string | null | undefined;
292
+ fileUrl?: string | undefined;
293
+ fileSize?: number | undefined;
280
294
  relatedTo?: {
281
295
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
282
296
  id: string;
@@ -291,6 +305,8 @@ export declare const updateDocumentSchema: z.ZodObject<{
291
305
  name?: string | undefined;
292
306
  description?: string | null | undefined;
293
307
  category?: string | null | undefined;
308
+ fileUrl?: string | undefined;
309
+ fileSize?: number | undefined;
294
310
  relatedTo?: {
295
311
  type: "farm" | "field" | "other" | "equipment" | "purchase" | "expense";
296
312
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"documents.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/documents.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,eAAO,MAAM,kBAAkB,qGAQ7B,CAAC;AAGH,eAAO,MAAM,uBAAuB,2EAAyE,CAAC;AAG9G,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYX,CAAC;AAG3B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASzC,CAAC;AAGH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;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,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -42,7 +42,7 @@ exports.createDocumentAttributesSchema = zod_1.z.object({
42
42
  name: zod_1.z.string().min(1).max(200),
43
43
  type: exports.documentTypeSchema,
44
44
  category: zod_1.z.string().optional(),
45
- fileUrl: zod_1.z.string().url(), // URL to uploaded file
45
+ fileUrl: zod_1.z.string().url().optional(), // URL to uploaded file (optional - can be set after upload)
46
46
  fileSize: zod_1.z.number().int().positive().optional(), // in bytes
47
47
  relatedTo: exports.relatedEntitySchema.optional(),
48
48
  tags: zod_1.z.array(zod_1.z.string()).optional(),
@@ -53,6 +53,8 @@ exports.updateDocumentAttributesSchema = zod_1.z.object({
53
53
  name: zod_1.z.string().min(1).max(200).optional(),
54
54
  type: exports.documentTypeSchema.optional(),
55
55
  category: zod_1.z.string().nullable().optional(),
56
+ fileUrl: zod_1.z.string().url().optional(), // URL to uploaded file (can be updated after upload)
57
+ fileSize: zod_1.z.number().int().positive().optional(), // in bytes
56
58
  relatedTo: exports.relatedEntitySchema.nullable().optional(),
57
59
  tags: zod_1.z.array(zod_1.z.string()).optional(),
58
60
  description: zod_1.z.string().nullable().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepintel-ltd/farmpro-contracts",
3
- "version": "1.3.4",
3
+ "version": "1.4.0",
4
4
  "description": "Type-safe API contracts for FarmPro API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",