# Deployment Instructions - 2026 Calculator Updates

**Date:** 2026-01-07  
**Status:** Ready for Deployment

---

## Pre-Deployment Checklist

### ✅ Code Verification

- [x] All code changes applied
- [x] All constants verified (2026 values)
- [x] All formulas verified (2026 calculations)
- [x] All "2025" references removed/updated
- [x] Minified files regenerated
- [x] No linter errors
- [x] Formula tests passing (21/21)

### ⚠️ Testing

- [ ] Browser testing completed
- [ ] Schema validation completed
- [ ] Cross-calculator verification completed
- [ ] Export functionality tested

### ⚠️ Documentation

- [x] Code changes documented
- [x] Testing framework created
- [x] Deployment checklist created
- [ ] Browser testing results documented
- [ ] Schema validation results documented

---

## Deployment Steps

### Step 1: Pre-Deployment Verification

**Before deploying, verify:**

1. **Code Status:**
   ```bash
   # Check git status
   git status
   
   # Verify all changes are committed
   git diff
   
   # Check for uncommitted changes
   ```

2. **Test Status:**
   ```bash
   # Run formula tests
   node tests/calculators/formulas/formula-tests.js
   
   # Verify all tests passing
   ```

3. **Build Status:**
   ```bash
   # Regenerate minified files
   npm run minify
   
   # Verify minified files updated
   ```

---

### Step 2: Staging Deployment

**Deploy to staging environment:**

1. **Deploy Code:**
   ```bash
   # Push to staging branch
   git push origin staging
   
   # Or deploy via deployment tool
   ```

2. **Verify Deployment:**
   - [ ] Check staging URL
   - [ ] Verify page loads
   - [ ] Check for JavaScript errors
   - [ ] Verify calculations work

3. **Run Tests on Staging:**
   - [ ] Test Midijob calculator
   - [ ] Test Brutto-Netto calculator
   - [ ] Test other calculators
   - [ ] Verify calculations match expected results
   - [ ] Test exports (PDF, CSV)
   - [ ] Verify no "2025" references in UI

4. **Schema Validation:**
   - [ ] Run Google Rich Results Test
   - [ ] Verify FAQPage schema valid
   - [ ] Verify no "2025" references in schema
   - [ ] Verify all values match 2026

5. **Cross-Browser Testing:**
   - [ ] Test in Chrome
   - [ ] Test in Firefox
   - [ ] Test in Safari
   - [ ] Test in Edge
   - [ ] Test on mobile devices

---

### Step 3: Production Deployment

**Deploy to production:**

1. **Pre-Deployment:**
   - [ ] Verify staging tests passed
   - [ ] Review all changes
   - [ ] Get approval (if required)
   - [ ] Backup current production

2. **Deploy Code:**
   ```bash
   # Push to production branch
   git push origin main
   
   # Or deploy via deployment tool
   ```

3. **Verify Deployment:**
   - [ ] Check production URL
   - [ ] Verify page loads
   - [ ] Check for JavaScript errors
   - [ ] Verify calculations work

4. **Quick Smoke Tests:**
   - [ ] Test Midijob calculator (quick test)
   - [ ] Test Brutto-Netto calculator (quick test)
   - [ ] Verify calculations match expected results
   - [ ] Check console for errors

---

### Step 4: Post-Deployment Verification

**After deploying:**

1. **Monitor:**
   - [ ] Monitor error logs
   - [ ] Check for JavaScript errors
   - [ ] Monitor server performance
   - [ ] Check analytics

2. **Verify Calculations:**
   - [ ] Test key calculators in production
   - [ ] Verify calculations match expected results
   - [ ] Compare with staging results

3. **User Feedback:**
   - [ ] Monitor user feedback
   - [ ] Check support tickets
   - [ ] Review analytics

4. **Documentation:**
   - [ ] Document deployment date
   - [ ] Document any issues found
   - [ ] Update deployment log

---

## Rollback Plan

**If issues are found:**

### Immediate Rollback

1. **Revert Code:**
   ```bash
   # Revert to previous commit
   git revert HEAD
   
   # Or restore from backup
   ```

2. **Verify Rollback:**
   - [ ] Verify rollback successful
   - [ ] Test calculators work
   - [ ] Check for errors

### Investigation

1. **Identify Issue:**
   - [ ] Identify root cause
   - [ ] Document issue
   - [ ] Create fix plan

2. **Fix Issue:**
   - [ ] Fix code issue
   - [ ] Test fix thoroughly
   - [ ] Verify fix works

3. **Re-deploy:**
   - [ ] Deploy fix to staging
   - [ ] Test fix on staging
   - [ ] Deploy fix to production
   - [ ] Verify fix works

---

## Deployment Checklist

### Pre-Deployment:
- [x] All code fixes applied
- [x] All constants verified
- [x] All formulas verified
- [x] Minified files regenerated
- [x] No linter errors
- [x] Formula tests passing (21/21)
- [ ] Browser testing completed
- [ ] Schema validation completed
- [ ] Code review completed

### Staging Deployment:
- [ ] Deploy to staging
- [ ] Verify deployment successful
- [ ] Run browser tests
- [ ] Verify calculations
- [ ] Test exports
- [ ] Schema validation
- [ ] Cross-browser testing

### Production Deployment:
- [ ] Deploy to production
- [ ] Verify deployment successful
- [ ] Quick smoke tests
- [ ] Monitor for errors
- [ ] Verify calculations

### Post-Deployment:
- [ ] Monitor error logs
- [ ] Verify calculations in production
- [ ] Check analytics
- [ ] Document deployment

---

## Files to Deploy

### Modified Files:
1. `v2/js/tools-midijob-calculator.js`
2. `v2/pages/tools_midijob_rechner.php`
3. `v2/pages/tools_bruttonettorechner.php`

### Regenerated Files:
1. `v2/js/tools-midijob-calculator.min.js`

### Documentation Files (Optional):
- All documentation files in `docs/guides/tools-pages/`
- Test files in `tests/calculators/`

---

## Deployment Commands

### Regenerate Minified Files

```bash
npm run minify
```

### Run Formula Tests

```bash
node tests/calculators/formulas/formula-tests.js
```

### Check Git Status

```bash
git status
git diff
```

### Deploy (Example)

```bash
# Staging
git push origin staging

# Production
git push origin main
```

---

## Success Criteria

### Code Level:
- ✅ All constants match 2026 official values
- ✅ All formulas use correct 2026 calculations
- ✅ All "2025" references removed/updated
- ✅ Minified files regenerated
- ✅ No linter errors

### Testing Level:
- ✅ Formula tests passing (21/21)
- ⚠️ Browser testing completed
- ⚠️ Schema validation completed

### Deployment Level:
- ⚠️ Staging deployment successful
- ⚠️ Production deployment successful
- ⚠️ Post-deployment verification complete

---

## Next Steps

1. ✅ **Code Changes:** Complete
2. ✅ **Testing Framework:** Complete
3. ✅ **Documentation:** Complete
4. ⚠️ **Browser Testing:** Pending
5. ⚠️ **Schema Validation:** Pending
6. ⚠️ **Staging Deployment:** Pending
7. ⚠️ **Production Deployment:** Pending

---

## Support

**For Issues:**
- Review `PROJECT_COMPLETE_2026.md` for project status
- Review `CODE_UPDATES_2026.md` for code changes
- Review `BROWSER_TESTING_GUIDE_2026.md` for testing procedures

**For Questions:**
- Check documentation files
- Review test results
- Check deployment logs

---

## Notes

- Deploy during low-traffic hours if possible
- Monitor closely after deployment
- Have rollback plan ready
- Document all deployment steps
- Keep deployment log updated

