{"version":3,"sources":["webpack:///./src/services/ReportingPeriodService.ts","webpack:///./src/services/StatePlanReportService.ts","webpack:///./src/services/OrganizationUserService.ts","webpack:///./src/services/fetch.ts","webpack:///./src/services/CentralPlanReportService.ts","webpack:///external \"jQuery\"","webpack:///./src/signalrwrapper.ts","webpack:///./src/services/ZonePlanReportService.ts","webpack:///external \"toastr\"","webpack:///external \"moment\"","webpack:///./src/services/OrganizationService.ts","webpack:///./src/services/UnitPlanReportService.ts","webpack:///./src/utils/browserStorage.ts","webpack:///./src/services/AllKpiReportsService.ts","webpack:///./src/services/AllReportsService.ts","webpack:///./src/services/AdminService.ts"],"names":["reportingPeriodServiceUrl","apiBaseUrl","getReportingPeriodsToCreatePlan","organizationId","getNextReportingPeriod","reportId","statePlanReportServiceUrl","getPlan","planId","includeKpi","this","updatePlan","planData","JSON","stringify","createPlan","organizationReference","year","reportingTerm","createPlan2","reportingFrequency","copy","copyFrom","organization","submitPlan","updateReportLastPeriodFromModel","getReport","updateReport","reportData","updateReportLastPeriod","reportLastPeriodUpdateData","submitReport","unsubmitReport","downloadReport","excelReportType","resetPlan","resetYPlanFromQ","resetReport","resetYReportFromQ","recalculatePlan","recalculateYPlanFromQ","recalculateReport","recalculateYReportFromQ","delete","organizationUserServiceUrl","search","organizationUserSearchTerms","toQry","searchAllRecords","getOrganizationUser","organizationUserId","getOrganizationUserByEmail","email","searchTerms","create","username","organizationRoleType","encodeURIComponent","update","fetchWithAccessToken","url","authservice","instance","get","headers","Headers","set","getAccessToken","fetch","then","response","status","json","toastr","error","statusText","Error","fetchPostWithAccessToken","jsonBody","signalrwrapper","signalrConnection","id","method","body","console","log","fetchFileWithAccessToken","blob","centralPlanReportServiceUrl","module","exports","jQuery","SignalrConnectionState","eventName","callback","dispose","undefined","eventHandlers","onDisconnected","disposeConnectionStateChangedEventHandler","stop","window","setTimeout","start","subscribeToHubEvents","unsubscribeFromHubEvents","i","length","eventHandler","reportingModuleHubProxy","off","on","auth0","base","returnTo","hubConnection","useDefaultPath","createHubProxy","done","state","logging","fail","connectionStateChangedEventHandler","getConnectionStateChangedEventHandler","stateChanged","handler","h","cancelled","change","cancel","newState","disconnected","forEach","push","SignalREventHandler","eventHandlerToRemoveIndex","eventHandlerToRemove","splice","invoke","methodName","newArgs","concat","args","apply","zonePlanReportServiceUrl","moment","organizationServiceUrl","organizationSearchTerms","myorganizations","description","details","organizationType","parents","ok","catch","message","getOrganization","getAvailableParents","excludeOrgId","result","items","filter","org","map","unitPlanReportServiceUrl","bucketName","settings","canUseStorage","storage","setItem","removeItem","e","noop","getBucketKey","bucket","key","setInternal","value","getInternal","parse","removeInternal","clearInternal","l","keys","split","k2","localStorage","a","b","_","remove","clear","kpiReportServiceUrl","report","reportSearchTerms","reportServiceUrl","download","pingServiceUrl","ping","updateAllOrganizationUnitCounts","forceRecalculation"],"mappings":"8FACA,4DAGA,wBACI,KAAAA,0BAA+B,IAAIC,WAAU,gCAE7C,KAAAC,gCAAkC,SAACC,GAC/B,OAAO,YAAwB,EAAKH,0BAAyB,kCAAkCG,IAGnG,KAAAC,uBAAyB,SAACC,GACtB,OAAO,YAAwB,EAAKL,0BAAyB,kBAAkBK,M,oCCZvF,4DAaA,0BACI,KAAAC,0BAA+B,IAAIL,WAAU,sBA+FjD,OA7FI,YAAAM,QAAA,SAAQC,EAAgBC,GACpB,YADoB,IAAAA,OAAA,GACb,YAAwBC,KAAKJ,0BAAyB,SAASE,EAAM,eAAeC,IAG/F,YAAAE,WAAA,SAAWR,EAAwBK,EAAgBI,GAC/C,OAAO,YAA4BF,KAAKJ,0BAAyB,+BAA+BH,EAAc,WAAWK,EACrHK,KAAKC,UAAUF,KAGvB,YAAAG,WAAA,SAAWC,EAA8CC,EAAcC,GACnE,OAAO,YAA4BR,KAAKJ,0BAAyB,qBAAqBW,EAAI,kBAAkBC,EACxGL,KAAKC,UAAUE,KAGvB,YAAAG,YAAA,SAAYH,EAA8CC,EAAcC,EAA8BE,GAClG,OAAO,YAA4BV,KAAKJ,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C/DrK,KAAKoL,OAAS,SAACf,GAAU,EAAKK,eAAeZ,EAASM,EAAQC,IAC9DrK,KAAKqL,MAAQ,WAAQ,EAAKV,cAAcb,EAASM,M,oCCxBzD,4DAMA,wBACI,KAAAkB,oBAAyB,IAAI/L,WAAU,cAEvC,KAAAgM,OAAS,SAACC,GACN,OAAO,YAAwB,EAAKF,oBAAmB,WAAWE,EAAkBnJ,Y,kCCV5F,4DAMA,wBACI,KAAAoJ,iBAAsB,IAAIlM,WAAU,oBAEpC,KAAA4C,OAAS,SAACqJ,GACN,OAAO,YAAwB,EAAKC,iBAAgB,WAAWD,EAAkBnJ,UAGrF,KAAAqJ,SAAW,SAACF,GACR,OAAO,YAA4B,EAAKC,iBAAgB,aAAaD,EAAkBnJ,Y,kCCd/F,4DAGA,0BACI,KAAAsJ,eAAoB,IAAIpM,WAAU,qBAUtC,OARI,YAAAqM,KAAA,SAAK3C,GACD,OAAO,YAAyBjJ,KAAK2L,eAAgB1C,IAGzD,YAAA4C,gCAAA,SAAgCC,QAAA,IAAAA,OAAA,GAC5B,IAAM5I,EAAS,IAAI3D,WAAU,iFAAiFuM,EAC9G,OAAO,YAAyB5I,EAAK,OAE7C,EAXA,K","file":"app~e3f5d840.0da1817849387f5e4e75.chunk.js","sourcesContent":["import { ReportingPeriodViewModel } from \"models/ReportingPeriodViewModel\";\r\nimport { fetchWithAccessToken } from \"./fetch\";\r\nimport env from \"../environment\";\r\n\r\nexport class ReportingPeriodService {\r\n reportingPeriodServiceUrl = `${env.apiBaseUrl}/reporting/v1/reportingperiod`;\r\n\r\n getReportingPeriodsToCreatePlan = (organizationId: number): Promise => {\r\n return fetchWithAccessToken(`${this.reportingPeriodServiceUrl}/oforganization?organizationId=${organizationId}`);\r\n }\r\n\r\n getNextReportingPeriod = (reportId: number): Promise => {\r\n return fetchWithAccessToken(`${this.reportingPeriodServiceUrl}/next?reportId=${reportId}`);\r\n }\r\n}","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { StatePlanViewModelDto } from \"../models/StatePlanViewModelDto\";\r\nimport { StateReportViewModelDto } from \"../models/StateReportViewModelDto\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\n\r\nexport class StatePlanReportService {\r\n statePlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/state`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.statePlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`,\r\n JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.statePlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n \r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n \r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.statePlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.statePlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","import env from \"../environment\";\r\nimport { OrganizationUserSearchTerms } from \"models/OrganizationUserSearchTerms\";\r\nimport { OrganizationUserViewModelDto } from \"models/OrganizationUserViewModelDto\";\r\nimport { OrganizationRoleType } from \"models/OrganizationRoleType\";\r\nimport { EntityReference } from \"models/EntityReference\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\n\r\nexport class OrganizationUserService {\r\n organizationUserServiceUrl = `${env.apiBaseUrl}/reporting/v1/organization/user`;\r\n\r\n search = (organizationUserSearchTerms: OrganizationUserSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.organizationUserServiceUrl}/search?${organizationUserSearchTerms.toQry()}`);\r\n }\r\n\r\n getOrganizationUser(organizationUserId: number): Promise {\r\n return fetchWithAccessToken(`${this.organizationUserServiceUrl}/id?organizationUserId=${organizationUserId}`);\r\n }\r\n\r\n getOrganizationUserByEmail(email: string): Promise> {\r\n const searchTerms = new OrganizationUserSearchTerms(email, 1, 10);\r\n\r\n return this.search(searchTerms);\r\n }\r\n\r\n searchAllRecords = (organizationUserSearchTerms: OrganizationUserSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationUserServiceUrl}/search?`);\r\n }\r\n\r\n async create(username: string, organizationRoleType: OrganizationRoleType, organization: EntityReference): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationUserServiceUrl}/create?username=${encodeURIComponent(username)}&organizationRoleType=${organizationRoleType}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n async update(organizationUserId: number, username: string, organizationRoleType: OrganizationRoleType, organization: EntityReference): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationUserServiceUrl}/update?organizationUserId=${organizationUserId}&username=${encodeURIComponent(username)}&organizationRoleType=${organizationRoleType}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n delete(organizationUserId: number, organization: EntityReference): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationUserServiceUrl}/delete?organizationUserId=${organizationUserId}`, JSON.stringify(organization));\r\n }\r\n}\r\n","import { Container } from \"aurelia-framework\";\r\nimport { AuthService } from \"../auth-service\";\r\nimport { SignalrWrapper } from \"signalrwrapper\";\r\n\r\nexport function fetchWithAccessToken(url: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n \r\n return fetch(url, {\r\n headers: headers\r\n })\r\n .then(response => {\r\n if (response.status === 200) {\r\n return response.json();\r\n }\r\n toastr.error(response.statusText);\r\n throw new Error(response.statusText);\r\n }, error => {\r\n throw error;\r\n });\r\n}\r\n\r\nexport function fetchPostWithAccessToken(url: string, jsonBody?: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n \r\n return fetch(url, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: jsonBody,\r\n })\r\n .then(response => {\r\n console.log(response);\r\n if (response.status === 200) {\r\n return;\r\n }\r\n if(response.status === 404) {\r\n throw Error(\"Not Found\");\r\n }\r\n }, error => {\r\n console.log(error);\r\n throw error;\r\n });\r\n}\r\n\r\nexport function fetchFileWithAccessToken(url: string): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n \r\n return fetch(url, {\r\n headers: headers\r\n })\r\n .then(response => {\r\n if (response.status === 200) {\r\n return response.blob();\r\n }\r\n }, error => {\r\n console.log(error);\r\n throw error;\r\n });\r\n}","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { CentralPlanViewModelDto } from \"models/CentralPlanViewModelDto\";\r\nimport { CentralReportViewModelDto } from \"models/CentralReportViewModelDto\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class CentralPlanReportService {\r\n centralPlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/central`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`, JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`, JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.centralPlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`, JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.centralPlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.centralPlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","module.exports = jQuery;","import $ from \"jquery\";\r\nimport env from \"./environment\";\r\n\r\nexport class SignalREventHandler {\r\n constructor(public eventName: string, public callback: (...msg: any[]) => void) {}\r\n dispose() {\r\n this.callback = undefined;\r\n }\r\n}\r\n\r\nexport enum SignalrConnectionState {\r\n connecting= 0,\r\n connected= 1,\r\n reconnecting= 2,\r\n disconnected= 4\r\n}\r\n\r\n// url without generated proxy - https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-server#signalrurl\r\n// signalr javascript client guide - https://docs.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client\r\nexport class SignalrWrapper {\r\n signalrConnection: SignalR.Hub.Connection;\r\n reportingModuleHubProxy: SignalR.Hub.Proxy;\r\n eventHandlers: SignalREventHandler[] = [];\r\n connectionStateChangedEventHandler : {\r\n cancelled: boolean;\r\n handler: (change: SignalR.StateChanged) => void,\r\n cancel: () => void,\r\n onDisconnected: () => void\r\n };\r\n\r\n start() {\r\n console.log(`env.apiBaseUrl is: ${env.apiBaseUrl}, env.auth0.base is: ${env.auth0.base}, env.auth0.returnTo is: ${env.auth0.returnTo}`);\r\n this.signalrConnection = $.hubConnection(`${env.apiBaseUrl}/signalr`, {useDefaultPath: false});\r\n // this.signalrConnection.logging = true; // use a feature toggle here\r\n this.reportingModuleHubProxy = this.signalrConnection.createHubProxy('reportingModuleHub');\r\n this.reportingModuleHubProxy.on(\"dummyFunc\", () => {});\r\n window.setTimeout(() => {\r\n return this.signalrConnection.start()\r\n .done(() => {\r\n console.log([\"SignalR connected, connection ID:state:logging \",\r\n this.signalrConnection.id, SignalrConnectionState[this.signalrConnection.state], this.signalrConnection.logging]);\r\n })\r\n .fail(function () {\r\n console.log(\"Could not connect SignalR\");\r\n });\r\n }, 0);\r\n this.connectionStateChangedEventHandler = this.getConnectionStateChangedEventHandler();\r\n this.signalrConnection.stateChanged(this.connectionStateChangedEventHandler.handler);\r\n }\r\n \r\n getConnectionStateChangedEventHandler() {\r\n const h = {\r\n cancelled: false,\r\n handler: (change: SignalR.StateChanged) => {},\r\n cancel: () => {},\r\n onDisconnected: this.onDisconnected\r\n };\r\n\r\n h.handler = (change: SignalR.StateChanged) => {\r\n console.log(`Connection state is: ${change.newState}, enum is: ${SignalrConnectionState[change.newState]}`);\r\n if(h.cancelled){\r\n console.log(\"disconnected\");\r\n return;\r\n }\r\n if(change.newState === SignalrConnectionState.disconnected) {\r\n h.onDisconnected();\r\n }\r\n };\r\n\r\n h.cancel = () => {\r\n h.cancelled = true;\r\n h.onDisconnected = undefined;\r\n };\r\n\r\n return h;\r\n }\r\n\r\n onDisconnected = (): void => {\r\n console.log(\"onDisconnected Cleanup\");\r\n this.disposeConnectionStateChangedEventHandler();\r\n console.log(\"onDisconnected stop previous connection\");\r\n this.signalrConnection.stop();\r\n console.log(\"onDisconnected call start in 5 seconds\");\r\n window.setTimeout(() => {\r\n console.log(\"onDisconnected calling start\");\r\n this.start();\r\n console.log(\"onDisconnected re-subscribe event handlers\");\r\n this.subscribeToHubEvents();\r\n }, 5000);\r\n }\r\n\r\n unsubscribeFromHubEvents = () => {\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n const eventHandler = this.eventHandlers[i];\r\n this.reportingModuleHubProxy.off(eventHandler.eventName, eventHandler.callback);\r\n }\r\n }\r\n\r\n subscribeToHubEvents = () => {\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n const eventHandler = this.eventHandlers[i];\r\n this.reportingModuleHubProxy.on(eventHandler.eventName, eventHandler.callback);\r\n }\r\n }\r\n\r\n disposeConnectionStateChangedEventHandler() {\r\n this.connectionStateChangedEventHandler.cancel();\r\n this.unsubscribeFromHubEvents();\r\n this.reportingModuleHubProxy = undefined;\r\n }\r\n\r\n dispose() {\r\n this.disposeConnectionStateChangedEventHandler();\r\n this.connectionStateChangedEventHandler = undefined;\r\n this.eventHandlers.forEach(eventHandler => eventHandler.dispose());\r\n }\r\n\r\n on(eventName: string, callback: (...msg: any[]) => void): void {\r\n this.eventHandlers.push(new SignalREventHandler(eventName, callback));\r\n this.reportingModuleHubProxy.on(eventName, callback);\r\n }\r\n\r\n off(eventName: string, callback: (...msg: any[]) => void): void {\r\n let eventHandlerToRemoveIndex = -1;\r\n for (let i = 0; i < this.eventHandlers.length; i++) {\r\n if (this.eventHandlers[i].eventName === eventName && this.eventHandlers[i].callback === callback) {\r\n eventHandlerToRemoveIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n if (eventHandlerToRemoveIndex !== -1) {\r\n const eventHandlerToRemove = this.eventHandlers[eventHandlerToRemoveIndex];\r\n this.reportingModuleHubProxy.off(eventName, callback);\r\n eventHandlerToRemove.dispose();\r\n this.eventHandlers.splice(eventHandlerToRemoveIndex, 1);\r\n }\r\n }\r\n\r\n invoke(methodName: string, ...args: any[]): JQueryPromise {\r\n const newArgs = [methodName].concat(args);\r\n return this.reportingModuleHubProxy.invoke.apply(this.reportingModuleHubProxy, newArgs);\r\n }\r\n}\r\n","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { PlanData } from \"../models/PlanData\";\r\nimport { ReportData } from \"models/ReportData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ZonePlanViewModelDto } from \"models/ZonePlanViewModelDto\";\r\nimport { ZoneReportViewModelDto } from \"models/ZoneReportViewModelDto\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class ZonePlanReportService {\r\n zonePlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/zone`;\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`, JSON.stringify(planData));\r\n }\r\n\r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`, JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.zonePlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/update/id?organizationId=${organizationId}&reportId=${reportId}`, JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/updateLastPeriod/id?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.zonePlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n resetPlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yPlan/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/reset/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n resetYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yReport/reset/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculatePlan(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/plan/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYPlanFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yPlan/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/recalculate/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n recalculateYReportFromQ(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/yReport/recalculate/fromOwnQuarters/id?organizationId=${organizationId}&reportId=${reportId}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.zonePlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","module.exports = toastr;","module.exports = moment;","import env from \"../environment\";\r\nimport { OrganizationSearchTerms } from \"models/OrganizationSearchTerms\";\r\nimport { OrganizationViewModelDto } from \"models/OrganizationViewModelDto\";\r\nimport { EntityReference } from \"models/EntityReference\";\r\nimport { OrganizationType } from \"models/OrganizationType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { fetchPostWithAccessToken, fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { Container } from \"aurelia-framework\";\r\nimport { AuthService } from \"../auth-service\";\r\nimport { SignalrWrapper } from \"signalrwrapper\";\r\n\r\n\r\nexport class OrganizationService {\r\n organizationServiceUrl = `${env.apiBaseUrl}/reporting/v1/organization`;\r\n\r\n search = (organizationSearchTerms: OrganizationSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/search?${organizationSearchTerms.toQry()}`);\r\n }\r\n\r\n searchAllRecords = (organizationSearchTerms: OrganizationSearchTerms): Promise> => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/search?`);\r\n }\r\n\r\n myorganizations = (): Promise => {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/myorganizations`);\r\n }\r\n /**\r\n * Creates a new organization with support for multiple parent organizations.\r\n *\r\n * @param description - The organization name/description\r\n * @param details - Additional details about the organization\r\n * @param organizationType - The type of organization\r\n * @param reportingFrequency - How often the organization reports\r\n * @param parents - Array of parent organization references (supports multiple parents)\r\n * @returns Promise that resolves when the organization is created\r\n * @throws Error with message 'Cycle detected in organization hierarchy' when a 400 Bad Request occurs due to circular parent-child relationships\r\n * @throws Error for other failure cases\r\n */\r\n async create(description: string, details: string, organizationType: OrganizationType, reportingFrequency: ReportingFrequency, parents: EntityReference[]): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n\r\n const response = await fetch(`${this.organizationServiceUrl}/create?description=${description}&details=${details}&organizationType=${organizationType}&reportingFrequency=${reportingFrequency}`, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: JSON.stringify(parents),\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 400) {\r\n const error = await response.json().catch(() => ({ message: null }));\r\n throw new Error(error.message || 'Cycle detected in organization hierarchy');\r\n }\r\n throw new Error(`Failed to create organization: ${response.statusText}`);\r\n }\r\n }\r\n\r\n /**\r\n * Updates an existing organization with support for multiple parent organizations.\r\n *\r\n * @param organizationId - The ID of the organization to update\r\n * @param description - The organization name/description\r\n * @param details - Additional details about the organization\r\n * @param organizationType - The type of organization\r\n * @param reportingFrequency - How often the organization reports\r\n * @param parents - Array of parent organization references (supports multiple parents)\r\n * @returns Promise that resolves when the organization is updated\r\n * @throws Error with message 'Cycle detected in organization hierarchy' when a 400 Bad Request occurs due to circular parent-child relationships\r\n * @throws Error for other failure cases\r\n */\r\n async update(organizationId: number, description: string, details: string, organizationType: OrganizationType, reportingFrequency: ReportingFrequency, parents: EntityReference[]): Promise {\r\n const authservice = Container.instance.get(AuthService);\r\n const signalrwrapper = Container.instance.get(SignalrWrapper);\r\n\r\n const headers = new Headers();\r\n headers.set(\"Authorization\", `Bearer ${authservice.getAccessToken()}`);\r\n headers.set(\"SignalRConnectionId\", signalrwrapper.signalrConnection.id);\r\n headers.set(\"Accept\", \"application/json\");\r\n headers.set(\"Content-Type\", \"application/json\");\r\n\r\n const response = await fetch(`${this.organizationServiceUrl}/update?organizationId=${organizationId}&description=${description}&details=${details}&organizationType=${organizationType}&reportingFrequency=${reportingFrequency}`, {\r\n headers: headers,\r\n method: \"POST\",\r\n body: JSON.stringify(parents),\r\n });\r\n\r\n if (!response.ok) {\r\n if (response.status === 400) {\r\n const error = await response.json().catch(() => ({ message: null }));\r\n throw new Error(error.message || 'Cycle detected in organization hierarchy');\r\n }\r\n throw new Error(`Failed to update organization: ${response.statusText}`);\r\n }\r\n }\r\n\r\n delete(organizationId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.organizationServiceUrl}/delete?organizationId=${organizationId}`);\r\n }\r\n\r\n getOrganization(organizationId: number): Promise {\r\n return fetchWithAccessToken(`${this.organizationServiceUrl}/id?organizationId=${organizationId}`);\r\n }\r\n\r\n /**\r\n * Gets a list of organizations that can be selected as parents.\r\n *\r\n * @param excludeOrgId - Optional organization ID to exclude from results (typically the current organization being edited to prevent self-selection)\r\n * @returns Promise resolving to an array of organization references that can be used as parents\r\n */\r\n async getAvailableParents(excludeOrgId?: number): Promise {\r\n const searchTerms = new OrganizationSearchTerms();\r\n const result = await this.searchAllRecords(searchTerms);\r\n\r\n // Filter out the excluded organization if provided\r\n if (excludeOrgId !== undefined) {\r\n return result.items\r\n .filter(org => org.id !== excludeOrgId)\r\n .map(org => ({ id: org.id, description: org.description } as EntityReference));\r\n }\r\n\r\n return result.items.map(org => ({ id: org.id, description: org.description } as EntityReference));\r\n }\r\n}","import env from \"../environment\";\r\nimport { fetchWithAccessToken, fetchPostWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\nimport { UnitPlanViewModelDto } from \"models/UnitPlanViewModelDto\";\r\nimport { PlanData } from \"models/PlanData\";\r\nimport { ReportingTerm } from \"models/ReportingTerm\";\r\nimport { OrganizationReference } from \"models/OrganizationReference\";\r\nimport { UnitReportViewModelDto } from \"models/UnitReportViewModelDto\";\r\nimport { ReportUpdateData } from \"models/ReportUpdateData\";\r\nimport { ExcelReportType } from \"models/ExcelReportType\";\r\nimport { ReportingFrequency } from \"models/ReportingFrequency\";\r\nimport { ReportLastPeriodUpdateData } from \"models/ReportLastPeriodUpdateData\";\r\n\r\nexport class UnitPlanReportService {\r\n unitPlanReportServiceUrl = `${env.apiBaseUrl}/reporting/v1/unit`;\r\n \r\n createPlan(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/create?year=${year}&reportingTerm=${reportingTerm}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n createPlan2(organizationReference: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/create2?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}`,\r\n JSON.stringify(organizationReference));\r\n }\r\n\r\n copy(copyFrom: number, organization: OrganizationReference, year: number, reportingTerm: ReportingTerm, reportingFrequency: ReportingFrequency): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/copy?year=${year}&reportingTerm=${reportingTerm}&reportingFrequency=${reportingFrequency}©FromReportId=${copyFrom}`,\r\n JSON.stringify(organization));\r\n }\r\n\r\n getPlan(planId: number, includeKpi: boolean = false): Promise {\r\n return fetchWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/${planId}?includeKpi=${includeKpi}`);\r\n }\r\n\r\n updatePlan(organizationId: number, planId: number, planData: PlanData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/update?organizationId=${organizationId}&planId=${planId}`,\r\n JSON.stringify(planData));\r\n }\r\n\r\n submitPlan(organizationId: number, planId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/plan/submit?planId=${planId}&organizationId=${organizationId}`);\r\n }\r\n\r\n updateReportLastPeriodFromModel(reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/updateLastPeriodFromModel/${reportId}`);\r\n }\r\n\r\n getReport(reportId: number): Promise {\r\n return fetchWithAccessToken(`${this.unitPlanReportServiceUrl}/report/${reportId}`);\r\n }\r\n\r\n updateReport(organizationId: number, reportId: number, reportData: ReportUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/update?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportData));\r\n }\r\n\r\n updateReportLastPeriod(organizationId: number, reportId: number, reportLastPeriodUpdateData: ReportLastPeriodUpdateData): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/updateLastPeriod?organizationId=${organizationId}&reportId=${reportId}`,\r\n JSON.stringify(reportLastPeriodUpdateData));\r\n }\r\n\r\n submitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/submit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n unsubmitReport(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/unsubmit?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n\r\n downloadReport(reportId: number, excelReportType: ExcelReportType): Promise {\r\n return fetchFileWithAccessToken(`${this.unitPlanReportServiceUrl}/download/report/${reportId}?excelReportType=${excelReportType}`);\r\n }\r\n\r\n delete(organizationId: number, reportId: number): Promise {\r\n return fetchPostWithAccessToken(`${this.unitPlanReportServiceUrl}/report/delete?reportId=${reportId}&organizationId=${organizationId}`);\r\n }\r\n}\r\n","export class BrowserStorage {\r\n bucket: string;\r\n storage: Storage;\r\n set: (key: string, value: any) => void;\r\n get: (key: string) => any;\r\n remove: (key: string) => void;\r\n clear: () => void;\r\n\r\n constructor(bucketName, settings: any = null) {\r\n let bucket = bucketName,\r\n storage = settings ? settings.storage : window.localStorage;\r\n\r\n if (!this.canUseStorage(storage)) {\r\n console.log(\"Storage is full or not supported\");\r\n this.set = (a, b) => { this.noop(); };\r\n this.get = (_) => { return this.noop(); };\r\n this.remove = (_) => { this.noop(); };\r\n this.clear = () => { this.noop(); };\r\n return;\r\n }\r\n\r\n this.set = (key, value) => { this.setInternal(storage, bucket, key, value); };\r\n this.get = (key) => { return this.getInternal(storage, bucket, key); };\r\n this.remove = (key) => { this.removeInternal(storage, bucket, key); };\r\n this.clear = () => { this.clearInternal(storage, bucket); };\r\n };\r\n\r\n private canUseStorage = (storage: Storage) => {\r\n if (!storage) {\r\n return false;\r\n }\r\n try {\r\n storage.setItem(\"rmtest\", \"abc\");\r\n storage.removeItem(\"rmtest\");\r\n return true;\r\n } catch (e) {\r\n console.log(\"Storage unavailable: \" + e);\r\n return false;\r\n }\r\n };\r\n\r\n private noop = function () {\r\n console.log(\"Storage is full or not supported\");\r\n return null;\r\n };\r\n\r\n private getBucketKey = (bucket: string, key: string) => {\r\n return bucket ? bucket + \"|\" + key : key;\r\n };\r\n\r\n private setInternal = (storage: Storage, bucket: string, key: string, value: any) => {\r\n storage[this.getBucketKey(bucket, key)] = JSON.stringify(value);\r\n };\r\n\r\n private getInternal = (storage: Storage, bucket: string, key: string) => {\r\n let value = storage[this.getBucketKey(bucket, key)];\r\n return value ? JSON.parse(value) : null;\r\n };\r\n\r\n private removeInternal = (storage: Storage, bucket: string, key: string) => {\r\n storage.removeItem(this.getBucketKey(bucket, key));\r\n };\r\n\r\n private clearInternal = (storage: Storage, bucket: string) => {\r\n let i = 0, l = storage.length, keys: string[] = [], key: string;\r\n for (i; i < l; i++) {\r\n key = storage.key(i);\r\n if (key && key.split(\"|\")[0] === bucket) {\r\n keys.push(key);\r\n }\r\n }\r\n keys.forEach(function (k2) { storage.removeItem(k2); });\r\n };\r\n}\r\n","import env from \"../environment\";\r\nimport { ReportSearchTerms } from \"models/ReportSearchTerms\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { ReportViewModelDto } from \"models/ReportViewModelDto\";\r\nimport { fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\nexport class AllKpiReportService {\r\n kpiReportServiceUrl = `${env.apiBaseUrl}/kpi/v1/all`;\r\n\r\n report = (reportSearchTerms: ReportSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.kpiReportServiceUrl}/report?${reportSearchTerms.toQry()}`);\r\n }\r\n\r\n}\r\n","import env from \"../environment\";\r\nimport { ReportSearchTerms } from \"models/ReportSearchTerms\";\r\nimport { SearchResult } from \"models/SearchResult\";\r\nimport { ReportViewModelDto } from \"models/ReportViewModelDto\";\r\nimport { fetchWithAccessToken, fetchFileWithAccessToken } from \"./fetch\";\r\n\r\nexport class AllReportService {\r\n reportServiceUrl = `${env.apiBaseUrl}/reporting/v1/all`;\r\n\r\n search = (reportSearchTerms: ReportSearchTerms): Promise> => { \r\n return fetchWithAccessToken(`${this.reportServiceUrl}/search?${reportSearchTerms.toQry()}`);\r\n }\r\n\r\n download = (reportSearchTerms: ReportSearchTerms): Promise => { \r\n return fetchFileWithAccessToken(`${this.reportServiceUrl}/download?${reportSearchTerms.toQry()}`);\r\n } \r\n}\r\n","import env from \"../environment\";\r\nimport { fetchPostWithAccessToken } from \"./fetch\";\r\n\r\nexport class AdminService {\r\n pingServiceUrl = `${env.apiBaseUrl}/reporting/v1/ping`;\r\n\r\n ping(message: string): Promise {\r\n return fetchPostWithAccessToken(this.pingServiceUrl, message);\r\n }\r\n\r\n updateAllOrganizationUnitCounts(forceRecalculation: boolean = true): Promise {\r\n const url = `${env.apiBaseUrl}/reporting/v1/organization/updateallorganizationunitcounts?forceRecalculation=${forceRecalculation}`;\r\n return fetchPostWithAccessToken(url, null);\r\n }\r\n}"],"sourceRoot":""}