5.5 KiB
Requirements Document
Introduction
This feature will complete the Shopify Price Updater TUI by implementing the three missing screens: Scheduling, View Logs, and Tag Analysis. Currently, these screens show "coming soon" placeholders, but users need functional interfaces to schedule operations, view historical logs, and analyze product tags before running operations.
Requirements
Requirement 1: Scheduling Screen
User Story: As a store owner, I want to schedule price update operations to run automatically at specific times, so that I can manage promotional pricing without manual intervention.
Acceptance Criteria
- WHEN the user navigates to the Scheduling screen THEN the system SHALL display a list of scheduled operations
- WHEN the user selects "Add New Schedule" THEN the system SHALL provide a form to create a new scheduled operation
- WHEN creating a schedule THEN the system SHALL allow selection of operation type (update/rollback)
- WHEN creating a schedule THEN the system SHALL allow setting of date and time for execution
- WHEN creating a schedule THEN the system SHALL allow selection of recurrence pattern (once, daily, weekly, monthly)
- WHEN the user saves a schedule THEN the system SHALL persist it to a schedules.json file
- WHEN viewing schedules THEN the system SHALL show status (pending, completed, failed) for each scheduled operation
- WHEN the user selects a schedule THEN the system SHALL allow editing or deleting the schedule
- IF a schedule is set to run THEN the system SHALL provide instructions on how to enable automatic execution
Requirement 2: View Logs Screen
User Story: As a store owner, I want to view historical operation logs in the TUI, so that I can review past price updates and troubleshoot issues without leaving the interface.
Acceptance Criteria
- WHEN the user navigates to the View Logs screen THEN the system SHALL display a list of available log files
- WHEN the user selects a log file THEN the system SHALL display the log contents with syntax highlighting
- WHEN viewing logs THEN the system SHALL provide filtering options (date range, operation type, status)
- WHEN viewing logs THEN the system SHALL show pagination for large log files
- WHEN viewing logs THEN the system SHALL highlight important information (errors, warnings, success messages)
- WHEN the user presses a key THEN the system SHALL allow scrolling through log content
- WHEN no logs exist THEN the system SHALL display a helpful message explaining how logs are created
- WHEN viewing logs THEN the system SHALL show log metadata (file size, creation date, operation count)
Requirement 3: Tag Analysis Screen
User Story: As a store owner, I want to analyze product tags in my store through the TUI, so that I can understand my product organization and make informed decisions about which tags to target for price updates.
Acceptance Criteria
- WHEN the user navigates to the Tag Analysis screen THEN the system SHALL fetch and display all product tags from the store
- WHEN displaying tags THEN the system SHALL show the count of products for each tag
- WHEN displaying tags THEN the system SHALL show the count of variants for each tag
- WHEN displaying tags THEN the system SHALL calculate and show total value of products for each tag
- WHEN the user selects a tag THEN the system SHALL display detailed information about products with that tag
- WHEN viewing tag details THEN the system SHALL show product names, prices, and variant counts
- WHEN analyzing tags THEN the system SHALL provide search/filter functionality to find specific tags
- WHEN the analysis is complete THEN the system SHALL allow the user to select a tag for immediate use in configuration
- IF the API connection fails THEN the system SHALL display appropriate error messages with troubleshooting guidance
Requirement 4: Navigation and User Experience
User Story: As a user, I want consistent navigation and user experience across all TUI screens, so that I can efficiently use all features without confusion.
Acceptance Criteria
- WHEN the user is on any new screen THEN the system SHALL provide consistent keyboard navigation (↑/↓ arrows, Enter, Esc)
- WHEN the user presses Esc THEN the system SHALL return to the main menu from any screen
- WHEN displaying data THEN the system SHALL use consistent styling and colors across all screens
- WHEN operations are in progress THEN the system SHALL show consistent loading indicators and progress bars
- WHEN errors occur THEN the system SHALL display consistent error messages with helpful guidance
- WHEN the user navigates between screens THEN the system SHALL maintain state appropriately (remember selections, preserve data)
Requirement 5: Data Persistence and Integration
User Story: As a user, I want the new TUI screens to integrate seamlessly with existing functionality, so that all features work together cohesively.
Acceptance Criteria
- WHEN schedules are created THEN the system SHALL store them in a JSON file in the project directory
- WHEN viewing logs THEN the system SHALL read from the same Progress.md file used by CLI operations
- WHEN analyzing tags THEN the system SHALL use the same Shopify API services as other operations
- WHEN configuration changes are made THEN the system SHALL reflect those changes in all relevant screens
- WHEN the user selects a tag from analysis THEN the system SHALL allow updating the configuration with that tag
- WHEN schedules are executed THEN the system SHALL log results to the same logging system used by manual operations