@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 +66 -0
- package/dist/index.d.mts +75 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +816 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +776 -0
- package/dist/index.mjs.map +1 -0
- package/dist-wc/partners/logo-parceiro-exemplo.jpeg +0 -0
- package/dist-wc/pbm-wc.js +94 -0
- package/package.json +84 -0
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
|
+

|
|
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
|
+
|  | Biblioteca principal para construção de UI |
|
|
54
|
+
|  | Bundler ultrarrápido para desenvolvimento |
|
|
55
|
+
|  | Tipagem estática moderna para JavaScript |
|
|
56
|
+
|  | Framework CSS utilitário |
|
|
57
|
+
|  | Testes unitários |
|
|
58
|
+
|  | Documentação e desenvolvimento de UI isolada |
|
|
59
|
+
|  | 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.
|
package/dist/index.d.mts
ADDED
|
@@ -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 };
|
package/dist/index.d.ts
ADDED
|
@@ -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 };
|