a2n-seattle / a2n-seattle/rms-app
Gen 2 migration Subtask 1: Build remaining 9 Lambda functions
- Lenguaje dominante
- TypeScript
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 27 min
- PR fusionados (30 d)
- 4
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Examina el archivo `amplify-gen2/functions/add-item/resource.ts` existente y su integración en `amplify-gen2/backend.ts`. Revisa el documento `.claude/plans/can-you-make-a-shimmying-crane.md` para conocer el contexto. Para cada una de las 9 funciones enumeradas, crea un archivo `resource.ts` similar, configura las concesiones de IAM mediante `backend-config.json` y añade la función a `backend.ts`. La salida de `build/` para cada función ya existe. Prueba la integración ejecutando el sandbox (`ampx sandbox`) para verificar que la capa Lambda/DynamoDB coincide con el entorno alpha de Gen 1.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- aws, nodejs, typescript
- Área
- backend, cloud, devops
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 35/100