feat: add inline catalog checkout with modals

Replace redirect to /comprar with a 2-step modal flow (cart confirmation
+ personal data) on the catalog page. Add createCatalogPurchase API
endpoint for catalog sales.
This commit is contained in:
2026-05-28 17:13:22 -05:00
parent 2b52c63133
commit e816ae3e7d
3 changed files with 229 additions and 51 deletions

View File

@@ -1,67 +1,71 @@
class Api {
constructor (apiImplementation) {
this.apiImplementation = apiImplementation;
}
constructor(apiImplementation) {
this.apiImplementation = apiImplementation;
}
getCustomers() {
return this.apiImplementation.getCustomers();
}
getCustomers() {
return this.apiImplementation.getCustomers();
}
getProducts() {
return this.apiImplementation.getProducts();
}
getProducts() {
return this.apiImplementation.getProducts();
}
getPaymentMethods() {
return this.apiImplementation.getPaymentMethods();
}
getPaymentMethods() {
return this.apiImplementation.getPaymentMethods();
}
getSummaryPurchase(purchaseId) {
return this.apiImplementation.getSummaryPurchase(purchaseId);
}
getSummaryPurchase(purchaseId) {
return this.apiImplementation.getSummaryPurchase(purchaseId);
}
getPurchasesForReconciliation() {
return this.apiImplementation.getPurchasesForReconciliation();
}
getPurchasesForReconciliation() {
return this.apiImplementation.getPurchasesForReconciliation();
}
getListReconcliations(page=1, itemsPerPage=10) {
return this.apiImplementation.getListReconcliations(page, itemsPerPage);
}
getListReconcliations(page = 1, itemsPerPage = 10) {
return this.apiImplementation.getListReconcliations(page, itemsPerPage);
}
getReconciliation(reconciliationId) {
return this.apiImplementation.getReconciliation(reconciliationId);
}
getReconciliation(reconciliationId) {
return this.apiImplementation.getReconciliation(reconciliationId);
}
createPurchase(purchase) {
return this.apiImplementation.createPurchase(purchase);
}
createPurchase(purchase) {
return this.apiImplementation.createCatalogPurchase(purchase);
}
createReconciliationJar(reconciliation) {
return this.apiImplementation.createReconciliationJar(reconciliation);
}
createCatalogPurchase(purchase) {
return this.apiImplementation.createPurchase(purchase);
}
createCustomer(customer) {
return this.apiImplementation.createCustomer(customer);
}
createReconciliationJar(reconciliation) {
return this.apiImplementation.createReconciliationJar(reconciliation);
}
getCSVForTryton() {
return this.apiImplementation.getCSVForTryton();
}
createCustomer(customer) {
return this.apiImplementation.createCustomer(customer);
}
getProductsFromTryton() {
return this.apiImplementation.getProductsFromTryton();
}
getCSVForTryton() {
return this.apiImplementation.getCSVForTryton();
}
getCustomersFromTryton() {
return this.apiImplementation.getCustomersFromTryton();
}
getProductsFromTryton() {
return this.apiImplementation.getProductsFromTryton();
}
sendSalesToTryton(){
return this.apiImplementation.sendSalesToTryton();
}
getCustomersFromTryton() {
return this.apiImplementation.getCustomersFromTryton();
}
getCurrentUser() {
return this.apiImplementation.getCurrentUser();
}
sendSalesToTryton() {
return this.apiImplementation.sendSalesToTryton();
}
getCurrentUser() {
return this.apiImplementation.getCurrentUser();
}
}
export default Api;

View File

@@ -60,6 +60,11 @@ class DjangoApi {
return this.postRequest(url, purchase);
}
createCatalogPurchase(purchase) {
const url = this.base + "/don_confiao/api/catalog_sales/";
return this.postRequest(url, purchase);
}
createReconciliationJar(reconciliation) {
const url = this.base + "/don_confiao/reconciliate_jar";
return this.postRequest(url, reconciliation);