feat: Excel template export with meeting number auto-generation

- Add meeting_number field (M-YYYYMMDD-XX format) with auto-generation
- Refactor Excel export to use cell coordinates instead of placeholders
- Export files saved to backend/record/ directory with meeting number filename
- Add database migration for meeting_number column
- Add start.sh script for managing frontend/backend/sidecar services
- Update OpenSpec documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-11 19:45:53 +08:00
parent a4a2fc3ae7
commit e790f48967
16 changed files with 1139 additions and 122 deletions

View File

@@ -15,30 +15,47 @@ The middleware server SHALL generate Excel reports from meeting data using templ
- **THEN** server SHALL return HTTP 404
### Requirement: Template-based Generation
The Excel export SHALL use openpyxl with template files.
The Excel export SHALL use openpyxl with template files and cell coordinate mapping.
#### Scenario: Placeholder replacement
- **WHEN** Excel is generated
- **THEN** placeholders ({{subject}}, {{time}}, {{chair}}, etc.) SHALL be replaced with actual meeting data
#### Scenario: Cell coordinate filling
- **WHEN** Excel is generated from template `meeting_template.xlsx`
- **THEN** data SHALL be filled into specific cells:
- D3: meeting subject
- D4: meeting time
- D5: chairperson
- F4: location
- F5: recorder
- D6: attendees (comma separated)
- C8: meeting number (M-YYYYMMDD-XX format)
- D8: conclusions (newline separated if multiple)
#### Scenario: Dynamic row insertion
- **WHEN** meeting has multiple conclusions or action items
- **THEN** rows SHALL be dynamically inserted to accommodate all items
#### Scenario: Dynamic row filling for action items
- **WHEN** meeting has action items
- **THEN** rows SHALL be filled starting from row 10:
- Column C: action item system code (A-YYYYMMDD-XX)
- Column D: action item content
- Column F: owner
- Column G: due date
- Column H: status (Open/In Progress/Done/Delayed)
#### Scenario: Template path resolution
- **WHEN** export is requested
- **THEN** server SHALL load template from `backend/template/meeting_template.xlsx`
### Requirement: Complete Data Inclusion
The exported Excel SHALL include all meeting metadata and AI-generated content.
The exported Excel SHALL include all meeting metadata, conclusions, and action items.
#### Scenario: Full metadata export
- **WHEN** Excel is generated
- **THEN** it SHALL include subject, meeting_time, location, chairperson, recorder, and attendees
- **THEN** it SHALL include subject, meeting_time, location, chairperson, recorder, attendees, and meeting_number
#### Scenario: Conclusions export
- **WHEN** Excel is generated
- **THEN** all conclusions SHALL be listed with their system codes
- **WHEN** Excel is generated with multiple conclusions
- **THEN** all conclusions SHALL be merged with newline separator into cell D8
#### Scenario: Action items export
#### Scenario: Action items export with status
- **WHEN** Excel is generated
- **THEN** all action items SHALL be listed with content, owner, due_date, status, and system code
- **THEN** all action items SHALL be listed with system_code, content, owner, due_date, and status
### Requirement: Template Management
Admin users SHALL be able to manage Excel templates.
@@ -47,3 +64,18 @@ Admin users SHALL be able to manage Excel templates.
- **WHEN** admin user accesses template management
- **THEN** they SHALL be able to upload, view, and update Excel templates
### Requirement: Meeting Number Generation
The system SHALL automatically generate meeting numbers for each meeting record.
#### Scenario: Auto-generate meeting number
- **WHEN** a new meeting is created
- **THEN** system SHALL generate meeting number in format `M-YYYYMMDD-XX` where XX is daily sequence
#### Scenario: Meeting number uniqueness
- **WHEN** multiple meetings are created on same date
- **THEN** each SHALL receive unique sequential number (M-20251211-01, M-20251211-02, etc.)
#### Scenario: Meeting number in export
- **WHEN** Excel is exported
- **THEN** meeting_number SHALL be displayed in cell C8