Easy online store product. It should be as easy to setup as a social media account; just post an image and initialize settings.
Summary
While the goal is quite simple, to archive it in the best way, we need to refactor our current Product as a Code solution to use database based approach.
Current state: We currently have a products.ts file which quite heavily defines our products with a "as a code" solution for our new web store dynamically. This end product is then sent over REST API to the client. We also have a legacy database structure in place for our invoicing system, but it isn't directly compatible yet, nor the web shop use it at the moment.
Future state: We will keep products.ts as a "as a code" solution but refactor it as a separate standalone module to produce a JSON output. We'll refactor the database to be compatible with our dynamic product schema. We'll then implement a tool in the CLI Agent to read the JSON and synchronize the state from it to the database. Then the REST API will be refactored to use the database directly. This will enable dynamic products with limited stock amounts (including single amount) in the online shop.
Subtasks
[x] Remove unneccessary features from the dynamic product schema (e.g. "composite" product which never was in use)
[x] Refactor product and database schemas to be compatible
[x] Refactor the Product as a Code part of the code to product a JSON file
[x] Refactor the database to support our product scheme
[x] Refactor the backend to return the JSON from the database instead of directly from the Product as a Code solution
[x] Implement a feature in the CLI Agent to synchronize the database using a JSON file
Goal
Easy online store product. It should be as easy to setup as a social media account; just post an image and initialize settings.
Summary
While the goal is quite simple, to archive it in the best way, we need to refactor our current Product as a Code solution to use database based approach.
products.ts
file which quite heavily defines our products with a "as a code" solution for our new web store dynamically. This end product is then sent over REST API to the client. We also have a legacy database structure in place for our invoicing system, but it isn't directly compatible yet, nor the web shop use it at the moment.products.ts
as a "as a code" solution but refactor it as a separate standalone module to produce a JSON output. We'll refactor the database to be compatible with our dynamic product schema. We'll then implement a tool in the CLI Agent to read the JSON and synchronize the state from it to the database. Then the REST API will be refactored to use the database directly. This will enable dynamic products with limited stock amounts (including single amount) in the online shop.Subtasks