adjust collection; adjust migration

This commit is contained in:
giovanni
2026-04-14 16:52:50 +07:00
parent 9b0335cac8
commit 6a012b75aa
7 changed files with 5261 additions and 246 deletions
+2798 -72
View File
File diff suppressed because it is too large Load Diff
+1961 -67
View File
File diff suppressed because it is too large Load Diff
+80 -75
View File
@@ -6,6 +6,24 @@
"item": [ "item": [
{ {
"item": [ "item": [
{
"item": [
{
"name": "GET api / constants",
"request": {
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"method": "GET",
"url": "{{base_url}}/api/constants/"
}
}
],
"name": "API"
},
{ {
"item": [ "item": [
{ {
@@ -76,27 +94,9 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/approvals/" "url": "{{base_url}}/api/approvals/?module_name=EXPENSES\u0026module_id=1\u0026group_step_number=false\u0026page=1\u0026limit=10\u0026search=approval\u0026order_by_date=DESC"
} }
}, },
{
"name": "GET api / constants",
"request": {
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"method": "GET",
"url": "{{base_url}}/api/constants/"
}
}
],
"name": "API"
},
{
"item": [
{ {
"name": "GET api / closings", "name": "GET api / closings",
"request": { "request": {
@@ -107,9 +107,14 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/" "url": "{{base_url}}/api/closings/?page=1\u0026limit=10\u0026search=kandang\u0026project_status=1\u0026location_id={{location_id}}"
} }
}
],
"name": "API"
}, },
{
"item": [
{ {
"name": "GET api / closings / :projectFlockId", "name": "GET api / closings / :projectFlockId",
"request": { "request": {
@@ -120,7 +125,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{projectFlockId}}" "url": "{{base_url}}/api/closings/{{projectFlockId}}?kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -133,7 +138,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{projectFlockId}}/keuangan" "url": "{{base_url}}/api/closings/{{projectFlockId}}/keuangan?kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -146,7 +151,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{projectFlockId}}/production-data" "url": "{{base_url}}/api/closings/{{projectFlockId}}/production-data?kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -159,7 +164,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{projectFlockId}}/sapronak?type=incoming" "url": "{{base_url}}/api/closings/{{projectFlockId}}/sapronak?type=incoming\u0026page=1\u0026limit=10\u0026search=pakan\u0026kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -172,7 +177,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{projectFlockId}}/sapronak/summary?type=incoming" "url": "{{base_url}}/api/closings/{{projectFlockId}}/sapronak/summary?type=incoming\u0026search=pakan\u0026kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -237,7 +242,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{project_flock_id}}/{{project_flock_kandang_id}}/perhitungan_sapronak" "url": "{{base_url}}/api/closings/{{project_flock_id}}/{{project_flock_kandang_id}}/perhitungan_sapronak?flag=DOC"
} }
}, },
{ {
@@ -250,7 +255,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{project_flock_id}}/expedition-hpp" "url": "{{base_url}}/api/closings/{{project_flock_id}}/expedition-hpp?project_flock_kandang_id={{project_flock_kandang_id}}"
} }
}, },
{ {
@@ -289,7 +294,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/closings/{{project_flock_id}}/perhitungan_sapronak" "url": "{{base_url}}/api/closings/{{project_flock_id}}/perhitungan_sapronak?flag=DOC"
} }
} }
], ],
@@ -307,7 +312,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/daily-checklists/" "url": "{{base_url}}/api/daily-checklists/?page=1\u0026limit=10\u0026search=kebersihan\u0026date_from=2026-01-01\u0026date_to=2026-01-31\u0026status=done\u0026kandang_id={{idProjectFlockKandang}}"
} }
}, },
{ {
@@ -346,7 +351,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/daily-checklists/report" "url": "{{base_url}}/api/daily-checklists/report?page=1\u0026limit=10\u0026bulan=1\u0026tahun=2026\u0026area_id={{area_id}}\u0026location_id={{location_id}}\u0026kandang_id={{idProjectFlockKandang}}\u0026employee_id={{employee_id}}\u0026phase_id={{id}}"
} }
}, },
{ {
@@ -359,7 +364,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/daily-checklists/summary" "url": "{{base_url}}/api/daily-checklists/summary?date_from=2026-01-01\u0026date_to=2026-01-31\u0026category=cleaning\u0026kandang_id={{idProjectFlockKandang}}"
} }
}, },
{ {
@@ -372,7 +377,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/daily-checklists/tasks" "url": "{{base_url}}/api/daily-checklists/tasks?checklist_id={{idDailyChecklist}}"
} }
} }
], ],
@@ -390,7 +395,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/dashboards/" "url": "{{base_url}}/api/dashboards/?page=1\u0026limit=10\u0026search=farm\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026analysis_mode=OVERVIEW\u0026comparison_type=PREVIOUS_PERIOD\u0026metric=egg_mass\u0026location_ids=1,2\u0026flock_ids=1,2\u0026kandang_ids=1,2\u0026include=performance,summary"
} }
} }
], ],
@@ -408,7 +413,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/expenses/" "url": "{{base_url}}/api/expenses/?page=1\u0026limit=10\u0026search=operasional"
} }
}, },
{ {
@@ -478,7 +483,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/finance/transactions/" "url": "{{base_url}}/api/finance/transactions/?page=1\u0026limit=10\u0026search=invoice\u0026bank_ids={{bank_id}}\u0026customer_ids=1,2\u0026supplier_ids=1,2\u0026transaction_types=payment,initial_balance\u0026sort_date=created_at\u0026start_date=2026-01-01\u0026end_date=2026-01-31"
} }
}, },
{ {
@@ -509,7 +514,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/inventory/adjustments/" "url": "{{base_url}}/api/inventory/adjustments/?page=1\u0026limit=10\u0026product_id={{product_id}}\u0026warehouse_id={{warehouse_id}}\u0026transaction_type=IN\u0026transaction_subtype=ADJUSTMENT\u0026function_code=MANUAL_ADJUSTMENT"
} }
}, },
{ {
@@ -535,7 +540,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/inventory/product-stocks/" "url": "{{base_url}}/api/inventory/product-stocks/?page=1\u0026limit=10\u0026search=pakan"
} }
}, },
{ {
@@ -561,7 +566,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/inventory/product-warehouses/" "url": "{{base_url}}/api/inventory/product-warehouses/?page=1\u0026limit=10\u0026search=gudang\u0026product_id={{product_id}}\u0026warehouse_id={{warehouse_id}}\u0026location_id={{location_id}}\u0026flags=DOC\u0026kandang_id={{project_flock_kandang_id}}\u0026available_only=true\u0026transfer_context=inventory_transfer\u0026stock_mode=exclude_chickin\u0026type=incoming"
} }
}, },
{ {
@@ -587,7 +592,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/inventory/transfers/" "url": "{{base_url}}/api/inventory/transfers/?page=1\u0026limit=10\u0026search=TRF"
} }
}, },
{ {
@@ -618,7 +623,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/marketing/" "url": "{{base_url}}/api/marketing/?page=1\u0026limit=10\u0026search=delivery\u0026product_ids=1,2\u0026status=DRAFT\u0026customer_id={{customer_id}}\u0026marketing_id=1"
} }
}, },
{ {
@@ -649,7 +654,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/areas/" "url": "{{base_url}}/api/master-data/areas/?page=1\u0026limit=10\u0026search=bandung"
} }
}, },
{ {
@@ -675,7 +680,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/banks/" "url": "{{base_url}}/api/master-data/banks/?page=1\u0026limit=10\u0026search=bca"
} }
}, },
{ {
@@ -701,7 +706,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/config-checklists/" "url": "{{base_url}}/api/master-data/config-checklists/?page=1\u0026limit=10\u0026search=harian"
} }
}, },
{ {
@@ -727,7 +732,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/customers/" "url": "{{base_url}}/api/master-data/customers/?page=1\u0026limit=10\u0026search=pt\u0026has_marketing=true"
} }
}, },
{ {
@@ -753,7 +758,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/employees/" "url": "{{base_url}}/api/master-data/employees/?page=1\u0026limit=10\u0026search=andi\u0026kandang_id={{project_flock_kandang_id}}\u0026is_active=true"
} }
}, },
{ {
@@ -779,7 +784,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/fcrs/" "url": "{{base_url}}/api/master-data/fcrs/?page=1\u0026limit=10\u0026search=fcr"
} }
}, },
{ {
@@ -805,7 +810,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/flocks/" "url": "{{base_url}}/api/master-data/flocks/?page=1\u0026limit=10\u0026search=layer"
} }
}, },
{ {
@@ -831,7 +836,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/kandang-groups/" "url": "{{base_url}}/api/master-data/kandang-groups/?page=1\u0026limit=10\u0026search=blok\u0026location_id={{location_id}}\u0026pic_id={{employee_id}}"
} }
}, },
{ {
@@ -857,7 +862,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/kandangs/" "url": "{{base_url}}/api/master-data/kandangs/?page=1\u0026limit=10\u0026search=kandang\u0026location_id={{location_id}}\u0026pic_id={{employee_id}}"
} }
}, },
{ {
@@ -883,7 +888,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/locations/" "url": "{{base_url}}/api/master-data/locations/?page=1\u0026limit=10\u0026search=farm\u0026area_id={{area_id}}\u0026has_laying=false"
} }
}, },
{ {
@@ -909,7 +914,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/nonstocks/" "url": "{{base_url}}/api/master-data/nonstocks/?page=1\u0026limit=10\u0026search=vitamin\u0026supplier_id={{supplier_id}}"
} }
}, },
{ {
@@ -935,7 +940,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/phase-activities/" "url": "{{base_url}}/api/master-data/phase-activities/?page=1\u0026limit=10\u0026search=cek pakan\u0026phase_ids=1,2"
} }
}, },
{ {
@@ -961,7 +966,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/phases/" "url": "{{base_url}}/api/master-data/phases/?page=1\u0026limit=10\u0026search=starter\u0026category=Growing"
} }
}, },
{ {
@@ -987,7 +992,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/product-categories/" "url": "{{base_url}}/api/master-data/product-categories/?page=1\u0026limit=10\u0026search=pakan"
} }
}, },
{ {
@@ -1013,7 +1018,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/production-standards/" "url": "{{base_url}}/api/master-data/production-standards/?page=1\u0026limit=10\u0026search=standar\u0026project_category=GROWING"
} }
}, },
{ {
@@ -1039,7 +1044,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/products/" "url": "{{base_url}}/api/master-data/products/?page=1\u0026limit=10\u0026search=jagung\u0026product_category_id={{product_category_id}}\u0026is_depletion=false\u0026include_all=false"
} }
}, },
{ {
@@ -1065,7 +1070,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/suppliers/" "url": "{{base_url}}/api/master-data/suppliers/?page=1\u0026limit=10\u0026search=supplier\u0026flag=ACTIVE\u0026category=PAKAN"
} }
}, },
{ {
@@ -1091,7 +1096,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/uoms/" "url": "{{base_url}}/api/master-data/uoms/?page=1\u0026limit=10\u0026search=kg"
} }
}, },
{ {
@@ -1117,7 +1122,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/master-data/warehouses/" "url": "{{base_url}}/api/master-data/warehouses/?page=1\u0026limit=10\u0026search=gudang\u0026area_id={{area_id}}\u0026location_id={{location_id}}\u0026active_project_flock=false\u0026transfer_context=inventory_transfer"
} }
}, },
{ {
@@ -1161,7 +1166,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/project-flock-kandangs/" "url": "{{base_url}}/api/production/project-flock-kandangs/?page=1\u0026limit=10\u0026search=kandang\u0026name_with_periode=false\u0026project_flock_id={{project_flock_id}}\u0026kandang_id={{project_flock_kandang_id}}\u0026category=Growing\u0026area_id={{area_id}}\u0026location_id={{location_id}}\u0026sort_by=created_at\u0026sort_order=ASC\u0026step_name=Pengajuan"
} }
}, },
{ {
@@ -1200,7 +1205,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/project-flocks/" "url": "{{base_url}}/api/production/project-flocks/?page=1\u0026limit=10\u0026search=flock\u0026sort_by=created_at\u0026sort_order=asc\u0026area_id={{area_id}}\u0026location_id={{location_id}}\u0026period=1\u0026category=Growing\u0026status=Aktif\u0026kandang_id=1,2\u0026transfer_context=transfer_to_laying"
} }
}, },
{ {
@@ -1226,7 +1231,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/project-flocks/kandangs/lookup" "url": "{{base_url}}/api/production/project-flocks/kandangs/lookup?project_flock_id={{project_flock_id}}\u0026kandang_id={{project_flock_kandang_id}}\u0026withpopulation=false\u0026record_date=2026-01-01"
} }
}, },
{ {
@@ -1252,7 +1257,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/recordings/" "url": "{{base_url}}/api/production/recordings/?page=1\u0026limit=10\u0026project_flock_kandang_id={{project_flock_kandang_id}}\u0026search=record\u0026export=excel"
} }
}, },
{ {
@@ -1278,7 +1283,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/recordings/next-day" "url": "{{base_url}}/api/production/recordings/next-day?project_flock_kandang_id={{project_flock_kandang_id}}\u0026record_date=2026-01-01"
} }
}, },
{ {
@@ -1291,7 +1296,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/transfer_layings/" "url": "{{base_url}}/api/production/transfer_layings/?page=1\u0026limit=10\u0026search=transfer\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026flock_source=1,2\u0026flock_destination=3,4\u0026status=DRAFT,APPROVED"
} }
}, },
{ {
@@ -1343,7 +1348,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/production/uniformities/" "url": "{{base_url}}/api/production/uniformities/?page=1\u0026limit=10\u0026project_flock_kandang_id={{project_flock_kandang_id}}\u0026week=1\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026with_chart=false"
} }
}, },
{ {
@@ -1374,7 +1379,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/purchases/" "url": "{{base_url}}/api/purchases/?page=1\u0026limit=10\u0026supplier_id={{supplier_id}}\u0026area_id={{area_id}}\u0026location_id={{location_id}}\u0026product_category_id=1\u0026approval_status=PENDING\u0026po_date=2026-01-01\u0026po_date_from=2026-01-01\u0026po_date_to=2026-01-31\u0026search=PO-\u0026created_from=2026-01-01\u0026created_to=2026-01-31"
} }
}, },
{ {
@@ -1405,7 +1410,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/customer-payment?customer_ids={{customer_id}}" "url": "{{base_url}}/api/reports/customer-payment?page=1\u0026limit=10\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026customer_ids={{customer_id}}\u0026filter_by=TRANS_DATE"
} }
}, },
{ {
@@ -1418,7 +1423,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/debt-supplier?supplier_ids={{supplier_id}}" "url": "{{base_url}}/api/reports/debt-supplier?page=1\u0026limit=10\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026supplier_ids={{supplier_id}}\u0026filter_by=received_date\u0026sort_order=asc"
} }
}, },
{ {
@@ -1431,7 +1436,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/expense" "url": "{{base_url}}/api/reports/expense?page=1\u0026limit=10\u0026search=operasional\u0026category=BOP\u0026supplier_id=1\u0026kandang_id=1\u0026project_flock_kandang_id=1\u0026nonstock_id=1\u0026location_id=1\u0026area_id=1\u0026realization_date=2026-01-15"
} }
}, },
{ {
@@ -1444,7 +1449,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/hpp-per-kandang" "url": "{{base_url}}/api/reports/hpp-per-kandang?page=1\u0026limit=10\u0026period=2026-01-01\u0026show_unrecorded=false\u0026area_id=1,2\u0026location_id=1,2\u0026kandang_id=1,2\u0026weight_min=1.2\u0026weight_max=1.8"
} }
}, },
{ {
@@ -1457,7 +1462,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/marketing" "url": "{{base_url}}/api/reports/marketing?page=1\u0026limit=10\u0026search=SO-\u0026customer_id=1\u0026product_id=1\u0026warehouse_id=1\u0026sales_person_id=1\u0026area_id=1\u0026location_id=1\u0026marketing_type=ayam\u0026filter_by=so_date\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026sort_by=so_date\u0026sort_order=asc"
} }
}, },
{ {
@@ -1470,7 +1475,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/production-result/{{idProjectFlockKandang}}" "url": "{{base_url}}/api/reports/production-result/{{idProjectFlockKandang}}?page=1\u0026limit=10"
} }
}, },
{ {
@@ -1483,7 +1488,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/reports/purchase-supplier" "url": "{{base_url}}/api/reports/purchase-supplier?page=1\u0026limit=10\u0026area_id=1,2\u0026supplier_id=1,2\u0026product_id=1,2\u0026product_category_id=1,2\u0026start_date=2026-01-01\u0026end_date=2026-01-31\u0026sort_by=created_at\u0026filter_by=received_date"
} }
} }
], ],
@@ -1501,7 +1506,7 @@
} }
], ],
"method": "GET", "method": "GET",
"url": "{{base_url}}/api/users/" "url": "{{base_url}}/api/users/?page=1\u0026limit=10\u0026search=admin"
} }
}, },
{ {
+2 -2
View File
@@ -193,7 +193,7 @@ func randomToken(size int) (string, error) {
func canonicalPermissions(perms []string) []string { func canonicalPermissions(perms []string) []string {
if len(perms) == 0 { if len(perms) == 0 {
return nil return []string{}
} }
seen := make(map[string]struct{}, len(perms)) seen := make(map[string]struct{}, len(perms))
@@ -214,7 +214,7 @@ func canonicalPermissions(perms []string) []string {
func uniqueUint(values []uint) []uint { func uniqueUint(values []uint) []uint {
if len(values) == 0 { if len(values) == 0 {
return nil return []uint{}
} }
seen := make(map[uint]struct{}, len(values)) seen := make(map[uint]struct{}, len(values))
+419 -29
View File
@@ -476,10 +476,11 @@ func buildPostmanURL(route normalizedRoute, meta routeMeta) string {
query := make([]string, 0, len(meta.QueryParams)) query := make([]string, 0, len(meta.QueryParams))
for _, param := range meta.QueryParams { for _, param := range meta.QueryParams {
if !param.IncludePostman { value := strings.TrimSpace(param.PostmanValue)
continue if value == "" && param.Example != nil {
value = fmt.Sprintf("%v", param.Example)
} }
query = append(query, fmt.Sprintf("%s=%v", param.Name, param.PostmanValue)) query = append(query, fmt.Sprintf("%s=%v", param.Name, value))
} }
if len(query) == 0 { if len(query) == 0 {
@@ -552,31 +553,103 @@ func buildPostmanEnvironment(routes []normalizedRoute) map[string]any {
} }
func describeRoute(route normalizedRoute) routeMeta { func describeRoute(route normalizedRoute) routeMeta {
routePath := route.Path
if len(routePath) > 1 {
routePath = strings.TrimSuffix(routePath, "/")
}
meta := routeMeta{ meta := routeMeta{
Group: "Dashboard API Key", Group: "Dashboard API Key",
Tag: inferTag(route.Path), Tag: inferTag(routePath),
Summary: defaultSummary(route.Path), Summary: defaultSummary(routePath),
Description: fmt.Sprintf("Read access to `%s`.", route.Path), Description: fmt.Sprintf("Read access to `%s`.", routePath),
Security: securityAPIOrBearer, Security: securityAPIOrBearer,
ListStyle: !strings.Contains(route.Path, ":"), ListStyle: !strings.Contains(routePath, ":"),
} }
switch { switch {
case route.Path == "/healthz" || route.Path == "/readyz" || route.Path == "/api/constants": case routePath == "/healthz" || routePath == "/readyz" || routePath == "/api/constants":
meta.Group = "Public" meta.Group = "Public"
meta.Security = securityNone meta.Security = securityNone
meta.ListStyle = false meta.ListStyle = false
case strings.HasPrefix(route.Path, "/api/sso/"): case strings.HasPrefix(routePath, "/api/sso/"):
meta.Group = "Internal/OAuth Reference" meta.Group = "Internal/OAuth Reference"
meta.ListStyle = false meta.ListStyle = false
if route.Path == "/api/sso/userinfo" { if routePath == "/api/sso/userinfo" {
meta.Security = securityBearer meta.Security = securityBearer
} else { } else {
meta.Security = securityNone meta.Security = securityNone
} }
} }
switch route.Path { switch routePath {
case "/api/approvals":
meta.QueryParams = []parameterMeta{
{Name: "module_name", In: "query", Description: "Approval workflow module name.", Required: true, Example: "EXPENSES", PostmanValue: "EXPENSES"},
{Name: "module_id", In: "query", Description: "Optional approvable module id.", Example: 1},
{Name: "group_step_number", In: "query", Description: "Group approval records by step number.", Example: false},
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "approval"},
{Name: "order_by_date", In: "query", Description: "Sort direction by date.", Example: "DESC"},
}
case "/api/daily-checklists":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "kebersihan"},
{Name: "date_from", In: "query", Description: "Start date filter (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "date_to", In: "query", Description: "End date filter (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "status", In: "query", Description: "Checklist status filter.", Example: "done"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{idProjectFlockKandang}}"},
}
case "/api/daily-checklists/report":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Required: true, Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Required: true, Example: 10},
{Name: "bulan", In: "query", Description: "Month number (1-12).", Required: true, Example: 1},
{Name: "tahun", In: "query", Description: "Year.", Required: true, Example: 2026},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{idProjectFlockKandang}}"},
{Name: "employee_id", In: "query", Description: "Employee id filter.", Example: 1, PostmanValue: "{{employee_id}}"},
{Name: "phase_id", In: "query", Description: "Phase id filter.", Example: 1, PostmanValue: "{{id}}"},
}
case "/api/daily-checklists/summary":
meta.QueryParams = []parameterMeta{
{Name: "date_from", In: "query", Description: "Start date filter (YYYY-MM-DD).", Required: true, Example: "2026-01-01"},
{Name: "date_to", In: "query", Description: "End date filter (YYYY-MM-DD).", Required: true, Example: "2026-01-31"},
{Name: "category", In: "query", Description: "Checklist category filter.", Example: "cleaning"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{idProjectFlockKandang}}"},
}
case "/api/daily-checklists/tasks":
meta.QueryParams = []parameterMeta{
{Name: "checklist_id", In: "query", Description: "Daily checklist id.", Required: true, Example: 1, PostmanValue: "{{idDailyChecklist}}"},
}
case "/api/closings":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "kandang"},
{Name: "project_status", In: "query", Description: "Project status filter (1 or 2).", Example: 1},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
}
case "/api/closings/:projectFlockId":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
}
case "/api/closings/:project_flock_id/perhitungan_sapronak", "/api/closings/:project_flock_id/:project_flock_kandang_id/perhitungan_sapronak":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "flag", In: "query", Description: "Product category flag filter (DOC/OVK/PAKAN/PULLET).", Example: "DOC"},
}
case "/api/expenses":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "operasional"},
}
case "/api/dashboards": case "/api/dashboards":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1}, {Name: "page", In: "query", Description: "Page number.", Example: 1},
@@ -592,22 +665,309 @@ func describeRoute(route normalizedRoute) routeMeta {
{Name: "kandang_ids", In: "query", Description: "Comma separated kandang ids.", Example: "1,2"}, {Name: "kandang_ids", In: "query", Description: "Comma separated kandang ids.", Example: "1,2"},
{Name: "include", In: "query", Description: "Comma separated dashboard sections to include.", Example: "performance,summary"}, {Name: "include", In: "query", Description: "Comma separated dashboard sections to include.", Example: "performance,summary"},
} }
case "/api/closings/:projectFlockId/sapronak", "/api/closings/:projectFlockId/sapronak/summary": case "/api/closings/:projectFlockId/sapronak":
meta.ListStyle = route.Path == "/api/closings/:projectFlockId/sapronak" meta.ListStyle = true
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "type", In: "query", Description: "Required sapronak direction.", Required: true, Example: "incoming", PostmanValue: "incoming", IncludePostman: true}, {Name: "type", In: "query", Description: "Required sapronak direction.", Required: true, Example: "incoming", PostmanValue: "incoming"},
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "pakan"}, {Name: "search", In: "query", Description: "Search keyword.", Example: "pakan"},
{Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1}, {Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
}
case "/api/closings/:projectFlockId/sapronak/summary":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "type", In: "query", Description: "Required sapronak direction.", Required: true, Example: "incoming", PostmanValue: "incoming"},
{Name: "search", In: "query", Description: "Search keyword.", Example: "pakan"},
{Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
} }
case "/api/closings/:projectFlockId/production-data", "/api/closings/:projectFlockId/keuangan": case "/api/closings/:projectFlockId/production-data", "/api/closings/:projectFlockId/keuangan":
meta.ListStyle = false meta.ListStyle = false
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1}, {Name: "kandang_id", In: "query", Description: "Optional kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
} }
case "/api/closings/:project_flock_id/expedition-hpp": case "/api/closings/:project_flock_id/expedition-hpp":
meta.ListStyle = false meta.ListStyle = false
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "project_flock_kandang_id", In: "query", Description: "Optional project flock kandang id filter.", Example: 1}, {Name: "project_flock_kandang_id", In: "query", Description: "Optional project flock kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
}
case "/api/inventory/adjustments":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "product_id", In: "query", Description: "Product id filter.", Example: 1, PostmanValue: "{{product_id}}"},
{Name: "warehouse_id", In: "query", Description: "Warehouse id filter.", Example: 1, PostmanValue: "{{warehouse_id}}"},
{Name: "transaction_type", In: "query", Description: "Transaction type filter.", Example: "IN"},
{Name: "transaction_subtype", In: "query", Description: "Transaction subtype filter.", Example: "ADJUSTMENT"},
{Name: "function_code", In: "query", Description: "Function code filter.", Example: "MANUAL_ADJUSTMENT"},
}
case "/api/inventory/product-stocks":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "pakan"},
}
case "/api/inventory/product-warehouses":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "gudang"},
{Name: "product_id", In: "query", Description: "Product id filter.", Example: 1, PostmanValue: "{{product_id}}"},
{Name: "warehouse_id", In: "query", Description: "Warehouse id filter.", Example: 1, PostmanValue: "{{warehouse_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "flags", In: "query", Description: "Stock flags filter.", Example: "DOC"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "available_only", In: "query", Description: "Show available stock only.", Example: true},
{Name: "transfer_context", In: "query", Description: "Transfer context filter.", Example: "inventory_transfer"},
{Name: "stock_mode", In: "query", Description: "Stock mode filter.", Example: "exclude_chickin"},
{Name: "type", In: "query", Description: "Warehouse stock type filter.", Example: "incoming"},
}
case "/api/inventory/transfers":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "TRF"},
}
case "/api/marketing":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "delivery"},
{Name: "product_ids", In: "query", Description: "Comma separated product ids.", Example: "1,2"},
{Name: "status", In: "query", Description: "Delivery status filter.", Example: "DRAFT"},
{Name: "customer_id", In: "query", Description: "Customer id filter.", Example: 1, PostmanValue: "{{customer_id}}"},
{Name: "marketing_id", In: "query", Description: "Marketing id filter.", Example: 1},
}
case "/api/master-data/areas":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "bandung"},
}
case "/api/master-data/banks":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "bca"},
}
case "/api/master-data/config-checklists":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "harian"},
}
case "/api/master-data/customers":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "pt"},
{Name: "has_marketing", In: "query", Description: "Filter customer by marketing relation.", Example: true},
}
case "/api/master-data/employees":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "andi"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "is_active", In: "query", Description: "Active status filter.", Example: true},
}
case "/api/master-data/fcrs":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "fcr"},
}
case "/api/master-data/flocks":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "layer"},
}
case "/api/master-data/kandang-groups":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "blok"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "pic_id", In: "query", Description: "Person in charge id filter.", Example: 1, PostmanValue: "{{employee_id}}"},
}
case "/api/master-data/kandangs":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "kandang"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "pic_id", In: "query", Description: "Person in charge id filter.", Example: 1, PostmanValue: "{{employee_id}}"},
}
case "/api/master-data/locations":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "farm"},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "has_laying", In: "query", Description: "Filter laying locations only.", Example: false},
}
case "/api/master-data/nonstocks":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "vitamin"},
{Name: "supplier_id", In: "query", Description: "Supplier id filter.", Example: 1, PostmanValue: "{{supplier_id}}"},
}
case "/api/master-data/phase-activities":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "cek pakan"},
{Name: "phase_ids", In: "query", Description: "Comma separated phase ids.", Example: "1,2"},
}
case "/api/master-data/phases":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "starter"},
{Name: "category", In: "query", Description: "Phase category filter.", Example: "Growing"},
}
case "/api/master-data/product-categories":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "pakan"},
}
case "/api/master-data/production-standards":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "standar"},
{Name: "project_category", In: "query", Description: "Project category filter.", Example: "GROWING"},
}
case "/api/master-data/products":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "jagung"},
{Name: "product_category_id", In: "query", Description: "Product category id filter.", Example: 1, PostmanValue: "{{product_category_id}}"},
{Name: "is_depletion", In: "query", Description: "Filter depletion products.", Example: false},
{Name: "include_all", In: "query", Description: "Include all products regardless of status.", Example: false},
}
case "/api/master-data/suppliers":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "supplier"},
{Name: "flag", In: "query", Description: "Supplier type flag filter.", Example: "ACTIVE"},
{Name: "category", In: "query", Description: "Supplier category filter.", Example: "PAKAN"},
}
case "/api/master-data/uoms":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "kg"},
}
case "/api/master-data/warehouses":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "gudang"},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "active_project_flock", In: "query", Description: "Filter only active project flock warehouses.", Example: false},
{Name: "transfer_context", In: "query", Description: "Transfer context filter.", Example: "inventory_transfer"},
}
case "/api/production/project-flock-kandangs":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "kandang"},
{Name: "name_with_periode", In: "query", Description: "Return name-with-period projection.", Example: false},
{Name: "project_flock_id", In: "query", Description: "Project flock id filter.", Example: 1, PostmanValue: "{{project_flock_id}}"},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "category", In: "query", Description: "Project category filter.", Example: "Growing"},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "sort_by", In: "query", Description: "Sort field.", Example: "created_at"},
{Name: "sort_order", In: "query", Description: "Sort order.", Example: "ASC"},
{Name: "step_name", In: "query", Description: "Approval step name filter.", Example: "Pengajuan"},
}
case "/api/production/project-flocks":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "flock"},
{Name: "sort_by", In: "query", Description: "Sort field.", Example: "created_at"},
{Name: "sort_order", In: "query", Description: "Sort order.", Example: "asc"},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "period", In: "query", Description: "Project period filter.", Example: 1},
{Name: "category", In: "query", Description: "Project category filter.", Example: "Growing"},
{Name: "status", In: "query", Description: "Project status filter.", Example: "Aktif"},
{Name: "kandang_id", In: "query", Description: "Comma separated kandang ids.", Example: "1,2"},
{Name: "transfer_context", In: "query", Description: "Transfer context filter.", Example: "transfer_to_laying"},
}
case "/api/production/project-flocks/kandangs/lookup":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "project_flock_id", In: "query", Description: "Project flock id.", Required: true, Example: 1, PostmanValue: "{{project_flock_id}}"},
{Name: "kandang_id", In: "query", Description: "Kandang id.", Required: true, Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "withpopulation", In: "query", Description: "Include population value in response.", Example: false},
{Name: "record_date", In: "query", Description: "Reference date (YYYY-MM-DD).", Example: "2026-01-01"},
}
case "/api/production/recordings":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "project_flock_kandang_id", In: "query", Description: "Project flock kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "search", In: "query", Description: "Search keyword.", Example: "record"},
{Name: "export", In: "query", Description: "Export mode.", Example: "excel"},
}
case "/api/production/recordings/next-day":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "project_flock_kandang_id", In: "query", Description: "Project flock kandang id.", Required: true, Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "record_date", In: "query", Description: "Recording date (YYYY-MM-DD).", Required: true, Example: "2026-01-01"},
}
case "/api/production/transfer_layings":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "transfer"},
{Name: "start_date", In: "query", Description: "Start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "End date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "flock_source", In: "query", Description: "Comma separated source flock ids.", Example: "1,2"},
{Name: "flock_destination", In: "query", Description: "Comma separated destination flock ids.", Example: "3,4"},
{Name: "status", In: "query", Description: "Comma separated status values.", Example: "DRAFT,APPROVED"},
}
case "/api/production/uniformities":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "project_flock_kandang_id", In: "query", Description: "Project flock kandang id filter.", Example: 1, PostmanValue: "{{project_flock_kandang_id}}"},
{Name: "week", In: "query", Description: "Week number filter.", Example: 1},
{Name: "start_date", In: "query", Description: "Start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "End date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "with_chart", In: "query", Description: "Include chart payload.", Example: false},
}
case "/api/purchases":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "supplier_id", In: "query", Description: "Supplier id filter.", Example: 1, PostmanValue: "{{supplier_id}}"},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1, PostmanValue: "{{area_id}}"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1, PostmanValue: "{{location_id}}"},
{Name: "product_category_id", In: "query", Description: "Product category id filter.", Example: "1"},
{Name: "approval_status", In: "query", Description: "Approval status filter.", Example: "PENDING"},
{Name: "po_date", In: "query", Description: "PO date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "po_date_from", In: "query", Description: "PO date start (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "po_date_to", In: "query", Description: "PO date end (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "search", In: "query", Description: "Search keyword.", Example: "PO-"},
{Name: "created_from", In: "query", Description: "Created date start (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "created_to", In: "query", Description: "Created date end (YYYY-MM-DD).", Example: "2026-01-31"},
}
case "/api/users":
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "admin"},
} }
case "/api/reports/expense": case "/api/reports/expense":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
@@ -616,6 +976,9 @@ func describeRoute(route normalizedRoute) routeMeta {
{Name: "search", In: "query", Description: "Search keyword.", Example: "operasional"}, {Name: "search", In: "query", Description: "Search keyword.", Example: "operasional"},
{Name: "category", In: "query", Description: "Expense category filter.", Example: "BOP"}, {Name: "category", In: "query", Description: "Expense category filter.", Example: "BOP"},
{Name: "supplier_id", In: "query", Description: "Supplier id filter.", Example: 1}, {Name: "supplier_id", In: "query", Description: "Supplier id filter.", Example: 1},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1},
{Name: "project_flock_kandang_id", In: "query", Description: "Project flock kandang id filter.", Example: 1},
{Name: "nonstock_id", In: "query", Description: "Nonstock id filter.", Example: 1},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1}, {Name: "location_id", In: "query", Description: "Location id filter.", Example: 1},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1}, {Name: "area_id", In: "query", Description: "Area id filter.", Example: 1},
{Name: "realization_date", In: "query", Description: "Realization date filter (YYYY-MM-DD).", Example: "2026-01-15"}, {Name: "realization_date", In: "query", Description: "Realization date filter (YYYY-MM-DD).", Example: "2026-01-15"},
@@ -624,19 +987,32 @@ func describeRoute(route normalizedRoute) routeMeta {
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1}, {Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "SO-"},
{Name: "customer_id", In: "query", Description: "Customer id filter.", Example: 1},
{Name: "product_id", In: "query", Description: "Product id filter.", Example: 1},
{Name: "warehouse_id", In: "query", Description: "Warehouse id filter.", Example: 1},
{Name: "sales_person_id", In: "query", Description: "Sales person id filter.", Example: 1},
{Name: "area_id", In: "query", Description: "Area id filter.", Example: 1},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1},
{Name: "marketing_type", In: "query", Description: "Marketing type filter.", Example: "ayam"},
{Name: "filter_by", In: "query", Description: "Date field filter.", Example: "so_date"},
{Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"}, {Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"}, {Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "customer_id", In: "query", Description: "Customer id filter.", Example: 1}, {Name: "sort_by", In: "query", Description: "Sort field.", Example: "so_date"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1}, {Name: "sort_order", In: "query", Description: "Sort order.", Example: "asc"},
} }
case "/api/reports/purchase-supplier": case "/api/reports/purchase-supplier":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1}, {Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "area_id", In: "query", Description: "Comma separated area ids.", Example: "1,2"},
{Name: "supplier_id", In: "query", Description: "Comma separated supplier ids.", Example: "1,2"},
{Name: "product_id", In: "query", Description: "Comma separated product ids.", Example: "1,2"},
{Name: "product_category_id", In: "query", Description: "Comma separated product category ids.", Example: "1,2"},
{Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"}, {Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"}, {Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "supplier_id", In: "query", Description: "Comma separated supplier ids.", Example: "1,2"}, {Name: "sort_by", In: "query", Description: "Sort field.", Example: "created_at"},
{Name: "area_id", In: "query", Description: "Comma separated area ids.", Example: "1,2"}, {Name: "filter_by", In: "query", Description: "Filter field.", Example: "received_date"},
} }
case "/api/reports/debt-supplier": case "/api/reports/debt-supplier":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
@@ -644,7 +1020,9 @@ func describeRoute(route normalizedRoute) routeMeta {
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"}, {Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"}, {Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "supplier_ids", In: "query", Description: "Comma separated supplier ids.", Example: "1,2", PostmanValue: "{{supplier_id}}", IncludePostman: true}, {Name: "supplier_ids", In: "query", Description: "Comma separated supplier ids.", Example: "1,2", PostmanValue: "{{supplier_id}}"},
{Name: "filter_by", In: "query", Description: "Date field filter.", Example: "received_date"},
{Name: "sort_order", In: "query", Description: "Sort order.", Example: "asc"},
} }
case "/api/reports/customer-payment": case "/api/reports/customer-payment":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
@@ -652,34 +1030,46 @@ func describeRoute(route normalizedRoute) routeMeta {
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"}, {Name: "start_date", In: "query", Description: "Period start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"}, {Name: "end_date", In: "query", Description: "Period end date (YYYY-MM-DD).", Example: "2026-01-31"},
{Name: "customer_ids", In: "query", Description: "Comma separated customer ids.", Example: "1,2", PostmanValue: "{{customer_id}}", IncludePostman: true}, {Name: "customer_ids", In: "query", Description: "Comma separated customer ids.", Example: "1,2", PostmanValue: "{{customer_id}}"},
{Name: "filter_by", In: "query", Description: "Date field filter.", Example: "TRANS_DATE"},
} }
case "/api/reports/hpp-per-kandang": case "/api/reports/hpp-per-kandang":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1}, {Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "period", In: "query", Description: "Daily period filter (YYYY-MM).", Example: "2026-01"}, {Name: "period", In: "query", Description: "Daily period filter (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "location_id", In: "query", Description: "Location id filter.", Example: 1}, {Name: "show_unrecorded", In: "query", Description: "Include unrecorded data.", Example: false},
{Name: "kandang_id", In: "query", Description: "Kandang id filter.", Example: 1}, {Name: "area_id", In: "query", Description: "Comma separated area ids.", Example: "1,2"},
{Name: "location_id", In: "query", Description: "Comma separated location ids.", Example: "1,2"},
{Name: "kandang_id", In: "query", Description: "Comma separated kandang ids.", Example: "1,2"},
{Name: "weight_min", In: "query", Description: "Minimum body weight filter.", Example: "1.2"},
{Name: "weight_max", In: "query", Description: "Maximum body weight filter.", Example: "1.8"},
}
case "/api/reports/production-result/:idProjectFlockKandang":
meta.ListStyle = false
meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10},
} }
case "/api/finance/transactions": case "/api/finance/transactions":
meta.QueryParams = []parameterMeta{ meta.QueryParams = []parameterMeta{
{Name: "page", In: "query", Description: "Page number.", Example: 1}, {Name: "page", In: "query", Description: "Page number.", Example: 1},
{Name: "limit", In: "query", Description: "Page size.", Example: 10}, {Name: "limit", In: "query", Description: "Page size.", Example: 10},
{Name: "search", In: "query", Description: "Search keyword.", Example: "invoice"}, {Name: "search", In: "query", Description: "Search keyword.", Example: "invoice"},
{Name: "bank_ids", In: "query", Description: "Comma separated bank ids.", Example: "1,2", PostmanValue: "{{bank_id}}", IncludePostman: true}, {Name: "bank_ids", In: "query", Description: "Comma separated bank ids.", Example: "1,2", PostmanValue: "{{bank_id}}"},
{Name: "customer_ids", In: "query", Description: "Comma separated customer ids.", Example: "1,2"}, {Name: "customer_ids", In: "query", Description: "Comma separated customer ids.", Example: "1,2"},
{Name: "supplier_ids", In: "query", Description: "Comma separated supplier ids.", Example: "1,2"}, {Name: "supplier_ids", In: "query", Description: "Comma separated supplier ids.", Example: "1,2"},
{Name: "transaction_types", In: "query", Description: "Comma separated transaction types.", Example: "payment,initial_balance"}, {Name: "transaction_types", In: "query", Description: "Comma separated transaction types.", Example: "payment,initial_balance"},
{Name: "sort_date", In: "query", Description: "Sort date basis.", Example: "created_at"},
{Name: "start_date", In: "query", Description: "Start date (YYYY-MM-DD).", Example: "2026-01-01"}, {Name: "start_date", In: "query", Description: "Start date (YYYY-MM-DD).", Example: "2026-01-01"},
{Name: "end_date", In: "query", Description: "End date (YYYY-MM-DD).", Example: "2026-01-31"}, {Name: "end_date", In: "query", Description: "End date (YYYY-MM-DD).", Example: "2026-01-31"},
} }
} }
if route.Path == "/healthz" { if routePath == "/healthz" {
meta.Summary = "Health check" meta.Summary = "Health check"
meta.Description = "Simple liveness probe." meta.Description = "Simple liveness probe."
} else if route.Path == "/readyz" { } else if routePath == "/readyz" {
meta.Summary = "Readiness check" meta.Summary = "Readiness check"
meta.Description = "Readiness probe for database and Redis." meta.Description = "Readiness probe for database and Redis."
} }