The goal of this technical challenge is to prove the ability to solve a technical problem by proposing and developing a scalable solution using our stack.
Imagine the following scenario:
Two online stores (Ecommerce1, Ecommerce2) hit their sales record in December 2023, many of their customers do not require an invoice so global invoices for these payments must be created at the end of the month. This function must be executed at 23:59 (America/Mexico_City timezone) on the last day of the month.
Invoices can only be created in a single currency, and if the currency is different from (MXN) Mexican pesos, the exchange rate must be specified.
Each global invoice can contain multiple payments, but for this challenge, the number of items in each invoice cannot exceed 750 items. All items of payment must be in the same global invoice.
You can identify payments from each e-commerce by the key "accountId" in each payment:
- Ecommerce1: team_cjf5GBxz60sqHfs
- Ecommerce2: team_xvHTilvNssRf7rw
Note: A global invoice is an invoice that includes multiple payments, usually issued using the legal name: PUBLICO EN GENERAL, RFC: XAXX010101000, and Fiscal Regime: Sin obligaciones fiscales, with any postal code in Mexico.
Note: You can use the following configuration for the global invoice:
- Payment method: Pago en parcialidades o diferido
- Payment form: Por definir
- Use: Sin efectos fiscales
- Invoice type: Ingreso
- Create a function that runs at the last minute of the month to generate global invoices for Ecommerce1 and Ecommerce2 by calling the Gigstack API.
- Group global invoices by currency and use the exchange rate of the day when the currency is different from the Mexican Pesos (MXN).
- Ensure that each global invoice does not contain more than 750 items.
- Develop a dashboard to visualize payments and invoices, showing real-time updates.
-
How do you ensure that your solution is scalable for โnโ number of online stores?
-
If each e-commerce increases its sales by 10% each month and the number of online stores increases by 15% each month, how do you ensure that your code will execute all global invoices in one minute?
- Use the Gigstack API to create invoices (Gigstack API Documentation).
- Use the payments.json dataset provided in this repo (data/payments.json).
- Use an exchange rates API to retrieve the exchange rate of the day; we recommend using ExchangeRate-API.
- Use cloud functions to create the necessary server functions for your proposal (deployment is not required).
- Use ant.design to design the components.
- Use Firebase Firestore to store data.
- Use the GCP resources that you consider appropriate for your solution (deployment is not required).
- Submit and provide access to a GitHub repository.
- In each call to the Gigstack API, add your email to the metadata.