feature/IO-3255-simplified-parts-management - Soft Deletes

This commit is contained in:
Dave
2025-08-21 18:20:53 -04:00
parent 1577921334
commit 2c8f3a173e
2 changed files with 17 additions and 4 deletions

View File

@@ -102,6 +102,18 @@ const DELETE_JOBLINES_BY_IDS = `
}
`;
// Soft delete joblines by marking removed=true instead of hard-deleting
const SOFT_DELETE_JOBLINES_BY_IDS = `
mutation SoftDeleteJoblinesByIds($jobid: uuid!, $unqSeqs: [Int!]!) {
update_joblines(
where: { jobid: { _eq: $jobid }, unq_seq: { _in: $unqSeqs } },
_set: { removed: true }
) {
affected_rows
}
}
`;
const INSERT_JOBLINES = `
mutation InsertJoblines($joblines: [joblines_insert_input!]!) {
insert_joblines(objects: $joblines) {
@@ -243,6 +255,7 @@ module.exports = {
UPSERT_JOBLINES,
DELETE_JOBLINES_BY_JOBID,
DELETE_JOBLINES_BY_IDS,
SOFT_DELETE_JOBLINES_BY_IDS,
INSERT_JOBLINES,
CHECK_EXTERNAL_SHOP_ID,
CREATE_SHOP,