Commit graph

25 commits

Author SHA1 Message Date
Adam Moussa
e1f57d3fb2 Add comment types, audit logging, and WorkOrderAuditLog table
- Add CommentType field to Comments (customer, vendor, internal)
- Add Status field to EditWorkorder_DTO
- Create WorkOrderAuditLog model tracking field-level changes
- Log all field changes on work order edit and status change
- Include commentType and auditLog in GetWorkorderById response
- Set CommentType=customer on synced comments from DynamoDB
- Add BackfillCommentTypes endpoint for existing data
2026-04-16 18:09:57 -04:00
Adam Moussa
c69cef7fa9 Add HttpPut route to EditWorkorder endpoint
- services/api.js sends PUT for updates, controller only accepted POST
- Add [HttpPut("{id:int}")] alongside existing [HttpPost]
2026-04-16 17:44:00 -04:00
Adam Moussa
cc87039a77 Include commenter and recordType in GetWorkorderById comments response 2026-04-16 17:41:11 -04:00
Adam Moussa
5a4d8e2240 Add description, createdDate, locationId to GetWorkorderById response 2026-04-16 17:37:21 -04:00
Adam Moussa
60fc933da7 Add lowercase route aliases for all controllers
- services/api.js uses lowercase routes (/api/workorders, /api/employees, etc.)
- Add matching [Route] attributes to WorkOrder, Employee, Contact, Account, FollowUp, PMSchedule controllers
- Add [HttpGet("{id:int}")] to WorkOrderController for REST-style get by ID
2026-04-16 17:32:28 -04:00
Adam Moussa
6f8f67735a Add DynamoDB sync bridge for workorder-ingest pipeline
- Add ExternalWorkOrderId, Customer, SiteCode, Building, Severity,
  DateReported, ScheduledStart, SourceEmailS3Key to WorkOrder model
- Add Commenter, RecordType, ExternalCommentId to Comments model
- Add AWSSDK.DynamoDBv2 package
- Create SyncController with endpoints:
  - POST /api/Sync/WorkOrders — scans DynamoDB WorkOrders table, upserts into SQL
  - POST /api/Sync/Comments — scans DynamoDB WorkOrderComments, creates Comments
  - POST /api/Sync/All — runs both
- Auto-creates Locations from site_code/building/address during sync
- Maps DynamoDB status values to SHOC status strings
- Maps severity to SHOC priority format (Sev N)
- Deduplicates on ExternalWorkOrderId / ExternalCommentId
2026-04-16 17:29:52 -04:00
Adam Moussa
93fa76a5aa Handle string-to-int AccountId conversion in Location DTOs
- Frontend sends accountId as empty string when not set
- Change DTO AccountId to string with GetAccountId() parser
- Prevents JSON deserialization error on empty/non-numeric values
2026-04-16 17:15:28 -04:00
Adam Moussa
5a20e55138 Add lowercase route alias for LocationController
- services/api.js uses /api/locations (lowercase), controller was only matching /api/Location
- Add [Route("api/locations")] to support both casings
2026-04-16 17:11:36 -04:00
Adam Moussa
534f97d6f1 Add LocationController with full CRUD and extended model
- Extend Locations model with Address, City, State, ZipCode, Phone, Contact, ContactEmail, Status, AccountId
- Update Location DTOs to match new fields
- Create LocationController with paged list, get by ID, create, update, delete
- Support both REST-style routes (/api/Location/{id}) and legacy query routes (/api/Location/DeleteLocation?id=)
- Add migration for new Location columns
2026-04-16 17:09:59 -04:00
Adam Moussa
51b52a7fb5 Add migration to sync Contacts table with model
- Generate SyncContactsAndModels migration for missing columns
- Adds AccountId, Address fields, social URLs, LocationId to Contacts table
2026-04-16 16:54:36 -04:00
Adam Moussa
dbb31ca7d7 Fix Contacts.Name references throughout Blazor project
- Replace all Contacts.Name with (FirstName + " " + LastName) pattern
- Fix ContactService, Index.razor, QuotesPDF, QuotesDetails, CreateQuotes
- Fix WorkOrderPDF, Viewworkorder, UserViewWordOrder, Addworkorders
- Fix ViewTemplate, AddTemplate, Templates settings pages
- Blazor project now builds successfully
2026-04-16 16:54:28 -04:00
Adam Moussa
493cff00fb Fix pagination to use database-side Skip/Take instead of loading all rows
- Move .ToList() after .Skip().Take() in ContactController, QuotesController, SettingsController
- Prevents loading entire tables into memory for paginated queries
2026-04-16 16:54:18 -04:00
Adam Moussa
483b765d69 Remove sample WeatherForecastController 2026-04-16 16:54:10 -04:00
Adam Moussa
e8c400a20a Add null safety checks across all API controllers
- Add null checks after FirstOrDefault() before property access
- Guard navigation property access (Locations, AssignToUser, ApplicationUser, POC, Contacts)
- Null-coalesce string properties in search/filter LINQ queries
- Protect Sum() on nullable LineItems collections
- Change FirstAsync to FirstOrDefaultAsync with null guard in UserController
- Add null check on model.Attachments iteration in EditWorkorder
2026-04-16 16:33:42 -04:00
Adam Moussa
128ae44a0d Fix login null check order and strengthen password reset code
- Reorder null check: check user != null before accessing user.IsDeleted
- Increase password reset code from 4 digits to 6 digits (10K to 1M combinations)
2026-04-16 16:33:09 -04:00
Adam Moussa
486233076c Replace hardcoded SMTP credentials with SendGrid service
- Remove inline SMTP method with codevoir.com credentials
- Inject existing SendMessage helper that uses SendGrid via config
- Clean up unused using directives
2026-04-16 16:25:11 -04:00
Adam Moussa
0e3cb761c9 Configure local development environment
- Generalize appsettings.json by removing hardcoded credentials
- Add local connection string and JWT config to appsettings.Development.json
- Add EF Core Design package for running migrations locally
- Seed admin user on startup in development
- Skip HTTPS redirect in development for proxy compatibility
- Gitignore appsettings.Development.json
2026-04-16 16:25:03 -04:00
npalOmega
a9fc4b8701 fix 2026-03-30 06:49:40 -05:00
npalOmega
cd78c93fa8 fix 2026-01-21 16:24:54 -06:00
npalOmega
9c78cd96fa added new controllers 2026-01-21 15:41:19 -06:00
npalOmega
2e9716fe34 fix 2025-03-09 19:39:28 -05:00
npalOmega
9a23c41b21 initial commit for api changes 2025-02-18 13:13:33 -06:00
npalOmega
f7260919b5 fixing forgot password issue 2024-10-08 07:36:59 -05:00
npalOmega
a30bb60690 fixing temp password issue 2024-10-07 01:32:17 -05:00
69b9e69f00 Initial commit 2024-09-28 14:58:36 -04:00