a2n-seattle / a2n-seattle/rms-app

Gen 2 migration Subtask 1: Build remaining 9 Lambda functions

オープン
#293 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
priority-high task
主要言語
TypeScript
スター
1
フォーク
1
平均マージ
27分
マージ済み PR(30日)
4

説明

Story Points: 5

# How?

Part of #292 (Amplify Gen 1 → Gen 2 Rebuild). Full detail in `.claude/plans/can-you-make-a-shimmying-crane.md`, section 4 and Phase 4.

Replicate the `add-item` pattern (already done — see `amplify-gen2/functions/add-item/resource.ts`, wired into `backend.ts`) for the remaining 9 functions. `build/` output already exists for all of them (produced by `backend-build-gen2.js`); only the CDK `resource.ts` construct + wiring into `backend.ts` is missing.

Functions to add:
- `borrow-item`
- `borrow-from-schedule`
- `create-batch`
- `create-reservation`
- `delete-batch`
- `delete-item`
- `delete-reservation`
- `return-item`
- `update-tags`
- `smsrouter` (deploys as a plain Lambda with **no SNS trigger** — the old phone number is lost, nothing to wire up; rebuilding SMS routing is separate future work)

For each:
1. `resource.ts` using plain `lambda.Function` (not `NodejsFunction`) pointed at `build/` via `lambda.Code.fromAsset(...)`, `runtime: NODEJS_22_X`, handler matching the existing dotted convention (e.g. `handlers/api/BorrowItem.handler`).
2. IAM grants via `table.grantReadWriteData(fn)` per function, using `backend-config.json`'s per-function table lists (9 API functions get `main, items, tags, batch, history, schedule`; `smsrouter` additionally gets `transactions`).
3. Wire into `defineBackend(...)` in `amplify-gen2/backend.ts`.

Checkpoint: sandbox (`ampx sandbox`) is a complete functional mirror of Gen 1 `alpha`'s DynamoDB/Lambda layer. Full sandbox integration pass before moving to the cutover sub-issue.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

既存の `amplify-gen2/functions/add-item/resource.ts` と、`amplify-gen2/backend.ts` でのその組み込みを調査します。背景を把握するため、`.claude/plans/can-you-make-a-shimmying-crane.md` ドキュメントを確認します。リストされている 9 個の各関数について、同様の `resource.ts` ファイルを作成し、`backend-config.json` を使用して IAM グラントを設定し、関数を `backend.ts` に追加します。各関数の `build/` 出力はすでに存在します。sandbox(`ampx sandbox`)を実行して統合をテストし、Lambda/DynamoDB レイヤーが Gen 1 alpha 環境と一致することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, nodejs, typescript
領域
backend, cloud, devops
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。