{
"issueNumber": 545,
"branchName": "rc/atlassian-integration",
"generatedAt": "2026-04-23T17:15:00Z",
"stories": [
{
"id": "S1",
"title": "Create AtlassianOauthStateEntity and register it in DatabaseModule + entities barrel",
"priority": 1,
"dependsOn": [],
"acceptanceCriteria": [
"Entity file declares @Entity('atlassian_oauth_state') with columns id (uuid pk), platform, tenant_id, access_token (nullable), refresh_token, expires_at (nullable), updated_at",
"@Unique(['platform', 'tenantId']) present",
"Entity exported from src/database/entities/index.ts",
"Entity added to both forRoot and forFeature arrays in database.module.ts"
],
"passes": false,
"completedAt": null
},
{
"id": "S2",
"title": "Create AtlassianModule, AtlassianOauthStateRepo, and barrel with get/upsert API",
"priority": 2,
"dependsOn": [
"S1"
],
"acceptanceCriteria": [
"AtlassianOauthStateRepo is @Injectable with InjectRepository(AtlassianOauthStateEntity)",
"get(platform, tenantId) returns entity or null",
"upsert(platform, tenantId, { accessToken, refreshToken, expiresAt }) writes row and updates on conflict without duplicating",
"AtlassianModule imports TypeOrmModule.forFeature([entity]) and exports the repo",
"src/atlassian/index.ts exports module, repo, and entity"
],
"passes": false,
"completedAt": null
},
{
"id": "S3",
"title": "Add unit tests for the repo using in-memory SQLite",
"priority": 3,
"dependsOn": [
"S2"
],
"acceptanceCriteria": [
"Spec uses Test.createTestingModule with DatabaseModule under NODE_ENV=test",
"Covers: insert via upsert, read via get, idempotent upsert on same (platform, tenantId), null accessToken/expiresAt round-trip",
"npm run test passes; npm run lint zero warnings; npm run build clean"
],
"passes": false,
"completedAt": null
}
]
}