@agrada_digital/pbm 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # 🚀 PBM Library
2
+
3
+ > Uma biblioteca de componentes **React** para implementar o modelo **PBM (Pharmacy Benefit Manager)** de forma simples e eficiente.
4
+
5
+ ![GitHub package.json version](https://img.shields.io/npm/v/@agradadigital/pbm?color=%2364c3ff&label=versão&style=flat-square)
6
+
7
+ ---
8
+
9
+ ## 📦 Instalação
10
+
11
+ Instale a biblioteca com seu gerenciador de pacotes favorito:
12
+
13
+ #### NPM
14
+
15
+ ```bash
16
+ npm install @agradadigital/pbm
17
+ ```
18
+
19
+ #### Yarn
20
+
21
+ ```bash
22
+ yarn add @agradadigital/pbm
23
+ ```
24
+
25
+ #### PNPM
26
+
27
+ ```bash
28
+ pnpm add @agradadigital/pbm
29
+ ```
30
+
31
+ ---
32
+
33
+ ## 💡 Uso em Vanilla JS (sem React)
34
+
35
+ Inclua via `<script>`:
36
+
37
+ ```html
38
+ <script src="https://unpkg.com/@agradadigital/pbm/dist-wc/pbm-wc.js"></script>
39
+
40
+ <pbm-component
41
+ originalproductprice="199.9"
42
+ industrylogo="https://meusite.com/logo.png"
43
+ clientid="*****"
44
+ eanProduct="********"
45
+ >
46
+ </pbm-component>
47
+ ```
48
+
49
+ ## 🛠️ Tecnologias Utilizadas
50
+
51
+ | Tecnologia | Descrição |
52
+ |----------------|----------------------------------------------|
53
+ | ![React](https://img.shields.io/badge/-React-61DAFB?logo=react&logoColor=white&style=flat-square) | Biblioteca principal para construção de UI |
54
+ | ![Vite](https://img.shields.io/badge/-Vite-646CFF?logo=vite&logoColor=white&style=flat-square) | Bundler ultrarrápido para desenvolvimento |
55
+ | ![TypeScript](https://img.shields.io/badge/-TypeScript-3178C6?logo=typescript&logoColor=white&style=flat-square) | Tipagem estática moderna para JavaScript |
56
+ | ![TailwindCSS](https://img.shields.io/badge/-Tailwind-06B6D4?logo=tailwindcss&logoColor=white&style=flat-square) | Framework CSS utilitário |
57
+ | ![Jest](https://img.shields.io/badge/-Jest-C21325?logo=jest&logoColor=white&style=flat-square) | Testes unitários |
58
+ | ![Storybook](https://img.shields.io/badge/-Storybook-FF4785?logo=storybook&logoColor=white&style=flat-square) | Documentação e desenvolvimento de UI isolada |
59
+ | ![PNPM](https://img.shields.io/badge/-PNPM-F69220?logo=pnpm&logoColor=white&style=flat-square) | Gerenciador de pacotes leve e rápido |
60
+
61
+ ---
62
+
63
+ ## 🧑‍💻 Criado por
64
+
65
+ **Inovação - Agrada Digital**
66
+ Feito com ❤️ para transformar a experiência em benefícios farmacêuticos.
@@ -0,0 +1,75 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as zustand from 'zustand';
3
+ import { StoreApi } from 'zustand';
4
+
5
+ interface PBMProps {
6
+ originalProductPrice: number;
7
+ industryLogo: string;
8
+ clientID: string;
9
+ eanProduct: string;
10
+ }
11
+ declare function PBM({ originalProductPrice, industryLogo, clientID, eanProduct, }: PBMProps): react_jsx_runtime.JSX.Element;
12
+
13
+ interface discountTypes {
14
+ unit: number;
15
+ total: number;
16
+ }
17
+ interface usePBMTypes {
18
+ securityNumber: string;
19
+ state: "isRegistered" | "isActivated" | "isInvalid" | "isEmpty";
20
+ availableDiscountSelected: {
21
+ quantity: number;
22
+ discount: discountTypes;
23
+ totalPrice: number;
24
+ };
25
+ campaign: "pbm_campaign";
26
+ targetProduct: ITargetProductPBM | null;
27
+ }
28
+ interface IEpharma {
29
+ name: string;
30
+ presentationId: string;
31
+ presentation: string;
32
+ maximumPrice: number;
33
+ salePrice: number;
34
+ discountPercent: number;
35
+ comboAvailable: boolean;
36
+ progressiveDiscount: boolean;
37
+ replacementIndustryPrice: number;
38
+ replacementPurchasePrice: number;
39
+ replacementIndustryDiscount: number;
40
+ commercialGradeId: number;
41
+ commercialGrade: string;
42
+ calculationRuleTypeId: number;
43
+ calculationRuleType: string;
44
+ }
45
+ interface ITargetProductPBM {
46
+ productId: string;
47
+ ean: string;
48
+ sku: string;
49
+ name: string;
50
+ stock: number;
51
+ listPrice: number;
52
+ salesPrice: number;
53
+ availabilityText: string;
54
+ discountMin: number;
55
+ discountMaxNewPatient: number;
56
+ discountMax: number;
57
+ industryName: string;
58
+ informativeMessage: string;
59
+ authorizer: string;
60
+ discountMinNewPatient: number;
61
+ qtyForDiscountMax: number;
62
+ programName: string;
63
+ dataSource: string;
64
+ epharma: IEpharma;
65
+ }
66
+
67
+ interface PBMStore extends usePBMTypes {
68
+ setSecurityNumber: (securityNumber: string) => void;
69
+ setState: (state: usePBMTypes["state"]) => void;
70
+ setAvailableDiscountSelected: (availableDiscount: usePBMTypes["availableDiscountSelected"]) => void;
71
+ setTargetProduct: (targetProduct: usePBMTypes["targetProduct"]) => void;
72
+ }
73
+ declare const usePBMStore: zustand.UseBoundStore<StoreApi<PBMStore>>;
74
+
75
+ export { PBM, type PBMProps, type PBMStore, usePBMStore };
@@ -0,0 +1,75 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as zustand from 'zustand';
3
+ import { StoreApi } from 'zustand';
4
+
5
+ interface PBMProps {
6
+ originalProductPrice: number;
7
+ industryLogo: string;
8
+ clientID: string;
9
+ eanProduct: string;
10
+ }
11
+ declare function PBM({ originalProductPrice, industryLogo, clientID, eanProduct, }: PBMProps): react_jsx_runtime.JSX.Element;
12
+
13
+ interface discountTypes {
14
+ unit: number;
15
+ total: number;
16
+ }
17
+ interface usePBMTypes {
18
+ securityNumber: string;
19
+ state: "isRegistered" | "isActivated" | "isInvalid" | "isEmpty";
20
+ availableDiscountSelected: {
21
+ quantity: number;
22
+ discount: discountTypes;
23
+ totalPrice: number;
24
+ };
25
+ campaign: "pbm_campaign";
26
+ targetProduct: ITargetProductPBM | null;
27
+ }
28
+ interface IEpharma {
29
+ name: string;
30
+ presentationId: string;
31
+ presentation: string;
32
+ maximumPrice: number;
33
+ salePrice: number;
34
+ discountPercent: number;
35
+ comboAvailable: boolean;
36
+ progressiveDiscount: boolean;
37
+ replacementIndustryPrice: number;
38
+ replacementPurchasePrice: number;
39
+ replacementIndustryDiscount: number;
40
+ commercialGradeId: number;
41
+ commercialGrade: string;
42
+ calculationRuleTypeId: number;
43
+ calculationRuleType: string;
44
+ }
45
+ interface ITargetProductPBM {
46
+ productId: string;
47
+ ean: string;
48
+ sku: string;
49
+ name: string;
50
+ stock: number;
51
+ listPrice: number;
52
+ salesPrice: number;
53
+ availabilityText: string;
54
+ discountMin: number;
55
+ discountMaxNewPatient: number;
56
+ discountMax: number;
57
+ industryName: string;
58
+ informativeMessage: string;
59
+ authorizer: string;
60
+ discountMinNewPatient: number;
61
+ qtyForDiscountMax: number;
62
+ programName: string;
63
+ dataSource: string;
64
+ epharma: IEpharma;
65
+ }
66
+
67
+ interface PBMStore extends usePBMTypes {
68
+ setSecurityNumber: (securityNumber: string) => void;
69
+ setState: (state: usePBMTypes["state"]) => void;
70
+ setAvailableDiscountSelected: (availableDiscount: usePBMTypes["availableDiscountSelected"]) => void;
71
+ setTargetProduct: (targetProduct: usePBMTypes["targetProduct"]) => void;
72
+ }
73
+ declare const usePBMStore: zustand.UseBoundStore<StoreApi<PBMStore>>;
74
+
75
+ export { PBM, type PBMProps, type PBMStore, usePBMStore };