Skip to content

Commit

Permalink
feat: define new workflow for algodriven VM (MN-372) (#598)
Browse files Browse the repository at this point in the history
Co-authored-by: Deepak Chaudhary <deepakglobant>
  • Loading branch information
deepakglobant authored Nov 3, 2023
1 parent b35d8cd commit 204b382
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/contexts/clients/clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const Clients = {
CAT: 'cat',
FASTBACK: 'fastback',
ALPHA: 'alpha',
ALGODRIVEN: 'algodriven',
ALGODRIVEN_CAPTURE: 'algodriven_capture',
ALGODRIVEN_REPORT: 'algodriven_report',
};

export default Clients;
3 changes: 2 additions & 1 deletion src/contexts/clients/info/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const ClientInfo = {
[Clients.CAT]: catInfo,
[Clients.FASTBACK]: fastbackInfo,
[Clients.ALPHA]: alphaInfo,
[Clients.ALGODRIVEN]: algodrivenInfo,
[Clients.ALGODRIVEN_CAPTURE]: algodrivenInfo,
[Clients.ALGODRIVEN_REPORT]: algodrivenInfo,
};

export default ClientInfo;
3 changes: 2 additions & 1 deletion src/contexts/clients/palettes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const ClientPalettes = {
[Clients.CAT]: catPalette,
[Clients.FASTBACK]: defaultPalette,
[Clients.ALPHA]: defaultPalette,
[Clients.ALGODRIVEN]: defaultPalette,
[Clients.ALGODRIVEN_CAPTURE]: defaultPalette,
[Clients.ALGODRIVEN_REPORT]: defaultPalette,
};

export default function getClientTheme(client) {
Expand Down
3 changes: 2 additions & 1 deletion src/contexts/clients/sights/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const ClientSights = {
[Clients.CAT]: defaultWithVin,
[Clients.FASTBACK]: defaultSights,
[Clients.ALPHA]: defaultSights,
[Clients.ALGODRIVEN]: defaultSights,
[Clients.ALGODRIVEN_CAPTURE]: defaultSights,
[Clients.ALGODRIVEN_REPORT]: defaultSights,
};

export default ClientSights;
3 changes: 2 additions & 1 deletion src/contexts/clients/workflows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const ClientWorkflows = {
[Clients.CAT]: Workflows.CAPTURE_VEHICLE_SELECTION,
[Clients.FASTBACK]: Workflows.DEFAULT,
[Clients.ALPHA]: Workflows.DEFAULT,
[Clients.ALGODRIVEN]: Workflows.CAPTURE,
[Clients.ALGODRIVEN_CAPTURE]: Workflows.CAPTURE,
[Clients.ALGODRIVEN_REPORT]: Workflows.INSPECTION_REPORT,
};

export default ClientWorkflows;
Expand Down
6 changes: 6 additions & 0 deletions src/contexts/clients/workflows/workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ const Workflows = {
* - Vehicle type in params /If no vehicle type : redirected to vehicle type selection page
*/
CAPTURE_VEHICLE_SELECTION: 'capture vehicle selection',
/**
* Inspection Report workflow :
* - No landing screen / No Capture
* - Inspection Report only
*/
INSPECTION_REPORT: 'inspection report',
};

export default Workflows;
10 changes: 10 additions & 0 deletions src/screens/Landing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ export default function Landing() {
isLastTour: true,
},
);
} else if (workflow === Workflows.INSPECTION_REPORT && !route.params?.captureComplete) {
navigation.navigate(
names.INSPECTION_REPORT,
{
selectedMod: 'car360',
inspectionId,
vehicle: { vehicleType: VehicleTypeMap[vehicleTypeParam] ?? 'cuv' },
isLastTour: true,
},
);
} else if (workflow === Workflows.CAPTURE_VEHICLE_SELECTION && !route.params?.captureComplete) {
if (vehicleTypeParam && VehicleTypeMap[vehicleTypeParam]) {
navigation.navigate(
Expand Down
3 changes: 2 additions & 1 deletion src/screens/paramsMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const ClientParamMap = {
pd8: Clients.CAT,
'2bd': Clients.FASTBACK,
a3o: Clients.ALPHA,
m4n: Clients.ALGODRIVEN,
m4n: Clients.ALGODRIVEN_CAPTURE,
zxg: Clients.ALGODRIVEN_REPORT,
};

export const VehicleTypeMap = {
Expand Down

0 comments on commit 204b382

Please sign in to comment.