feature/IO-3182-Phone-Number-Consent - Front/Back Start/stop logic complete
This commit is contained in:
@@ -2980,4 +2980,59 @@ exports.INSERT_INTEGRATION_LOG = `
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
`;
|
||||
|
||||
exports.INSERT_PHONE_NUMBER_OPT_OUT = `
|
||||
mutation INSERT_PHONE_NUMBER_OPT_OUT($optOutInput: [phone_number_opt_out_insert_input!]!) {
|
||||
insert_phone_number_opt_out(objects: $optOutInput, on_conflict: { constraint: phone_number_consent_bodyshopid_phone_number_key, update_columns: [updated_at] }) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
bodyshopid
|
||||
phone_number
|
||||
created_at
|
||||
updated_at
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// Query to check if a phone number is opted out
|
||||
exports.CHECK_PHONE_NUMBER_OPT_OUT = `
|
||||
query CHECK_PHONE_NUMBER_OPT_OUT($bodyshopid: uuid!, $phone_number: String!) {
|
||||
phone_number_opt_out(where: { bodyshopid: { _eq: $bodyshopid }, phone_number: { _eq: $phone_number } }) {
|
||||
id
|
||||
bodyshopid
|
||||
phone_number
|
||||
created_at
|
||||
updated_at
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// Query to check if a phone number is opted out
|
||||
exports.CHECK_PHONE_NUMBER_OPT_OUT = `
|
||||
query CHECK_PHONE_NUMBER_OPT_OUT($bodyshopid: uuid!, $phone_number: String!) {
|
||||
phone_number_opt_out(where: { bodyshopid: { _eq: $bodyshopid }, phone_number: { _eq: $phone_number } }) {
|
||||
id
|
||||
bodyshopid
|
||||
phone_number
|
||||
created_at
|
||||
updated_at
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// Mutation to delete a phone number opt-out record
|
||||
exports.DELETE_PHONE_NUMBER_OPT_OUT = `
|
||||
mutation DELETE_PHONE_NUMBER_OPT_OUT($bodyshopid: uuid!, $phone_number: String!) {
|
||||
delete_phone_number_opt_out(where: { bodyshopid: { _eq: $bodyshopid }, phone_number: { _eq: $phone_number } }) {
|
||||
affected_rows
|
||||
returning {
|
||||
id
|
||||
bodyshopid
|
||||
phone_number
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user