feat(ppc): add PPC API contracts and finance CostMasterLookupService - #51
Merged
ilramdhan merged 2 commits intoJul 28, 2026
Merged
Conversation
Introduce finance/v1/cost_master_lookup.proto, a read-only projection of the finance cost masters intended for service-to-service consumption by the new PPC service (and its BFF pickers). RPCs cover product master (single, batch, list, resolve-by-ERP-code), the released product route, product grades, and product parameters (list + batch value fetch). Every RPC is a query — no mutation surface is exposed — so the calls can be authenticated by the shared internal service secret instead of a user JWT. ResolveCostProductMasterByErpCode exists so PPC can link Oracle sales-order staging rows to finance products by ERP item/shade code. Authored-By: Ilham R <ilhamram332@gmail.com> Co-Authored-By: Ilham R <me@ilramdhan.dev> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: IT Mutugading <it@mutugading.com> Co-Authored-By: Indra Putro <indraputro@mutugading.com> Co-Authored-By: Ilham R <ilham.ramadhan@mutugading.com> Co-Authored-By: IT Mutu Gading <mutugadingapps@gmail.com>
Add the ppc/v1 module — the contract for the new PPC service that replaces the
Excel-based production planning workflow across the SPG, TXT and TWT areas.
Message definitions are split by bounded context:
- common.proto shared enums (area, demand type/status, plan and work
order status, shift, UOM)
- master.proto machine group, machine, lot, product PPC config,
machine capacity/parameters, overrun threshold,
downtime reason, waste category
- customer.proto PPC customer master
- demand.proto demand intake, sales-order staging, product linking
- plan_item.proto monthly plan items
- work_order.proto work order lifecycle (draft → approval → running →
closed)
- changeover.proto machine changeover records
- packing.proto packing and grade actuals
- daily_performance.proto shift entries, machine/area shift logs, efficiency
snapshots
- dashboard.proto aggregated dashboard reads
All RPCs are aggregated behind a single PPCService (ppc_service.proto) exposed
over gRPC and, via grpc-gateway annotations, REST under /api/v1/ppc/*. Decimal
quantities are transported as strings to avoid float precision loss, and the
platform BaseResponse/PaginationResponse envelope is reused rather than
redefined.
The buf generate inputs are extended with the ppc module so both the Go and
TypeScript stubs are produced.
Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Ilham R <me@ilramdhan.dev>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: IT Mutugading <it@mutugading.com>
Co-Authored-By: Indra Putro <indraputro@mutugading.com>
Co-Authored-By: Ilham R <ilham.ramadhan@mutugading.com>
Co-Authored-By: IT Mutu Gading <mutugadingapps@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the API contracts for the new PPC (Production Planning & Control) service, which
replaces the Excel-based monthly production planning workflow across the SPG, TXT and TWT
areas, plus a read-only finance lookup service that PPC consumes instead of duplicating the
finance cost masters.
Two logical changes:
finance/v1/cost_master_lookup.proto— a read-only projection of the finance costmasters for service-to-service consumption by PPC (and its BFF pickers). RPCs cover
product master (single, batch, list, resolve-by-ERP-code), the released product route,
product grades and product parameters (list + batch value fetch). Every RPC is a query —
no mutation surface is exposed — so the calls can be authenticated by the shared internal
service secret instead of a user JWT.
ResolveCostProductMasterByErpCodeexists so PPCcan link Oracle sales-order staging rows to finance products by ERP item/shade code.
ppc/v1/*— the PPC module, split by bounded context, with all RPCs aggregatedbehind a single
PPCServiceexposed over gRPC and, via grpc-gateway annotations, RESTunder
/api/v1/ppc/*.Both are additive: no existing message, field number or RPC was changed or removed.
Change Type
Proto Files Changed
common/v1/common.protofinance/v1/uom.protofinance/v1/cost_master_lookup.proto,ppc/v1/*(11 files),buf.gen.yaml,buf.gen.ts.yamlChanges Made
finance/v1/cost_master_lookup.proto—CostMasterLookupService, read-only productmaster / released route / grades / parameters lookups for internal callers.
ppc/v1/common.proto— shared enums (area, demand type/sub-type/source/status, planand work-order status, shift, grade requirement, quantity source, threshold level/unit).
ppc/v1/master.proto— machine group, machine, lot, product PPC config, machinecapacity and parameters, overrun threshold, downtime reason, waste category.
ppc/v1/customer.proto— PPC customer master.ppc/v1/demand.proto— demand intake, sales-order staging, product linking.ppc/v1/plan_item.proto— monthly plan items.ppc/v1/work_order.proto— work-order lifecycle (draft → approval → running → closed).ppc/v1/changeover.proto— machine changeover records.ppc/v1/packing.proto— packing and grade actuals.ppc/v1/daily_performance.proto— shift entries, machine/area shift logs, efficiencysnapshots.
ppc/v1/dashboard.proto— aggregated dashboard reads.ppc/v1/ppc_service.proto— the single aggregatedPPCServicewithgoogle.api.httpmappings under
/api/v1/ppc/*.buf.gen.yamlandbuf.gen.ts.yamlinputs with theppcmodule so both Go andTypeScript stubs are produced.
Conventions followed: decimal quantities are transported as strings to avoid float
precision loss, and the platform
BaseResponse/PaginationResponseenvelope fromcommon/v1/common.protois reused, not redefined.Related Issues
Fixes #
Related to #
Breaking Change Check
buf breakingpassesBreaking Change Evidence:
Lint Check
Generated Code Preview (Optional)
Go stubs land in
goapps-backend/gen/ppc/v1/andgoapps-backend/gen/finance/v1/;TypeScript stubs in
goapps-frontend/src/types/generated/{ppc,finance}/v1/. Both arecommitted in their respective consumer PRs (see merge order).
Pre-merge Checklist
buf format -wappliedbuf lintpassesbuf breakingpassesbuf.validateon request fields)Impact Assessment
Reviewer Notes
Please review in this order:
ppc/v1/common.proto(the enum vocabulary everything elsedepends on) →
ppc/v1/master.proto→ the transactional contexts →ppc_service.protoforthe REST surface.
Worth a second look:
finance/v1/cost_master_lookup.protois deliberately query-only,because the backend PR relaxes auth for exactly these methods when a valid internal service
secret is present. If any RPC there gains a mutating counterpart later, that allowlist has to
be revisited.