From e24c3e2a720e26f71d80934396706b3783e8370a Mon Sep 17 00:00:00 2001 From: cclohmar Date: Wed, 15 Jul 2026 21:53:44 +0000 Subject: [PATCH] feat: add fixture seed data for portability - Added fixture config in hooks.py for Workspace, Resource Center, Engagement Recipe, and Engagement Order - Exported workspace.json (3 Service Factory workspaces) - Created resource_center.json seed data (Engineering Team, Solutions Consulting) - All configuration is now version-controlled and portable via 'bench migrate' on any server --- service_factory/fixtures/resource_center.json | 20 + service_factory/fixtures/workspace.json | 721 ++++++++++++++++++ service_factory/hooks.py | 9 +- 3 files changed, 748 insertions(+), 2 deletions(-) create mode 100644 service_factory/fixtures/resource_center.json create mode 100644 service_factory/fixtures/workspace.json diff --git a/service_factory/fixtures/resource_center.json b/service_factory/fixtures/resource_center.json new file mode 100644 index 0000000..83ba314 --- /dev/null +++ b/service_factory/fixtures/resource_center.json @@ -0,0 +1,20 @@ +[ + { + "center_name": "Engineering Team", + "resource_type": "Engineering", + "hourly_cost_rate": 75.0, + "hourly_billing_rate": 150.0, + "daily_capacity_hours": 40.0, + "members": [], + "doctype": "Resource Center" + }, + { + "center_name": "Solutions Consulting", + "resource_type": "Consulting", + "hourly_cost_rate": 100.0, + "hourly_billing_rate": 200.0, + "daily_capacity_hours": 24.0, + "members": [], + "doctype": "Resource Center" + } +] diff --git a/service_factory/fixtures/workspace.json b/service_factory/fixtures/workspace.json new file mode 100644 index 0000000..8b1e816 --- /dev/null +++ b/service_factory/fixtures/workspace.json @@ -0,0 +1,721 @@ +[ + { + "app": null, + "charts": [], + "content": "[{\"id\":\"manager_header_1\",\"type\":\"header\",\"data\":{\"text\":\"Operational Overview\",\"col\":12}},{\"id\":\"manager_card_orders\",\"type\":\"card\",\"data\":{\"card_name\":\"Engagement Orders\",\"col\":4}},{\"id\":\"manager_card_centers\",\"type\":\"card\",\"data\":{\"card_name\":\"Resource Centers\",\"col\":4}},{\"id\":\"manager_card_recipes\",\"type\":\"card\",\"data\":{\"card_name\":\"Engagement Recipes\",\"col\":4}},{\"id\":\"manager_spacer_1\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"manager_header_2\",\"type\":\"header\",\"data\":{\"text\":\"Resource Capacity\",\"col\":12}},{\"id\":\"manager_card_gantt\",\"type\":\"card\",\"data\":{\"card_name\":\"Schedule Gantt\",\"col\":6}},{\"id\":\"manager_card_alerts\",\"type\":\"card\",\"data\":{\"card_name\":\"Capacity Alerts\",\"col\":6}},{\"id\":\"manager_spacer_2\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"manager_header_3\",\"type\":\"header\",\"data\":{\"text\":\"Key Metrics\",\"col\":12}},{\"id\":\"manager_shortcut_active\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Active Engagements\",\"col\":3}},{\"id\":\"manager_shortcut_stalled\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Stalled / Blocked\",\"col\":3}},{\"id\":\"manager_shortcut_capacity\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Capacity Overview\",\"col\":3}},{\"id\":\"manager_shortcut_executions\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"All Execution Cards\",\"col\":3}}]", + "custom_blocks": [], + "docstatus": 0, + "doctype": "Workspace", + "external_link": null, + "for_user": "", + "hide_custom": 0, + "icon": "share", + "indicator_color": null, + "is_hidden": 0, + "label": "Manager Workspace", + "link_to": null, + "link_type": null, + "links": [ + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Orders", + "link_count": 4, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Order", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Scheduled Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "In Progress Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Completed Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Resource Centers", + "link_count": 2, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Resource Center", + "link_count": 0, + "link_to": "Resource Center", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Resource Center Members", + "link_count": 0, + "link_to": "Resource Center Member", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Recipes", + "link_count": 2, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Recipe", + "link_count": 0, + "link_to": "Engagement Recipe", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Recipe Steps", + "link_count": 0, + "link_to": "Engagement Recipe Step", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Execution Tracking", + "link_count": 2, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Execution Card", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Execution Card Logs", + "link_count": 0, + "link_to": "Execution Card Log", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + } + ], + "modified": "2026-07-15 19:00:00", + "module": "Service Factory", + "name": "Manager Workspace", + "number_cards": [], + "parent_page": "", + "public": 1, + "quick_lists": [], + "restrict_to_domain": null, + "roles": [], + "sequence_id": 2.0, + "shortcuts": [ + { + "color": "Blue", + "doc_view": null, + "format": "{}", + "icon": "list", + "kanban_board": null, + "label": "Active Engagements", + "link_to": "Engagement Order", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[[\"Engagement Order\",\"status\",\"in\",[\"Scheduled\",\"In Progress\"]]]", + "type": "DocType", + "url": null + }, + { + "color": "Red", + "doc_view": null, + "format": "{}", + "icon": "info", + "kanban_board": null, + "label": "Stalled / Blocked", + "link_to": "Engagement Order", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[[\"Engagement Order\",\"status\",\"=\",\"On Hold\"]]", + "type": "DocType", + "url": null + }, + { + "color": "Green", + "doc_view": null, + "format": "{}", + "icon": "organization", + "kanban_board": null, + "label": "Capacity Overview", + "link_to": "Resource Center", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + }, + { + "color": "Grey", + "doc_view": null, + "format": "{}", + "icon": "check", + "kanban_board": null, + "label": "All Execution Cards", + "link_to": "Execution Card", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + } + ], + "title": "Manager Workspace", + "type": "Workspace" + }, + { + "app": null, + "charts": [], + "content": "[{\"id\":\"director_header_1\",\"type\":\"header\",\"data\":{\"text\":\"Financial Margin Ledger\",\"col\":12}},{\"id\":\"director_card_margin\",\"type\":\"card\",\"data\":{\"card_name\":\"Margin Overview\",\"col\":6}},{\"id\":\"director_card_pnl\",\"type\":\"card\",\"data\":{\"card_name\":\"P&L Summary\",\"col\":6}},{\"id\":\"director_spacer_1\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"director_header_2\",\"type\":\"header\",\"data\":{\"text\":\"Delivery Performance\",\"col\":12}},{\"id\":\"director_card_efficiency\",\"type\":\"card\",\"data\":{\"card_name\":\"Delivery Efficiency\",\"col\":6}},{\"id\":\"director_card_burn\",\"type\":\"card\",\"data\":{\"card_name\":\"Resource Burn-Down\",\"col\":6}},{\"id\":\"director_spacer_2\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"director_header_3\",\"type\":\"header\",\"data\":{\"text\":\"Executive KPIs\",\"col\":12}},{\"id\":\"director_shortcut_revenue\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Revenue Pipeline\",\"col\":3}},{\"id\":\"director_shortcut_costs\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Delivery Costs\",\"col\":3}},{\"id\":\"director_shortcut_margin\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Gross Margin %\",\"col\":3}},{\"id\":\"director_shortcut_utilization\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Utilization Rate\",\"col\":3}}]", + "custom_blocks": [], + "docstatus": 0, + "doctype": "Workspace", + "external_link": null, + "for_user": "", + "hide_custom": 0, + "icon": "chart", + "indicator_color": null, + "is_hidden": 0, + "label": "Director Workspace", + "link_to": null, + "link_type": null, + "links": [ + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Financial Overview", + "link_count": 3, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Order", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Execution Card", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Resource Center", + "link_count": 0, + "link_to": "Resource Center", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Analytics", + "link_count": 4, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "All Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Completed Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Recipes", + "link_count": 0, + "link_to": "Engagement Recipe", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Submitted Cards", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + } + ], + "modified": "2026-07-15 19:00:00", + "module": "Service Factory", + "name": "Director Workspace", + "number_cards": [], + "parent_page": "", + "public": 1, + "quick_lists": [], + "restrict_to_domain": null, + "roles": [], + "sequence_id": 3.0, + "shortcuts": [ + { + "color": "Green", + "doc_view": null, + "format": "{}", + "icon": "currency", + "kanban_board": null, + "label": "Revenue Pipeline", + "link_to": "Engagement Order", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[[\"Engagement Order\",\"docstatus\",\"=\",1],[\"Engagement Order\",\"status\",\"!=\",\"Cancelled\"]]", + "type": "DocType", + "url": null + }, + { + "color": "Red", + "doc_view": null, + "format": "{}", + "icon": "cost", + "kanban_board": null, + "label": "Delivery Costs", + "link_to": "Execution Card", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[[\"Execution Card\",\"status\",\"=\",\"Submitted\"]]", + "type": "DocType", + "url": null + }, + { + "color": "Blue", + "doc_view": null, + "format": "{}", + "icon": "percent", + "kanban_board": null, + "label": "Gross Margin %", + "link_to": "Engagement Order", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + }, + { + "color": "Orange", + "doc_view": null, + "format": "{}", + "icon": "chart", + "kanban_board": null, + "label": "Utilization Rate", + "link_to": "Resource Center", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + } + ], + "title": "Director Workspace", + "type": "Workspace" + }, + { + "app": null, + "charts": [], + "content": "[{\"id\":\"engineer_header_1\",\"type\":\"header\",\"data\":{\"text\":\"My Active Deliverables\",\"col\":12}},{\"id\":\"engineer_card_my_cards\",\"type\":\"card\",\"data\":{\"card_name\":\"My Execution Cards\",\"col\":4}},{\"id\":\"engineer_card_orders\",\"type\":\"card\",\"data\":{\"card_name\":\"My Engagement Orders\",\"col\":4}},{\"id\":\"engineer_card_reports\",\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}},{\"id\":\"engineer_spacer_1\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"engineer_header_2\",\"type\":\"header\",\"data\":{\"text\":\"Time Tracking\",\"col\":12}},{\"id\":\"engineer_card_timer\",\"type\":\"card\",\"data\":{\"card_name\":\"Execution Card Timer\",\"col\":6}},{\"id\":\"engineer_card_hours\",\"type\":\"card\",\"data\":{\"card_name\":\"My Hours This Week\",\"col\":6}},{\"id\":\"engineer_spacer_2\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"engineer_header_3\",\"type\":\"header\",\"data\":{\"text\":\"Quick Actions\",\"col\":12}},{\"id\":\"engineer_shortcut_new_card\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"New Execution Card\",\"col\":3}},{\"id\":\"engineer_shortcut_active\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"My Active Cards\",\"col\":3}}]", + "custom_blocks": [], + "docstatus": 0, + "doctype": "Workspace", + "external_link": null, + "for_user": "", + "hide_custom": 0, + "icon": "workflow", + "indicator_color": null, + "is_hidden": 0, + "label": "Engineer Workspace", + "link_to": null, + "link_type": null, + "links": [ + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Execution Cards", + "link_count": 3, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Execution Card", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Open Cards", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Submitted Cards", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Engagement Orders", + "link_count": 2, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Engagement Order", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 1, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Active Orders", + "link_count": 0, + "link_to": "Engagement Order", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + }, + { + "dependencies": null, + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "Reports", + "link_count": 1, + "link_to": null, + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Card Break" + }, + { + "dependencies": "", + "description": null, + "hidden": 0, + "icon": null, + "is_query_report": 0, + "label": "My Hours", + "link_count": 0, + "link_to": "Execution Card", + "link_type": "DocType", + "onboard": 0, + "only_for": null, + "report_ref_doctype": null, + "type": "Link" + } + ], + "modified": "2026-07-15 19:00:00", + "module": "Service Factory", + "name": "Engineer Workspace", + "number_cards": [], + "parent_page": "", + "public": 1, + "quick_lists": [], + "restrict_to_domain": null, + "roles": [], + "sequence_id": 1.0, + "shortcuts": [ + { + "color": "Blue", + "doc_view": null, + "format": "{}", + "icon": "add", + "kanban_board": null, + "label": "New Execution Card", + "link_to": "Execution Card", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + }, + { + "color": "Grey", + "doc_view": null, + "format": "{}", + "icon": "list", + "kanban_board": null, + "label": "My Active Cards", + "link_to": "Execution Card", + "report_ref_doctype": null, + "restrict_to_domain": null, + "stats_filter": "[[\"Execution Card\",\"assigned_employee\",\"=\",\"__user_employee__\"],[\"Execution Card\",\"status\",\"in\",[\"Open\",\"Running\",\"Paused\"]]]", + "type": "DocType", + "url": null + } + ], + "title": "Engineer Workspace", + "type": "Workspace" + } +] \ No newline at end of file diff --git a/service_factory/hooks.py b/service_factory/hooks.py index 3b27dca..091726e 100644 --- a/service_factory/hooks.py +++ b/service_factory/hooks.py @@ -167,12 +167,17 @@ doctype_js = {"Execution Card" : "doctype/execution_card/execution_card.js"} # ], # } -# Fixtures - sync Workspaces during migrate +# Fixtures - seed data synced during bench migrate +# Add new DocType records here to make them portable +# across all server instances. # ----------------------------------------- fixtures = [ {"dt": "Workspace", "filters": [ ["module", "=", "Service Factory"] - ]} + ]}, + {"dt": "Resource Center"}, + {"dt": "Engagement Recipe"}, + {"dt": "Engagement Order"}, ] # Testing