@rangka-os/create 0.5.0-alpha.2 → 0.5.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +42 -6
- package/package.json +1 -1
- package/template/base/apps/crm/app.rk +2 -0
- package/template/base/apps/crm/processes/lead_to_cash.rk +8 -0
- package/template/base/apps/dapur/app.rk +35 -0
- package/template/base/apps/dapur/dashboards/dapur_hari_ini.rk +26 -0
- package/template/base/apps/faktur_piutang/app.rk +31 -0
- package/template/base/apps/faktur_piutang/dashboards/piutang_ringkas.rk +88 -0
- package/template/base/apps/fnb_cabang/app.rk +11 -6
- package/template/base/apps/fnb_cabang/dashboards/fnb_overview.rk +38 -14
- package/template/base/apps/fnb_cabang/dashboards/outlet_harian.rk +36 -0
- package/template/base/apps/fnb_cabang/dashboards/stock_recap.rk +19 -16
- package/template/base/apps/grosir_distribusi/app.rk +57 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_ar.rk +66 -0
- package/template/base/apps/grosir_distribusi/dashboards/grosir_overview.rk +91 -0
- package/template/base/apps/grosir_distribusi/dashboards/gudang_harian.rk +33 -0
- package/template/base/apps/grosir_distribusi/dashboards/salesman_harian.rk +51 -0
- package/template/base/apps/jasa_proyek/app.rk +24 -5
- package/template/base/apps/jasa_proyek/dashboards/absen_saya.rk +15 -0
- package/template/base/apps/jasa_proyek/dashboards/jasa_overview.rk +65 -38
- package/template/base/apps/jasa_proyek/dashboards/project_margin.rk +94 -0
- package/template/base/apps/jasa_proyek/dashboards/rekap_absen.rk +18 -0
- package/template/base/apps/jasa_proyek/processes/quote_to_cash.rk +10 -0
- package/template/base/apps/kasir/app.rk +38 -0
- package/template/base/apps/kasir/dashboards/kasir_ringkas.rk +20 -0
- package/template/base/apps/kasir/skills/rangka-app-kasir/SKILL.md +80 -0
- package/template/base/apps/kelas_kursus/app.rk +32 -0
- package/template/base/apps/kelas_kursus/dashboards/kelas_saya.rk +41 -0
- package/template/base/apps/kelas_kursus/dashboards/kursus_ringkas.rk +67 -0
- package/template/base/apps/langganan_jasa/app.rk +39 -0
- package/template/base/apps/langganan_jasa/dashboards/langganan_ringkas.rk +167 -0
- package/template/base/apps/langganan_jasa/dashboards/penagihan_saya.rk +54 -0
- package/template/base/apps/mutasi_bank/app.rk +22 -0
- package/template/base/apps/pajak/app.rk +25 -0
- package/template/base/apps/pembelian_pemasok/app.rk +23 -0
- package/template/base/apps/pembukuan/app.rk +19 -0
- package/template/base/apps/penjualan_harian/app.rk +34 -0
- package/template/base/apps/penjualan_harian/dashboards/penjualan_ringkas.rk +87 -0
- package/template/base/apps/produksi_pabrik/app.rk +54 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_overview.rk +101 -0
- package/template/base/apps/produksi_pabrik/dashboards/produksi_upah.rk +39 -0
- package/template/base/apps/ritel_cabang/app.rk +61 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_overview.rk +137 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_stock.rk +147 -0
- package/template/base/apps/ritel_cabang/dashboards/ritel_tax.rk +76 -0
- package/template/base/apps/sewa_alat/app.rk +36 -0
- package/template/base/apps/sewa_alat/dashboards/alat_hari_ini.rk +90 -0
- package/template/base/apps/sewa_alat/dashboards/sewa_ringkas.rk +86 -0
- package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/SKILL.md +24 -0
- package/template/base/apps/sewa_alat/skills/rangka-app-sewa-alat/first-day.json +162 -0
- package/template/base/apps/stok_outlet/app.rk +34 -0
- package/template/base/apps/stok_outlet/dashboards/outlet_hari_ini.rk +33 -0
- package/template/base/apps/stok_outlet/dashboards/stok_ringkas.rk +50 -0
- package/template/base/connectors/biteship/connector.rk +246 -0
- package/template/base/connectors/biteship/fixtures/cancel_order.json +1 -0
- package/template/base/connectors/biteship/fixtures/create_order.json +8 -0
- package/template/base/connectors/biteship/fixtures/expect.json +9 -0
- package/template/base/connectors/biteship/fixtures/get_order.json +2 -0
- package/template/base/connectors/biteship/fixtures/get_rates.json +7 -0
- package/template/base/connectors/biteship/fixtures/get_tracking.json +7 -0
- package/template/base/connectors/biteship/fixtures/order_price.json +11 -0
- package/template/base/connectors/biteship/fixtures/order_status.json +15 -0
- package/template/base/connectors/biteship/fixtures/order_status_cancelled.json +15 -0
- package/template/base/connectors/biteship/fixtures/order_waybill.json +7 -0
- package/template/base/connectors/biteship/fixtures/search_areas.json +1 -0
- package/template/base/connectors/doku/connector.rk +128 -0
- package/template/base/connectors/doku/fixtures/create_checkout.json +6 -0
- package/template/base/connectors/doku/fixtures/expect.json +38 -0
- package/template/base/connectors/doku/fixtures/payment_notified.json +5 -0
- package/template/base/connectors/doku/fixtures/payment_notified_failed.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_no_type.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_null_type.json +3 -0
- package/template/base/connectors/doku/fixtures/payment_notified_refund.json +3 -0
- package/template/base/connectors/doku/mock/doku_mock.py +217 -0
- package/template/base/connectors/loyverse/connector.rk +98 -0
- package/template/base/connectors/moka/connector.rk +121 -0
- package/template/base/connectors/moka/fixtures/expect.json +44 -0
- package/template/base/connectors/moka/fixtures/latest_transactions.json +79 -0
- package/template/base/connectors/moka/fixtures/list_items.json +4 -0
- package/template/base/connectors/moka/fixtures/list_outlets.json +4 -0
- package/template/base/connectors/moka/fixtures/transaction_created.json +44 -0
- package/template/base/connectors/moka/fixtures/transaction_created_refund.json +39 -0
- package/template/base/connectors/moka/fixtures/transaction_created_refund_later.json +51 -0
- package/template/base/connectors/moka/mock/moka_mock.py +210 -0
- package/template/base/connectors/whatsapp_business/connector.rk +22 -1
- package/template/base/connectors/whatsapp_business/templates.md +32 -0
- package/template/base/connectors/xendit/connector.rk +184 -0
- package/template/base/connectors/xendit/mock/xendit_mock.py +231 -0
- package/template/base/modules/accounting/flows/financial_report_compute.rk +47 -0
- package/template/base/modules/accounting/flows/financial_report_recompute.rk +47 -0
- package/template/base/modules/accounting/flows/gl_cash_advance_post.rk +33 -0
- package/template/base/modules/accounting/flows/gl_cash_advance_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_delivery_note_post.rk +37 -0
- package/template/base/modules/accounting/flows/gl_delivery_note_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_goods_receipt_post.rk +41 -0
- package/template/base/modules/accounting/flows/gl_goods_receipt_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_opening_balance_post.rk +132 -0
- package/template/base/modules/accounting/flows/gl_opening_balance_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_return_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_outlet_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_sales_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_outlet_sales_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_outlet_takings_post.rk +71 -0
- package/template/base/modules/accounting/flows/gl_outlet_takings_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_payment_post.rk +63 -0
- package/template/base/modules/accounting/flows/gl_payment_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_payroll_close_post.rk +89 -0
- package/template/base/modules/accounting/flows/gl_payroll_close_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_pos_sale_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_pos_sale_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_pos_shift_close_post.rk +59 -0
- package/template/base/modules/accounting/flows/gl_pos_shift_close_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_production_batch_post.rk +62 -0
- package/template/base/modules/accounting/flows/gl_production_batch_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_project_expense_post.rk +64 -0
- package/template/base/modules/accounting/flows/gl_project_expense_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_rental_booking_post.rk +35 -0
- package/template/base/modules/accounting/flows/gl_rental_booking_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_rental_return_post.rk +47 -0
- package/template/base/modules/accounting/flows/gl_rental_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_sales_invoice_post.rk +95 -0
- package/template/base/modules/accounting/flows/gl_sales_invoice_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_sales_return_post.rk +40 -0
- package/template/base/modules/accounting/flows/gl_sales_return_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_adjustment_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_adjustment_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_count_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_count_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_post.rk +38 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_receipt_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_stock_transfer_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_timesheet_post.rk +35 -0
- package/template/base/modules/accounting/flows/gl_timesheet_reverse.rk +194 -0
- package/template/base/modules/accounting/flows/gl_vendor_bill_post.rk +63 -0
- package/template/base/modules/accounting/flows/gl_vendor_bill_reverse.rk +194 -0
- package/template/base/modules/accounting/imports/opening_balance_sheet.rk +22 -0
- package/template/base/modules/accounting/models/financial_report.rk +85 -0
- package/template/base/modules/accounting/models/gl_entry.rk +164 -0
- package/template/base/modules/accounting/models/opening_balance.rk +48 -0
- package/template/base/modules/accounting/models/period_close.rk +33 -0
- package/template/base/modules/accounting/module.rk +16 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_booked.rk +12 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_booked_released.rk +11 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_claim.rk +29 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_confirm.rk +61 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_link_locked.rk +11 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_matched.rk +13 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_release.rk +11 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_suggest.rk +73 -0
- package/template/base/modules/bank_statement/flows/bank_transaction_unmatched.rk +11 -0
- package/template/base/modules/bank_statement/imports/bank_statement_csv.rk +25 -0
- package/template/base/modules/bank_statement/models/bank_transaction.rk +147 -0
- package/template/base/modules/bank_statement/models/bank_transaction_claim.rk +49 -0
- package/template/base/modules/bank_statement/module.rk +12 -0
- package/template/base/modules/catalogue/imports/item_list.rk +20 -0
- package/template/base/modules/catalogue/imports/item_master.rk +25 -0
- package/template/base/modules/catalogue/models/item.rk +81 -1
- package/template/base/modules/catalogue/models/item_category.rk +29 -0
- package/template/base/modules/catalogue/models/uom.rk +14 -0
- package/template/base/modules/catalogue/models/uom_conversion.rk +8 -0
- package/template/base/modules/catalogue/module.rk +8 -2
- package/template/base/modules/consignment/flows/consignment_bill.rk +39 -0
- package/template/base/modules/consignment/flows/consignment_bill_cancelled.rk +14 -0
- package/template/base/modules/consignment/models/consignment_settlement.rk +111 -0
- package/template/base/modules/consignment/models/consignment_settlement_item.rk +37 -0
- package/template/base/modules/consignment/module.rk +15 -0
- package/template/base/modules/contacts/imports/customer_list.rk +17 -0
- package/template/base/modules/contacts/imports/vendor_list.rk +16 -0
- package/template/base/modules/contacts/models/credit_guard.rk +40 -0
- package/template/base/modules/contacts/models/customer.rk +144 -2
- package/template/base/modules/contacts/models/vendor.rk +51 -2
- package/template/base/modules/contacts/module.rk +6 -1
- package/template/base/modules/coretax/models/tax_period.rk +89 -0
- package/template/base/modules/coretax/module.rk +13 -0
- package/template/base/modules/coretax/print/coretax_bupot.rk +31 -0
- package/template/base/modules/coretax/print/coretax_bupot.xml +28 -0
- package/template/base/modules/coretax/print/coretax_faktur.rk +44 -0
- package/template/base/modules/coretax/print/coretax_faktur.xml +74 -0
- package/template/base/modules/courses/flows/charge_cancel_guard.rk +23 -0
- package/template/base/modules/courses/flows/charge_invoice_on_submit.rk +58 -0
- package/template/base/modules/courses/flows/enrollment_seats_on_create.rk +15 -0
- package/template/base/modules/courses/flows/enrollment_seats_on_update.rk +35 -0
- package/template/base/modules/courses/flows/invoice_course_once.rk +22 -0
- package/template/base/modules/courses/flows/invoice_course_tag_lock.rk +16 -0
- package/template/base/modules/courses/flows/session_attendance_checked.rk +14 -0
- package/template/base/modules/courses/flows/session_fill_attendance.rk +16 -0
- package/template/base/modules/courses/flows/session_of_the_day.rk +34 -0
- package/template/base/modules/courses/flows/student_billing_on_create.rk +25 -0
- package/template/base/modules/courses/models/course_attendance.rk +24 -0
- package/template/base/modules/courses/models/course_batch.rk +119 -0
- package/template/base/modules/courses/models/course_batch_slot.rk +18 -0
- package/template/base/modules/courses/models/course_charge.rk +125 -0
- package/template/base/modules/courses/models/course_guard.rk +50 -0
- package/template/base/modules/courses/models/course_program.rk +101 -0
- package/template/base/modules/courses/models/course_session.rk +94 -0
- package/template/base/modules/courses/models/enrollment.rk +136 -0
- package/template/base/modules/courses/models/student.rk +68 -0
- package/template/base/modules/courses/module.rk +14 -0
- package/template/base/modules/courses/roles/instructor.rk +7 -0
- package/template/base/modules/courses/screens/absen_kelas.rk +17 -0
- package/template/base/modules/currency/module.rk +5 -0
- package/template/base/modules/delivery/flows/delivery_cancel_guard.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_cancelled.rk +21 -0
- package/template/base/modules/delivery/flows/fulfilment_on_delivery_submitted.rk +28 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_cancelled.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_invoice_submitted.rk +22 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_created.rk +18 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_order_updated.rk +19 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_cancelled.rk +16 -0
- package/template/base/modules/delivery/flows/fulfilment_on_return_submitted.rk +16 -0
- package/template/base/modules/delivery/flows/invoice_qty_from_deliveries.rk +20 -0
- package/template/base/modules/delivery/flows/order_cancel_guard.rk +10 -0
- package/template/base/modules/delivery/flows/return_cancel_guard.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_payment_submitted.rk +21 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_cancelled.rk +11 -0
- package/template/base/modules/delivery/flows/return_credit_on_return_submitted.rk +10 -0
- package/template/base/modules/delivery/models/delivery_guard.rk +48 -0
- package/template/base/modules/delivery/models/delivery_note.rk +101 -0
- package/template/base/modules/delivery/models/delivery_note_item.rk +11 -0
- package/template/base/modules/delivery/models/order_fulfilment.rk +27 -0
- package/template/base/modules/delivery/models/order_fulfilment_item.rk +10 -0
- package/template/base/modules/delivery/models/return_credit.rk +23 -0
- package/template/base/modules/delivery/models/sales_return.rk +87 -0
- package/template/base/modules/delivery/models/sales_return_item.rk +16 -0
- package/template/base/modules/delivery/module.rk +16 -0
- package/template/base/modules/delivery/print/delivery_note.html +96 -0
- package/template/base/modules/delivery/print/delivery_note.rk +9 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_invoice_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_order_submitted.rk +25 -0
- package/template/base/modules/distribution/flows/credit_on_payment_cancelled.rk +17 -0
- package/template/base/modules/distribution/flows/credit_on_payment_submitted.rk +17 -0
- package/template/base/modules/distribution/flows/giro_bounced.rk +20 -0
- package/template/base/modules/distribution/flows/giro_from_payment.rk +21 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_created.rk +17 -0
- package/template/base/modules/distribution/flows/order_tier_pricing_updated.rk +17 -0
- package/template/base/modules/distribution/models/giro.rk +79 -0
- package/template/base/modules/distribution/module.rk +14 -0
- package/template/base/modules/invoicing/flows/invoice_due_digest.rk +12 -0
- package/template/base/modules/invoicing/flows/milestone_invoiced.rk +23 -0
- package/template/base/modules/invoicing/flows/milestone_reopened.rk +19 -0
- package/template/base/modules/invoicing/flows/payment_instruction_on_submit.rk +25 -0
- package/template/base/modules/invoicing/flows/project_billed_on_cancel.rk +16 -0
- package/template/base/modules/invoicing/flows/project_billed_on_submit.rk +16 -0
- package/template/base/modules/invoicing/flows/project_revenue_on_cancel.rk +22 -0
- package/template/base/modules/invoicing/flows/project_revenue_on_submit.rk +17 -0
- package/template/base/modules/invoicing/flows/sales_invoice_credit_recheck.rk +18 -0
- package/template/base/modules/invoicing/models/bank_account.rk +134 -0
- package/template/base/modules/invoicing/models/invoice_reminder.rk +83 -0
- package/template/base/modules/invoicing/models/payment_instruction.rk +72 -0
- package/template/base/modules/invoicing/models/sales_invoice.rk +324 -13
- package/template/base/modules/invoicing/models/sales_invoice_item.rk +23 -0
- package/template/base/modules/invoicing/module.rk +7 -2
- package/template/base/modules/invoicing/print/sales_invoice.html +145 -32
- package/template/base/modules/invoicing/print/sales_invoice.rk +7 -0
- package/template/base/modules/invoicing/print/sales_invoice_nota.html +71 -0
- package/template/base/modules/invoicing/print/sales_invoice_nota.rk +13 -0
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.html +45 -0
- package/template/base/modules/invoicing/print/sales_invoice_whatsapp.rk +15 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_sale.rk +47 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_update.rk +30 -0
- package/template/base/modules/kitchen/flows/kitchen_ticket_on_void.rk +23 -0
- package/template/base/modules/kitchen/models/kitchen_guard.rk +40 -0
- package/template/base/modules/kitchen/models/kitchen_route.rk +26 -0
- package/template/base/modules/kitchen/models/kitchen_station.rk +40 -0
- package/template/base/modules/kitchen/models/kitchen_ticket.rk +83 -0
- package/template/base/modules/kitchen/models/kitchen_ticket_item.rk +10 -0
- package/template/base/modules/kitchen/module.rk +18 -0
- package/template/base/modules/kitchen/print/kitchen_ticket.html +29 -0
- package/template/base/modules/kitchen/print/kitchen_ticket.rk +9 -0
- package/template/base/modules/kitchen/roles/kitchen.rk +6 -0
- package/template/base/modules/kitchen/screens/dapur.rk +22 -0
- package/template/base/modules/orders/models/customer_order.rk +98 -2
- package/template/base/modules/orders/models/customer_order_item.rk +29 -0
- package/template/base/modules/orders/module.rk +7 -2
- package/template/base/modules/outlet_sales/flows/moka_api_opened.rk +30 -0
- package/template/base/modules/outlet_sales/flows/moka_daily_sales.rk +78 -0
- package/template/base/modules/outlet_sales/flows/moka_held_release.rk +35 -0
- package/template/base/modules/outlet_sales/flows/moka_legacy_key_overlap.rk +22 -0
- package/template/base/modules/outlet_sales/flows/moka_line_mapped.rk +38 -0
- package/template/base/modules/outlet_sales/flows/moka_transaction_refused.rk +15 -0
- package/template/base/modules/outlet_sales/flows/moka_transaction_staged.rk +171 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_backfill_harian.rk +71 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_free_sales.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_free_takings.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_on_sales.rk +19 -0
- package/template/base/modules/outlet_sales/flows/outlet_day_on_takings.rk +19 -0
- package/template/base/modules/outlet_sales/flows/refund_on_return_cancelled.rk +15 -0
- package/template/base/modules/outlet_sales/flows/refund_on_return_submitted.rk +26 -0
- package/template/base/modules/outlet_sales/flows/refund_on_sales_submitted.rk +14 -0
- package/template/base/modules/outlet_sales/flows/sales_cancel_guard.rk +18 -0
- package/template/base/modules/outlet_sales/imports/daily_form.rk +3 -1
- package/template/base/modules/outlet_sales/imports/loyverse_receipts.rk +28 -0
- package/template/base/modules/outlet_sales/imports/moka_item_details.rk +14 -4
- package/template/base/modules/outlet_sales/imports/pos_sales_file.rk +28 -0
- package/template/base/modules/outlet_sales/imports/takings_file.rk +23 -0
- package/template/base/modules/outlet_sales/models/moka_sale_line.rk +66 -0
- package/template/base/modules/outlet_sales/models/moka_transaction.rk +26 -0
- package/template/base/modules/outlet_sales/models/outlet_return.rk +66 -0
- package/template/base/modules/outlet_sales/models/outlet_return_item.rk +7 -0
- package/template/base/modules/outlet_sales/models/outlet_sales.rk +79 -7
- package/template/base/modules/outlet_sales/models/outlet_sales_guard.rk +40 -0
- package/template/base/modules/outlet_sales/models/outlet_sales_line.rk +2 -0
- package/template/base/modules/outlet_sales/models/outlet_takings.rk +85 -0
- package/template/base/modules/outlet_sales/models/outlet_takings_line.rk +37 -0
- package/template/base/modules/outlet_sales/models/pos_refund.rk +36 -0
- package/template/base/modules/outlet_sales/models/pos_refund_item.rk +9 -0
- package/template/base/modules/outlet_sales/module.rk +7 -2
- package/template/base/modules/outlets/models/outlet.rk +57 -0
- package/template/base/modules/outlets/models/outlet_day.rk +30 -0
- package/template/base/modules/outlets/models/outlet_day_backfill.rk +25 -0
- package/template/base/modules/outlets/module.rk +7 -2
- package/template/base/modules/payments/flows/payment_from_doku.rk +73 -0
- package/template/base/modules/payments/flows/payment_from_xendit_invoice.rk +59 -0
- package/template/base/modules/payments/flows/payment_from_xendit_qr.rk +59 -0
- package/template/base/modules/payments/flows/payment_from_xendit_va.rk +59 -0
- package/template/base/modules/payments/flows/payment_gateway_claim_created.rk +19 -0
- package/template/base/modules/payments/flows/payment_gateway_claim_submitted.rk +19 -0
- package/template/base/modules/payments/flows/payment_gateway_release.rk +12 -0
- package/template/base/modules/payments/flows/payment_refund_from_doku.rk +14 -0
- package/template/base/modules/payments/models/gateway_ref_claim.rk +42 -0
- package/template/base/modules/payments/models/payment.rk +62 -1
- package/template/base/modules/payments/models/withholding.rk +16 -2
- package/template/base/modules/payments/module.rk +7 -2
- package/template/base/modules/payments/print/statement.html +1 -1
- package/template/base/modules/payroll/flows/cash_advance_cancel_guard.rk +15 -0
- package/template/base/modules/payroll/flows/invoice_payroll_once.rk +20 -0
- package/template/base/modules/payroll/flows/invoice_payroll_tag_lock.rk +13 -0
- package/template/base/modules/payroll/flows/payroll_close_on_cancel.rk +35 -0
- package/template/base/modules/payroll/flows/payroll_close_on_submit.rk +66 -0
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_created.rk +14 -0
- package/template/base/modules/payroll/flows/payroll_run_overlap_guard_updated.rk +14 -0
- package/template/base/modules/payroll/flows/payroll_totals_on_payslip_cancel.rk +29 -0
- package/template/base/modules/payroll/flows/payroll_totals_on_payslip_submit.rk +29 -0
- package/template/base/modules/payroll/flows/payslip_advance_guard.rk +23 -0
- package/template/base/modules/payroll/flows/payslip_cancel_guard.rk +14 -0
- package/template/base/modules/payroll/flows/payslip_casual_guard.rk +19 -0
- package/template/base/modules/payroll/flows/payslip_from_recap.rk +76 -0
- package/template/base/modules/payroll/flows/payslip_month_guard_created.rk +16 -0
- package/template/base/modules/payroll/flows/payslip_month_guard_submitted.rk +16 -0
- package/template/base/modules/payroll/flows/payslip_order_guard_cancelled.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_order_guard_submitted.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_pay_overlap_guard.rk +15 -0
- package/template/base/modules/payroll/flows/payslip_ytd_guard.rk +35 -0
- package/template/base/modules/payroll/flows/payslip_ytd_on_create.rk +49 -0
- package/template/base/modules/payroll/flows/recap_cancel_guard.rk +15 -0
- package/template/base/modules/payroll/models/cash_advance.rk +53 -0
- package/template/base/modules/payroll/models/payroll_close.rk +80 -0
- package/template/base/modules/payroll/models/payroll_guard.rk +89 -0
- package/template/base/modules/payroll/models/payroll_profile.rk +146 -0
- package/template/base/modules/payroll/models/payroll_run.rk +220 -0
- package/template/base/modules/payroll/models/payslip.rk +370 -0
- package/template/base/modules/payroll/module.rk +13 -0
- package/template/base/modules/payroll/print/payslip.html +54 -0
- package/template/base/modules/payroll/print/payslip.rk +7 -0
- package/template/base/modules/pipeline/module.rk +5 -0
- package/template/base/modules/pos/flows/outlet_day_backfill_kasir.rk +61 -0
- package/template/base/modules/pos/flows/pos_daily_form_guard.rk +18 -0
- package/template/base/modules/pos/flows/pos_sale_on_cancel.rk +42 -0
- package/template/base/modules/pos/flows/pos_sale_on_submit.rk +60 -0
- package/template/base/modules/pos/flows/pos_shift_close_on_cancel.rk +26 -0
- package/template/base/modules/pos/flows/pos_shift_close_on_submit.rk +23 -0
- package/template/base/modules/pos/flows/pos_shift_on_create.rk +21 -0
- package/template/base/modules/pos/flows/pos_shift_on_update.rk +10 -0
- package/template/base/modules/pos/flows/pos_takings_guard.rk +28 -0
- package/template/base/modules/pos/models/pos_guard.rk +76 -0
- package/template/base/modules/pos/models/pos_payment.rk +17 -0
- package/template/base/modules/pos/models/pos_sale.rk +226 -0
- package/template/base/modules/pos/models/pos_sale_item.rk +46 -0
- package/template/base/modules/pos/models/pos_shift.rk +92 -0
- package/template/base/modules/pos/models/pos_shift_close.rk +77 -0
- package/template/base/modules/pos/module.rk +22 -0
- package/template/base/modules/pos/print/pos_receipt.html +50 -0
- package/template/base/modules/pos/print/pos_receipt.rk +9 -0
- package/template/base/modules/pos/screens/kasir.rk +41 -0
- package/template/base/modules/procurement/flows/project_vendor_cost_on_cancel.rk +22 -0
- package/template/base/modules/procurement/flows/project_vendor_cost_on_submit.rk +17 -0
- package/template/base/modules/procurement/imports/opening_stock.rk +25 -0
- package/template/base/modules/procurement/models/goods_receipt.rk +3 -1
- package/template/base/modules/procurement/models/purchase_order.rk +22 -8
- package/template/base/modules/procurement/models/purchase_request.rk +12 -1
- package/template/base/modules/procurement/models/purchase_request_item.rk +2 -0
- package/template/base/modules/procurement/models/vendor_bill.rk +117 -4
- package/template/base/modules/procurement/module.rk +7 -2
- package/template/base/modules/production/flows/batch_cancel_guard.rk +12 -0
- package/template/base/modules/production/flows/batch_from_bom.rk +19 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_cancelled.rk +14 -0
- package/template/base/modules/production/flows/wage_sheet_on_batch_submitted.rk +12 -0
- package/template/base/modules/production/flows/work_order_materials_created.rk +20 -0
- package/template/base/modules/production/flows/work_order_materials_updated.rk +20 -0
- package/template/base/modules/production/models/bom.rk +68 -0
- package/template/base/modules/production/models/bom_byproduct.rk +7 -0
- package/template/base/modules/production/models/bom_line.rk +11 -0
- package/template/base/modules/production/models/production_batch.rk +153 -0
- package/template/base/modules/production/models/production_guard.rk +23 -0
- package/template/base/modules/production/models/production_labour.rk +10 -0
- package/template/base/modules/production/models/production_material.rk +8 -0
- package/template/base/modules/production/models/production_output.rk +8 -0
- package/template/base/modules/production/models/production_stage.rk +19 -0
- package/template/base/modules/production/models/wage_line.rk +15 -0
- package/template/base/modules/production/models/wage_sheet.rk +28 -0
- package/template/base/modules/production/models/work_order.rk +63 -0
- package/template/base/modules/production/models/work_order_material.rk +8 -0
- package/template/base/modules/production/module.rk +17 -0
- package/template/base/modules/production/print/wage_sheet.html +75 -0
- package/template/base/modules/production/print/wage_sheet.rk +9 -0
- package/template/base/modules/projects/flows/attendance_close_cancel_guard.rk +15 -0
- package/template/base/modules/projects/flows/attendance_close_on_submit.rk +68 -0
- package/template/base/modules/projects/flows/attendance_log_cancel_guard.rk +14 -0
- package/template/base/modules/projects/flows/attendance_log_guard_created.rk +17 -0
- package/template/base/modules/projects/flows/attendance_log_guard_submitted.rk +38 -0
- package/template/base/modules/projects/flows/attendance_log_guard_updated.rk +15 -0
- package/template/base/modules/projects/flows/milestone_back_on_acceptance_cancel.rk +15 -0
- package/template/base/modules/projects/flows/milestone_lock_on_update.rk +16 -0
- package/template/base/modules/projects/flows/milestone_ready_on_acceptance.rk +40 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_create.rk +14 -0
- package/template/base/modules/projects/flows/milestone_scheduled_on_update.rk +27 -0
- package/template/base/modules/projects/flows/project_expense_on_cancel.rk +21 -0
- package/template/base/modules/projects/flows/project_expense_on_submit.rk +16 -0
- package/template/base/modules/projects/flows/project_labor_on_cancel.rk +22 -0
- package/template/base/modules/projects/flows/project_labor_on_submit.rk +17 -0
- package/template/base/modules/projects/flows/project_terms_lock.rk +26 -0
- package/template/base/modules/projects/flows/timesheet_assignment_on_create.rk +28 -0
- package/template/base/modules/projects/flows/timesheet_attendance_overlap_guard.rk +20 -0
- package/template/base/modules/projects/flows/vendor_bill_cancel_guard.rk +15 -0
- package/template/base/modules/projects/flows/work_site_supervisor_changed.rk +19 -0
- package/template/base/modules/projects/flows/worker_employee_changed.rk +19 -0
- package/template/base/modules/projects/imports/attendance_recap.rk +23 -0
- package/template/base/modules/projects/imports/billing_milestone.rk +20 -0
- package/template/base/modules/projects/models/assignment.rk +65 -3
- package/template/base/modules/projects/models/attendance_close.rk +67 -0
- package/template/base/modules/projects/models/attendance_guard.rk +57 -0
- package/template/base/modules/projects/models/attendance_log.rk +275 -0
- package/template/base/modules/projects/models/billing_milestone.rk +217 -0
- package/template/base/modules/projects/models/project.rk +76 -2
- package/template/base/modules/projects/models/project_expense.rk +121 -0
- package/template/base/modules/projects/models/project_guard.rk +27 -0
- package/template/base/modules/projects/models/project_ledger.rk +146 -0
- package/template/base/modules/projects/models/timesheet.rk +100 -10
- package/template/base/modules/projects/models/work_site.rk +83 -0
- package/template/base/modules/projects/module.rk +8 -3
- package/template/base/modules/projects/roles/field_worker.rk +10 -0
- package/template/base/modules/projects/roles/site_supervisor.rk +8 -0
- package/template/base/modules/projects/screens/absen.rk +23 -0
- package/template/base/modules/quotation/models/quotation.rk +20 -4
- package/template/base/modules/quotation/models/quotation_item.rk +13 -0
- package/template/base/modules/quotation/module.rk +6 -1
- package/template/base/modules/quotation/print/quotation.html +17 -3
- package/template/base/modules/rental/flows/rental_booking_on_cancel.rk +19 -0
- package/template/base/modules/rental/flows/rental_booking_on_submit.rk +45 -0
- package/template/base/modules/rental/flows/rental_checkout_on_cancel.rk +24 -0
- package/template/base/modules/rental/flows/rental_checkout_on_submit.rk +33 -0
- package/template/base/modules/rental/flows/rental_invoice_once.rk +20 -0
- package/template/base/modules/rental/flows/rental_invoice_tag_lock.rk +12 -0
- package/template/base/modules/rental/flows/rental_return_on_cancel.rk +28 -0
- package/template/base/modules/rental/flows/rental_return_on_submit.rk +45 -0
- package/template/base/modules/rental/models/rental_booking.rk +124 -0
- package/template/base/modules/rental/models/rental_checkout.rk +91 -0
- package/template/base/modules/rental/models/rental_checkout_unit.rk +22 -0
- package/template/base/modules/rental/models/rental_guard.rk +93 -0
- package/template/base/modules/rental/models/rental_item.rk +83 -0
- package/template/base/modules/rental/models/rental_return.rk +134 -0
- package/template/base/modules/rental/models/rental_return_unit.rk +29 -0
- package/template/base/modules/rental/models/rental_schedule.rk +59 -0
- package/template/base/modules/rental/models/rental_unit.rk +80 -0
- package/template/base/modules/rental/module.rk +25 -0
- package/template/base/modules/rental/print/rental_bast_in.html +107 -0
- package/template/base/modules/rental/print/rental_bast_in.rk +9 -0
- package/template/base/modules/rental/print/rental_bast_out.html +98 -0
- package/template/base/modules/rental/print/rental_bast_out.rk +11 -0
- package/template/base/modules/rental/roles/rental_staff.rk +7 -0
- package/template/base/modules/rental/screens/alat_keluar.rk +19 -0
- package/template/base/modules/rental/screens/alat_kembali.rk +19 -0
- package/template/base/modules/rental/screens/jadwal_alat.rk +21 -0
- package/template/base/modules/stock/flows/adjustment_value_backfill.rk +95 -0
- package/template/base/modules/stock/flows/adjustment_value_on_cancel.rk +19 -0
- package/template/base/modules/stock/flows/adjustment_value_on_submit.rk +17 -0
- package/template/base/modules/stock/models/recipe.rk +8 -0
- package/template/base/modules/stock/models/stock_adjustment.rk +1 -0
- package/template/base/modules/stock/models/stock_adjustment_value.rk +80 -0
- package/template/base/modules/stock/models/stock_balance.rk +6 -2
- package/template/base/modules/stock/models/stock_count.rk +2 -0
- package/template/base/modules/stock/models/stock_move.rk +17 -5
- package/template/base/modules/stock/models/stock_transfer_item.rk +1 -1
- package/template/base/modules/stock/module.rk +7 -2
- package/template/base/modules/subscriptions/flows/collector_deposit_on_submit.rk +57 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_kept.rk +17 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_not_cancelled.rk +14 -0
- package/template/base/modules/subscriptions/flows/deposit_payment_not_deleted.rk +14 -0
- package/template/base/modules/subscriptions/flows/field_collection_cap_created.rk +24 -0
- package/template/base/modules/subscriptions/flows/field_collection_cap_updated.rk +24 -0
- package/template/base/modules/subscriptions/flows/field_collection_locked.rk +12 -0
- package/template/base/modules/subscriptions/flows/field_collection_not_deleted.rk +10 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_kept.rk +19 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_once.rk +34 -0
- package/template/base/modules/subscriptions/flows/invoice_subscription_tag_lock.rk +13 -0
- package/template/base/modules/subscriptions/flows/service_area_collector.rk +14 -0
- package/template/base/modules/subscriptions/flows/subscription_billing.rk +79 -0
- package/template/base/modules/subscriptions/flows/subscription_dunning.rk +81 -0
- package/template/base/modules/subscriptions/flows/subscription_extra_locked.rk +14 -0
- package/template/base/modules/subscriptions/flows/subscription_status_on_payment.rk +48 -0
- package/template/base/modules/subscriptions/models/collection_visit.rk +47 -0
- package/template/base/modules/subscriptions/models/collector_deposit.rk +36 -0
- package/template/base/modules/subscriptions/models/field_collection.rk +42 -0
- package/template/base/modules/subscriptions/models/service_area.rk +19 -0
- package/template/base/modules/subscriptions/models/subscription.rk +235 -0
- package/template/base/modules/subscriptions/models/subscription_bill.rk +48 -0
- package/template/base/modules/subscriptions/models/subscription_extra.rk +50 -0
- package/template/base/modules/subscriptions/models/subscription_guard.rk +65 -0
- package/template/base/modules/subscriptions/models/subscription_month.rk +29 -0
- package/template/base/modules/subscriptions/models/subscription_plan.rk +75 -0
- package/template/base/modules/subscriptions/models/subscription_status_log.rk +27 -0
- package/template/base/modules/subscriptions/module.rk +18 -0
- package/template/base/modules/subscriptions/roles/collector.rk +7 -0
- package/template/base/modules/subscriptions/screens/catat_tagih.rk +18 -0
- package/template/base/modules/subscriptions/screens/rute_tagih.rk +25 -0
- package/template/base/modules/tax_id/module.rk +5 -0
- package/template/base/modules/users/models/user.rk +35 -4
- package/template/base/modules/users/models/user_outlet.rk +6 -0
- package/template/base/modules/users/module.rk +8 -2
- package/template/base/modules/users/roles/cashier.rk +8 -0
- package/template/base/modules/users/roles/course_admin.rk +4 -0
- package/template/base/modules/users/roles/field_sales.rk +7 -0
- package/template/base/modules/workforce/imports/worker_list.rk +21 -0
- package/template/base/modules/workforce/models/certification.rk +1 -2
- package/template/base/modules/workforce/models/worker.rk +54 -4
- package/template/base/modules/workforce/module.rk +6 -1
- package/template/demo/fixtures/demo.rk +2 -2
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""A local stand-in for the DOKU Non-SNAP Checkout API, for demos and tests without a DOKU account.
|
|
3
|
+
|
|
4
|
+
DOKU_MOCK_SECRET_KEY=SK-test-dummy-demo python3 doku/mock/doku_mock.py --port 8901 --client-id BRN-0001-CONTOH \
|
|
5
|
+
--notify-url http://127.0.0.1:8080/hooks/<org>/doku/payment_notified
|
|
6
|
+
|
|
7
|
+
Dummy keys only. The mock signs any notification it is asked for (/simulate/*), without authentication: it is a
|
|
8
|
+
signing oracle for its key. So it listens on 127.0.0.1 only, reads the key from DOKU_MOCK_SECRET_KEY (not argv, which
|
|
9
|
+
`ps` shows), and refuses a key that does not say it is a dummy (a part "dummy" or "test" between - _ or .). Never give it a
|
|
10
|
+
key from DOKU Back Office, sandbox or production.
|
|
11
|
+
|
|
12
|
+
Stdlib only. What it does, in DOKU's formats (rangka connector doku, research in Juragan's
|
|
13
|
+
reports/keputusan-riset/doku-connector.md):
|
|
14
|
+
|
|
15
|
+
- POST /checkout/v1/payment checks Client-Id and the signature (HMACSHA256= + base64 HMAC-SHA256 over Client-Id,
|
|
16
|
+
Request-Id, Request-Timestamp, Request-Target and Digest lines), answers like DOKU Checkout (response.payment.url,
|
|
17
|
+
token_id, expired_date). A bad signature is 401 {"error": {"code": "invalid_signature"}}.
|
|
18
|
+
- GET /checkout-link-v2/<token> a small page standing in for DOKU's payment page (QRIS text and a pay button).
|
|
19
|
+
- POST /simulate/pay/<token>[?status=FAILED] marks the payment and sends the signed HTTP notification to
|
|
20
|
+
--notify-url, the way DOKU's sandbox simulator does; answers with the notification's status code.
|
|
21
|
+
- POST /simulate/refund/<token>[?amount=N] a paid payment refunded (all, or N): a notification of transaction.type
|
|
22
|
+
REFUND, status SUCCESS, same original_request_id, as DOKU sends after a refund from Back Office. Not money in.
|
|
23
|
+
- POST /simulate/notify body {"invoice_number", "amount", "status", "type"}: a notification for an invoice without
|
|
24
|
+
Checkout (a static QRIS paid at the counter); type SALE by default, REFUND for a refund.
|
|
25
|
+
- GET /calls every request it received (for tests).
|
|
26
|
+
|
|
27
|
+
The kernel only sends signed requests over https to api-sandbox.doku.com or api.doku.com (rangka-os contract 0017
|
|
28
|
+
§5), so a local kernel never calls this mock: the mock is the payer's side. Its Checkout endpoint is what a test calls
|
|
29
|
+
with requests signed the same way, and sign_lines() below is the reference used to check the kernel's signatures.
|
|
30
|
+
"""
|
|
31
|
+
from __future__ import annotations
|
|
32
|
+
|
|
33
|
+
import argparse
|
|
34
|
+
import base64
|
|
35
|
+
import html
|
|
36
|
+
import os
|
|
37
|
+
import re
|
|
38
|
+
import hashlib
|
|
39
|
+
import hmac
|
|
40
|
+
import json
|
|
41
|
+
import sys
|
|
42
|
+
import threading
|
|
43
|
+
import urllib.error
|
|
44
|
+
import urllib.parse
|
|
45
|
+
import urllib.request
|
|
46
|
+
import uuid
|
|
47
|
+
from datetime import datetime, timedelta, timezone
|
|
48
|
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def digest(body: bytes) -> str:
|
|
52
|
+
return base64.b64encode(hashlib.sha256(body).digest()).decode()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sign_lines(secret: str, client_id: str, request_id: str, timestamp: str, target: str, body: bytes | None) -> str:
|
|
56
|
+
"""DOKU Non-SNAP signature: HMACSHA256= + base64(HMAC-SHA256(secret, lines)); no Digest line without a body."""
|
|
57
|
+
lines = [f"Client-Id:{client_id}", f"Request-Id:{request_id}", f"Request-Timestamp:{timestamp}", f"Request-Target:{target}"]
|
|
58
|
+
if body:
|
|
59
|
+
lines.append(f"Digest:{digest(body)}")
|
|
60
|
+
mac = hmac.new(secret.encode(), "\n".join(lines).encode(), hashlib.sha256).digest()
|
|
61
|
+
return "HMACSHA256=" + base64.b64encode(mac).decode()
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def now_utc() -> str:
|
|
65
|
+
return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class State:
|
|
69
|
+
"""The mock's memory. secret is a dummy key: whoever reaches the mock can have anything signed with it."""
|
|
70
|
+
|
|
71
|
+
def __init__(self, client_id, secret, notify_url):
|
|
72
|
+
self.client_id, self.secret, self.notify_url = client_id, secret, notify_url
|
|
73
|
+
self.payments = {} # token -> {invoice_number, amount, request_id, status}
|
|
74
|
+
self.calls = []
|
|
75
|
+
self.lock = threading.Lock()
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def notify(state: State, invoice: str, amount: int, status: str, original_request_id: str, channel="QRIS", type_="SALE") -> int:
|
|
79
|
+
"""Send one signed notification to the notify URL, as DOKU does; returns the HTTP status (0 when unreachable)."""
|
|
80
|
+
body = json.dumps({
|
|
81
|
+
"order": {"invoice_number": invoice, "amount": amount},
|
|
82
|
+
"transaction": {"type": type_, "status": status, "date": now_utc(), "original_request_id": original_request_id},
|
|
83
|
+
"service": {"id": "QRIS" if channel == "QRIS" else "VIRTUAL_ACCOUNT"}, "acquirer": {"id": "QRIS"},
|
|
84
|
+
"channel": {"id": channel}, "additional_info": {"origin": {"product": "CHECKOUT", "source": "doku-mock"}},
|
|
85
|
+
}, separators=(",", ":")).encode()
|
|
86
|
+
req_id, ts = str(uuid.uuid4()), now_utc()
|
|
87
|
+
target = urllib.parse.urlparse(state.notify_url).path
|
|
88
|
+
req = urllib.request.Request(state.notify_url, data=body, method="POST", headers={
|
|
89
|
+
"Content-Type": "application/json", "Client-Id": state.client_id, "Request-Id": req_id, "Request-Timestamp": ts,
|
|
90
|
+
"Signature": sign_lines(state.secret, state.client_id, req_id, ts, target, body)})
|
|
91
|
+
try:
|
|
92
|
+
with urllib.request.urlopen(req, timeout=10) as r:
|
|
93
|
+
return r.status
|
|
94
|
+
except urllib.error.HTTPError as e:
|
|
95
|
+
return e.code
|
|
96
|
+
except OSError:
|
|
97
|
+
return 0
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def handler(state: State):
|
|
101
|
+
class H(BaseHTTPRequestHandler):
|
|
102
|
+
def log_message(self, *a):
|
|
103
|
+
pass
|
|
104
|
+
|
|
105
|
+
def send(self, code, obj, ctype="application/json"):
|
|
106
|
+
raw = obj.encode() if isinstance(obj, str) else json.dumps(obj).encode()
|
|
107
|
+
self.send_response(code)
|
|
108
|
+
self.send_header("Content-Type", ctype)
|
|
109
|
+
self.send_header("Content-Length", str(len(raw)))
|
|
110
|
+
self.end_headers()
|
|
111
|
+
self.wfile.write(raw)
|
|
112
|
+
|
|
113
|
+
def body(self) -> bytes:
|
|
114
|
+
n = int(self.headers.get("Content-Length") or 0)
|
|
115
|
+
return self.rfile.read(n) if n else b""
|
|
116
|
+
|
|
117
|
+
def do_GET(self):
|
|
118
|
+
path = urllib.parse.urlparse(self.path).path
|
|
119
|
+
if path == "/calls":
|
|
120
|
+
with state.lock:
|
|
121
|
+
return self.send(200, state.calls)
|
|
122
|
+
if path.startswith("/checkout-link-v2/"):
|
|
123
|
+
tok = path.rsplit("/", 1)[-1]
|
|
124
|
+
p = state.payments.get(tok)
|
|
125
|
+
if not p:
|
|
126
|
+
return self.send(404, {"error": {"code": "not_found"}})
|
|
127
|
+
return self.send(200, f"<!doctype html><meta charset=utf-8><title>DOKU (mock)</title>"
|
|
128
|
+
f"<h1>Bayar {html.escape(str(p['invoice_number']))}</h1><p>QRIS Rp {p['amount']:,}</p>"
|
|
129
|
+
f"<form method=post action=/simulate/pay/{urllib.parse.quote(tok)}><button>Simulasi bayar</button></form>",
|
|
130
|
+
"text/html; charset=utf-8")
|
|
131
|
+
self.send(404, {"error": {"code": "not_found"}})
|
|
132
|
+
|
|
133
|
+
def do_POST(self):
|
|
134
|
+
u = urllib.parse.urlparse(self.path)
|
|
135
|
+
raw = self.body()
|
|
136
|
+
with state.lock:
|
|
137
|
+
state.calls.append({"method": "POST", "path": u.path, "headers": {k: v for k, v in self.headers.items()},
|
|
138
|
+
"body": raw.decode(errors="replace")})
|
|
139
|
+
if u.path == "/checkout/v1/payment":
|
|
140
|
+
h = self.headers
|
|
141
|
+
want = sign_lines(state.secret, state.client_id, h.get("Request-Id", ""), h.get("Request-Timestamp", ""), u.path, raw)
|
|
142
|
+
if h.get("Client-Id") != state.client_id or not hmac.compare_digest(h.get("Signature", ""), want):
|
|
143
|
+
return self.send(401, {"error": {"code": "invalid_signature", "message": "Invalid Header Signature"}})
|
|
144
|
+
try:
|
|
145
|
+
req = json.loads(raw)
|
|
146
|
+
order, pay = req["order"], req.get("payment", {})
|
|
147
|
+
amount = int(float(order["amount"]))
|
|
148
|
+
invoice = str(order["invoice_number"])
|
|
149
|
+
except (ValueError, KeyError, TypeError):
|
|
150
|
+
return self.send(400, {"error": {"code": "invalid_request"}})
|
|
151
|
+
tok = "tok-" + uuid.uuid4().hex[:12]
|
|
152
|
+
due = int(pay.get("payment_due_date") or 60)
|
|
153
|
+
with state.lock:
|
|
154
|
+
state.payments[tok] = {"invoice_number": invoice, "amount": amount, "request_id": h.get("Request-Id"), "status": "PENDING"}
|
|
155
|
+
host = self.headers.get("Host", "127.0.0.1")
|
|
156
|
+
expires = (datetime.now(timezone(timedelta(hours=7))) + timedelta(minutes=due)).strftime("%Y%m%d%H%M%S")
|
|
157
|
+
return self.send(200, {"message": ["SUCCESS"], "response": {
|
|
158
|
+
"order": {"amount": str(amount), "invoice_number": invoice, "currency": "IDR", "session_id": "sess-" + tok},
|
|
159
|
+
"payment": {"payment_method_types": pay.get("payment_method_types") or ["QRIS"], "payment_due_date": due,
|
|
160
|
+
"token_id": tok, "url": f"http://{host}/checkout-link-v2/{tok}", "expired_date": expires},
|
|
161
|
+
"headers": {"request_id": h.get("Request-Id")}}})
|
|
162
|
+
if u.path.startswith("/simulate/pay/"):
|
|
163
|
+
tok = u.path.rsplit("/", 1)[-1]
|
|
164
|
+
p = state.payments.get(tok)
|
|
165
|
+
if not p:
|
|
166
|
+
return self.send(404, {"error": {"code": "not_found"}})
|
|
167
|
+
status = urllib.parse.parse_qs(u.query).get("status", ["SUCCESS"])[0]
|
|
168
|
+
p["status"] = status
|
|
169
|
+
code = notify(state, p["invoice_number"], p["amount"], status, p["request_id"])
|
|
170
|
+
return self.send(200, {"notified": code, "status": status})
|
|
171
|
+
if u.path.startswith("/simulate/refund/"):
|
|
172
|
+
tok = u.path.rsplit("/", 1)[-1]
|
|
173
|
+
p = state.payments.get(tok)
|
|
174
|
+
if not p or p["status"] != "SUCCESS":
|
|
175
|
+
return self.send(404, {"error": {"code": "not_paid"}})
|
|
176
|
+
amount = int(urllib.parse.parse_qs(u.query).get("amount", [str(p["amount"])])[0])
|
|
177
|
+
code = notify(state, p["invoice_number"], amount, "SUCCESS", p["request_id"], type_="REFUND")
|
|
178
|
+
return self.send(200, {"notified": code, "type": "REFUND", "amount": amount})
|
|
179
|
+
if u.path == "/simulate/notify":
|
|
180
|
+
try:
|
|
181
|
+
req = json.loads(raw or b"{}")
|
|
182
|
+
code = notify(state, str(req["invoice_number"]), int(req["amount"]), req.get("status", "SUCCESS"),
|
|
183
|
+
req.get("original_request_id") or str(uuid.uuid4()), req.get("channel", "QRIS"),
|
|
184
|
+
req.get("type", "SALE"))
|
|
185
|
+
except (ValueError, KeyError, TypeError):
|
|
186
|
+
return self.send(400, {"error": {"code": "invalid_request"}})
|
|
187
|
+
return self.send(200, {"notified": code})
|
|
188
|
+
self.send(404, {"error": {"code": "not_found"}})
|
|
189
|
+
return H
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def dummy_key(secret: str) -> bool:
|
|
193
|
+
"""True for a key that says it is a dummy: the mock signs whatever it is asked, so a real key must never reach it."""
|
|
194
|
+
return bool(re.search(r"(^|[-_.])(dummy|test)([-_.]|$)", secret, re.IGNORECASE))
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def main(argv=None):
|
|
198
|
+
ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
199
|
+
ap.add_argument("--port", type=int, default=8901)
|
|
200
|
+
ap.add_argument("--client-id", required=True)
|
|
201
|
+
ap.add_argument("--secret-key", help="deprecated (visible in ps): set DOKU_MOCK_SECRET_KEY instead")
|
|
202
|
+
ap.add_argument("--notify-url", required=True, help="the kernel hook: http://<kernel>/hooks/<org>/doku/payment_notified")
|
|
203
|
+
a = ap.parse_args(argv)
|
|
204
|
+
secret = os.environ.get("DOKU_MOCK_SECRET_KEY") or a.secret_key or ""
|
|
205
|
+
if not dummy_key(secret):
|
|
206
|
+
ap.error("set DOKU_MOCK_SECRET_KEY to a dummy key (a part dummy or test, e.g. SK-test-dummy-demo); never a real DOKU key")
|
|
207
|
+
srv = ThreadingHTTPServer(("127.0.0.1", a.port), handler(State(a.client_id, secret, a.notify_url)))
|
|
208
|
+
print(f"doku mock on http://127.0.0.1:{srv.server_address[1]} (notifications to {a.notify_url})", flush=True)
|
|
209
|
+
try:
|
|
210
|
+
srv.serve_forever()
|
|
211
|
+
except KeyboardInterrupt:
|
|
212
|
+
pass
|
|
213
|
+
return 0
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
if __name__ == "__main__":
|
|
217
|
+
sys.exit(main())
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/connector.json
|
|
2
|
+
# Loyverse POS (free POS used by many small shops): receipts, stores, items and stock levels through the public
|
|
3
|
+
# Loyverse API v1.0 with a personal access token (Back Office > Settings > Access tokens).
|
|
4
|
+
# Status: spec, no flow calls it yet. The kernel does not run connectors (contract 0002); until it does, rangka-apps imports the
|
|
5
|
+
# "Receipts by item" export file (modules/outlet_sales/imports/loyverse_receipts). Field names follow Loyverse's
|
|
6
|
+
# public API reference and have not been checked against a live account yet.
|
|
7
|
+
# A refund is its own receipt with receipt_type REFUND; flows turn its lines into negative outlet_sales lines.
|
|
8
|
+
name: loyverse
|
|
9
|
+
label: {id: Loyverse POS}
|
|
10
|
+
summary:
|
|
11
|
+
id: Ambil struk, toko, barang dan stok dari kasir Loyverse.
|
|
12
|
+
en: Pull receipts, stores, items and stock from Loyverse POS.
|
|
13
|
+
category: sales
|
|
14
|
+
icon: store-2-line
|
|
15
|
+
version: 0.1.0
|
|
16
|
+
vendor: Loyverse
|
|
17
|
+
docs: https://developer.loyverse.com/docs/
|
|
18
|
+
auth:
|
|
19
|
+
type: token
|
|
20
|
+
fields:
|
|
21
|
+
- name: access_token
|
|
22
|
+
label: {id: Access token}
|
|
23
|
+
secret: true
|
|
24
|
+
help: {id: 'Back Office Loyverse > Pengaturan > Token akses'}
|
|
25
|
+
triggers:
|
|
26
|
+
# Loyverse posts {merchant_id, type, created_at, receipts: [...]} to the URL registered with create_webhook.
|
|
27
|
+
- name: receipt_updated
|
|
28
|
+
label: {id: Struk baru atau berubah}
|
|
29
|
+
via: webhook
|
|
30
|
+
for_each: receipts[]
|
|
31
|
+
emit:
|
|
32
|
+
receipt_number: item.receipt_number
|
|
33
|
+
receipt_type: item.receipt_type
|
|
34
|
+
receipt_date: item.receipt_date
|
|
35
|
+
store_id: item.store_id
|
|
36
|
+
total_money: item.total_money
|
|
37
|
+
total_discount: item.total_discount
|
|
38
|
+
line_items: item.line_items
|
|
39
|
+
payments: item.payments
|
|
40
|
+
- name: inventory_level_updated
|
|
41
|
+
label: {id: Stok berubah di Loyverse}
|
|
42
|
+
via: webhook
|
|
43
|
+
for_each: inventory_levels[]
|
|
44
|
+
emit:
|
|
45
|
+
variant_id: item.variant_id
|
|
46
|
+
store_id: item.store_id
|
|
47
|
+
in_stock: item.in_stock
|
|
48
|
+
updated_at: item.updated_at
|
|
49
|
+
actions:
|
|
50
|
+
# A scheduled flow pulls one day per store: GET /receipts?store_id=&created_at_min=&created_at_max=&limit=250,
|
|
51
|
+
# following `cursor` while the answer has one.
|
|
52
|
+
- name: list_receipts
|
|
53
|
+
label: {id: Ambil struk}
|
|
54
|
+
request:
|
|
55
|
+
method: GET
|
|
56
|
+
url: https://api.loyverse.com/v1.0/receipts
|
|
57
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
58
|
+
query: {store_id: '{input.store_id}', created_at_min: '{input.since}', created_at_max: '{input.until}', limit: '250', cursor: '{input.cursor}'}
|
|
59
|
+
input:
|
|
60
|
+
- {name: store_id, type: data, required: true}
|
|
61
|
+
- {name: since, type: datetime, required: true}
|
|
62
|
+
- {name: until, type: datetime, required: true}
|
|
63
|
+
- {name: cursor, type: data}
|
|
64
|
+
output: {receipts: receipts, cursor: cursor}
|
|
65
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
66
|
+
- name: list_stores
|
|
67
|
+
label: {id: Daftar toko}
|
|
68
|
+
request:
|
|
69
|
+
method: GET
|
|
70
|
+
url: https://api.loyverse.com/v1.0/stores
|
|
71
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
72
|
+
output: {stores: stores}
|
|
73
|
+
retry: {max: 3, backoff: exponential, on: [429, 500, 502, 503]}
|
|
74
|
+
- name: list_items
|
|
75
|
+
label: {id: Daftar barang}
|
|
76
|
+
request:
|
|
77
|
+
method: GET
|
|
78
|
+
url: https://api.loyverse.com/v1.0/items
|
|
79
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
80
|
+
query: {limit: '250', cursor: '{input.cursor}'}
|
|
81
|
+
input:
|
|
82
|
+
- {name: cursor, type: data}
|
|
83
|
+
output: {items: items, cursor: cursor}
|
|
84
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
85
|
+
- name: create_webhook
|
|
86
|
+
label: {id: Daftarkan webhook}
|
|
87
|
+
request:
|
|
88
|
+
method: POST
|
|
89
|
+
url: https://api.loyverse.com/v1.0/webhooks
|
|
90
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
91
|
+
body: {url: '{input.url}', type: '{input.type}', status: ENABLED}
|
|
92
|
+
input:
|
|
93
|
+
- {name: url, type: data, required: true}
|
|
94
|
+
- {name: type, type: data, required: true, help: {id: 'receipts.update atau inventory_levels.update'}}
|
|
95
|
+
idempotency: input.type
|
|
96
|
+
limits:
|
|
97
|
+
rate: 300 requests/min per token
|
|
98
|
+
note: {id: 'API Loyverse gratis; webhook dan token dibuat dari Back Office pemilik toko'}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://rangka-os.github.io/rangka-os/schema/0.5/connector.json
|
|
2
|
+
# Moka POS (GoTo): transactions, refunds, outlets and items through the Moka Connect API with OAuth 2.0
|
|
3
|
+
# (authorization code; the owner approves Juragan in Moka Backoffice).
|
|
4
|
+
# Status: spec. API access needs Moka's approval of the integration (developer application at Moka); the paths
|
|
5
|
+
# below follow Moka's published API reference and must be confirmed once access is granted. Until then, rangka-apps
|
|
6
|
+
# imports the Item Details export (modules/outlet_sales/imports/moka_item_details), whose headers were checked against
|
|
7
|
+
# real exports.
|
|
8
|
+
# fixtures/ are synthetic (no merchant data): two outlets of the demo F&B shop. The checkouts fields (sku, quantity,
|
|
9
|
+
# total_price, discount_amount, refunded_quantity) follow the API reference as read before access; rangka-apps flow
|
|
10
|
+
# moka_transaction_staged reads them, so a rename after access changes the flow and these fixtures together.
|
|
11
|
+
name: moka
|
|
12
|
+
label: {id: Moka POS}
|
|
13
|
+
summary:
|
|
14
|
+
id: Ambil transaksi, refund, outlet dan barang dari kasir Moka.
|
|
15
|
+
en: Pull transactions, refunds, outlets and items from Moka POS.
|
|
16
|
+
category: sales
|
|
17
|
+
icon: store-2-line
|
|
18
|
+
version: 0.1.0
|
|
19
|
+
vendor: Moka (GoTo)
|
|
20
|
+
docs: https://api.mokapos.com/docs
|
|
21
|
+
auth:
|
|
22
|
+
type: oauth2
|
|
23
|
+
fields:
|
|
24
|
+
- name: client_id
|
|
25
|
+
label: {id: Client ID}
|
|
26
|
+
- name: client_secret
|
|
27
|
+
label: {id: Client secret}
|
|
28
|
+
secret: true
|
|
29
|
+
- name: access_token
|
|
30
|
+
label: {id: Access token}
|
|
31
|
+
secret: true
|
|
32
|
+
help: {id: Diisi setelah pemilik menyetujui Juragan di Moka Backoffice}
|
|
33
|
+
- name: refresh_token
|
|
34
|
+
label: {id: Refresh token}
|
|
35
|
+
secret: true
|
|
36
|
+
triggers:
|
|
37
|
+
# Moka has no webhook for sales: the kernel polls get_latest_transactions per outlet every 5 minutes (contract 0002
|
|
38
|
+
# §A.1, each:). list_outlets runs first. Moka's public API spec (api.mokapos.com/docs, swagger "MOKA API" 0.2,
|
|
39
|
+
# 6 Mar 2026): since/until are epoch seconds, results come newest first unless reorder_type is ASC, there is no page
|
|
40
|
+
# parameter (the answer's next_url is the next page), time_filter picks created_at, updated_at or synchronized_at.
|
|
41
|
+
# In its example a refund made after the sale shows in payment_refunds and in the checkout's refunded_quantity while
|
|
42
|
+
# updated_at stays the sale's time; synchronized_at is when Moka's server got the transaction (late for offline mode).
|
|
43
|
+
# So every poll reads the whole window again: the transactions Moka's server received (synchronized_at) since two
|
|
44
|
+
# days back, newest first, with no cursor.
|
|
45
|
+
# - A transaction that did not change emits the same event, which the kernel drops (the event key is the hash of
|
|
46
|
+
# what is emitted, kept 30 days); a refunded one emits a new event (payment_refunds, refunded_quantity), and flow
|
|
47
|
+
# moka_transaction_staged (rangka-apps) books only the quantity refunded since, per checkout uuid.
|
|
48
|
+
# - A sale synced late from offline mode comes in with its sync time, inside the window.
|
|
49
|
+
# - Pages: next: next makes the kernel follow Moka's next_url (on api.mokapos.com only) until it is null (rangka-os
|
|
50
|
+
# contract 0002, refinement 11 Nov 2026; at most 50 pages of 100 per outlet and poll), so the whole window is read
|
|
51
|
+
# and nothing in it is lost. A refund made more than two days after the sale is outside the window (head office
|
|
52
|
+
# books it, or the export). An outlet moves from the export file to the API on the day head office sets its
|
|
53
|
+
# moka_api_from (rangka-apps outlet; until then its API transactions are kept without lines).
|
|
54
|
+
# To confirm once Moka grants API access: synchronized_at for offline sales, the largest per_page, the offset of
|
|
55
|
+
# created_at (flows take the day from its first 10 characters, a Z time as WIB).
|
|
56
|
+
- name: transaction_created
|
|
57
|
+
label: {id: Transaksi baru atau berubah}
|
|
58
|
+
via: poll
|
|
59
|
+
every: 5m
|
|
60
|
+
action: latest_transactions
|
|
61
|
+
each: {action: list_outlets, items: outlets, as: outlet, key: outlet.id}
|
|
62
|
+
input:
|
|
63
|
+
outlet_id: outlet.id
|
|
64
|
+
since: "(days_between('1970-01-01', today()) - 2) * 86400"
|
|
65
|
+
time_filter: "'synchronized_at'"
|
|
66
|
+
reorder_type: "'DESC'"
|
|
67
|
+
next: next
|
|
68
|
+
for_each: payments[]
|
|
69
|
+
emit:
|
|
70
|
+
transaction_id: item.id
|
|
71
|
+
outlet_id: item.outlet_id
|
|
72
|
+
outlet_name: outlet.name
|
|
73
|
+
receipt_no: item.payment_no
|
|
74
|
+
created_at: item.created_at
|
|
75
|
+
synchronized_at: item.synchronized_at
|
|
76
|
+
is_refunded: item.is_refunded
|
|
77
|
+
refunded_date: item.refunded_date
|
|
78
|
+
# Moka's refunds of this sale (each with its own created_at and refund_amount); the checkouts carry
|
|
79
|
+
# refunded_quantity and a uuid per line
|
|
80
|
+
payment_refunds: item.payment_refunds
|
|
81
|
+
checkouts: item.checkouts
|
|
82
|
+
payment_type: item.payment_type
|
|
83
|
+
total_collected: item.total_collected
|
|
84
|
+
actions:
|
|
85
|
+
- name: latest_transactions
|
|
86
|
+
label: {id: Ambil transaksi terbaru}
|
|
87
|
+
request:
|
|
88
|
+
method: GET
|
|
89
|
+
url: https://api.mokapos.com/v3/outlets/{input.outlet_id}/reports/get_latest_transactions
|
|
90
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
91
|
+
query: {since: '{input.since}', time_filter: '{input.time_filter}', reorder_type: '{input.reorder_type}', per_page: '100'}
|
|
92
|
+
input:
|
|
93
|
+
- {name: outlet_id, type: data, required: true}
|
|
94
|
+
- {name: since, type: int, required: true, help: {id: 'Detik epoch (UTC)'}}
|
|
95
|
+
- {name: time_filter, type: data, default: "'synchronized_at'", help: {id: 'created_at, updated_at atau synchronized_at'}}
|
|
96
|
+
- {name: reorder_type, type: data, default: "'DESC'", help: {id: 'DESC (terbaru dulu) atau ASC'}}
|
|
97
|
+
output: {payments: data.payments, next: data.next_url}
|
|
98
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
99
|
+
- name: list_outlets
|
|
100
|
+
label: {id: Daftar outlet}
|
|
101
|
+
request:
|
|
102
|
+
method: GET
|
|
103
|
+
url: https://api.mokapos.com/v1/businesses/outlets
|
|
104
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
105
|
+
output: {outlets: data}
|
|
106
|
+
retry: {max: 3, backoff: exponential, on: [429, 500, 502, 503]}
|
|
107
|
+
- name: list_items
|
|
108
|
+
label: {id: Daftar barang}
|
|
109
|
+
request:
|
|
110
|
+
method: GET
|
|
111
|
+
url: https://api.mokapos.com/v1/outlets/{input.outlet_id}/items
|
|
112
|
+
headers: {Authorization: 'Bearer {auth.access_token}'}
|
|
113
|
+
query: {per_page: '100', page: '{input.page}'}
|
|
114
|
+
input:
|
|
115
|
+
- {name: outlet_id, type: data, required: true}
|
|
116
|
+
- {name: page, type: int}
|
|
117
|
+
output: {items: data.items}
|
|
118
|
+
retry: {max: 5, backoff: exponential, on: [429, 500, 502, 503]}
|
|
119
|
+
limits:
|
|
120
|
+
rate: per Moka partner agreement
|
|
121
|
+
note: {id: 'Akses API Moka lewat persetujuan integrasi dari Moka; ekspor file tetap jalan tanpa akses API'}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"transaction_created.json": {
|
|
3
|
+
"transaction_id": "4a3f6c1e-0b6d-4c1a-9a2e-91000001aaaa",
|
|
4
|
+
"outlet_id": 70002,
|
|
5
|
+
"outlet_name": "Tahu Contoh - Braga",
|
|
6
|
+
"receipt_no": "BRG-000101",
|
|
7
|
+
"created_at": "2026-11-10T11:42:10+07:00",
|
|
8
|
+
"is_refunded": false,
|
|
9
|
+
"total_collected": 63000,
|
|
10
|
+
"refunded_date": null,
|
|
11
|
+
"synchronized_at": "2026-11-10T11:42:10+07:00"
|
|
12
|
+
},
|
|
13
|
+
"transaction_created_refund.json": {
|
|
14
|
+
"transaction_id": "4a3f6c1e-0b6d-4c1a-9a2e-91000002bbbb",
|
|
15
|
+
"is_refunded": true,
|
|
16
|
+
"payment_type": "qris"
|
|
17
|
+
},
|
|
18
|
+
"list_outlets.json": {
|
|
19
|
+
"outlets": [
|
|
20
|
+
{
|
|
21
|
+
"id": 70001,
|
|
22
|
+
"name": "Tahu Contoh - Dago",
|
|
23
|
+
"address": "Jl. Contoh Dago No. 1",
|
|
24
|
+
"city": "Bandung"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": 70002,
|
|
28
|
+
"name": "Tahu Contoh - Braga",
|
|
29
|
+
"address": "Jl. Contoh Braga No. 2",
|
|
30
|
+
"city": "Bandung"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"latest_transactions.json": {
|
|
35
|
+
"next": null
|
|
36
|
+
},
|
|
37
|
+
"transaction_created_refund_later.json": {
|
|
38
|
+
"transaction_id": "4a3f6c1e-0b6d-4c1a-9a2e-91000001aaaa",
|
|
39
|
+
"is_refunded": true,
|
|
40
|
+
"refunded_date": "2026-11-11T09:15:30+07:00",
|
|
41
|
+
"created_at": "2026-11-10T11:42:10+07:00",
|
|
42
|
+
"synchronized_at": "2026-11-11T09:15:30+07:00"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"data": {
|
|
3
|
+
"completed": true,
|
|
4
|
+
"next_url": null,
|
|
5
|
+
"payments": [
|
|
6
|
+
{
|
|
7
|
+
"id": "4a3f6c1e-0b6d-4c1a-9a2e-91000002bbbb",
|
|
8
|
+
"payment_no": "BRG-000102",
|
|
9
|
+
"outlet_id": 70002,
|
|
10
|
+
"created_at": "2026-11-10T19:05:44+07:00",
|
|
11
|
+
"payment_type": "qris",
|
|
12
|
+
"is_refunded": true,
|
|
13
|
+
"refunded_date": "2026-11-10T19:07:02+07:00",
|
|
14
|
+
"total_collected": 15000,
|
|
15
|
+
"checkouts": [
|
|
16
|
+
{
|
|
17
|
+
"item_id": 501,
|
|
18
|
+
"item_name": "Tahu goreng original",
|
|
19
|
+
"item_variant_name": "",
|
|
20
|
+
"sku": "TH-ORI",
|
|
21
|
+
"quantity": 1,
|
|
22
|
+
"item_price": 15000,
|
|
23
|
+
"total_price": 15000,
|
|
24
|
+
"discount_amount": 0,
|
|
25
|
+
"refunded_quantity": 1,
|
|
26
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000003"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"synchronized_at": "2026-11-10T19:07:02+07:00",
|
|
30
|
+
"payment_refunds": [
|
|
31
|
+
{
|
|
32
|
+
"uuid": "a3f0e000-0000-4000-8000-000000000002",
|
|
33
|
+
"created_at": "2026-11-10T19:07:02+07:00",
|
|
34
|
+
"refund_amount": 15000,
|
|
35
|
+
"refund_type": "full"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "4a3f6c1e-0b6d-4c1a-9a2e-91000001aaaa",
|
|
41
|
+
"payment_no": "BRG-000101",
|
|
42
|
+
"outlet_id": 70002,
|
|
43
|
+
"created_at": "2026-11-10T11:42:10+07:00",
|
|
44
|
+
"payment_type": "cash",
|
|
45
|
+
"is_refunded": false,
|
|
46
|
+
"refunded_date": null,
|
|
47
|
+
"total_collected": 63000,
|
|
48
|
+
"checkouts": [
|
|
49
|
+
{
|
|
50
|
+
"item_id": 501,
|
|
51
|
+
"item_name": "Tahu goreng original",
|
|
52
|
+
"item_variant_name": "",
|
|
53
|
+
"sku": "TH-ORI",
|
|
54
|
+
"quantity": 2,
|
|
55
|
+
"item_price": 15000,
|
|
56
|
+
"total_price": 30000,
|
|
57
|
+
"discount_amount": 0,
|
|
58
|
+
"refunded_quantity": 0,
|
|
59
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000001"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"item_id": 502,
|
|
63
|
+
"item_name": "Tahu goreng pedas",
|
|
64
|
+
"item_variant_name": "",
|
|
65
|
+
"sku": "TH-PDS",
|
|
66
|
+
"quantity": 2,
|
|
67
|
+
"item_price": 18000,
|
|
68
|
+
"total_price": 36000,
|
|
69
|
+
"discount_amount": 3000,
|
|
70
|
+
"refunded_quantity": 0,
|
|
71
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000002"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"synchronized_at": "2026-11-10T11:42:10+07:00",
|
|
75
|
+
"payment_refunds": []
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"outlet": {
|
|
3
|
+
"id": 70002,
|
|
4
|
+
"name": "Tahu Contoh - Braga"
|
|
5
|
+
},
|
|
6
|
+
"item": {
|
|
7
|
+
"id": "4a3f6c1e-0b6d-4c1a-9a2e-91000001aaaa",
|
|
8
|
+
"payment_no": "BRG-000101",
|
|
9
|
+
"outlet_id": 70002,
|
|
10
|
+
"created_at": "2026-11-10T11:42:10+07:00",
|
|
11
|
+
"payment_type": "cash",
|
|
12
|
+
"is_refunded": false,
|
|
13
|
+
"refunded_date": null,
|
|
14
|
+
"total_collected": 63000,
|
|
15
|
+
"checkouts": [
|
|
16
|
+
{
|
|
17
|
+
"item_id": 501,
|
|
18
|
+
"item_name": "Tahu goreng original",
|
|
19
|
+
"item_variant_name": "",
|
|
20
|
+
"sku": "TH-ORI",
|
|
21
|
+
"quantity": 2,
|
|
22
|
+
"item_price": 15000,
|
|
23
|
+
"total_price": 30000,
|
|
24
|
+
"discount_amount": 0,
|
|
25
|
+
"refunded_quantity": 0,
|
|
26
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000001"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"item_id": 502,
|
|
30
|
+
"item_name": "Tahu goreng pedas",
|
|
31
|
+
"item_variant_name": "",
|
|
32
|
+
"sku": "TH-PDS",
|
|
33
|
+
"quantity": 2,
|
|
34
|
+
"item_price": 18000,
|
|
35
|
+
"total_price": 36000,
|
|
36
|
+
"discount_amount": 3000,
|
|
37
|
+
"refunded_quantity": 0,
|
|
38
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000002"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"synchronized_at": "2026-11-10T11:42:10+07:00",
|
|
42
|
+
"payment_refunds": []
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"outlet": {
|
|
3
|
+
"id": 70002,
|
|
4
|
+
"name": "Tahu Contoh - Braga"
|
|
5
|
+
},
|
|
6
|
+
"item": {
|
|
7
|
+
"id": "4a3f6c1e-0b6d-4c1a-9a2e-91000002bbbb",
|
|
8
|
+
"payment_no": "BRG-000102",
|
|
9
|
+
"outlet_id": 70002,
|
|
10
|
+
"created_at": "2026-11-10T19:05:44+07:00",
|
|
11
|
+
"payment_type": "qris",
|
|
12
|
+
"is_refunded": true,
|
|
13
|
+
"refunded_date": "2026-11-10T19:07:02+07:00",
|
|
14
|
+
"total_collected": 15000,
|
|
15
|
+
"checkouts": [
|
|
16
|
+
{
|
|
17
|
+
"item_id": 501,
|
|
18
|
+
"item_name": "Tahu goreng original",
|
|
19
|
+
"item_variant_name": "",
|
|
20
|
+
"sku": "TH-ORI",
|
|
21
|
+
"quantity": 1,
|
|
22
|
+
"item_price": 15000,
|
|
23
|
+
"total_price": 15000,
|
|
24
|
+
"discount_amount": 0,
|
|
25
|
+
"refunded_quantity": 1,
|
|
26
|
+
"uuid": "c0ffee00-0000-4000-8000-000066000003"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"synchronized_at": "2026-11-10T19:07:02+07:00",
|
|
30
|
+
"payment_refunds": [
|
|
31
|
+
{
|
|
32
|
+
"uuid": "a3f0e000-0000-4000-8000-000000000002",
|
|
33
|
+
"created_at": "2026-11-10T19:07:02+07:00",
|
|
34
|
+
"refund_amount": 15000,
|
|
35
|
+
"refund_type": "full"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|