import{bc as e,a7 as a}from"./app-BgLa5dit.js";import{B as i}from"./DkDkjje4.chunk.js";var g=(t=>(t[t.User=0]="User",t[t.Classroom=1]="Classroom",t[t.Customer=2]="Customer",t))(g||{});const c={getOrganisationRostering(t){return{url:`/ajax/rostering/integrations/organisations/${t}`,key:`rostering:integrations:${t}:organisations`}},getOrganisationExistingMapping(t){return{url:a.urlBuilder(`/ajax/rostering/integrations/${t}/map-customers`,{externalIdType:g.Customer}),key:`rostering:organisaiton:${t}:mapping`}},updateRosteringSchoolMappings(t,r){return{url:`/ajax/rostering/integrations/${t}/map-customers`,type:e.POST,data:r,key:`rostering:organisaiton:${t}:mapping:update`,invalidationKeys:[`rostering:organisaiton:${t}:mapping`,`rostering:integrations:${t}:organisations`]}},getOrganisationRosteringStatus(t,r,s){return{url:a.urlBuilder(`/ajax/rostering/organisations/${t}/jobs/status`,{customerId:r,userId:s}),key:`rostering:organisations:${t}:jobs:status:${r}:${s}`}},getExternalOrganisations(t){return{url:`/ajax/rostering/${t}/organisations`,key:`rostering:${t}:organisations`}},getExternalOrganisation(t,r,s,n,o){return{url:`/ajax/rostering/${t}/organisations/${r}`,key:`rostering:${t}:organisations:${r}`,success:s,error:n,always:o}},getExternalSchools(t,r){return{url:`/ajax/rostering/${t}/organisations/${r}/customers`,key:`external:${t}:organisation:${r}:customers`}},createSchoolMapping(t){return{url:"/ajax/rostering/integrations",key:"save:rostering:mappings",invalidationKeys:[`rostering:integrations:${t.organisationId}:organisations`],type:e.POST,data:t}},getSyncList(t,r,s){const n={};if(s.cursor&&(n.cursor=s.cursor),s.sort&&(s.sort==="oldest"?n.order="ASC":n.order="DESC"),s.jobStatus){const o=[];s.jobStatus.includes("completed")&&o.push(i.Completed,i.CompletedWithError),s.jobStatus.includes("failed")&&o.push(i.Failed),s.jobStatus.includes("inProgress")&&o.push(i.Submitted,i.Queued,i.Pending,i.InProgress),n.status=o}return n.customerId=r.customerId,n.userId=r.id,{url:a.urlBuilder(`/ajax/rostering/organisations/${t}/jobs`,n),key:`rostering:sync:${t}:${s.cursor}:${s.sort}:${s.jobStatus}`}},getSyncScheduleSettings(t){return{url:`/ajax/rostering/integrations/${t}/schedule`,key:`sync-settings:${t}`}},updateScheduleSetting(t,r,s,n,o){return{url:`/ajax/rostering/integrations/${r}/schedule`,key:"sync-settings",type:e.PUT,invalidationKeys:[`sync-settings:${r}`],data:t,success:s,error:n,always:o}},createRosteringSyncJob(t,r,s){return{url:"/ajax/batch/jobs",key:"create:job",type:e.POST,invalidationKeys:["rostering:sync"],data:t,success:r,error:s}}};export{c as R};
//# sourceMappingURL=BOJRju0G.chunk.js.map
