# Aimee-Blue Client/Server/Functions Contract

## Structure

```
schemas
  {feature}
    funcParam1.ts    <-- types specific to function params
    action1.ts       <-- types specific to actions
    type1.ts         <-- types specific to entity (e.g. re-used by params/actions ^ above)
    ...
    api.ts               <-- all types above collected into API interface
    index.ts             <-- reexport all dir types for namespacing
  ...
  index.ts  <-- reexport all features
```

## Examples?

Looking for examples - dig deeper into code.

## Conventions

1. Do not put code that is specific only to `Functions` or only to `Client`. The purpose of this repo is to define a
   contract between them.
   
1. Do not share code between feature modules. Subsequent changes to contract of a module should not break other module contracts. Copy-paste is good in this case.

1. Difference between `Action` and `Params`:

   - `Action` - received in PubSub stream by client

   - `Params` - received as parameter to function

1. Please try to suffix your types with `Shape`. Suffix your schemas with `Schema`. Suffix function params with `Params` and suffix action schemas with `ActionSchema`.

1. Typically whenever a feature is being developed by more than one dev - any changes to `schemas` directory should be approved by both FE and BE devs developing the feature

## Happy coding!
