| 531 | |
| 532 | // @effect-diagnostics-next-line missingEffectServiceDependency:off |
| 533 | class OrderRepo extends Context.Service<OrderRepo>()( |
| 534 | "OrderRepo", |
| 535 | { |
| 536 | make: Effect.gen(function*() { |
| 537 | const partitionKey = "orders-" + new Date().getTime() |
| 538 | return yield* makeRepo("Order", Order, { config: { partitionValue: () => partitionKey } }) |
| 539 | }) |
| 540 | } |
| 541 | ) { |
| 542 | static readonly layer = Layer |
| 543 | .effect( |
| 544 | OrderRepo, |
| 545 | Effect.gen(function*() { |
| 546 | const partitionKey = "orders-" + new Date().getTime() |
| 547 | const repo = OrderRepo.of( |
| 548 | yield* makeRepo("Order", Order, { |
| 549 | config: { partitionValue: () => partitionKey } |
| 550 | }) |
| 551 | ) |
| 552 | yield* repo.saveAndPublish(orderItems).pipe(setupRequestContextFromCurrent("init")) |
| 553 | return repo |
| 554 | }) |
| 555 | ) |
| 556 | static readonly Test = this |
| 557 | .layer |
| 558 | .pipe(Layer.provide(Layer.merge(MemoryStoreLive, RepositoryRegistryLive))) |
| 559 | |
| 560 | static readonly TestSqlite = this |
| 561 | .layer |
| 562 | .pipe( |
| 563 | Layer.provide( |
| 564 | Layer.merge( |
| 565 | SQLiteStoreLayer({ |
| 566 | url: Redacted.make("sqlite://"), |
| 567 | prefix: "test_", |
| 568 | dbName: "test" |
| 569 | }), |
| 570 | RepositoryRegistryLive |
| 571 | ) |
| 572 | ), |
| 573 | Layer.provide(SqliteClient.layer({ filename: ":memory:" })) |
| 574 | ) |
| 575 | } |
| 576 | |
| 577 | describe("scanner-style AllPickList computed projections", () => { |
| 578 | const test = Effect |
nothing calls this directly
no test coverage detected
searching dependent graphs…