Skip to content

Commit f87c1d6

Browse files
committed
feat: finalize working solution with fixes, tests, and metadata updates
- Fixed logic for priority sorting and time-based filtering - Refactored core filtering into `process_actions` function - Added panic-free unit tests using `anyhow::Result` - Introduced `parse_date` helper for safe timestamp parsing - Renamed crate to `aws-lambda-action-filter` in Cargo.toml - Bumped version to 0.1.1 to distinguish from original (0.1.0) - Updated README with attribution, improvements, and preserved original prompt - Added CHANGELOG.md to document changes and track versions
1 parent 41a9c80 commit f87c1d6

File tree

6 files changed

+419
-39
lines changed

6 files changed

+419
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ target/
55

66
# These are backup files generated by rustfmt
77
**/*.rs.bk
8+
*.swp
9+
*~
810

911
# MSVC Windows builds of rustc generate these, which store debugging information
1012
*.pdb

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project uses [semantic versioning](https://semver.org/).
6+
7+
---
8+
9+
## [Unreleased]
10+
11+
- Awaiting license and attribution confirmation from the original author
12+
13+
---
14+
15+
## [0.1.1] – 2025-06-27
16+
17+
### Added
18+
- Added `process_actions` function to encapsulate business logic
19+
- Wrote unit tests using `anyhow::Result` and `ensure` for panic-free testing
20+
- Added `parse_date` utility to safely parse ISO-8601 timestamps
21+
- Added README summary and improvements section
22+
23+
### Fixed
24+
- Corrected deprecated use of `lambda_runtime::handler_fn`
25+
- Fixed business logic for:
26+
- Skipping actions less than 7 days old
27+
- Filtering future actions beyond 90 days
28+
- Sorting urgent priorities first
29+
- Ensured only one action per `entity_id` is returned
30+
31+
---
32+
33+
## [0.0.1] – original version
34+
35+
- Initial assignment version, likely authored by Illya (via LinkedIn)
36+
- Included broken logic, outdated dependencies, and no tests

Cargo.lock

Lines changed: 145 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[package]
2-
name = "lambda-action-filter"
3-
version = "0.1.0"
2+
name = "aws-lambda-action-filter"
3+
version = "0.1.1"
44
edition = "2021"
55

66
[dependencies]
7-
lambda_runtime = "0.9"
8-
serde = { version = "1.0", features = ["derive"] }
7+
anyhow = "1.0"
8+
chrono = { version = "0.4", features = ["serde"] }
9+
lambda_runtime = "0.10"
910
serde_json = "1.0"
11+
serde = { version = "1.0", features = ["derive"] }
1012
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
11-
chrono = { version = "0.4", features = ["serde"] }

0 commit comments

Comments
 (0)