feat(status): add --project flag for filtering boards by project name
- Implemented the --project flag in the pcli status command to filter boards based on the specified project name. - Updated the command to resolve project names to IDs using case-insensitive matching. - Adjusted the totalBoards count in the output to reflect the number of boards matching the project filter. - Enhanced command help text and README documentation to include usage examples for the new flag. - Verified functionality through manual testing and ensured default behavior remains unchanged when the flag is omitted. feat(board): expand GetBoard response to include labels and card associations - Modified the Board struct to include Labels, CardLabels, and CardMemberships fields. - Updated the GetBoard method to parse additional fields from the API response. - Enhanced ListCardsByBoard to include label names for each card based on the enriched board data. - Ensured backward compatibility by making new fields optional and preserving existing output structure.
This commit is contained in:
@@ -1,7 +1,32 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Status command project filtering
|
||||
The system SHALL accept an optional `--project <name>` flag on the `pcli status` command. When `--project` is provided, the system SHALL resolve the project name to a project ID using case-insensitive exact matching against all accessible projects. The system SHALL then filter the board list to include only boards whose `projectId` matches the resolved project ID. The `totalBoards` count in the output SHALL reflect the filtered board count. When `--project` is omitted, behavior SHALL be unchanged (all boards shown).
|
||||
|
||||
#### Scenario: Status filtered by project name
|
||||
- **WHEN** `pcli status --project "MyProject"` is executed and the project exists with 2 boards
|
||||
- **THEN** the output SHALL include only the 2 boards belonging to "MyProject"
|
||||
- **AND** `totalBoards` SHALL be 2
|
||||
|
||||
#### Scenario: Status filtered by project name case-insensitive
|
||||
- **WHEN** `pcli status --project "myproject"` is executed and a project named "MyProject" exists
|
||||
- **THEN** the output SHALL include boards belonging to "MyProject"
|
||||
|
||||
#### Scenario: Status with project filter and no matching boards
|
||||
- **WHEN** `pcli status --project "EmptyProject"` is executed and the project exists but has no boards
|
||||
- **THEN** the output SHALL show `totalBoards` as 0 and an empty boards array
|
||||
|
||||
#### Scenario: Status with project not found
|
||||
- **WHEN** `pcli status --project "NonExistent"` is executed and no project with that name exists
|
||||
- **THEN** the system SHALL output an error "project not found: NonExistent"
|
||||
- **AND** the system SHALL exit with code 1
|
||||
|
||||
#### Scenario: Status without project flag
|
||||
- **WHEN** `pcli status` is executed without `--project`
|
||||
- **THEN** the output SHALL include all boards across all projects (unchanged behavior)
|
||||
|
||||
### Requirement: Status command summary output
|
||||
The system SHALL provide a top-level `pcli status` command that outputs a summary of all boards, their lists, and card counts. The summary SHALL include the total number of boards. For each board, the summary SHALL include the board name and a breakdown of each list within that board showing the list name, the number of open cards (where `isClosed` is false), and the number of closed cards (where `isClosed` is true). Empty lists SHALL be included in the output with 0 open and 0 closed cards.
|
||||
The system SHALL provide a top-level `pcli status` command that outputs a summary of all boards (or boards filtered by `--project`), their lists, and card counts. The summary SHALL include the total number of boards. For each board, the summary SHALL include the board name and a breakdown of each list within that board showing the list name, the number of open cards (where `isClosed` is false), and the number of closed cards (where `isClosed` is true). Empty lists SHALL be included in the output with 0 open and 0 closed cards.
|
||||
|
||||
#### Scenario: Status with multiple boards and lists
|
||||
- **WHEN** `pcli status` is executed and there are boards with lists containing cards
|
||||
|
||||
Reference in New Issue
Block a user