forked from nfelger/achill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bdce8d
commit 9b7790c
Showing
15 changed files
with
1,515 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { HttpResponse, http, passthrough } from "msw"; | ||
|
||
export const handlers = [ | ||
http.get( | ||
"https://digitalservice.troi.software/api/v2/rest/calculationPositions", | ||
() => { | ||
return HttpResponse.json(require("./stubs/calculationPositions.json")); | ||
}, | ||
), | ||
http.get("https://digitalservice.troi.software/api/v2/rest/clients", () => { | ||
return HttpResponse.json(require("./stubs/clients.json")); | ||
}), | ||
http.get("https://digitalservice.troi.software/api/v2/rest/employees", () => { | ||
return HttpResponse.json(require("./stubs/employees.json")); | ||
}), | ||
http.get( | ||
"https://digitalservice.troi.software/api/v2/rest/calendarEvents", | ||
() => { | ||
return HttpResponse.json(require("./stubs/calendarEvents.json")); | ||
}, | ||
), | ||
http.get( | ||
"https://digitalservice.troi.software/api/v2/rest/billings/hours", | ||
({ request }) => { | ||
switch (new URLSearchParams(request.url).get("calculationPositionId")) { | ||
case "4": | ||
return HttpResponse.json(require("./stubs/billings_hours_4.json")); | ||
case "7": | ||
return HttpResponse.json(require("./stubs/billings_hours_7.json")); | ||
} | ||
|
||
return passthrough(); | ||
}, | ||
), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { setupServer } from "msw/node"; | ||
import { handlers } from "./handlers"; | ||
|
||
export const server = setupServer(...handlers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
[ | ||
{ | ||
"Client": { | ||
"Type": "ApiClient", | ||
"Name": "DigitalService GmbH des Bundes", | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 1, | ||
"Id": 1, | ||
"Path": "/clients/1", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"CalculationPosition": { | ||
"Type": "ApiCalculationPosition", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 4, | ||
"Id": 4, | ||
"Path": "/calculationPositions/4", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Service": null, | ||
"Employee": { | ||
"Type": "ApiEmployee", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 2, | ||
"Id": 2, | ||
"Path": "/employees/2", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Date": "2023-12-20", | ||
"Quantity": 5, | ||
"Remark": "Retro, Daily, Some Ticket", | ||
"IsBillable": true, | ||
"IsBilled": false, | ||
"IsInvoiced": false, | ||
"IsApproved": true, | ||
"DisplayPath": "DigitalService / DS_23_0001 / A cool Project / Regular Engineering", | ||
"id": 10, | ||
"Id": 10, | ||
"Path": "/billings/hours/10", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"documentComputedTotalNet": 0, | ||
"ClassName": "ApiHourBilling" | ||
}, | ||
{ | ||
"Client": { | ||
"Type": "ApiClient", | ||
"Name": "DigitalService GmbH des Bundes", | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 1, | ||
"Id": 1, | ||
"Path": "/clients/1", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"CalculationPosition": { | ||
"Type": "ApiCalculationPosition", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 4, | ||
"Id": 4, | ||
"Path": "/calculationPositions/4", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Service": null, | ||
"Employee": { | ||
"Type": "ApiEmployee", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 2, | ||
"Id": 2, | ||
"Path": "/employees/2", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Date": "2023-12-22", | ||
"Quantity": 3, | ||
"Remark": "Another Ticket", | ||
"IsBillable": true, | ||
"IsBilled": false, | ||
"IsInvoiced": false, | ||
"IsApproved": true, | ||
"DisplayPath": "DigitalService / DS_23_0001 / A cool Project / Regular Engineering", | ||
"id": 11, | ||
"Id": 11, | ||
"Path": "/billings/hours/11", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"documentComputedTotalNet": 0, | ||
"ClassName": "ApiHourBilling" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[ | ||
{ | ||
"Client": { | ||
"Type": "ApiClient", | ||
"Name": "DigitalService GmbH des Bundes", | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 1, | ||
"Id": 1, | ||
"Path": "/clients/1", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"CalculationPosition": { | ||
"Type": "ApiCalculationPosition", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 7, | ||
"Id": 7, | ||
"Path": "/calculationPositions/7", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Service": null, | ||
"Employee": { | ||
"Type": "ApiEmployee", | ||
"Name": null, | ||
"IsFavorite": false, | ||
"IsPrintable": false, | ||
"ParentPath": "", | ||
"ReeEmployeeId": 0, | ||
"ReeCpId": 0, | ||
"ReeSubProjectId": 0, | ||
"ReeProjectId": 0, | ||
"ReeQuantity": 0, | ||
"ReeDate": null, | ||
"ReeServiceId": 0, | ||
"id": 2, | ||
"Id": 2, | ||
"Path": "/employees/2", | ||
"ETag": null, | ||
"IsDeleted": false, | ||
"ClassName": "ApiSyncItem" | ||
}, | ||
"Date": "2023-12-22", | ||
"Quantity": 5, | ||
"Remark": "Retro, Daily, User Testing", | ||
"IsBillable": true, | ||
"IsBilled": false, | ||
"IsInvoiced": false, | ||
"IsApproved": true, | ||
"DisplayPath": "DigitalService / DS_23_0001 / A 2nd Project / Regular Engineering", | ||
"id": 12, | ||
"Id": 12, | ||
"Path": "/billings/hours/12", | ||
"ETag": "20240101010203", | ||
"IsDeleted": false, | ||
"documentComputedTotalNet": 0, | ||
"ClassName": "ApiHourBilling" | ||
} | ||
] |
Oops, something went wrong.