@ooneex/payment 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ooneex
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @ooneex/payment
@@ -0,0 +1,77 @@
1
+ import { ICategory } from "@ooneex/category";
2
+ import { CurrencyCodeType } from "@ooneex/currencies";
3
+ import { IImage } from "@ooneex/image";
4
+ import { ITag } from "@ooneex/tag";
5
+ import { IBase, ScalarType } from "@ooneex/types";
6
+ declare enum EDiscountType {
7
+ PERCENTAGE = "percentage",
8
+ FIXED = "fixed"
9
+ }
10
+ declare enum ESubscriptionPeriod {
11
+ MONTHLY = "monthly",
12
+ YEARLY = "yearly",
13
+ WEEKLY = "weekly",
14
+ DAILY = "daily"
15
+ }
16
+ type DiscountType = `${EDiscountType}`;
17
+ type SubscriptionPeriodType = `${ESubscriptionPeriod}`;
18
+ interface IProduct extends IBase {
19
+ name: string;
20
+ description?: string;
21
+ categories?: ICategory[];
22
+ currency: CurrencyCodeType;
23
+ price: number;
24
+ barcode?: string;
25
+ images?: IImage[];
26
+ attributes?: Record<string, ScalarType>;
27
+ tags?: ITag[];
28
+ }
29
+ interface IFeature extends IBase {
30
+ name: string;
31
+ description?: string;
32
+ isEnabled?: boolean;
33
+ limit?: number;
34
+ }
35
+ interface ICoupon extends IBase {
36
+ code: string;
37
+ name?: string;
38
+ description?: string;
39
+ discountType: EDiscountType;
40
+ discountValue: number;
41
+ currency?: CurrencyCodeType;
42
+ maxUses?: number;
43
+ usedCount?: number;
44
+ startAt?: Date;
45
+ endAt?: Date;
46
+ isActive?: boolean;
47
+ minimumAmount?: number;
48
+ applicableProducts?: IProduct[];
49
+ applicablePlans?: IPlan[];
50
+ }
51
+ interface IPlan extends IBase {
52
+ name: string;
53
+ description?: string;
54
+ currency: CurrencyCodeType;
55
+ price: number;
56
+ period: ESubscriptionPeriod;
57
+ periodCount?: number;
58
+ features?: IFeature[];
59
+ isActive?: boolean;
60
+ trialDays?: number;
61
+ }
62
+ interface ICredit extends IBase {
63
+ balance: number;
64
+ currency?: CurrencyCodeType;
65
+ expiresAt?: Date;
66
+ description?: string;
67
+ }
68
+ interface ISubscription extends IBase {
69
+ coupons?: ICoupon[];
70
+ plans?: IPlan[];
71
+ credits?: ICredit[];
72
+ startAt: Date;
73
+ endAt?: Date;
74
+ isTrial?: boolean;
75
+ isActive?: boolean;
76
+ }
77
+ export { SubscriptionPeriodType, ISubscription, IProduct, IPlan, IFeature, ICredit, ICoupon, ESubscriptionPeriod, EDiscountType, DiscountType };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ var t;((r)=>{r.PERCENTAGE="percentage";r.FIXED="fixed"})(t||={});var n;((e)=>{e.MONTHLY="monthly";e.YEARLY="yearly";e.WEEKLY="weekly";e.DAILY="daily"})(n||={});export{n as ESubscriptionPeriod,t as EDiscountType};
2
+
3
+ //# debugId=EA280E251DAE89B564756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/types.ts"],
4
+ "sourcesContent": [
5
+ "import type { ICategory } from \"@ooneex/category\";\nimport type { CurrencyCodeType } from \"@ooneex/currencies\";\nimport type { IImage } from \"@ooneex/image\";\nimport type { ITag } from \"@ooneex/tag\";\nimport type { IBase, ScalarType } from \"@ooneex/types\";\n\nexport enum EDiscountType {\n PERCENTAGE = \"percentage\",\n FIXED = \"fixed\",\n}\n\nexport enum ESubscriptionPeriod {\n MONTHLY = \"monthly\",\n YEARLY = \"yearly\",\n WEEKLY = \"weekly\",\n DAILY = \"daily\",\n}\n\nexport type DiscountType = `${EDiscountType}`;\nexport type SubscriptionPeriodType = `${ESubscriptionPeriod}`;\n\nexport interface IProduct extends IBase {\n name: string;\n description?: string;\n categories?: ICategory[];\n currency: CurrencyCodeType;\n price: number;\n barcode?: string;\n images?: IImage[];\n attributes?: Record<string, ScalarType>;\n tags?: ITag[];\n}\n\nexport interface IFeature extends IBase {\n name: string;\n description?: string;\n isEnabled?: boolean;\n limit?: number;\n}\n\nexport interface ICoupon extends IBase {\n code: string;\n name?: string;\n description?: string;\n discountType: EDiscountType;\n discountValue: number;\n currency?: CurrencyCodeType;\n maxUses?: number;\n usedCount?: number;\n startAt?: Date;\n endAt?: Date;\n isActive?: boolean;\n minimumAmount?: number;\n applicableProducts?: IProduct[];\n applicablePlans?: IPlan[];\n}\n\nexport interface IPlan extends IBase {\n name: string;\n description?: string;\n currency: CurrencyCodeType;\n price: number;\n period: ESubscriptionPeriod;\n periodCount?: number;\n features?: IFeature[];\n isActive?: boolean;\n trialDays?: number;\n}\n\nexport interface ICredit extends IBase {\n balance: number;\n currency?: CurrencyCodeType;\n expiresAt?: Date;\n description?: string;\n}\n\nexport interface ISubscription extends IBase {\n coupons?: ICoupon[];\n plans?: IPlan[];\n credits?: ICredit[];\n startAt: Date;\n endAt?: Date;\n isTrial?: boolean;\n isActive?: boolean;\n}\n"
6
+ ],
7
+ "mappings": "AAMO,IAAK,GAAL,CAAK,IAAL,CACL,aAAa,aACb,QAAQ,UAFE,QAKL,IAAK,GAAL,CAAK,IAAL,CACL,UAAU,UACV,SAAS,SACT,SAAS,SACT,QAAQ,UAJE",
8
+ "debugId": "EA280E251DAE89B564756E2164756E21",
9
+ "names": []
10
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@ooneex/payment",
3
+ "description": "",
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "files": [
7
+ "dist",
8
+ "LICENSE",
9
+ "README.md",
10
+ "package.json"
11
+ ],
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./dist/index.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "build": "bunup",
26
+ "lint": "tsgo --noEmit && bunx biome lint",
27
+ "publish:prod": "bun publish --tolerate-republish --access public",
28
+ "publish:pack": "bun pm pack --destination ./dist",
29
+ "publish:dry": "bun publish --dry-run"
30
+ },
31
+ "dependencies": {},
32
+ "devDependencies": {
33
+ "@ooneex/category": "0.0.1",
34
+ "@ooneex/currencies": "0.0.1",
35
+ "@ooneex/image": "0.0.1",
36
+ "@ooneex/tag": "0.0.1",
37
+ "@ooneex/types": "0.0.1"
38
+ },
39
+ "peerDependencies": {}
40
+ }