Retire the legacy Machine model (ADR-001 cutover)
The asset/computer model is now the single source of truth. Remove the Machine instance layer end to end: - Delete models Machine, MachineStatus, PCType, MachineRelationship, InstalledApp, PrinterData; keep MachineType (models.machinetypeid still references it). - Delete the /api/machines, /api/statuses, /api/pctypes blueprints and the legacy /api/printers/legacy (PrinterData) blueprint. - Drop the deprecated communications.machineid column and its FK. - Migration 7c01 drops tables machines, machinestatuses, pctypes, machinerelationships, installedapps, printerdata (idempotent). - Fix remaining readers (applications install counts) to ComputerInstalledApp. - Frontend: remove dead machinesApi/statusesApi/pctypesApi wrappers; repoint the PC Types settings page at computer types. 143 tests pass; all asset/computer/dashboard/report/collector endpoints 200. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -58,38 +58,6 @@ export const authApi = {
|
||||
}
|
||||
}
|
||||
|
||||
// Machines API (legacy - use equipmentApi or computersApi instead)
|
||||
export const machinesApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/machines', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/machines/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/machines', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/machines/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/machines/${id}`)
|
||||
},
|
||||
updateCommunication(id, data) {
|
||||
return api.put(`/machines/${id}/communication`, data)
|
||||
},
|
||||
// Relationships
|
||||
getRelationships(id) {
|
||||
return api.get(`/machines/${id}/relationships`)
|
||||
},
|
||||
createRelationship(id, data) {
|
||||
return api.post(`/machines/${id}/relationships`, data)
|
||||
},
|
||||
deleteRelationship(relationshipId) {
|
||||
return api.delete(`/machines/relationships/${relationshipId}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Equipment API (plugin)
|
||||
export const equipmentApi = {
|
||||
list(params = {}) {
|
||||
@@ -199,25 +167,6 @@ export const machinetypesApi = {
|
||||
}
|
||||
}
|
||||
|
||||
// Statuses API
|
||||
export const statusesApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/statuses', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/statuses/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/statuses', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/statuses/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/statuses/${id}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Vendors API
|
||||
export const vendorsApi = {
|
||||
list(params = {}) {
|
||||
@@ -396,25 +345,6 @@ export const modelsApi = {
|
||||
}
|
||||
}
|
||||
|
||||
// PC Types API
|
||||
export const pctypesApi = {
|
||||
list(params = {}) {
|
||||
return api.get('/pctypes', { params })
|
||||
},
|
||||
get(id) {
|
||||
return api.get(`/pctypes/${id}`)
|
||||
},
|
||||
create(data) {
|
||||
return api.post('/pctypes', data)
|
||||
},
|
||||
update(id, data) {
|
||||
return api.put(`/pctypes/${id}`, data)
|
||||
},
|
||||
delete(id) {
|
||||
return api.delete(`/pctypes/${id}`)
|
||||
}
|
||||
}
|
||||
|
||||
// Operating Systems API
|
||||
export const operatingsystemsApi = {
|
||||
list(params = {}) {
|
||||
|
||||
Reference in New Issue
Block a user