@agroyaar/sdk 3.1.2 → 3.2.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.
package/dist/index.cjs CHANGED
@@ -94,7 +94,6 @@ var createClient = (config, middlewares = []) => {
94
94
  var croppingPatternMapper = {
95
95
  getOne: (dto) => ({
96
96
  id: dto.id,
97
- createdAt: dto.createdAt,
98
97
  cropKind: dto.cropKind,
99
98
  farm: dto.farm,
100
99
  farmer: dto.farmer,
@@ -107,7 +106,9 @@ var croppingPatternMapper = {
107
106
  reports: dto.reports,
108
107
  selectedCrops: dto.selectedCrops,
109
108
  status: dto.status
110
- })
109
+ }),
110
+ getAll: (dto) => dto.map(croppingPatternMapper.getOne),
111
+ create: (_dto) => ({})
111
112
  };
112
113
 
113
114
  // src/services/dashboard/cropping-pattern/croppingPattern.service.ts
@@ -138,6 +139,44 @@ var createCroppingPatternServices = (client) => ({
138
139
  } catch (error) {
139
140
  return wrapError(error);
140
141
  }
142
+ },
143
+ getAll: async ({
144
+ pathParams
145
+ }) => {
146
+ try {
147
+ const response = await client.typed(
148
+ "get",
149
+ "/farmers/{farmerId}/cropping-patterns",
150
+ {
151
+ pathParams
152
+ }
153
+ );
154
+ return import_ts_belt2.R.Ok(
155
+ croppingPatternMapper.getAll(response.result.data.croppingPatterns)
156
+ );
157
+ } catch (error) {
158
+ return wrapError(error);
159
+ }
160
+ },
161
+ create: async ({
162
+ body,
163
+ pathParams
164
+ }) => {
165
+ try {
166
+ const response = await client.typed(
167
+ "post",
168
+ "/farmers/{farmerId}/cropping-patterns",
169
+ {
170
+ pathParams,
171
+ body
172
+ }
173
+ );
174
+ return import_ts_belt2.R.Ok(
175
+ croppingPatternMapper.create(response.result.data.croppingPattern)
176
+ );
177
+ } catch (error) {
178
+ return wrapError(error);
179
+ }
141
180
  }
142
181
  });
143
182
 
@@ -523,7 +562,7 @@ var mechanizationMapper = {
523
562
  variety: varietiesMapper.getOne(dto.variety)
524
563
  }),
525
564
  getAll: (dto) => dto.map(mechanizationMapper.getOne),
526
- create: (_res) => ({})
565
+ create: (_dto) => ({})
527
566
  };
528
567
 
529
568
  // src/services/dashboard/mechanization/mechanization.service.ts
package/dist/index.d.ts CHANGED
@@ -909,8 +909,6 @@ interface components {
909
909
  FarmersResponseDto: {
910
910
  readonly result: components["schemas"]["FarmersResponseResult"];
911
911
  };
912
- ExperimentParameterKind: Record<string, never>;
913
- ExperimentKind: Record<string, never>;
914
912
  ExperimentParameter: {
915
913
  readonly id: string;
916
914
  /** Format: date-time */
@@ -919,22 +917,6 @@ interface components {
919
917
  readonly updatedAt: string;
920
918
  /** Format: date-time */
921
919
  readonly deletedAt: string;
922
- name: string;
923
- persianName: string;
924
- unit: string;
925
- cost: number;
926
- typeId: number;
927
- kindId: number;
928
- displayOrder: number;
929
- status: string;
930
- kind: components["schemas"]["ExperimentParameterKind"];
931
- optimumRange: string;
932
- idwClusterConfigIds: string[];
933
- type: components["schemas"]["ExperimentKind"];
934
- idwClusterConfigs: string[];
935
- uuid: string;
936
- startColor: string[];
937
- endColor: string[];
938
920
  };
939
921
  UnavailableExperimentParameter: {
940
922
  /** @description شناسه آزمایش */
@@ -946,10 +928,7 @@ interface components {
946
928
  /** @description پارامتر‌های ناموجود */
947
929
  unavailableExperimentParameters: components["schemas"]["UnavailableExperimentParameter"][];
948
930
  };
949
- ExperimentSamplingDepthKind: Record<string, never>;
950
- ExperimentSamplingPlantElementKind: Record<string, never>;
951
- ExperimentStation: Record<string, never>;
952
- Expert: {
931
+ Experiment: {
953
932
  readonly id: string;
954
933
  /** Format: date-time */
955
934
  readonly createdAt: string;
@@ -958,7 +937,18 @@ interface components {
958
937
  /** Format: date-time */
959
938
  readonly deletedAt: string;
960
939
  };
961
- ExperimentCategoryKind: Record<string, never>;
940
+ ExperimentsResponseData: {
941
+ readonly meta: components["schemas"]["ExperimentMeta"];
942
+ readonly experiments: components["schemas"]["Experiment"][];
943
+ };
944
+ ExperimentsResponseResult: {
945
+ readonly message: string;
946
+ readonly code: string;
947
+ readonly data: components["schemas"]["ExperimentsResponseData"];
948
+ };
949
+ ExperimentsResponseDto: {
950
+ readonly result: components["schemas"]["ExperimentsResponseResult"];
951
+ };
962
952
  OwnershipType: {
963
953
  id: number;
964
954
  name: string;
@@ -999,154 +989,6 @@ interface components {
999
989
  ownershipType: components["schemas"]["OwnershipType"];
1000
990
  farmer: components["schemas"]["Farmer"];
1001
991
  };
1002
- Pool: {
1003
- readonly id: string;
1004
- /** Format: date-time */
1005
- readonly createdAt: string;
1006
- /** Format: date-time */
1007
- readonly updatedAt: string;
1008
- /** Format: date-time */
1009
- readonly deletedAt: string;
1010
- };
1011
- Season: {
1012
- readonly id: string;
1013
- /** Format: date-time */
1014
- readonly createdAt: string;
1015
- /** Format: date-time */
1016
- readonly updatedAt: string;
1017
- /** Format: date-time */
1018
- readonly deletedAt: string;
1019
- };
1020
- IrrigationSource: {
1021
- readonly id: string;
1022
- /** Format: date-time */
1023
- readonly createdAt: string;
1024
- /** Format: date-time */
1025
- readonly updatedAt: string;
1026
- /** Format: date-time */
1027
- readonly deletedAt: string;
1028
- city: components["schemas"]["City"];
1029
- cityId: string;
1030
- /** @description بتمن */
1031
- name: string;
1032
- province: components["schemas"]["Province"];
1033
- provinceId: string;
1034
- zone: string;
1035
- discharge: number;
1036
- location: components["schemas"]["Coordinate"];
1037
- /** @description زمین */
1038
- farmerId: string;
1039
- farmer: components["schemas"]["Farmer"];
1040
- };
1041
- Request: {
1042
- readonly id: string;
1043
- /** Format: date-time */
1044
- readonly createdAt: string;
1045
- /** Format: date-time */
1046
- readonly updatedAt: string;
1047
- /** Format: date-time */
1048
- readonly deletedAt: string;
1049
- };
1050
- Invoice: {
1051
- readonly id: string;
1052
- /** Format: date-time */
1053
- readonly createdAt: string;
1054
- /** Format: date-time */
1055
- readonly updatedAt: string;
1056
- /** Format: date-time */
1057
- readonly deletedAt: string;
1058
- };
1059
- ParameterMap: Record<string, never>;
1060
- ExperimentSampleParametersResults: {
1061
- readonly id: string;
1062
- /** Format: date-time */
1063
- readonly createdAt: string;
1064
- /** Format: date-time */
1065
- readonly updatedAt: string;
1066
- /** Format: date-time */
1067
- readonly deletedAt: string;
1068
- };
1069
- Laboratory: {
1070
- readonly id: string;
1071
- /** Format: date-time */
1072
- readonly createdAt: string;
1073
- /** Format: date-time */
1074
- readonly updatedAt: string;
1075
- /** Format: date-time */
1076
- readonly deletedAt: string;
1077
- };
1078
- Status: {
1079
- id: string;
1080
- label: string;
1081
- /** @enum {string} */
1082
- name: "SUBMIT" | "ACTIVE" | "INACTIVE" | "CONFIRMED" | "PAID" | "DRAFT" | "PENDING" | "PROCESSING" | "ARCHIVED" | "COMPLETED" | "PASS_PAYMENT" | "VALID" | "INVALID" | "WRITING" | "REJECTED" | "FAILED" | "SUCCESS" | "DONE" | "VERIFIED" | "UNLOCK" | "LOCK" | "MODIFIED" | "REFUNDED_INVOICE" | "ACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "INACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "VALID_DEVICE_PUSH_TOKEN" | "INVALID_DEVICE_PUSH_TOKEN" | "DRAFT_MISSION" | "APPROVED_MISSION" | "REJECTED_MISSION" | "CANCELED_MISSION" | "COMPLETED_MISSION" | "IN_PROGRESS_MISSION" | "AWAITING_START_MISSION" | "AWAITING_APPROVAL_MISSION" | "AWAITING_REVIEW_DATA_MISSION" | "AWAITING_SAMPLE_DELIVERY_LABORATORY_MISSION" | "COMPLETED_REQUEST" | "AWAITING_SEND_REQUEST" | "AWAITING_REVIEW_REQUEST" | "AWAITING_PAYMENT_REQUEST" | "AWAITING_REVIEW_OFFER" | "AWAITING_COLLEAGUE_APPROVAL_REQUEST" | "AWAITING_MISSION_COMPLETION_REQUEST" | "AWAITING_PURCHASE_REQUEST" | "AWAITING_REVIEW_MISSION_DATA_REQUEST" | "REJECTED_REGISTRATION" | "REJECTED_MODIFICATION" | "REJECTED_ACTIVATION" | "CONFIRMED_ACTIVATION" | "CONFIRMED_REGISTRATION" | "AWAITING_REVIEW_ACTIVATION" | "AWAITING_SUBMIT_ACTIVATION" | "AWAITING_REVIEW_REGISTRATION" | "AWAITING_REVIEW_MODIFICATION" | "APPROVED_EXPERIMENT_ANALYSIS_REQUEST" | "REJECTED_EXPERIMENT_ANALYSIS_REQUEST" | "CANCELED_EXPERIMENT_ANALYSIS_REQUEST" | "COMPLETED_EXPERIMENT_ANALYSIS_REQUEST" | "IN_PROGRESS_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_START_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_APPROVAL_EXPERIMENT_ANALYSIS_REQUEST" | "DRAFT_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_REVIEW_INQUIRY" | "COMPLETED_REGISTRATION" | "CANCELED_REQUEST" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "APPROVED_RESIDENT_LEADING_EXPERT" | "REJECTED_RESIDENT_LEADING_EXPERT" | "AWAITING_SIGNING_CONTRACT" | "ACTIVE_LEADING_EXPERT" | "FAILED_CHARGE_WALLET_TRANSACTION" | "VERIFIED_CHARGE_WALLET_TRANSACTION" | "SUCCESS_PAYMENT_WALLET_TRANSACTION" | "SUCCESS_REFUND_WALLET_TRANSACTION" | "AWAITING_VERIFICATION_CHARGE_WALLET_TRANSACTION";
1083
- };
1084
- Experiment: {
1085
- readonly id: string;
1086
- /** Format: date-time */
1087
- readonly createdAt: string;
1088
- /** Format: date-time */
1089
- readonly updatedAt: string;
1090
- /** Format: date-time */
1091
- readonly deletedAt: string;
1092
- objectId: string;
1093
- seen: boolean;
1094
- samplingDepths: components["schemas"]["ExperimentSamplingDepthKind"];
1095
- samplingDepthIds: string[];
1096
- samplingPlantElements: components["schemas"]["ExperimentSamplingPlantElementKind"];
1097
- samplingPlantElementIds: string[];
1098
- resultFile: string;
1099
- stationsCount: number;
1100
- stations: components["schemas"]["ExperimentStation"];
1101
- previousCrop: string;
1102
- nextCrop: string;
1103
- expert: components["schemas"]["Expert"];
1104
- expertId: string;
1105
- expertTransportResponsibility: boolean;
1106
- isResidentLeadingExpert: boolean;
1107
- type: components["schemas"]["ExperimentKind"];
1108
- typeId: number;
1109
- category: components["schemas"]["ExperimentCategoryKind"];
1110
- categoryId: number;
1111
- parametersIds: string[];
1112
- parameters: components["schemas"]["ExperimentParameter"];
1113
- experimentCode: string;
1114
- drawingParametersMap: boolean;
1115
- recommendedSamplingCoordinates: components["schemas"]["Coordinate"];
1116
- samplesCount: number;
1117
- samplesAmount: string;
1118
- farmer: components["schemas"]["Farmer"];
1119
- farmerId: string;
1120
- farm: components["schemas"]["Farm"];
1121
- pool: components["schemas"]["Pool"];
1122
- season: components["schemas"]["Season"];
1123
- irrigationSource: components["schemas"]["IrrigationSource"];
1124
- relevantEntityId: string;
1125
- request: components["schemas"]["Request"];
1126
- invoice: components["schemas"]["Invoice"];
1127
- invoiceId: string;
1128
- parametersMaps: components["schemas"]["ParameterMap"];
1129
- samplesParametersResults: components["schemas"]["ExperimentSampleParametersResults"];
1130
- laboratory: components["schemas"]["Laboratory"];
1131
- laboratoryId: string;
1132
- /** Format: date-time */
1133
- analysisAt: string;
1134
- receiptAt: string;
1135
- geoShortLinkId: string;
1136
- status: components["schemas"]["Status"];
1137
- };
1138
- ExperimentsResponseData: {
1139
- readonly meta: components["schemas"]["ExperimentMeta"];
1140
- readonly experiments: components["schemas"]["Experiment"][];
1141
- };
1142
- ExperimentsResponseResult: {
1143
- readonly message: string;
1144
- readonly code: string;
1145
- readonly data: components["schemas"]["ExperimentsResponseData"];
1146
- };
1147
- ExperimentsResponseDto: {
1148
- readonly result: components["schemas"]["ExperimentsResponseResult"];
1149
- };
1150
992
  FarmsResponseData: {
1151
993
  readonly meta: Record<string, never>;
1152
994
  readonly totalItems: number;
@@ -1172,6 +1014,27 @@ interface components {
1172
1014
  FarmResponseDto: {
1173
1015
  readonly result: components["schemas"]["FarmResponseResult"];
1174
1016
  };
1017
+ IrrigationSource: {
1018
+ readonly id: string;
1019
+ /** Format: date-time */
1020
+ readonly createdAt: string;
1021
+ /** Format: date-time */
1022
+ readonly updatedAt: string;
1023
+ /** Format: date-time */
1024
+ readonly deletedAt: string;
1025
+ city: components["schemas"]["City"];
1026
+ cityId: string;
1027
+ /** @description بتمن */
1028
+ name: string;
1029
+ province: components["schemas"]["Province"];
1030
+ provinceId: string;
1031
+ zone: string;
1032
+ discharge: number;
1033
+ location: components["schemas"]["Coordinate"];
1034
+ /** @description زمین */
1035
+ farmerId: string;
1036
+ farmer: components["schemas"]["Farmer"];
1037
+ };
1175
1038
  IrrigationSourcesResponseData: {
1176
1039
  readonly meta: Record<string, never>;
1177
1040
  readonly totalItems: number;
@@ -1197,6 +1060,12 @@ interface components {
1197
1060
  IrrigationSourceResponseDto: {
1198
1061
  readonly result: components["schemas"]["IrrigationSourceResponseResult"];
1199
1062
  };
1063
+ Status: {
1064
+ id: string;
1065
+ label: string;
1066
+ /** @enum {string} */
1067
+ name: "SUBMIT" | "ACTIVE" | "INACTIVE" | "CONFIRMED" | "PAID" | "DRAFT" | "PENDING" | "PROCESSING" | "ARCHIVED" | "COMPLETED" | "PASS_PAYMENT" | "VALID" | "INVALID" | "WRITING" | "REJECTED" | "FAILED" | "SUCCESS" | "DONE" | "VERIFIED" | "UNLOCK" | "LOCK" | "MODIFIED" | "REFUNDED_INVOICE" | "ACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "INACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "VALID_DEVICE_PUSH_TOKEN" | "INVALID_DEVICE_PUSH_TOKEN" | "DRAFT_MISSION" | "APPROVED_MISSION" | "REJECTED_MISSION" | "CANCELED_MISSION" | "COMPLETED_MISSION" | "IN_PROGRESS_MISSION" | "AWAITING_START_MISSION" | "AWAITING_APPROVAL_MISSION" | "AWAITING_REVIEW_DATA_MISSION" | "AWAITING_SAMPLE_DELIVERY_LABORATORY_MISSION" | "COMPLETED_REQUEST" | "AWAITING_SEND_REQUEST" | "AWAITING_REVIEW_REQUEST" | "AWAITING_PAYMENT_REQUEST" | "AWAITING_REVIEW_OFFER" | "AWAITING_COLLEAGUE_APPROVAL_REQUEST" | "AWAITING_MISSION_COMPLETION_REQUEST" | "AWAITING_PURCHASE_REQUEST" | "AWAITING_REVIEW_MISSION_DATA_REQUEST" | "REJECTED_REGISTRATION" | "REJECTED_MODIFICATION" | "REJECTED_ACTIVATION" | "CONFIRMED_ACTIVATION" | "CONFIRMED_REGISTRATION" | "AWAITING_REVIEW_ACTIVATION" | "AWAITING_SUBMIT_ACTIVATION" | "AWAITING_REVIEW_REGISTRATION" | "AWAITING_REVIEW_MODIFICATION" | "APPROVED_EXPERIMENT_ANALYSIS_REQUEST" | "REJECTED_EXPERIMENT_ANALYSIS_REQUEST" | "CANCELED_EXPERIMENT_ANALYSIS_REQUEST" | "COMPLETED_EXPERIMENT_ANALYSIS_REQUEST" | "IN_PROGRESS_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_START_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_APPROVAL_EXPERIMENT_ANALYSIS_REQUEST" | "DRAFT_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_REVIEW_INQUIRY" | "COMPLETED_REGISTRATION" | "CANCELED_REQUEST" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "APPROVED_RESIDENT_LEADING_EXPERT" | "REJECTED_RESIDENT_LEADING_EXPERT" | "AWAITING_SIGNING_CONTRACT" | "ACTIVE_LEADING_EXPERT" | "FAILED_CHARGE_WALLET_TRANSACTION" | "VERIFIED_CHARGE_WALLET_TRANSACTION" | "SUCCESS_PAYMENT_WALLET_TRANSACTION" | "SUCCESS_REFUND_WALLET_TRANSACTION" | "AWAITING_VERIFICATION_CHARGE_WALLET_TRANSACTION";
1068
+ };
1200
1069
  WeatherStationAlertPhoneNumber: {
1201
1070
  fullName: string;
1202
1071
  position: string;
@@ -1536,6 +1405,15 @@ interface components {
1536
1405
  */
1537
1406
  selectedCropIds: string[];
1538
1407
  };
1408
+ Invoice: {
1409
+ readonly id: string;
1410
+ /** Format: date-time */
1411
+ readonly createdAt: string;
1412
+ /** Format: date-time */
1413
+ readonly updatedAt: string;
1414
+ /** Format: date-time */
1415
+ readonly deletedAt: string;
1416
+ };
1539
1417
  AnnuallyChartReportType: {
1540
1418
  /**
1541
1419
  * @description سال
@@ -3735,7 +3613,7 @@ interface operations {
3735
3613
  };
3736
3614
  }
3737
3615
 
3738
- type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP" | "CROPPING_PATTERN";
3616
+ type ServiceType = "EXPERIMENT" | "VISIT" | "CHILLING_REQUIREMENT" | "CULTIVAR_RECOMMENDATION" | "FIRST_SAFFRON_IRRIGATION_DATE_RECOMMENDATION" | "HARVEST_DATE_RECOMMENDATION" | "QUESTIONNAIRE" | "SOWING_DATE_RECOMMENDATIONS" | "WEATHER_STATION" | "YIELD_GAP";
3739
3617
  type StatusType = "SUBMIT" | "ACTIVE" | "INACTIVE" | "CONFIRMED" | "PAID" | "DRAFT" | "PENDING" | "PROCESSING" | "ARCHIVED" | "COMPLETED" | "PASS_PAYMENT" | "VALID" | "INVALID" | "WRITING" | "REJECTED" | "FAILED" | "SUCCESS" | "DONE" | "VERIFIED" | "UNLOCK" | "LOCK" | "MODIFIED" | "REFUNDED_INVOICE" | "ACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "INACTIVE_LABORTORY_FIELD_EXPERIMENT_KIND" | "VALID_DEVICE_PUSH_TOKEN" | "INVALID_DEVICE_PUSH_TOKEN" | "DRAFT_MISSION" | "APPROVED_MISSION" | "REJECTED_MISSION" | "CANCELED_MISSION" | "COMPLETED_MISSION" | "IN_PROGRESS_MISSION" | "AWAITING_START_MISSION" | "AWAITING_APPROVAL_MISSION" | "AWAITING_REVIEW_DATA_MISSION" | "AWAITING_SAMPLE_DELIVERY_LABORATORY_MISSION" | "COMPLETED_REQUEST" | "AWAITING_SEND_REQUEST" | "AWAITING_REVIEW_REQUEST" | "AWAITING_PAYMENT_REQUEST" | "AWAITING_REVIEW_OFFER" | "AWAITING_COLLEAGUE_APPROVAL_REQUEST" | "AWAITING_MISSION_COMPLETION_REQUEST" | "AWAITING_PURCHASE_REQUEST" | "AWAITING_REVIEW_MISSION_DATA_REQUEST" | "REJECTED_REGISTRATION" | "REJECTED_MODIFICATION" | "REJECTED_ACTIVATION" | "CONFIRMED_ACTIVATION" | "CONFIRMED_REGISTRATION" | "AWAITING_REVIEW_ACTIVATION" | "AWAITING_SUBMIT_ACTIVATION" | "AWAITING_REVIEW_REGISTRATION" | "AWAITING_REVIEW_MODIFICATION" | "APPROVED_EXPERIMENT_ANALYSIS_REQUEST" | "REJECTED_EXPERIMENT_ANALYSIS_REQUEST" | "CANCELED_EXPERIMENT_ANALYSIS_REQUEST" | "COMPLETED_EXPERIMENT_ANALYSIS_REQUEST" | "IN_PROGRESS_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_START_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_APPROVAL_EXPERIMENT_ANALYSIS_REQUEST" | "DRAFT_EXPERIMENT_ANALYSIS_REQUEST" | "AWAITING_REVIEW_INQUIRY" | "COMPLETED_REGISTRATION" | "CANCELED_REQUEST" | "AWAITING_APPROVAL_RESIDENT_LEADING_EXPERT" | "APPROVED_RESIDENT_LEADING_EXPERT" | "REJECTED_RESIDENT_LEADING_EXPERT" | "AWAITING_SIGNING_CONTRACT" | "ACTIVE_LEADING_EXPERT" | "FAILED_CHARGE_WALLET_TRANSACTION" | "VERIFIED_CHARGE_WALLET_TRANSACTION" | "SUCCESS_PAYMENT_WALLET_TRANSACTION" | "SUCCESS_REFUND_WALLET_TRANSACTION" | "AWAITING_VERIFICATION_CHARGE_WALLET_TRANSACTION";
3740
3618
  type TaskType = "SAMPLING_REQUEST" | "SAMPLING_MISSION" | "ANALYSIS_REQUEST" | "MAP_DRAWING" | "WATER_SAMPLE_CONTROL" | "WATER_ANALYSIS_MEASUREMENT" | "WATER_EXPERIMENT_TECHNICAL_REVIEW" | "PLANT_SAMPLE_CONTROL" | "PLANT_ANALYSIS_MEASUREMENT" | "PLANT_EXPERIMENT_TECHNICAL_REVIEW" | "SOIL_SAMPLE_CONTROL" | "SOIL_ANALYSIS_MEASUREMENT" | "SOIL_EXPERIMENT_TECHNICAL_REVIEW" | "SENDING_REPORTS" | "TECHNICAL_REVIEW" | "EXPERIMENT_ANALYSIS_RESULTS_CONTROL" | "EXPERIMENT_RECOMMENDATION_ANALYSIS_RESULTS" | "SUPPORT_EXPERIMENTS" | "VISIT_REQUEST" | "FOLLOW_UP_VISIT" | "VISIT_MAP_DRAWING" | "VISIT_SENDING_REPORTS" | "SUPPORT_VISITS";
3741
3619
  type MechanizationType = "MOTORIZED" | "NON_MOTORIZED";
@@ -4033,7 +3911,6 @@ type CroppingPatternReportModel = {
4033
3911
  };
4034
3912
  type CroppingPatternModel = {
4035
3913
  id: string;
4036
- createdAt: string;
4037
3914
  farm: Farm;
4038
3915
  farmer: Farmer;
4039
3916
  irrigationSource: IrrigationSource;
@@ -4180,12 +4057,22 @@ declare namespace ApiTypes {
4180
4057
  }
4181
4058
 
4182
4059
  type GetOneCroppingPatternParams = paths["/farmers/{farmerId}/cropping-patterns/{croppingPatternId}"]["get"]["parameters"]["path"];
4060
+ type GetAllListCroppingPatternParams = paths["/farmers/{farmerId}/cropping-patterns"]["get"]["parameters"]["path"];
4061
+ type CreateCroppingPatternBody = paths["/farmers/{farmerId}/cropping-patterns"]["post"]["requestBody"]["content"]["application/json"];
4062
+ type CreateCroppingPatternParams = paths["/farmers/{farmerId}/cropping-patterns"]["post"]["parameters"];
4183
4063
  type CroppingPatternTypes = ApiRequestType<{
4184
4064
  croppingPattern: components["schemas"]["CroppingPattern"];
4185
4065
  }, {
4186
4066
  getOne: {
4187
4067
  pathParams: NonNullable<GetOneCroppingPatternParams>;
4188
4068
  };
4069
+ getAll: {
4070
+ pathParams: NonNullable<GetAllListCroppingPatternParams>;
4071
+ };
4072
+ create: {
4073
+ body: CreateCroppingPatternBody;
4074
+ pathParams: NonNullable<CreateCroppingPatternParams["path"]>;
4075
+ };
4189
4076
  }>;
4190
4077
 
4191
4078
  type HttpMethod = "get" | "post" | "put" | "delete" | "patch";
@@ -4273,6 +4160,8 @@ declare const createSDK: (config: ClientConfig, middlewares?: Parameters<typeof
4273
4160
  };
4274
4161
  croppingPattern: {
4275
4162
  getOne: ({ pathParams, }: CroppingPatternTypes["RequestParams"]["getOne"]) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<CroppingPatternModel>>;
4163
+ getAll: ({ pathParams, }: CroppingPatternTypes["RequestParams"]["getAll"]) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<CroppingPatternModel[]>>;
4164
+ create: ({ body, pathParams, }: CroppingPatternTypes["RequestParams"]["create"]) => Promise<_mobily_ts_belt.Error<Error> | _mobily_ts_belt.Ok<unknown>>;
4276
4165
  };
4277
4166
  };
4278
4167
  };
package/dist/index.mjs CHANGED
@@ -58,7 +58,6 @@ var createClient = (config, middlewares = []) => {
58
58
  var croppingPatternMapper = {
59
59
  getOne: (dto) => ({
60
60
  id: dto.id,
61
- createdAt: dto.createdAt,
62
61
  cropKind: dto.cropKind,
63
62
  farm: dto.farm,
64
63
  farmer: dto.farmer,
@@ -71,7 +70,9 @@ var croppingPatternMapper = {
71
70
  reports: dto.reports,
72
71
  selectedCrops: dto.selectedCrops,
73
72
  status: dto.status
74
- })
73
+ }),
74
+ getAll: (dto) => dto.map(croppingPatternMapper.getOne),
75
+ create: (_dto) => ({})
75
76
  };
76
77
 
77
78
  // src/services/dashboard/cropping-pattern/croppingPattern.service.ts
@@ -102,6 +103,44 @@ var createCroppingPatternServices = (client) => ({
102
103
  } catch (error) {
103
104
  return wrapError(error);
104
105
  }
106
+ },
107
+ getAll: async ({
108
+ pathParams
109
+ }) => {
110
+ try {
111
+ const response = await client.typed(
112
+ "get",
113
+ "/farmers/{farmerId}/cropping-patterns",
114
+ {
115
+ pathParams
116
+ }
117
+ );
118
+ return R2.Ok(
119
+ croppingPatternMapper.getAll(response.result.data.croppingPatterns)
120
+ );
121
+ } catch (error) {
122
+ return wrapError(error);
123
+ }
124
+ },
125
+ create: async ({
126
+ body,
127
+ pathParams
128
+ }) => {
129
+ try {
130
+ const response = await client.typed(
131
+ "post",
132
+ "/farmers/{farmerId}/cropping-patterns",
133
+ {
134
+ pathParams,
135
+ body
136
+ }
137
+ );
138
+ return R2.Ok(
139
+ croppingPatternMapper.create(response.result.data.croppingPattern)
140
+ );
141
+ } catch (error) {
142
+ return wrapError(error);
143
+ }
105
144
  }
106
145
  });
107
146
 
@@ -487,7 +526,7 @@ var mechanizationMapper = {
487
526
  variety: varietiesMapper.getOne(dto.variety)
488
527
  }),
489
528
  getAll: (dto) => dto.map(mechanizationMapper.getOne),
490
- create: (_res) => ({})
529
+ create: (_dto) => ({})
491
530
  };
492
531
 
493
532
  // src/services/dashboard/mechanization/mechanization.service.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agroyaar/sdk",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",