-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement Core Business Logic, Authorization, and Workflow State Management #1908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: patent-management-v2
Are you sure you want to change the base?
Changes from all commits
5f8e54c
8bee7ad
c36c0d8
a28ac42
3a4e955
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', | ||
| 'NAME': 'fusionlab', | ||
| 'HOST': os.environ.get("DB_HOST", default='localhost'), | ||
| 'PORT': '5433', | ||
| 'USER': 'fusion_admin', | ||
| 'PASSWORD': 'hello123', | ||
| } | ||
|
|
@@ -64,4 +65,13 @@ | |
| ('0 22 * * *', 'applications.central_mess.tasks.generate_bill'), | ||
| ] | ||
|
|
||
| CRONTAB_DJANGO_MANAGE_PATH = '/home/owlman/Desktop/Fuse/Fusion/FusionIIIT/manage.py' | ||
| CRONTAB_DJANGO_MANAGE_PATH = '/home/owlman/Desktop/Fuse/Fusion/FusionIIIT/manage.py' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| TEST_RUNNER = 'django.test.runner.DiscoverRunner' | ||
|
|
||
| DATABASES['default']['TEST'] = { | ||
| 'MIRROR': 'default', | ||
| } | ||
|
|
||
| DEBUG = True | ||
| STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Package marker\n |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Module Name: Patent Management System | ||
|
|
||
| ## Designated User Roles & Permissions | ||
|
|
||
| ### 1. Role Name: PCC Admin | ||
|
|
||
| * **Description:** Central module administrator responsible for operational control, workflow routing, and compliance handling. | ||
|
|
||
| * **Permissions:** | ||
|
|
||
| * Full CRUD on patent applications and related module records. | ||
|
|
||
| * Review new submissions and forward applications to Director. | ||
|
|
||
| * Request modifications, manage workflow state transitions, and monitor pending actions. | ||
|
|
||
| * Manage budget entries, communication logs, attorney assignment, filing records, and analytics dashboards. | ||
|
|
||
| * Access audit logs and module-wide reporting views. | ||
|
|
||
|
|
||
| ### 2. Role Name: Director | ||
|
|
||
| * **Description:** Decision authority for review, approval/rejection, appeal decisions, and escalated budget approvals. | ||
|
|
||
| * **Permissions:** | ||
|
|
||
| * View applications assigned for Director review. | ||
|
|
||
| * Approve, reject, or mark applications for revision with mandatory feedback. | ||
|
|
||
| * Approve or deny escalated budgets. | ||
|
|
||
| * Review and decide appeals. | ||
|
|
||
| * View notifications and decision-linked records relevant to assigned workflows. | ||
|
|
||
|
|
||
| ### 3. Role Name: Applicant / Inventor | ||
|
|
||
| * **Description:** Primary end-user who submits, tracks, and updates patent applications and inventor consent data. | ||
|
|
||
| * **Permissions:** | ||
|
|
||
| * Create and submit patent applications. | ||
|
|
||
| * View personal/associated applications and status timeline. | ||
|
|
||
| * Revise and resubmit applications when revision is requested. | ||
|
|
||
| * Withdraw applications (subject to workflow/state restrictions). | ||
|
|
||
| * Provide/revoke inventor consent where applicable. | ||
|
|
||
| * Lodge appeal for rejected applications within defined timeline constraints. | ||
|
|
||
|
|
||
| ### 4. Role Name: External Attorney (Recorded Entity) | ||
|
|
||
| * **Description:** External legal expert tracked by the module for legal assessment and filing lifecycle stages. | ||
|
|
||
| * **Permissions:** | ||
|
|
||
| * Not a direct portal-authenticated role in current implementation. | ||
|
|
||
| * Assignment details, legal assessment inputs, and filing details are recorded by PCC Admin. | ||
|
|
||
| * Actions are represented through module records (assessment, filing, communication logs). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Package marker\n |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| from django.contrib import admin | ||
| from .models import ( | ||
| Applicant, Application, ApplicationSectionI, ApplicationSectionII, | ||
| ApplicationSectionIII, Inventor, CommunicationLog, Budget, AuditLog, Document, | ||
| AttorneyAssignment, PatentabilityAssessment, FilingRecord, | ||
| ) | ||
|
|
||
|
|
||
| class InventorInline(admin.TabularInline): | ||
| model = Inventor | ||
| extra = 0 | ||
|
|
||
|
|
||
| class SectionIInline(admin.StackedInline): | ||
| model = ApplicationSectionI | ||
| extra = 0 | ||
|
|
||
|
|
||
| class SectionIIInline(admin.StackedInline): | ||
| model = ApplicationSectionII | ||
| extra = 0 | ||
|
|
||
|
|
||
| class SectionIIIInline(admin.TabularInline): | ||
| model = ApplicationSectionIII | ||
| extra = 0 | ||
|
|
||
|
|
||
| @admin.register(Application) | ||
| class ApplicationAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "title", "status", "decision_status", "primary_applicant", "submitted_date") | ||
| list_filter = ("status", "decision_status") | ||
| search_fields = ("title", "token_no") | ||
| inlines = [InventorInline, SectionIInline, SectionIIInline, SectionIIIInline] | ||
|
|
||
|
|
||
| @admin.register(Applicant) | ||
| class ApplicantAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "name", "email", "user") | ||
| search_fields = ("name", "email") | ||
|
|
||
|
|
||
| @admin.register(CommunicationLog) | ||
| class CommunicationLogAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "direction", "subject", "logged_by", "created_at") | ||
| list_filter = ("direction",) | ||
|
|
||
|
|
||
| @admin.register(Budget) | ||
| class BudgetAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "total_cost", "decision") | ||
| list_filter = ("decision",) | ||
|
|
||
|
|
||
| @admin.register(AuditLog) | ||
| class AuditLogAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "action", "user", "timestamp") | ||
| list_filter = ("action",) | ||
| readonly_fields = ("application", "user", "action", "previous_state", "new_state", "details", "timestamp") | ||
|
|
||
|
|
||
| @admin.register(Document) | ||
| class DocumentAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "title", "link", "created_at") | ||
|
|
||
|
|
||
| @admin.register(AttorneyAssignment) | ||
| class AttorneyAssignmentAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "attorney_name", "attorney_firm", "assigned_by", "assignment_date", "is_active") | ||
| list_filter = ("is_active",) | ||
| search_fields = ("attorney_name", "attorney_firm", "attorney_email") | ||
|
|
||
|
|
||
| @admin.register(PatentabilityAssessment) | ||
| class PatentabilityAssessmentAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "assessed_by_attorney", "recommendation", "assessment_date") | ||
| list_filter = ("recommendation",) | ||
| search_fields = ("assessed_by_attorney", "opinion_summary") | ||
|
|
||
|
|
||
| @admin.register(FilingRecord) | ||
| class FilingRecordAdmin(admin.ModelAdmin): | ||
| list_display = ("id", "application", "filing_office", "jurisdiction", "external_filing_id", "filing_date") | ||
| list_filter = ("filing_office", "jurisdiction") | ||
| search_fields = ("external_filing_id",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PORT: '5433'is a personal dev machine setting — the standard Postgres port is 5432. Committing a non-standard port breaks every other developer's local setup without any explanation. Remove this line; if your local Postgres runs on a different port, override it via an environment variable: