Skip to content

Commit c973c7a

Browse files
Update readme and agents
1 parent d1f1075 commit c973c7a

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎.github/workflows/unit-test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
path: |
2828
~/.bun/install/cache
2929
node_modules
30-
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb') }}
30+
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
3131
restore-keys: |
3232
${{ runner.os }}-bun-
3333

‎AGENTS.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bun run pod-install # Bundle exec pod install (iOS)
3333

3434
Clean Architecture with 4 layers per feature module under `src/modules/{module}/`:
3535

36-
- **domain/** — Entity interfaces (`{Entity}`, `Create{Entity}Payload`, `Update{Entity}Payload`, `{Entity}Filter`), repository interface, Yup schema, adapter
36+
- **domain/** — Entity interfaces (`{Entity}`, `Create{Entity}Payload`, `Update{Entity}Payload`, `{Entity}Filter`), repository interface, Yup schema, adapter, mapper
3737
- **infrastructure/** — Service factory (switches on `CONFIG.SERVICE_PROVIDER`), HTTP (axios), Firebase (firestore), Mock implementations
3838
- **application/** — React Query hooks (queries with offline fallback, mutations with toast), Zustand stores with MMKV persistence
3939
- **ui/** — Screens (`{Entities}ListView`, `{Entity}DetailView`, `{Entity}FormView`) and screen-specific components
@@ -87,6 +87,18 @@ async getById(id: string): Promise<Product | Error> {
8787
// Mutation: check and re-throw
8888
const result = await productService.getById(id);
8989
if (result instanceof Error) throw result;
90+
91+
// Or show toast
92+
const show = useAppStorage(state => state.toast.show);
93+
useMutation({
94+
mutationFn: () => {},
95+
onError: (error: Error) => {
96+
show({
97+
message: error.message,
98+
type: 'error',
99+
});
100+
},
101+
})
90102
```
91103

92104
## React Patterns

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ src/
155155
156156
Each module (e.g., `src/modules/products/`) is divided into:
157157
158-
1. **Domain:** Entities, Repository Interfaces, Errors (Pure TS, no React/Lib dependencies).
158+
1. **Domain:** Entities, Repository Interfaces, Errors (Pure TS, no React/Lib dependencies), Mapper (Data Transformation Layer), Adapter (Interface Layer).
159159
2. **Application:** Use Cases, State Management (Zustand/Query), Logic.
160160
3. **Infrastructure:** API calls, Database implementation, Third-party adapters.
161161
4. **UI:** Screens, Components, Navigation.

0 commit comments

Comments
 (0)