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

@@ -0,0 +1,31 @@
## MODIFIED Requirements
### Requirement: Structured Output Format
The AI summarization SHALL return structured data with conclusions and action items.
#### Scenario: Complete structured response
- **WHEN** transcript contains clear decisions and assignments
- **THEN** response SHALL include conclusions array (0 to many items) and action_items array with content, owner, due_date fields
#### Scenario: Partial data extraction
- **WHEN** transcript lacks explicit owner or due_date for action items
- **THEN** those fields SHALL be empty strings or null allowing manual completion
#### Scenario: Variable conclusion count
- **WHEN** transcript has multiple decisions
- **THEN** conclusions array SHALL contain all extracted conclusions without artificial limit
#### Scenario: No conclusions found
- **WHEN** transcript has no clear decisions
- **THEN** conclusions array SHALL be empty []
### Requirement: Dify Prompt Configuration
The Dify workflow SHALL be configured with detailed system prompt for meeting summarization.
#### Scenario: System prompt behavior
- **WHEN** transcript is sent to Dify
- **THEN** Dify SHALL use configured system prompt to extract conclusions and action_items in JSON format
#### Scenario: Flexible output count
- **WHEN** Dify processes transcript
- **THEN** it SHALL return variable number of conclusions and action items based on actual content

View File

@@ -0,0 +1,61 @@
## MODIFIED Requirements
### Requirement: Template-based Generation
The Excel export SHALL use openpyxl with template files and cell coordinate mapping.
#### 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 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, conclusions, and action items.
#### Scenario: Full metadata export
- **WHEN** Excel is generated
- **THEN** it SHALL include subject, meeting_time, location, chairperson, recorder, attendees, and meeting_number
#### Scenario: Conclusions export
- **WHEN** Excel is generated with multiple conclusions
- **THEN** all conclusions SHALL be merged with newline separator into cell D8
#### Scenario: Action items export with status
- **WHEN** Excel is generated
- **THEN** all action items SHALL be listed with system_code, content, owner, due_date, and status
## ADDED Requirements
### 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

View File

@@ -0,0 +1,35 @@
## MODIFIED Requirements
### Requirement: Create Meeting
The system SHALL allow users to create meetings with required metadata and auto-generated meeting number.
#### Scenario: Create meeting with all fields
- **WHEN** user submits POST /api/meetings with subject, meeting_time, chairperson, location, recorder, attendees
- **THEN** a new meeting record SHALL be created with auto-generated UUID, meeting_number, and the meeting data SHALL be returned
#### Scenario: Create meeting with missing required fields
- **WHEN** user submits POST /api/meetings without subject or meeting_time
- **THEN** the server SHALL return HTTP 400 with validation error details
#### Scenario: Recorder defaults to current user
- **WHEN** user creates meeting without specifying recorder
- **THEN** the recorder field SHALL default to the logged-in user's email
#### Scenario: Auto-generate meeting number
- **WHEN** a new meeting is created
- **THEN** meeting_number SHALL be auto-generated in format M-YYYYMMDD-XX
### Requirement: System Code Generation
The system SHALL auto-generate unique system codes for meetings, conclusions, and action items.
#### Scenario: Generate meeting number
- **WHEN** a meeting is created on 2025-12-10
- **THEN** the meeting_number SHALL follow format M-20251210-XX where XX is sequence number
#### Scenario: Generate conclusion code
- **WHEN** a conclusion is created for a meeting on 2025-12-10
- **THEN** the system_code SHALL follow format C-20251210-XX where XX is sequence number
#### Scenario: Generate action item code
- **WHEN** an action item is created for a meeting on 2025-12-10
- **THEN** the system_code SHALL follow format A-20251210-XX where XX is sequence number