This repository contains the code related to the Andrew Insurance insurer and superadmin front facing application.
Andrew insurer deployed application
- API postman collection online
- API postman collection download
- Ecommerce postman collection online
- Ecommerce postman collection download
- As a superadmin i register devices and flash credentials on the devices firmware (IOT)
- As a new user from the landing page offering the subscription to Andrew's insurance products i click on call to action to create my customer account and i am redirected back to the application logged in
- As a logged in user i create a new subscription application and fill out the required informations and documents
- As a logged in user i submit my subscription application for review
- As an logged in insurer i review and validate the subscription application generating a contract attached checkout url
- As the system i takes informations from the subscription application to register a new contract and it's related vehicles generating checkout url using a the configured payment gateway (stripe)
- As the system i receive confirmation of the user subscription and update the contract status accordingly
- As a logged in insurer i select a device from the available device pool and link the device to a vehicle
- As a logged in insurer i activate the selected/linked device
- As a logged in insurer i send the device to the user address by mail
- As a logged in user i receive the device
- As a logged in user i activate the device by plugging it into the obd plug of my vehicle
- As an authorized device i verify the vehicle VIN is valid in the system
- As the system i validate the device from a customer point of view
- As a user, i am now happy i am insured
- As the device i collect vehicle metrics and send them to the system periodically
- As the system i classify the vehicle driver behaviour
- As the system and according to the vehcile driver behaviour classification i grant insurance discount on the user susbscription.
I. A customer create a subscription application with a status of PENDING II. when all informations filled and the customer wants to apply it confirms it subscription application and asks for a review of it, the status moved from PENDING to REVIEWING III. An insurer review the subscription application and can directly update the data if wanted, or finalize the subscription by applying a status:
-
PAYMENT_PENDING: initiate the payment/checkout workflow by generating a checkout url
- system register a contract with an INACTIVE status and vehicles linked to the contract from data present in subscription application
- customer click on the generated checkout url
- contract status change from INACTIVE to ACTIVE upon successful subscription initialization
-
REJECTED: customer can create a new susbcription application the current one won't be changed anymore
-
TO_AMMEND: customer must update it's subscription application
- customer can ammend its subscription application and restart from step II
- superadmin:
- devices WRITE + DELETE
- all below roles
- supervisor:
- devices READ
- devices to contract link
- users READ + WRITE + UPDATE + DELETE
- contracts READ + WRITE + UPDATE + DELETE
- vehicles READ + WRITE + UPDATE + DELETE
- subscription application READ + WRITE + UPDATE + DELETE
- user:
- devices READ own data
- contracts READ own data
- vehicle READ own data
- susbscription application WRITE + UPDATE
- [email protected] - superadmin
- [email protected] - insurer aka supervisor (keycloak)
- [email protected] - user
- [email protected] - user
# build the image
docker build -t <repository>/andrew-insurer:<DD>-<MM>-<YYYY>.<UNIQUE ID> .
# install project dependencies
npm install
# lauch developement server
npm run dev