Files
PowderCoatingLogix/src/PowderCoating.Core/Entities/FormulaLibraryRating.cs
T
spouliot ed35362c7a Add Formula Library ratings, Job Profitability report, and Quote Revision History improvements
- Formula Library ratings: thumbs up/down per company per formula; toggle on/off; sorts by net score; own formulas not rateable; FormulaLibraryRating entity + migration AddFormulaLibraryRatings
- Job Profitability report: actual labor cost (logged hours x StandardLaborRate) vs powder cost vs billed price per job; gross margin % color-coded; time-tracked-only filter; totals footer
- Quote Revision History: track Total price changes on every save; log Sent/Resent events with recipient email; replace flat table with grouped timeline UI (icons per event type, total-change badge on header)
- Setup Wizard: cap CompletedCount at TotalSteps so old 10-step data no longer shows 10/5
- Formula Library card: fix badge overflow on long titles; add Rate: label to make voting buttons discoverable
- Help docs and AI knowledge base updated for all three features

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 09:02:07 -04:00

25 lines
792 B
C#

namespace PowderCoating.Core.Entities;
/// <summary>
/// One thumbs-up or thumbs-down vote per company per library formula.
/// Platform-level — no BaseEntity, no soft delete, no CompanyId tenant filter.
/// Unique constraint enforced at the DB level: (FormulaLibraryItemId, CompanyId).
/// </summary>
public class FormulaLibraryRating
{
public int Id { get; set; }
public int FormulaLibraryItemId { get; set; }
/// <summary>The company casting the vote.</summary>
public int CompanyId { get; set; }
/// <summary>True = thumbs up, false = thumbs down.</summary>
public bool IsPositive { get; set; }
public DateTime RatedAt { get; set; } = DateTime.UtcNow;
// Navigation
public virtual FormulaLibraryItem FormulaLibraryItem { get; set; } = null!;
}