| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- """Generate minimal Mock samples for 1.0.263 API endpoints."""
- import json
- from pathlib import Path
- OUT = Path(__file__).resolve().parents[1] / "mock_api" / "samples"
- SAMPLES = {
- "contract_review_flow.json": [{"bizKey": "CR-CT-0001#1#1", "ReviewBillNo": "CR-CT-0001", "StageNo": "1", "RecID": 1, "updateTime": "2026-07-20T10:00:00"}],
- "linkage_plan.json": [{"bizKey": "SO-CT-0001#91C0D2C#1", "bill_no": "SO-CT-0001", "item_number": "91C0D2C", "id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "product_design.json": [{"bizKey": "PD-CT-0001", "BillNo": "PD-CT-0001", "updateTime": "2026-07-20T10:00:00"}],
- "product_design_bom.json": [{"bizKey": "100#1", "ProductDesignId": 100, "Id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "product_design_routing.json": [{"bizKey": "100#1", "ProductDesignId": 100, "Id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "requirement_examine_detail.json": [{"bizKey": "10#91C0D2C#1", "examine_id": 10, "item_number": "91C0D2C", "Id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "requirement_examine_result.json": [{"bizKey": "SO-CT-0001#WO-CT-0001#1", "bill_no": "SO-CT-0001", "morder_no": "WO-CT-0001", "Id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "sales_order_change.json": [{"bizKey": "SO-CT-0001#1", "bill_no": "SO-CT-0001", "Id": 1, "updateTime": "2026-07-20T10:00:00"}],
- "shipping_plan_detail.json": [{"bizKey": "1#SO-CT-0001#1", "plan_id": 1, "OrdNbr": "SO-CT-0001", "RecID": 1, "updateTime": "2026-07-20T10:00:00"}],
- "period_sequence.json": [{"bizKey": "100#WO-CT-0001#10#1", "Domain": "100", "WorkOrds": "WO-CT-0001", "Op": "10", "Sequence": 1, "updateTime": "2026-07-20T10:00:00"}],
- "consignee.json": [{"bizKey": "100#ADDR-01", "Domain": "100", "Address": "ADDR-01", "updateTime": "2026-07-20T10:00:00"}],
- "inventory.json": [{"bizKey": "100#91C0D2C#A01", "Domain": "100", "ItemNum": "91C0D2C", "Location": "A01", "updateTime": "2026-07-20T10:00:00"}],
- "item_new.json": [{"bizKey": "0#ITEM-NEW-01", "tenant_id": 0, "number": "ITEM-NEW-01", "updateTime": "2026-07-20T10:00:00"}],
- "s3_receipt_detail.json": [{"bizKey": "100#RC-S3-CT-0001#1", "Domain": "100", "Receiver": "RC-S3-CT-0001", "Line": 1, "updateTime": "2026-07-20T10:00:00"}],
- "routing_outsource.json": [{"bizKey": "100#R01#10#S001", "Domain": "100", "RoutingCode": "R01", "Op": "10", "SupplierCode": "S001", "updateTime": "2026-07-20T10:00:00"}],
- "shipper_detail.json": [{"bizKey": "1#10", "glid": "1", "id": "10", "updateTime": "2026-07-20T10:00:00"}],
- "source_list.json": [{"bizKey": "91C0D2C#S001", "number": "91C0D2C", "supplier_number": "S001", "updateTime": "2026-07-20T10:00:00"}],
- "s3_work_order.json": [{"bizKey": "100#WO-CT-0001", "Domain": "100", "WorkOrd": "WO-CT-0001", "updateTime": "2026-07-20T10:00:00"}],
- "s3_work_order_detail.json": [{"bizKey": "100#WO-CT-0001#10#91C0D2C", "Domain": "100", "WorkOrd": "WO-CT-0001", "Op": "10", "ItemNum": "91C0D2C", "updateTime": "2026-07-20T10:00:00"}],
- "s3_work_order_routing.json": [{"bizKey": "100#WO-CT-0001#10", "Domain": "100", "WorkOrd": "WO-CT-0001", "OP": "10", "updateTime": "2026-07-20T10:00:00"}],
- }
- ENDPOINTS = {
- "/api/contract-review-flow": "samples/contract_review_flow.json",
- "/api/linkage-plan": "samples/linkage_plan.json",
- "/api/product-design": "samples/product_design.json",
- "/api/product-design-bom": "samples/product_design_bom.json",
- "/api/product-design-routing": "samples/product_design_routing.json",
- "/api/requirement-examine-detail": "samples/requirement_examine_detail.json",
- "/api/requirement-examine-result": "samples/requirement_examine_result.json",
- "/api/sales-order-change": "samples/sales_order_change.json",
- "/api/shipping-plan-detail": "samples/shipping_plan_detail.json",
- "/api/period-sequence": "samples/period_sequence.json",
- "/api/consignee": "samples/consignee.json",
- "/api/inventory": "samples/inventory.json",
- "/api/item-new": "samples/item-new.json",
- "/api/s3-receipt-detail": "samples/s3_receipt_detail.json",
- "/api/routing-outsource": "samples/routing_outsource.json",
- "/api/shipper-detail": "samples/shipper_detail.json",
- "/api/source-list": "samples/source_list.json",
- "/api/s3-work-order": "samples/s3_work_order.json",
- "/api/s3-work-order-detail": "samples/s3_work_order_detail.json",
- "/api/s3-work-order-routing": "samples/s3_work_order_routing.json",
- }
- def main():
- OUT.mkdir(parents=True, exist_ok=True)
- for name, rows in SAMPLES.items():
- (OUT / name).write_text(json.dumps(rows, ensure_ascii=False, indent=2), encoding="utf-8")
- print("wrote", name)
- ep_path = OUT.parent / "endpoints.json"
- ep = json.loads(ep_path.read_text(encoding="utf-8"))
- ep.update(ENDPOINTS)
- ep_path.write_text(json.dumps(ep, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
- print("endpoints", len(ep))
- if __name__ == "__main__":
- main()
|