Skip to main content
Complete work archive

Production / Warehouse operations

Moladin Warehouse Management

Internal software tracking custody of used vehicles and their ownership documents as they move between warehouses.

Relationship
Client assignment · SoftwareSeni / Moladin
Role
Backend Engineer
Period
Aug 2022 - Sep 2022

At a glance

  • Modeled two separate stalls in one interwarehouse transfer: waiting on a manager, waiting on the car to arrive
  • A single timeout could not record which of the two stages had failed
  • Closed both stale states on a five-minute scheduled sweep, with a distinct cancellation reason for each
  • Kept borrow and buyout custody deadlines off Sunday, when the warehouse is closed
  • Limited physical check-in and check-out to warehouse-related staff, with approval delegated to mapped coordinators
  • Extended an existing service over a two-month assignment; the platform and its schema predated the assignment

Stack: TypeScript, Node.js, Express, Sequelize, MySQL

Inputs

Check-in requests
Approvals
Scheduled expiry jobs
Warehouse operations

Outputs

Custody state
Inventory history
Timeout notifications
What this system takes in, and what reads from it.

What I built

Extended interwarehouse check-in with separate response and arrival deadlines, scheduled cancellation, warehouse-scoped actions, and backend capability flags.

System context

Moladin buys and sells used cars in Indonesia. Cars move between warehouses, while each car's BPKB ownership certificate can move separately. The warehouse service therefore tracked the custody and status of both items across check-in, check-out, borrowing, sales, and interwarehouse transfers.

An interwarehouse transfer included human delays as part of the workflow: an agent requested a destination, a manager or mapped coordinator responded, and after approval the car or BPKB still had to arrive. A request could stall before approval while waiting on the manager, or after approval while waiting on the agent to bring the item.

SoftwareSeni assigned me to Moladin from August to September 2022. My role was Backend Engineer inside an existing TypeScript, Node.js, Express, Sequelize, and MySQL service. The assignment focused on extending and hardening the interwarehouse check-in and check-out flow used by mobile clients.

My scope

I owned

  • The post-approval reservation deadline and separate expiry handling for pending requests and approved arrivals.
  • Scheduled cancellation behavior, inventory logs and snapshots, reason-specific notifications, and configurable timeout windows.
  • The Sunday-aware deadline helper used by borrow and regular-buyout paths.
  • Warehouse-scoped authorization, delegated approval behavior, and manager-listing endpoints.
  • API capability flags for interwarehouse check-in and user-specific check-out actions.

I contributed to

  • Defect work around warehouse filtering, pagination, and inventory-location responses.
  • Changes around the existing request, inventory, notification, and custody-history models.

Team-owned

The warehouse platform, interwarehouse schema, original request deadline, delegation tables, architecture, and product priorities predated my assignment or remained team-owned. I implemented assigned changes inside that existing workflow and handed them over when the assignment ended.

Key engineering work

A transfer can stall in two different places

Workflow modeling

Problem

An existing request deadline covered the time waiting for a warehouse response. Approval introduced a second failure mode: the destination had accepted the request, but the agent might never bring the car or BPKB to the warehouse. Treating both as one timeout would not identify which stage had stalled.

Action

I extended the flow with a separate reservation deadline set when a request was approved. Repository queries distinguished expired pending requests from expired approved reservations, and separate scheduled services swept both groups every five minutes when cron processing was enabled.

Each cancellation wrote its own reject reason and remark, updated the approval state, created a detailed inventory log, and saved an inventory-history snapshot. Request and reservation windows were configured independently in hours through environment variables.

Result

Separate scheduled services closed both stale states automatically and recorded whether the manager-response window or the post-approval arrival window had expired. The reason was present in approval and inventory history instead of inferred from a generic canceled status.

A custody deadline could land on a Sunday

Domain modeling

Problem

Borrow and regular-buyout paths calculated future custody deadlines. Adding calendar days could place a deadline on Sunday, when the warehouse was closed.

Action

I added a shared helper that takes a start date, number of days, end-of-day behavior, and timezone. It calculates the result in the configured timezone and moves a Sunday result to Monday. Borrow and regular-buyout deadline paths used the helper instead of applying their own date arithmetic.

Result

Those paths no longer returned a Sunday deadline, and the Sunday rule lived in one function. We checked the borrow and buyout paths by hand, feeding in start dates whose computed deadline landed on a Sunday and watching each one move to Monday. QA was in that with me. No regression test pins the rule down, so it holds for the cases we walked and not for the ones we did not think of. The helper did not model public holidays, which remained a separate unimplemented requirement.

Scoping physical actions and delegated approvals differently

Authorization

Problem

A role did not establish authority over every warehouse. Physical check-in and check-out needed to be limited to administrators or staff related to the warehouse holding or receiving the item. Approval had a narrower delegation rule: a mapped warehouse coordinator could respond when the assigned destination manager was unavailable.

Action

I worked the service checks around those relationships. Physical check-in and check-out verified the actor's warehouse association and explicitly excluded coordinators from performing those actions. The approval path accepted either the assigned manager or a coordinator mapped to the destination warehouse, while preventing an inactive manager from approving directly.

I also added manager and area-control-manager listing endpoints with role checks in the service layer instead of relying on the caller to filter unauthorized results.

Result

Physical custody actions remained tied to the relevant warehouse, while delegated coordinators could handle the approval step without gaining check-in or check-out authority. QA and I walked the scenario on devbox: checking in as an administrator, then as related staff, then confirming that a coordinator was refused the same action while still able to approve. Reading the service checks would only have told me the rules looked right. Signing in as each role showed that they held.

Letting the backend decide which actions mobile may offer

API design

Problem

Whether mobile should offer a car, BPKB, or combined interwarehouse request depended on inventory state. Check-out depended on additional facts: the user's role and warehouse relationship, physical location, sale state, and approved borrowing state.

Action

I returned those decisions as explicit capability flags in the inventory API. The interwarehouse create path enforced the same car, BPKB, and combined-request flags, so the response was not only presentation guidance. User-specific check-out flags applied the authorization and inventory conditions on the backend as well.

Result

Mobile clients could render the actions returned by the backend, while requests were still validated against the same rules when submitted.

Other contributions

  • Notifications

    Pending-request reminders and cancellations used reason-specific messages. Reservation expiry notified the destination manager, origin manager, and agent over WhatsApp and also sent a push notification to the agent.

  • Defect work

    Worked on pagination counting from the wrong collection, warehouse filtering that only matched one warehouse, and a sold-then-checked-out car returning the wrong warehouse because the lookup considered the request without the current inventory record.

  • Handover

    Handed the work to a replacement developer at the end of the assignment, including access setup, staging databases, and the interwarehouse workflow behavior.

Technical decisions

The service already existed in TypeScript, Node.js, Express, and Sequelize, and the assignment ran two months, so the work extended the existing structure instead of reshaping it. When a fix would have meant adding properties to the backend response, I raised the performance cost of doing that on every request and asked for the change to be made in the CRM, where the logic it depended on already lived. Moving a fix to the system that owns the rule keeps the cost with the code that caused it.

Cancellations were not one state. A request cancelled by a user and a request cancelled by the system needed different downstream handling, so the check-in generation skips only the user-cancelled ones, identified by an empty rejection reason, instead of skipping every cancelled request. Treating them alike would have been less code and would have silently dropped records the warehouse still needed to account for.

Engineering takeaway

Waiting for a manager to respond and waiting for a car to physically arrive were two different stalls with two different owners, so they needed separate deadlines, separate cancellation reasons, and separate notifications. Collapsing them into one timeout would have closed the request without recording which stage had failed. When a workflow waits on a person, I treat the waiting as a state to model rather than a timeout to configure.