Skip to content

Commit 104b07a

Browse files
first commit
0 parents  commit 104b07a

152 files changed

Lines changed: 3963 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# CODEOWNERS
2+
# Format: <pattern> <owner>
3+
4+
* @zainsardar-tech
5+
6+
/backend/ @zainsardar-tech
7+
/.github/ @zainsardar-tech
8+
/*.md @zainsardar-tech
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Bug report
2+
description: Report a reproducible bug in ZA ERP Suite
3+
labels: ["type: bug", "area: backend"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for reporting a bug. Please fill all relevant details so maintainers can reproduce quickly.
9+
10+
- type: input
11+
id: summary
12+
attributes:
13+
label: Summary
14+
description: One-line description of the bug
15+
placeholder: API returns 500 when approving purchase order
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: steps
21+
attributes:
22+
label: Steps to reproduce
23+
description: Exact steps and API/UI actions
24+
placeholder: |
25+
1. Login as manager
26+
2. Submit purchase order
27+
3. Call approve endpoint
28+
4. Observe error
29+
validations:
30+
required: true
31+
32+
- type: textarea
33+
id: expected
34+
attributes:
35+
label: Expected behavior
36+
placeholder: Purchase order should move to completed and inventory should update
37+
validations:
38+
required: true
39+
40+
- type: textarea
41+
id: actual
42+
attributes:
43+
label: Actual behavior
44+
placeholder: Received 500 with traceback in logs
45+
validations:
46+
required: true
47+
48+
- type: input
49+
id: environment
50+
attributes:
51+
label: Environment
52+
description: OS, Python version, DB, Docker/local setup
53+
placeholder: Ubuntu 24.04, Python 3.12, SQLite, local venv
54+
55+
- type: textarea
56+
id: logs
57+
attributes:
58+
label: Logs / Traceback
59+
description: Paste relevant logs, traceback, or error payload
60+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security reports
4+
url: https://github.com/your-org/za-erp-suite/security/advisories/new
5+
about: Please report security vulnerabilities privately.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Feature request
2+
description: Suggest an enhancement for ZA ERP Suite
3+
labels: ["type: feature"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Use this template for new features, UX improvements, or architecture enhancements.
9+
10+
- type: input
11+
id: summary
12+
attributes:
13+
label: Feature summary
14+
placeholder: Add approval comments and reason history
15+
validations:
16+
required: true
17+
18+
- type: textarea
19+
id: problem
20+
attributes:
21+
label: Problem statement
22+
description: What problem are you trying to solve?
23+
placeholder: Managers cannot explain why a request was rejected
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
id: proposal
29+
attributes:
30+
label: Proposed solution
31+
description: Describe desired behavior
32+
placeholder: Add comment field on approve/reject endpoints and store in audit trail
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: alternatives
38+
attributes:
39+
label: Alternatives considered
40+
placeholder: Could rely on external ticketing system, but native ERP audit is better
41+
42+
- type: textarea
43+
id: impact
44+
attributes:
45+
label: Expected impact
46+
description: Which modules/users benefit?
47+
placeholder: Purchasing, Sales, and Audit workflows

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Summary
2+
3+
Describe what this PR changes and why.
4+
5+
## Type of change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Refactor
10+
- [ ] Documentation update
11+
- [ ] CI/DevOps update
12+
13+
## Related issues
14+
15+
Closes #
16+
17+
## What was changed
18+
19+
-
20+
-
21+
-
22+
23+
## Testing
24+
25+
- [ ] `python manage.py check`
26+
- [ ] `python manage.py makemigrations --check`
27+
- [ ] `python manage.py migrate`
28+
- [ ] `python3 -m compileall apps config manage.py`
29+
- [ ] Manual validation performed
30+
31+
Testing notes:
32+
33+
## Backward compatibility
34+
35+
- [ ] No breaking changes
36+
- [ ] Breaking change (describe below)
37+
38+
## Security and data considerations
39+
40+
- [ ] No secrets added
41+
- [ ] Permission checks reviewed
42+
- [ ] Tenant isolation considered
43+
- [ ] Migrations included (if model changes)
44+
45+
## Checklist
46+
47+
- [ ] Code follows project conventions
48+
- [ ] Docs updated (README/INSTALL/USECASE/CONTRIBUTING)
49+
- [ ] API changes documented
50+
- [ ] Screenshots/logs attached (if applicable)

.github/RELEASE_TEMPLATE.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Release {{VERSION}}
2+
3+
## Highlights
4+
5+
-
6+
-
7+
-
8+
9+
## New Features
10+
11+
-
12+
13+
## Improvements
14+
15+
-
16+
17+
## Bug Fixes
18+
19+
-
20+
21+
## Breaking Changes
22+
23+
- None
24+
25+
## Database and Migrations
26+
27+
- [ ] No migration changes
28+
- [ ] Migration changes included and validated
29+
30+
## Security Notes
31+
32+
-
33+
34+
## Upgrade Notes
35+
36+
1. Pull latest code.
37+
2. Install/update dependencies.
38+
3. Run migrations.
39+
4. Restart API and worker services.
40+
41+
## Validation Checklist
42+
43+
- [ ] `python manage.py check`
44+
- [ ] `python manage.py makemigrations --check --dry-run`
45+
- [ ] `python -m compileall apps config manage.py`
46+
- [ ] Core API smoke tests done
47+
48+
## Contributors
49+
50+
- @

.github/labeler.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"area: backend":
2+
- changed-files:
3+
- any-glob-to-any-file: "backend/**"
4+
5+
"area: docs":
6+
- changed-files:
7+
- any-glob-to-any-file: "*.md"
8+
- any-glob-to-any-file: "**/*.md"
9+
10+
"area: github":
11+
- changed-files:
12+
- any-glob-to-any-file: ".github/**"
13+
14+
"area: ci":
15+
- changed-files:
16+
- any-glob-to-any-file: ".github/workflows/**"
17+
18+
"area: migrations":
19+
- changed-files:
20+
- any-glob-to-any-file: "backend/**/migrations/**"

.github/workflows/auto-label.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Auto Label
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
issues:
7+
types: [opened, edited, reopened]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
issues: write
13+
14+
jobs:
15+
pr-labeler:
16+
if: github.event_name == 'pull_request'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Apply path labels to PR
23+
uses: actions/labeler@v5
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
configuration-path: .github/labeler.yml
27+
28+
issue-keyword-labeler:
29+
if: github.event_name == 'issues'
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Label issue by keywords
33+
uses: actions/github-script@v7
34+
with:
35+
script: |
36+
const issueNumber = context.payload.issue.number;
37+
const title = (context.payload.issue.title || '').toLowerCase();
38+
const body = (context.payload.issue.body || '').toLowerCase();
39+
const text = `${title}\n${body}`;
40+
41+
const labelsToEnsure = [
42+
{ name: 'type: bug', color: 'd73a4a', description: 'Something is not working' },
43+
{ name: 'type: feature', color: 'a2eeef', description: 'New feature or request' },
44+
{ name: 'type: docs', color: '0075ca', description: 'Documentation updates' },
45+
{ name: 'type: security', color: 'b60205', description: 'Security related' },
46+
{ name: 'type: question', color: 'd876e3', description: 'Further information is requested' },
47+
{ name: 'area: backend', color: '0e8a16', description: 'Backend/API changes' },
48+
{ name: 'area: docs', color: '1d76db', description: 'Documentation files' },
49+
{ name: 'area: github', color: '5319e7', description: 'GitHub templates/workflows/config' },
50+
{ name: 'area: security', color: 'b60205', description: 'Security/auth concerns' },
51+
];
52+
53+
for (const label of labelsToEnsure) {
54+
try {
55+
await github.rest.issues.createLabel({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
name: label.name,
59+
color: label.color,
60+
description: label.description,
61+
});
62+
} catch (error) {
63+
if (error.status !== 422) throw error;
64+
}
65+
}
66+
67+
const labels = new Set();
68+
if (/(bug|error|fail|failing|crash|exception|traceback|issue)/.test(text)) {
69+
labels.add('type: bug');
70+
labels.add('area: backend');
71+
}
72+
if (/(feature|enhancement|improve|proposal|request)/.test(text)) {
73+
labels.add('type: feature');
74+
}
75+
if (/(docs|documentation|readme|install|guide)/.test(text)) {
76+
labels.add('type: docs');
77+
labels.add('area: docs');
78+
}
79+
if (/(security|vulnerability|auth|token|xss|csrf|injection)/.test(text)) {
80+
labels.add('type: security');
81+
labels.add('area: security');
82+
}
83+
if (/(how to|help|question|clarify|what is)/.test(text)) {
84+
labels.add('type: question');
85+
}
86+
87+
if (labels.size > 0) {
88+
await github.rest.issues.addLabels({
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
issue_number: issueNumber,
92+
labels: Array.from(labels),
93+
});
94+
}

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
jobs:
9+
backend-ci:
10+
name: Backend Lint Check Build
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
DEBUG: "1"
15+
DJANGO_SECRET_KEY: ci-temporary-secret
16+
DB_ENGINE: django.db.backends.sqlite3
17+
DB_NAME: db.sqlite3
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install Dependencies
29+
working-directory: backend
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements.txt
33+
pip install ruff
34+
35+
- name: Lint (Ruff)
36+
run: ruff check backend --select E9,F63,F7,F82
37+
38+
- name: Django System Check
39+
working-directory: backend
40+
run: python manage.py check
41+
42+
- name: Migration Drift Check
43+
working-directory: backend
44+
run: python manage.py makemigrations --check --dry-run
45+
46+
- name: Build/Compile Check
47+
working-directory: backend
48+
run: python -m compileall apps config manage.py

0 commit comments

Comments
 (0)