Commit Graph
482 Commits
Author SHA1 Message Date
aefril 1edeaa0a48 Merge pull request 'fix(order): carry item weight through the contract-to-model transformer' (#30) from feature/weight-based-products into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/30
2026-09-06 17:46:07 +02:00
efrilmandClaude Opus 5 f2701882dc fix(order): carry item weight through the contract-to-model transformer
CreateOrderContractToModel and AddToOrderContractToModel copied every order
item field except Weight, so a weight sent by the client never reached the
processor and every weight-based line failed with "product ... is sold by
weight and requires a weight".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 22:44:55 +07:00
aefril c9311997a7 Merge pull request 'Feature/weight based products' (#29) from feature/weight-based-products into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/29
2026-09-06 17:13:51 +02:00
efrilmandClaude Opus 5 ebf666c004 feat(product): require a unit for weight-based products
A product sold by weight with no unit produces order lines with nothing to
print: the receipt would read "4,2" with no idea of what. Until now nothing
stopped that — the mistake only surfaced at the cashier.

Enforce it in two places, because neither alone sees the whole picture. On
create, the validator has everything it needs. On update, the request may
omit unit_id for a product that already has one, so the check runs in the
processor against the merged product: what is rejected is the end state, a
product sold by weight with no unit.

Also fixes two things this uncovered:

The struct tags on the product contracts are decorative — this validator is
hand-written and never calls validator.Struct — so `oneof=unit weight` was
never enforced, and an unknown sell_by was silently rewritten to "unit" by
the mapper. It is now rejected with a message that names the valid values.

The update validator's "at least one field" guard did not list unit_id,
sell_by or print_to_checker, so an update carrying only one of those was
turned away as an empty request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 17:29:34 +07:00
efrilmandClaude Opus 5 d3987c7114 docs(order): add weight-based product integration guide
Client-facing companion to the RFC, aimed at the POS Mobile and Backoffice
teams: endpoints and payloads for setting up a weight product, placing an
order, rendering the line, and voiding, refunding or splitting it.

Documents two gaps the teams have to work around rather than discover:
unit_id is not yet enforced when sell_by is "weight", so Backoffice must
require it in the form; and money rounds to 2 decimals rather than whole
rupiah, which is still an open decision.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 17:20:22 +07:00
efrilmandClaude Opus 5 992bb04816 feat(order): support weight-based products
Products like fish are sold per weighing (4.2 ons, 5.6 ons), which the
order line could not represent: quantity is INTEGER and prices are always
computed as quantity * unit_price.

Model one weighing as one order line. quantity stays INTEGER and keeps
meaning "how many items"; the measured amount goes into a new nullable
order_items.weight, and the line is priced weight * unit_price. Two
weighings of the same product are two lines, never merged into one.

Keeping quantity integral avoids float comparisons in void, refund and
split bill, where accumulated rounding error would silently misbehave —
"1.4 + 1.4 + 1.4" is not 4.2 in float64, which would leave a fully paid
split-bill item marked unpaid.

BillableQuantity() is now the single place that decides between weight
and count; every price and cost calculation goes through it. Missing one
would bill a 4.2 ons fish as a single ons — wrong money, no error.

Two database constraints back the design: a weighed line always carries a
positive weight, and its quantity is pinned to 1. The latter also makes
void all-or-nothing for weighed lines, so the row-splitting branch can
never produce a zero-weight remainder row.

Also wires product.unit_id through the API, which was previously not
settable at all, and corrects the misleading comment on the request's
unit_price field — that value has never been used; price always comes
from the database.

Design notes and the audit of every price multiplication site are in
docs/rfc-weight-based-products.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 17:14:42 +07:00
aefril 1e5573af75 Merge pull request 'feat: cash advance' (#28) from dev into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/28
2026-08-13 09:39:53 +02:00
Efril 2c6864147b feat: cash advance 2026-08-13 14:38:28 +07:00
aefril b42d141927 Merge pull request 'Dev' (#27) from dev into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/27
2026-08-11 17:46:43 +02:00
Efril e6078e3c0b feat(purchase 2026-08-11 22:41:10 +07:00
efrilm dbc143954c feat(purchase): unwired unit convertions 2026-08-11 21:24:24 +07:00
efrilm 0726fcecf0 feat(ingredients): make units nullable 2026-08-11 21:20:17 +07:00
efrilm 9ae5be2c33 feat(purchasae): added team with category parent and central 2026-08-11 21:00:39 +07:00
aefril a230199ce0 Merge pull request 'feat(products): sort by' (#26) from staging into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/26
2026-08-11 15:48:00 +02:00
Efril 4f7e774043 feat(products): sort by 2026-08-11 20:47:38 +07:00
aefril 793ef10ce8 Merge pull request 'feat(category): update list filter category' (#25) from staging into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/25
2026-08-11 15:42:49 +02:00
Efril a7c2d6cbb3 feat(category): update list filter category 2026-08-06 21:21:41 +07:00
aefril 1d412959d7 Merge pull request 'feat: profit sharing' (#24) from staging into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/24
2026-08-05 12:39:49 +00:00
Efril b9ac97178f feat: profit sharing 2026-08-05 19:28:38 +07:00
aefril 7b46da7007 Merge pull request 'staging' (#23) from staging into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/23
2026-07-09 15:43:23 +00:00
Efril 2b80c92caa feat: deployment 2026-07-09 22:43:01 +07:00
Efril f7dd0bd5e8 config: update port 2026-07-09 22:19:53 +07:00
Efril 1533914e4d config: prod and staging 2026-07-09 22:11:03 +07:00
Efril bfce4b865b update purchase date 2026-07-02 12:49:28 +07:00
Efril 581e4a5453 update purchase date 2026-07-02 12:23:12 +07:00
Efril 9b0fc9a63b feat: updat analytic profit loss add purchasing 2026-06-24 00:11:04 +07:00
Efril 793919cf10 feat: add outlet name at analytic response and new overview dashboard 2026-06-23 22:18:16 +07:00
aefril 25024c210a Merge pull request 'fix: product price' (#21) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/21
2026-06-22 06:34:02 +00:00
efrilm 3977370079 fix: product price 2026-06-22 13:33:25 +07:00
Efril 37bcb90ab0 feat: ensure all role 2026-06-19 13:58:36 +07:00
Efril e345aeee97 feat: new users role 2026-06-19 13:31:33 +07:00
Efril 486d94335b Merge branch 'main' of https://gits.altru.id/apksel-dev/apskel-pos-backend 2026-06-18 19:55:04 +07:00
aefril 7d5acb33e8 Merge pull request 'Update profit-loss' (#20) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/20
2026-06-18 12:53:23 +00:00
ryan 2138b44c53 Update profit-loss 2026-06-18 19:51:43 +07:00
Efril 503fb5734f fix: migration 82 2026-06-18 16:34:37 +07:00
aefril ac06a4bbe9 Merge pull request 'feature/exclusive-summary' (#19) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/19
2026-06-18 09:12:13 +00:00
ryan 87540fa1b7 Update exclusive summary 2026-06-18 15:44:15 +07:00
ryan 66d4c9f0af Update purchase order with outlet id 2026-06-18 15:27:20 +07:00
ryan 55119b3e91 Add MTD 2026-06-18 14:19:45 +07:00
aefril 67a5c076e7 Merge pull request 'Make vendor nullable' (#18) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/18
2026-06-18 04:12:08 +00:00
ryan c1d859ebdd Make vendor nullable 2026-06-18 11:04:59 +07:00
aefril 7a2060efdc Merge pull request 'Fix total_amount to use base price' (#17) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/17
2026-06-18 03:18:04 +00:00
ryan 2ad9e2f85f Fix total_amount to use base price 2026-06-18 09:52:16 +07:00
aefril a8d62bc5e8 Merge pull request 'feature/exclusive-summary' (#16) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/16
2026-06-18 01:11:14 +00:00
ryan 8816e4addc Merge branch 'feature/expense-revisi' into feature/exclusive-summary 2026-06-17 18:36:46 +07:00
ryan 2921631ac3 Revert "Revert purchase order"
This reverts commit 657a201fc0.
2026-06-17 18:31:10 +07:00
ryan 0db838e2c4 Fix bank 2026-06-17 18:26:40 +07:00
ryan 4b6cbb69c1 Add exclusive-summary 2026-06-17 18:17:08 +07:00
aefril 9e0ba0ce56 Merge pull request 'feature/exclusive-summary' (#15) from feature/exclusive-summary into main
Reviewed-on: https://gits.altru.id/apksel-dev/apskel-pos-backend/pulls/15
2026-06-17 09:26:24 +00:00
ryan 6c19876a47 Fix issue 2026-06-15 17:44:25 +07:00