// 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 Stamp {
  make(): Promise<number>;
}

export const StampToken: unique symbol = Symbol("Stamp");

export class ClockStamp implements Stamp {
  constructor(private deps: { Clock: bynk.Clock }) {}
  async make(): Promise<number> {
    const t = await this.deps.Clock.now();
    return t;
  }
}

export const ClockStampProvider = { token: StampToken, factory: (deps: any) => new ClockStamp(deps) };

export const ordering = {
  async call(sku: string, deps: { Stamp: Stamp }): Promise<number> {
    const placedAt = await deps.Stamp.make();
    return placedAt;
  },
};

export interface ShopOrdersDeps {
  readonly Stamp: Stamp;
}

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

