# Contributing to BTS ERP System

Welcome to contributing to the **BTS ERP System**, developed for **Bangladesh Thalassaemia Samity (BTS)**.

This document defines the **rules, workflow, and standards** that all contributors must follow to ensure code quality, security, and maintainability.

---

## 📌 Repository Policy

- This is a **private and proprietary** project.
- Only authorized contributors may access this repository.
- All changes must go through a **Pull Request (PR)** process.
- Direct push to `main` or `master` branch is **strictly prohibited**.

---

## 🟢 ERP Team Workflow

All contributors must follow the workflow below:

1️⃣ Clone the Repository
```bash
   git clone https://github.com/ipsita-soft/bts-erp.git
```

2️⃣ Fetch All Remote Branches
```bash
   git fetch origin
```
3️⃣ Checkout Your Assigned Branch
```bash
   git checkout <your-branch>
```
> Never create features directly on the main branch.

4️⃣ Development Rules
- Follow the project coding standards
- Use Service & Repository patterns
- Write clean, readable, and testable code
- Use transactions for database operations
- Follow authorization policies strictly

5️⃣ Commit Your Changes
```bash
   git add .
```
```bash
   git commit -m "Meaningful commit message"
```

**Commit message guidelines:**

- Be clear and concise
- Use present tense

6️⃣ Push to Your Branch
```bash
   git push origin <your-branch>
```

7️⃣ Create a Pull Request (PR)

- Base branch: main
- Provide a clear PR title
- Describe what was changed and why
- Link related issues (if any)
- Wait for review and approval before merge


## 🌿 Branch Naming Convention

| Type     | Example                     |
| -------- | --------------------------- |
| Feature  | `feature/patient-module`    |
| Bug Fix  | `fix/billing-calculation`   |
| Refactor | `refactor/accounts-service` |
| Chore    | `chore/readme-update`       |


## 🔐 Security Guidelines

- Never commit .env files
- Never commit secrets, tokens, or credentials
- Do not expose patient or financial data
- Follow RBAC and policy authorization rules strictly

## 🧠 Code Quality Standards

- Use $fillable instead of $guarded
- Use Form Request validation
- Use API Resources for responses
- Paginate list endpoints
- Eager load relationships
- Write seeders where applicable

## 🚫 Prohibited Actions

- Direct push to main
- Force push on shared branches
- Committing generated files
- Pushing unfinished or broken code

## 🏁 Final Notes

<p>By contributing to this repository, you agree to follow all rules defined in this document.</p>
<p>Failure to comply may result in:</p>

- PR rejection
- Access revocation

---

❤️ Thank you for helping maintain the quality and stability of the **BTS ERP System**.
