Skip to content

Parser architecture

Owen edited this page May 12, 2014 · 2 revisions

Overall architecture

  • Parser emits report-editing commands
  • Report editor executes parser-generated commands
  • Report serializer handles serialization/deserialization to/from disk and builds index file

Parser-generated Commands

  • Adding a report
    • Command
      • {"cmd": "add_report", "person_id": 3, "date": [Date object], "organization": "立法院", "title": "立法委員", "relatives": [{"relationship": "配偶", "name": "溫子苓"}, {"relationship": "子女", "name": "丁○豪"}]}
    • Result
      • {"err": null, "report_id": 1} or {"err": "reason for error"}
    • Notes
      • Not handling "變動申報" and "更正申報" for now as theoretically they should be reflected in the next report.
  • Editing a report
    • Real estate
      • Command
        • {"cmd": "add_land", "report_id": 1, "location": "臺北市北投區振興段一小段 0093-0000 地號", "area": 3971, "range": "10000 分之 101", "owner": "丁守中", "acquire-date": [Date object], "acquire-reason": "買賣", "acquire-value": "(超過五年)"}
        • {"cmd": "add_building", ...}
      • Result
        • {"err": null} or {"err": "reason for error"}
    • Boats
    • Cars
    • Aircraft
    • Cash
    • Deposits
    • Securities
    • Jewelry
    • Loans
    • Debts
    • Investments

Clone this wiki locally