• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

super3 / lowerproptax / 19279829809

11 Nov 2025 10:08PM UTC coverage: 81.29% (-18.7%) from 100.0%
19279829809

push

github

super3
Add admin page to track property assessments

- Create admin.html with unified assessments view
- Show pending and completed properties in single table
- Display Total Pending and Total Completed stats
- Add time elapsed tracking with color-coded warnings
- Implement Mark Ready action for pending properties
- Create admin API endpoints (pending, completed, mark-ready)
- Match dashboard layout and styling exactly
- Add responsive design for mobile devices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

36 of 38 branches covered (94.74%)

Branch coverage included in aggregate %.

0 of 27 new or added lines in 2 files covered. (0.0%)

90 of 117 relevant lines covered (76.92%)

7.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/controllers/adminController.js
1
import pool from '../db/connection.js';
2

3
// Get all pending properties (status = 'preparing')
4
export async function getPendingProperties(req, res) {
NEW
5
  try {
×
NEW
6
    const query = `
×
7
      SELECT
8
        p.id,
9
        p.address,
10
        p.city,
11
        p.state,
12
        p.zip_code,
13
        p.status,
14
        p.created_at,
15
        p.user_id
16
      FROM properties p
17
      WHERE p.status = 'preparing'
18
      ORDER BY p.created_at ASC
19
    `;
20

NEW
21
    const result = await pool.query(query);
×
22

23
    // For now, we don't have user email in the database
24
    // In production, you'd join with a users table or fetch from Clerk
NEW
25
    const properties = result.rows.map(prop => ({
×
26
      ...prop,
27
      user_email: null  // TODO: Fetch from Clerk API using user_id
28
    }));
29

NEW
30
    res.json(properties);
×
31
  } catch (error) {
NEW
32
    console.error('Error fetching pending properties:', error);
×
NEW
33
    res.status(500).json({ error: 'Failed to fetch pending properties' });
×
34
  }
35
}
36

37
// Get all completed properties (status = 'ready')
38
export async function getCompletedProperties(req, res) {
NEW
39
  try {
×
NEW
40
    const query = `
×
41
      SELECT
42
        p.id,
43
        p.address,
44
        p.city,
45
        p.state,
46
        p.zip_code,
47
        p.status,
48
        p.created_at,
49
        p.updated_at,
50
        p.user_id
51
      FROM properties p
52
      WHERE p.status = 'ready'
53
      ORDER BY p.updated_at DESC
54
    `;
55

NEW
56
    const result = await pool.query(query);
×
57

58
    // For now, we don't have user email in the database
59
    // In production, you'd join with a users table or fetch from Clerk
NEW
60
    const properties = result.rows.map(prop => ({
×
61
      ...prop,
62
      user_email: null  // TODO: Fetch from Clerk API using user_id
63
    }));
64

NEW
65
    res.json(properties);
×
66
  } catch (error) {
NEW
67
    console.error('Error fetching completed properties:', error);
×
NEW
68
    res.status(500).json({ error: 'Failed to fetch completed properties' });
×
69
  }
70
}
71

72
// Mark property as ready
73
export async function markPropertyAsReady(req, res) {
NEW
74
  try {
×
NEW
75
    const { id } = req.params;
×
76

NEW
77
    const query = `
×
78
      UPDATE properties
79
      SET status = 'ready', updated_at = NOW()
80
      WHERE id = $1
81
      RETURNING *
82
    `;
83

NEW
84
    const result = await pool.query(query, [id]);
×
85

NEW
86
    if (result.rows.length === 0) {
×
NEW
87
      return res.status(404).json({ error: 'Property not found' });
×
88
    }
89

NEW
90
    res.json(result.rows[0]);
×
91
  } catch (error) {
NEW
92
    console.error('Error marking property as ready:', error);
×
NEW
93
    res.status(500).json({ error: 'Failed to mark property as ready' });
×
94
  }
95
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc