3 The goal was to give developer a platform allowing them to create offers operations with a single, well typed, config file. And if customisation is needed, components are modular enough to give the needed flexibility to make it in a fast and reusable way.
7 In order to create a new offer, few steps are needed.
11 In `FeaturesContext.ts`, insert a new FeatureCode for the offer. **FeatureCode name must respect naming conventions**:
16 - Ex: `OfferBlackFriday2022`
20 Add an offer ID (for frontend purpose only) in `interface.ts` `OfferId` union type.
22 ### Create operation folder
24 Create a new folder inside `operations`. Name should be same as featureFlag without the prefix and camelCased.
26 Ex: If FF is `OfferBlackFriday2022` folder name will be `blackFriday2022`.
28 Then create and fill `configuration.ts`, `useOffer.ts`, `Layout.tsx` and `index.ts` files.
30 Be carefull with naming exports in `index.ts`.
35 export { default as blackFriday2022Config } from './configuration';
36 export { default as useBlackFriday2022 } from './useOffer';
39 ### Add operation to main hook
41 Import the config and the hook in `useOfferConfig`.