Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
4.9 KiB
4.9 KiB
Model Usage Analysis in Action Files
Summary
This document lists all action files that import and use models, along with the specific models they use and common method patterns.
Files Using Models from lib/models/
1. contractLineAction.ts
- Model:
ContractLinefrom 'server/src/lib/models/contractLine' - Model:
ContractLineFixedConfigfrom 'server/src/lib/models/contractLineFixedConfig' - Methods Used:
ContractLine.getAll()ContractLine.findById(planId)ContractLine.create(safePlanData)ContractLine.update(planId, safeUpdateData)ContractLine.delete(planId)ContractLine.isInUse(planId)ContractLine.hasAssociatedServices(planId)
2. contractActions.ts (contract line helpers)
- Repository:
contractLineRepositoryconsolidates template and contract line metadata
3. channel-actions/channelActions.ts
- Model:
Channelfrom '../../models/channel'
4. clientContractLineAction.ts
- Model:
CompanyContractLinefrom 'server/src/lib/models/clientContractLine'
5. comment-actions/commentActions.ts
- Model:
Commentfrom 'server/src/lib/models/comment'
6. company-actions/companyContractActions.ts
- Model:
CompanyContractfrom 'server/src/lib/models/companyContract'
7. creditReconciliationActions.ts & creditReconciliationFixActions.ts
- Model:
CreditReconciliationReportfrom 'server/src/lib/models/creditReconciliationReport'
8. document-actions/documentActions.ts
- Model:
Documentfrom 'server/src/lib/models/document' - Model:
DocumentAssociationfrom 'server/src/lib/models/document-association'
9. interactionActions.ts
- Model:
InteractionModelfrom 'server/src/lib/models/interactions'
10. invoiceActions.ts (and related invoice files)
- Model:
Invoicefrom 'server/src/lib/models/invoice'
11. contractActions.ts
- Model:
Contractfrom 'server/src/lib/models/contract'
12. priorityActions.ts
- Model:
Priorityfrom 'server/src/lib/models/priority'
13. project-actions/projectActions.ts
- Model:
ProjectModelfrom 'server/src/lib/models/project' - Model:
ProjectTaskModelfrom 'server/src/lib/models/projectTask'
14. scheduleActions.ts
- Model:
ScheduleEntryfrom 'server/src/lib/models/scheduleEntry'
15. serviceActions.ts
- Model:
Servicefrom 'server/src/lib/models/service' - Model:
ServiceTypeModelfrom '../models/serviceType'
16. serviceRateTierActions.ts
- Model:
ServiceRateTierfrom 'server/src/lib/models/serviceRateTier'
17. tagActions.ts
- Model:
Tagfrom 'server/src/lib/models/tag'
18. team-actions/teamActions.ts
- Model:
Teamfrom 'server/src/lib/models/team'
19. ticket-actions/ticketActions.ts
- Model:
Ticketfrom 'server/src/lib/models/ticket'
20. ticketResourceActions.ts
- Model:
TicketResourcefrom 'server/src/lib/models/ticketResource'
21. timePeriodsActions.ts
- Model:
TimePeriodfrom '../models/timePeriod' - Model:
TimePeriodSettingsfrom '../models/timePeriodSettings'
22. user-actions/userActions.ts & registrationActions.ts
- Model:
Userfrom 'server/src/lib/models/user' - Model:
UserPreferencesfrom 'server/src/lib/models/userPreferences'
23. initializeApp.ts
- Model:
Tenantfrom 'server/src/lib/models/tenant'
Files Using Models from src/models/
1. file-actions/fileActions.ts
- Model:
FileStoreModelfrom '../../../models/storage'
2. event-catalog-actions.ts
- Model:
EventCatalogModelfrom '../../models/eventCatalog'
3. workflow-event-attachment-actions.ts
- Model:
WorkflowEventAttachmentModelfrom 'server/src/models/workflowEventAttachment'
4. workflow-event-actions.ts
- Model:
WorkflowEventMappingModelfrom '../../models/workflowEventMapping'
5. workflow-trigger-actions.ts
- Model:
WorkflowTriggerModelfrom '../../models/workflowTrigger'
6. integrations/qboActions.ts
- Model:
AssetAssociationModelfrom 'server/src/models/asset'
Common Model Method Patterns
Based on the analysis, models typically expose these methods:
getAll()- Fetch all recordsfindById(id)- Find a single record by IDcreate(data)- Create a new recordupdate(id, data)- Update an existing recorddelete(id)- Delete a recordisInUse(id)- Check if record is referenced elsewherehasAssociatedServices(id)- Check for related services (specific to ContractLine)
Transaction Support Needed
All these models need to be updated to support optional Knex transaction parameter:
- Add optional
trx?: Knex.Transactionparameter to all model methods - Ensure the transaction is passed through to database queries
- This will enable proper transaction handling in action files using
withTransaction