// Generated by bynkc — do not edit by hand.
// context shop.orders

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "../runtime.js";

import * as bynk from "../bynk.js";

export interface Order {
  readonly sku: string;
  readonly placedAt: number;
}

export const Order = {
};

export const ordering = {
  async call(sku: string, deps: { Clock: bynk.Clock; Logger: bynk.Logger }): Promise<Order> {
    const __r0 = await deps.Logger.info("placing order");
    const now = await deps.Clock.now();
    return { sku: sku, placedAt: now };
  },
};

export interface ShopOrdersDeps {
  readonly Clock: bynk.Clock;
  readonly Logger: bynk.Logger;
}

export function makeSurface(deps: ShopOrdersDeps) {
  return {
    async ordering(sku: string): Promise<Order> {
      return ordering.call(sku, deps);
    },
  };
}

