Initial Commit
This commit is contained in:
77
openspec/changes/enterprise-api-plugin-events/proposal.md
Normal file
77
openspec/changes/enterprise-api-plugin-events/proposal.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# OpenSpec Change: enterprise-api-plugin-events
|
||||
|
||||
- **Change ID**: enterprise-api-plugin-events
|
||||
- **Package**: `@suaveplan/api-plugin-events`
|
||||
- **Category**: api/content
|
||||
- **Target path**: `api/content/api-plugin-events`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-04-24
|
||||
- **Reference spec**: `/mnt/s/web/suaveplan/enterprise/api-plugin-events.md`
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Deliver `@suaveplan/api-plugin-events` on the genesis branch from scratch at enterprise quality. Calendar/events plugin: event management (create/update/cancel), recurring event rules (RRule subset via `@suaveplan/datetime`), RSVP/attendance tracking, venue management, capacity limits, ticketing hooks, and an iCal feed export. Routes under `/events`. Per-table SurrealQL. Typed bus events: `calendar:event:created`, `calendar:event:cancelled`, `calendar:rsvp:confirmed`. Distinct from `@suaveplan/events` (the typed event bus package).
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps on genesis
|
||||
|
||||
| Package | Role |
|
||||
|---|---|
|
||||
| `@suaveplan/api` (`workspace:^`) | `definePlugin` |
|
||||
| `@suaveplan/api-shared` (`workspace:^`) | Helpers |
|
||||
| `@suaveplan/api-plugin-auth` (`workspace:^`) | `requireAuth` |
|
||||
| `@suaveplan/api-plugin-database` (`workspace:^`) | SurrealDB |
|
||||
| `@suaveplan/datetime` (`workspace:^`) | Timezone-aware dates, RRule recurrence |
|
||||
| `@suaveplan/events` (`workspace:^`) | Event bus (the pub/sub package) |
|
||||
| `@suaveplan/error` (`workspace:^`) | `CalendarError` hierarchy |
|
||||
| `@suaveplan/audit-logging` (`workspace:^`) | Audit |
|
||||
| `@suaveplan/rate-limiter` (`workspace:^`) | Rate limits |
|
||||
| `hono` + `@hono/zod-openapi` + `zod` | Routes |
|
||||
| `@opentelemetry/api` | OTel |
|
||||
|
||||
---
|
||||
|
||||
## Public API surface
|
||||
|
||||
```ts
|
||||
function createEventsPlugin(config?: EventsPluginConfig): PluginDescriptor
|
||||
// Services: CalendarEventService, VenueService, RsvpService, RecurrenceService
|
||||
// Routes: /events, /events/:id, /events/:id/rsvp, /events/:id/attendance,
|
||||
// /venues, /events/feed.ics
|
||||
```
|
||||
|
||||
### Error codes
|
||||
|
||||
```ts
|
||||
type CalendarErrorCode =
|
||||
| "CALENDAR_EVENT_NOT_FOUND"
|
||||
| "CALENDAR_VENUE_NOT_FOUND"
|
||||
| "CALENDAR_EVENT_FULL"
|
||||
| "CALENDAR_RSVP_DUPLICATE"
|
||||
| "CALENDAR_EVENT_CANCELLED"
|
||||
| "CALENDAR_INVALID_RECURRENCE"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File layout
|
||||
|
||||
```text
|
||||
api/content/api-plugin-events/
|
||||
package.json tsconfig.json vitest.config.ts
|
||||
surql/ (calendar_event, venue, rsvp, attendance tables)
|
||||
src/
|
||||
index.ts events.ts types/ errors/
|
||||
services/calendar-event/ services/venue/ services/rsvp/ services/recurrence/
|
||||
routes/events/ routes/venues/
|
||||
tests/integration.test.ts
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Impact
|
||||
|
||||
Prerequisites: `@suaveplan/api`, `@suaveplan/api-plugin-auth`, `@suaveplan/api-plugin-database`, `@suaveplan/datetime`.
|
||||
Reference in New Issue
Block a user