@litusarchieve18/agricore-utils 1.0.13 → 1.0.15

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.js CHANGED
@@ -29,10 +29,17 @@ __export(index_exports, {
29
29
  ApprovalType: () => ApprovalType,
30
30
  AuditStatus: () => AuditStatus,
31
31
  AuditType: () => AuditType,
32
+ CAR_SUPPORTED_EVIDENCE_MIME_TYPES: () => CAR_SUPPORTED_EVIDENCE_MIME_TYPES,
33
+ CAR_SUPPORTED_SIGNATURE_MIME_TYPES: () => CAR_SUPPORTED_SIGNATURE_MIME_TYPES,
32
34
  CAT: () => CAT,
35
+ CATEGORY_TABS: () => CATEGORY_TABS,
36
+ CORRECTIVE_ACTION_GENERATION_SOURCES: () => CORRECTIVE_ACTION_GENERATION_SOURCES,
37
+ CORRECTIVE_ACTION_STATUSES: () => CORRECTIVE_ACTION_STATUSES,
33
38
  Converter: () => Converter,
34
39
  CropCycleStatus: () => CropCycleStatus,
40
+ DOCUMENT_DISPLAY_INFO: () => DOCUMENT_DISPLAY_INFO,
35
41
  DOCUMENT_MENU_MAP: () => DOCUMENT_MENU_MAP,
42
+ DocumentCategory: () => DocumentCategory,
36
43
  DocumentType: () => DocumentType,
37
44
  ERROR_DICTIONARY: () => ERROR_DICTIONARY,
38
45
  EVERYONE: () => EVERYONE,
@@ -59,8 +66,10 @@ __export(index_exports, {
59
66
  RelationshipType: () => RelationshipType,
60
67
  RowOrientation: () => RowOrientation,
61
68
  SENTINEL_UUID: () => SENTINEL_UUID,
69
+ SIGNATURE_MODES: () => SIGNATURE_MODES,
62
70
  SoilTexture: () => SoilTexture,
63
71
  TASK_TYPE_REGISTRY: () => TASK_TYPE_REGISTRY,
72
+ TEMPLATE_SCOPE_LEVELS: () => TEMPLATE_SCOPE_LEVELS,
64
73
  TargetEntityType: () => TargetEntityType,
65
74
  TaskStatus: () => TaskStatus,
66
75
  TaskType: () => TaskType,
@@ -430,7 +439,10 @@ var TaskType = {
430
439
  KML_PARSE: "KML_PARSE",
431
440
  INVOICE_OCR: "INVOICE_OCR",
432
441
  AUDIT_UPLOAD: "AUDIT_UPLOAD",
433
- REPORT_GEN: "REPORT_GEN"
442
+ REPORT_GEN: "REPORT_GEN",
443
+ PDF_STAMPING: "PDF_STAMPING",
444
+ CAR_TEMPLATE_UPLOAD: "CAR_TEMPLATE_UPLOAD",
445
+ CORRECTIVE_ACTION_COMPILE: "CORRECTIVE_ACTION_COMPILE"
434
446
  };
435
447
  var TaskStatus = {
436
448
  PENDING: "PENDING",
@@ -789,6 +801,194 @@ var DocumentType = /* @__PURE__ */ ((DocumentType2) => {
789
801
  DocumentType2["SENSITIVE_IDENTITY"] = "SENSITIVE_IDENTITY";
790
802
  return DocumentType2;
791
803
  })(DocumentType || {});
804
+ var DocumentCategory = /* @__PURE__ */ ((DocumentCategory2) => {
805
+ DocumentCategory2["AGRONOMY_TESTING"] = "Agronomy & Testing";
806
+ DocumentCategory2["FARM_OPERATIONS"] = "Farm Operations";
807
+ DocumentCategory2["COMPLIANCE_QA"] = "Compliance & Quality";
808
+ DocumentCategory2["INVENTORY_LOG"] = "Inventory & Logistics";
809
+ DocumentCategory2["ASSETS_MAINT"] = "Assets & Maintenance";
810
+ DocumentCategory2["HR_LEGAL_SAFETY"] = "HR, Legal & Safety";
811
+ DocumentCategory2["FINANCE_ADMIN"] = "Finance & Admin";
812
+ return DocumentCategory2;
813
+ })(DocumentCategory || {});
814
+ var DOCUMENT_DISPLAY_INFO = {
815
+ // --- AGRONOMY & TESTING ---
816
+ ["SOIL_TEST" /* SOIL_TEST */]: {
817
+ label: "Soil Analysis",
818
+ description: "Detailed lab results for soil nutrients, pH, and health.",
819
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
820
+ },
821
+ ["LEAF_TEST" /* LEAF_TEST */]: {
822
+ label: "Leaf & Tissue Test",
823
+ description: "Nutrient analysis of plant tissue samples.",
824
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
825
+ },
826
+ ["WATER_TEST" /* WATER_TEST */]: {
827
+ label: "Water Quality Test",
828
+ description: "Testing for irrigation suitability and microbial levels.",
829
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
830
+ },
831
+ ["MRL_TESTING" /* MRL_TESTING */]: {
832
+ label: "MRL Residue Analysis",
833
+ description: "Maximum Residue Limit reports for chemical compliance.",
834
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
835
+ },
836
+ ["HEAVY_METAL" /* HEAVY_METAL */]: {
837
+ label: "Heavy Metal Analysis",
838
+ description: "Testing for lead, cadmium, and other metal contaminants.",
839
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
840
+ },
841
+ ["MICROBIAL" /* MICROBIAL */]: {
842
+ label: "Microbial Testing",
843
+ description: "Pathogen detection reports (e.g., E. coli, Salmonella).",
844
+ category: "Agronomy & Testing" /* AGRONOMY_TESTING */
845
+ },
846
+ // --- FARM OPERATIONS ---
847
+ ["SPRAY_RECORD" /* SPRAY_RECORD */]: {
848
+ label: "Spray Operations",
849
+ description: "Chemical application logs and weather conditions.",
850
+ category: "Farm Operations" /* FARM_OPERATIONS */
851
+ },
852
+ ["FERTIGATION_RECORD" /* FERTIGATION_RECORD */]: {
853
+ label: "Fertigation Logs",
854
+ description: "Records of liquid fertilizer applied via irrigation.",
855
+ category: "Farm Operations" /* FARM_OPERATIONS */
856
+ },
857
+ ["FERTILIZER_RECORD" /* FERTILIZER_RECORD */]: {
858
+ label: "Fertilizer Records",
859
+ description: "Manual granular or bulk fertilizer application logs.",
860
+ category: "Farm Operations" /* FARM_OPERATIONS */
861
+ },
862
+ ["HARVEST_LOG" /* HARVEST_LOG */]: {
863
+ label: "Harvest Manifests",
864
+ description: "Daily picking volumes and block yield data.",
865
+ category: "Farm Operations" /* FARM_OPERATIONS */
866
+ },
867
+ ["PACKHOUSE_INSPECTION" /* PACKHOUSE_INSPECTION */]: {
868
+ label: "Packhouse Inspections",
869
+ description: "Quality and hygiene checks conducted in the packhouse.",
870
+ category: "Farm Operations" /* FARM_OPERATIONS */
871
+ },
872
+ ["MAPPING_TRAFIC_MANAGEMENT" /* MAPPING_TRAFIC_MANAGEMENT */]: {
873
+ label: "Traffic Management",
874
+ description: "Maps and rules for vehicle and heavy machinery movement.",
875
+ category: "Farm Operations" /* FARM_OPERATIONS */
876
+ },
877
+ // --- COMPLIANCE & QUALITY ---
878
+ ["QA" /* QA */]: {
879
+ label: "Quality Assurance",
880
+ description: "General product quality checks and grading standards.",
881
+ category: "Compliance & Quality" /* COMPLIANCE_QA */
882
+ },
883
+ ["PEST" /* PEST */]: {
884
+ label: "Pest & Disease Monitoring",
885
+ description: "Scouting reports and pest pressure assessments.",
886
+ category: "Compliance & Quality" /* COMPLIANCE_QA */
887
+ },
888
+ ["AUDIT_REPORT" /* AUDIT_REPORT */]: {
889
+ label: "External Audit Reports",
890
+ description: "Final results from Freshcare, GlobalGAP, or Organic audits.",
891
+ category: "Compliance & Quality" /* COMPLIANCE_QA */
892
+ },
893
+ ["RISK_ASSESSMENTS" /* RISK_ASSESSMENTS */]: {
894
+ label: "Risk Assessments",
895
+ description: "Operational hazard identification and safety mitigations.",
896
+ category: "Compliance & Quality" /* COMPLIANCE_QA */
897
+ },
898
+ // --- ASSETS & MAINTENANCE ---
899
+ ["SERVICING_MAINTENANCE" /* SERVICING_MAINTENANCE */]: {
900
+ label: "Equipment Maintenance",
901
+ description: "Service history and repair logs for farm machinery.",
902
+ category: "Assets & Maintenance" /* ASSETS_MAINT */
903
+ },
904
+ ["EQUIPMENT_CALIBRATION_RECORD" /* EQUIPMENT_CALIBRATION_RECORD */]: {
905
+ label: "Calibration Records",
906
+ description: "Accuracy checks for sprayers, scales, and moisture probes.",
907
+ category: "Assets & Maintenance" /* ASSETS_MAINT */
908
+ },
909
+ ["CLEANING" /* CLEANING */]: {
910
+ label: "Sanitation Logs",
911
+ description: "Daily/weekly cleaning schedules for tools and facilities.",
912
+ category: "Assets & Maintenance" /* ASSETS_MAINT */
913
+ },
914
+ ["MAPPING_FARM_MAPS" /* MAPPING_FARM_MAPS */]: {
915
+ label: "Farm Infrastructure Maps",
916
+ description: "Layouts of blocks, irrigation, and fixed assets.",
917
+ category: "Assets & Maintenance" /* ASSETS_MAINT */
918
+ },
919
+ // --- INVENTORY & LOGISTICS ---
920
+ ["INVENTORY_CHEMICALS" /* INVENTORY_CHEMICALS */]: {
921
+ label: "Chemical Inventory",
922
+ description: "Manifests for stored pesticides and fertilizers.",
923
+ category: "Inventory & Logistics" /* INVENTORY_LOG */
924
+ },
925
+ ["INVENTORY_BOX_CARTON" /* INVENTORY_BOX_CARTON */]: {
926
+ label: "Packaging Inventory",
927
+ description: "Stock levels for cartons, bins, and packaging materials.",
928
+ category: "Inventory & Logistics" /* INVENTORY_LOG */
929
+ },
930
+ ["INVENTORY_CONSUMABLES" /* INVENTORY_CONSUMABLES */]: {
931
+ label: "General Consumables",
932
+ description: "Stock tracking for fuel, PPE, and workshop supplies.",
933
+ category: "Inventory & Logistics" /* INVENTORY_LOG */
934
+ },
935
+ ["STOCKTAKE" /* STOCKTAKE */]: {
936
+ label: "Physical Stocktake",
937
+ description: "Periodic audits of physical vs. recorded stock levels.",
938
+ category: "Inventory & Logistics" /* INVENTORY_LOG */
939
+ },
940
+ ["STOCKTAKE_MSDS" /* STOCKTAKE_MSDS */]: {
941
+ label: "MSDS / Safety Data",
942
+ description: "Material Safety Data Sheets for stored chemicals.",
943
+ category: "Inventory & Logistics" /* INVENTORY_LOG */
944
+ },
945
+ // --- HR, LEGAL & SAFETY ---
946
+ ["TRAINING_RECORDS" /* TRAINING_RECORDS */]: {
947
+ label: "Staff Inductions",
948
+ description: "General staff onboarding and safety training logs.",
949
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
950
+ },
951
+ ["TRAINING_CERTIFICATE" /* TRAINING_CERTIFICATE */]: {
952
+ label: "Training Certificates",
953
+ description: "External licenses, ChemCert, and first aid tickets.",
954
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
955
+ },
956
+ ["SOPS" /* SOPS */]: {
957
+ label: "Standard Procedures (SOPs)",
958
+ description: "Formalized instructions for farm and packhouse tasks.",
959
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
960
+ },
961
+ ["LEGAL_CONTRACT" /* LEGAL_CONTRACT */]: {
962
+ label: "Legal Contracts",
963
+ description: "Lease agreements, supply contracts, and employment terms.",
964
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
965
+ },
966
+ ["INCIDENT_REPORT" /* INCIDENT_REPORT */]: {
967
+ label: "Incident Reports",
968
+ description: "Logs of injuries, near-misses, or property damage.",
969
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
970
+ },
971
+ ["SENSITIVE_IDENTITY" /* SENSITIVE_IDENTITY */]: {
972
+ label: "Identity & Visas",
973
+ description: "Sensitive data: Passports, ID cards, and work permits.",
974
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
975
+ },
976
+ ["MAPPING_EMERGENCY" /* MAPPING_EMERGENCY */]: {
977
+ label: "Emergency Response Maps",
978
+ description: "Evacuation routes and emergency assembly points.",
979
+ category: "HR, Legal & Safety" /* HR_LEGAL_SAFETY */
980
+ },
981
+ // --- FINANCE & ADMIN ---
982
+ ["INVOICE" /* INVOICE */]: {
983
+ label: "Supplier Invoices",
984
+ description: "Billing records for inputs, utilities, and services.",
985
+ category: "Finance & Admin" /* FINANCE_ADMIN */
986
+ }
987
+ };
988
+ var CATEGORY_TABS = [
989
+ "All",
990
+ ...Object.values(DocumentCategory)
991
+ ];
792
992
  var DOCUMENT_MENU_MAP = {
793
993
  ["SPRAY_RECORD" /* SPRAY_RECORD */]: [RESOURCE_PATHS.farmManagement],
794
994
  ["FERTIGATION_RECORD" /* FERTIGATION_RECORD */]: [RESOURCE_PATHS.farmManagement],
@@ -824,6 +1024,36 @@ var DOCUMENT_MENU_MAP = {
824
1024
  ["AUDIT_REPORT" /* AUDIT_REPORT */]: [RESOURCE_PATHS.safetyAuditing, RESOURCE_PATHS.dashboard],
825
1025
  ["SENSITIVE_IDENTITY" /* SENSITIVE_IDENTITY */]: [RESOURCE_PATHS.adminUserRoster]
826
1026
  };
1027
+ var SIGNATURE_MODES = {
1028
+ TYPED_NAME: "typed_name",
1029
+ DRAWN_IMAGE: "drawn_image",
1030
+ UPLOADED_IMAGE: "uploaded_image"
1031
+ };
1032
+ var CORRECTIVE_ACTION_STATUSES = {
1033
+ DRAFT: "draft",
1034
+ GENERATED: "generated",
1035
+ REVIEWED: "reviewed",
1036
+ CLOSED: "closed",
1037
+ FAILED: "failed"
1038
+ };
1039
+ var TEMPLATE_SCOPE_LEVELS = {
1040
+ FACILITY: "facility",
1041
+ LEGAL_ENTITY: "legalEntity",
1042
+ COMPANY: "company"
1043
+ };
1044
+ var CORRECTIVE_ACTION_GENERATION_SOURCES = {
1045
+ CREATE: "CREATE",
1046
+ RECREATE: "RECREATE"
1047
+ };
1048
+ var CAR_SUPPORTED_EVIDENCE_MIME_TYPES = [
1049
+ "application/pdf",
1050
+ "image/png",
1051
+ "image/jpeg"
1052
+ ];
1053
+ var CAR_SUPPORTED_SIGNATURE_MIME_TYPES = [
1054
+ "image/png",
1055
+ "image/jpeg"
1056
+ ];
827
1057
 
828
1058
  // src/index.ts
829
1059
  var AppError = class extends Error {
@@ -1153,10 +1383,17 @@ function calculateFileMetadataMatch(criteria, fileMetadata, auditContext) {
1153
1383
  ApprovalType,
1154
1384
  AuditStatus,
1155
1385
  AuditType,
1386
+ CAR_SUPPORTED_EVIDENCE_MIME_TYPES,
1387
+ CAR_SUPPORTED_SIGNATURE_MIME_TYPES,
1156
1388
  CAT,
1389
+ CATEGORY_TABS,
1390
+ CORRECTIVE_ACTION_GENERATION_SOURCES,
1391
+ CORRECTIVE_ACTION_STATUSES,
1157
1392
  Converter,
1158
1393
  CropCycleStatus,
1394
+ DOCUMENT_DISPLAY_INFO,
1159
1395
  DOCUMENT_MENU_MAP,
1396
+ DocumentCategory,
1160
1397
  DocumentType,
1161
1398
  ERROR_DICTIONARY,
1162
1399
  EVERYONE,
@@ -1183,8 +1420,10 @@ function calculateFileMetadataMatch(criteria, fileMetadata, auditContext) {
1183
1420
  RelationshipType,
1184
1421
  RowOrientation,
1185
1422
  SENTINEL_UUID,
1423
+ SIGNATURE_MODES,
1186
1424
  SoilTexture,
1187
1425
  TASK_TYPE_REGISTRY,
1426
+ TEMPLATE_SCOPE_LEVELS,
1188
1427
  TargetEntityType,
1189
1428
  TaskStatus,
1190
1429
  TaskType,
package/dist/index.mjs CHANGED
@@ -6,9 +6,16 @@ import {
6
6
  ApprovalType,
7
7
  AuditStatus,
8
8
  AuditType,
9
+ CAR_SUPPORTED_EVIDENCE_MIME_TYPES,
10
+ CAR_SUPPORTED_SIGNATURE_MIME_TYPES,
9
11
  CAT,
12
+ CATEGORY_TABS,
13
+ CORRECTIVE_ACTION_GENERATION_SOURCES,
14
+ CORRECTIVE_ACTION_STATUSES,
10
15
  CropCycleStatus,
16
+ DOCUMENT_DISPLAY_INFO,
11
17
  DOCUMENT_MENU_MAP,
18
+ DocumentCategory,
12
19
  DocumentType,
13
20
  ERROR_DICTIONARY,
14
21
  EVERYONE,
@@ -34,8 +41,10 @@ import {
34
41
  RelationshipType,
35
42
  RowOrientation,
36
43
  SENTINEL_UUID,
44
+ SIGNATURE_MODES,
37
45
  SoilTexture,
38
46
  TASK_TYPE_REGISTRY,
47
+ TEMPLATE_SCOPE_LEVELS,
39
48
  TargetEntityType,
40
49
  TaskStatus,
41
50
  TaskType,
@@ -45,7 +54,7 @@ import {
45
54
  UserRole,
46
55
  VigorRating,
47
56
  WaterSource
48
- } from "./chunk-QI4YXI4P.mjs";
57
+ } from "./chunk-LYIT2TMM.mjs";
49
58
 
50
59
  // src/index.ts
51
60
  import { jwtVerify } from "jose";
@@ -563,10 +572,17 @@ export {
563
572
  ApprovalType,
564
573
  AuditStatus,
565
574
  AuditType,
575
+ CAR_SUPPORTED_EVIDENCE_MIME_TYPES,
576
+ CAR_SUPPORTED_SIGNATURE_MIME_TYPES,
566
577
  CAT,
578
+ CATEGORY_TABS,
579
+ CORRECTIVE_ACTION_GENERATION_SOURCES,
580
+ CORRECTIVE_ACTION_STATUSES,
567
581
  Converter,
568
582
  CropCycleStatus,
583
+ DOCUMENT_DISPLAY_INFO,
569
584
  DOCUMENT_MENU_MAP,
585
+ DocumentCategory,
570
586
  DocumentType,
571
587
  ERROR_DICTIONARY,
572
588
  EVERYONE,
@@ -593,8 +609,10 @@ export {
593
609
  RelationshipType,
594
610
  RowOrientation,
595
611
  SENTINEL_UUID,
612
+ SIGNATURE_MODES,
596
613
  SoilTexture,
597
614
  TASK_TYPE_REGISTRY,
615
+ TEMPLATE_SCOPE_LEVELS,
598
616
  TargetEntityType,
599
617
  TaskStatus,
600
618
  TaskType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litusarchieve18/agricore-utils",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "Canonical Backend Utility Library for AgriCore",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",