Repository navigation
(feature): adds production planning - #22
Merged
Merged
Conversation
✅ Deploy Preview for scenepilot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production Planning Module & MongoDB API Integration
🚀 Summary
Introduces Production Planning features for ScenePilot, establishing a structured data layer to manage scenes, shoot schedules, filming locations, cast, and crew rosters.
This PR turns ScenePilot into an operational production hub by establishing normalized data schemas and single-table embedded document strategies using the native MongoDB driver. It implements automatic plan initialization alongside section-based atomic updates ($push) for scene breakdowns, location logging, cast/crew tracking, and shoot day scheduling.
The implementation establishes a clear operational workflow for:
Automatic creation and fetching of project-scoped production plans without requiring explicit initialization endpoints.
Atomic section updates (scenes, locations, cast, crew, shootDays) with automatic MongoDB ObjectId generation for sub-documents.
Data structure validation utilizing Zod schemas for production elements.
Reusable client-side state orchestration via custom React hooks.
Tabbed UI navigation allowing production teams to manage script breakdowns and call sheets in one place.
Authenticated project members can now:
Retrieve or automatically initialize a complete production breakdown plan for any project.
Add and review script scenes with scene numbers, descriptions, required equipment, and production notes.
Plan shoot days by linking dates, locations, assigned scenes, call times, and roster info.
Catalog shooting locations with physical addresses and associated scene numbers.
Maintain cast and crew directories with roles, contacts, availability, and department details.
📦 Changes Made
📦 Production Data Schemas & Validation
Defined TypeScript interfaces and Zod schemas (models/ProductionPlan.ts):
Established schemas for Scene, Location, Cast, Crew, and ShootDay.
Unified all production elements under a project-scoped schema structure (ProductionPlan).
🌐API Routes
Implemented native driver API endpoints
(app/api/projects/[projectId]/production/route.ts):-
GET /api/projects/[projectId]/tasks (or /api/projects/[projectId]/production): Connects via native MongoClient, queries production_plans by projectId, and automatically upserts an empty document if none exists.PATCH /api/projects/[projectId]/production: Accepts section (scenes | locations | cast | crew | shootDays) and item payload. Generates a new ObjectId for embedded items and appends it via $push while maintaining createdAt and updatedAt timestamps.🧪How to Test
TypeScript & Linting Validation
Run:
Expected result: 0 errors, 0 warnings.
Testing API via Browser Console
Test adding a scene via PATCH:
Expected behavior: Returns the updated plan document with the new scene appended inside the scenes array, complete with an assigned
_id.📋 Pre-Merge Checklist
🔐 Security & Safety Notes
🔄 Next Steps
Production Scheduling
Create: