@nguyentrungkien/shared 1.0.0

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.
@@ -0,0 +1,3 @@
1
+ export * from "./user-role.enum";
2
+ export * from "./order.enum";
3
+ export * from "./payment.enum";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./user-role.enum"), exports);
18
+ __exportStar(require("./order.enum"), exports);
19
+ __exportStar(require("./payment.enum"), exports);
@@ -0,0 +1,20 @@
1
+ export declare enum OrderStatus {
2
+ PENDING = "pending",
3
+ CONFIRMED = "confirmed",
4
+ SHIPPING = "shipping",
5
+ COMPLETED = "completed",
6
+ CANCELLED = "cancelled",
7
+ DELIVERED = "delivered"
8
+ }
9
+ export declare enum PaymentMethod {
10
+ COD = "cod",
11
+ MOMO = "momo",
12
+ VNPAY = "vnpay"
13
+ }
14
+ export declare enum CancelReasonType {
15
+ CHANGE_OF_MIND = "CHANGE_OF_MIND",// Đổi ý
16
+ FOUND_BETTER_PRICE = "FOUND_BETTER_PRICE",// Tìm chỗ khác rẻ hơn
17
+ ORDER_BY_MISTAKE = "ORDER_BY_MISTAKE",// Đặt nhầm
18
+ WRONG_ADDRESS = "WRONG_ADDRESS",// Sai địa chỉ
19
+ OTHER = "OTHER"
20
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CancelReasonType = exports.PaymentMethod = exports.OrderStatus = void 0;
4
+ var OrderStatus;
5
+ (function (OrderStatus) {
6
+ OrderStatus["PENDING"] = "pending";
7
+ OrderStatus["CONFIRMED"] = "confirmed";
8
+ OrderStatus["SHIPPING"] = "shipping";
9
+ OrderStatus["COMPLETED"] = "completed";
10
+ OrderStatus["CANCELLED"] = "cancelled";
11
+ OrderStatus["DELIVERED"] = "delivered";
12
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
13
+ var PaymentMethod;
14
+ (function (PaymentMethod) {
15
+ PaymentMethod["COD"] = "cod";
16
+ PaymentMethod["MOMO"] = "momo";
17
+ PaymentMethod["VNPAY"] = "vnpay";
18
+ })(PaymentMethod || (exports.PaymentMethod = PaymentMethod = {}));
19
+ var CancelReasonType;
20
+ (function (CancelReasonType) {
21
+ CancelReasonType["CHANGE_OF_MIND"] = "CHANGE_OF_MIND";
22
+ CancelReasonType["FOUND_BETTER_PRICE"] = "FOUND_BETTER_PRICE";
23
+ CancelReasonType["ORDER_BY_MISTAKE"] = "ORDER_BY_MISTAKE";
24
+ CancelReasonType["WRONG_ADDRESS"] = "WRONG_ADDRESS";
25
+ CancelReasonType["OTHER"] = "OTHER";
26
+ })(CancelReasonType || (exports.CancelReasonType = CancelReasonType = {}));
@@ -0,0 +1,14 @@
1
+ export declare enum PaymentStatus {
2
+ PENDING = "PENDING",// Chờ thanh toán
3
+ SUCCESS = "SUCCESS",// Thanh toán thành công
4
+ FAILED = "FAILED",// Thanh toán thất bại,
5
+ CANCELLED = "CANCELLED",// Đã hủy,
6
+ REFUNDED = "REFUNDED"
7
+ }
8
+ export declare const PaymentStatusLabel: {
9
+ PENDING: string;
10
+ SUCCESS: string;
11
+ FAILED: string;
12
+ CANCELLED: string;
13
+ REFUNDED: string;
14
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentStatusLabel = exports.PaymentStatus = void 0;
4
+ var PaymentStatus;
5
+ (function (PaymentStatus) {
6
+ PaymentStatus["PENDING"] = "PENDING";
7
+ PaymentStatus["SUCCESS"] = "SUCCESS";
8
+ PaymentStatus["FAILED"] = "FAILED";
9
+ PaymentStatus["CANCELLED"] = "CANCELLED";
10
+ PaymentStatus["REFUNDED"] = "REFUNDED";
11
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
12
+ exports.PaymentStatusLabel = {
13
+ [PaymentStatus.PENDING]: "Chờ thanh toán",
14
+ [PaymentStatus.SUCCESS]: "Thanh toán thành công",
15
+ [PaymentStatus.FAILED]: "Thanh toán thất bại",
16
+ [PaymentStatus.CANCELLED]: "Đã hủy",
17
+ [PaymentStatus.REFUNDED]: "Đã hoàn tiền",
18
+ };
@@ -0,0 +1,32 @@
1
+ export declare enum UserRole {
2
+ ADMIN = "admin",
3
+ USER = "user",
4
+ STAFF = "staff"
5
+ }
6
+ export declare enum Gender {
7
+ MALE = "male",
8
+ FEMALE = "female"
9
+ }
10
+ export declare enum StaffStatus {
11
+ ACTIVE = "active",// đang làm
12
+ PROBATION = "probation",// đang thử việc
13
+ ON_LEAVE = "on_leave",// tạm nghĩ
14
+ RESIGNED = "resigned"
15
+ }
16
+ export declare enum StaffPosition {
17
+ SALE = "sale",
18
+ INVENTORY = "inventory",
19
+ MANAGER = "manager"
20
+ }
21
+ export declare enum MemberRank {
22
+ BRONZE = "bronze",
23
+ SILVER = "silver",
24
+ GOLD = "gold"
25
+ }
26
+ export declare enum DeleteReason {
27
+ NOT_USING = "NOT_USING",// Không còn sử dụng nữa
28
+ PRIVACY_CONCERNS = "PRIVACY_CONCERNS",// Lo ngại về quyền riêng tư
29
+ FOUND_BETTER_ALTERNATIVE = "FOUND_BETTER_ALTERNATIVE",// Tìm được ứng dụng tốt hơn
30
+ ACCOUNT_ISSUE = "ACCOUNT_ISSUE",// Gặp vấn đề với tài khoản
31
+ OTHER = "OTHER"
32
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteReason = exports.MemberRank = exports.StaffPosition = exports.StaffStatus = exports.Gender = exports.UserRole = void 0;
4
+ var UserRole;
5
+ (function (UserRole) {
6
+ UserRole["ADMIN"] = "admin";
7
+ UserRole["USER"] = "user";
8
+ UserRole["STAFF"] = "staff";
9
+ })(UserRole || (exports.UserRole = UserRole = {}));
10
+ var Gender;
11
+ (function (Gender) {
12
+ Gender["MALE"] = "male";
13
+ Gender["FEMALE"] = "female";
14
+ })(Gender || (exports.Gender = Gender = {}));
15
+ var StaffStatus;
16
+ (function (StaffStatus) {
17
+ StaffStatus["ACTIVE"] = "active";
18
+ StaffStatus["PROBATION"] = "probation";
19
+ StaffStatus["ON_LEAVE"] = "on_leave";
20
+ StaffStatus["RESIGNED"] = "resigned";
21
+ })(StaffStatus || (exports.StaffStatus = StaffStatus = {}));
22
+ var StaffPosition;
23
+ (function (StaffPosition) {
24
+ StaffPosition["SALE"] = "sale";
25
+ StaffPosition["INVENTORY"] = "inventory";
26
+ StaffPosition["MANAGER"] = "manager";
27
+ })(StaffPosition || (exports.StaffPosition = StaffPosition = {}));
28
+ var MemberRank;
29
+ (function (MemberRank) {
30
+ MemberRank["BRONZE"] = "bronze";
31
+ MemberRank["SILVER"] = "silver";
32
+ MemberRank["GOLD"] = "gold";
33
+ })(MemberRank || (exports.MemberRank = MemberRank = {}));
34
+ var DeleteReason;
35
+ (function (DeleteReason) {
36
+ DeleteReason["NOT_USING"] = "NOT_USING";
37
+ DeleteReason["PRIVACY_CONCERNS"] = "PRIVACY_CONCERNS";
38
+ DeleteReason["FOUND_BETTER_ALTERNATIVE"] = "FOUND_BETTER_ALTERNATIVE";
39
+ DeleteReason["ACCOUNT_ISSUE"] = "ACCOUNT_ISSUE";
40
+ DeleteReason["OTHER"] = "OTHER";
41
+ })(DeleteReason || (exports.DeleteReason = DeleteReason = {}));
@@ -0,0 +1,2 @@
1
+ export * from "./enums";
2
+ export * from "./types";
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./enums"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1 @@
1
+ export * from "./user.types";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./user.types"), exports);
@@ -0,0 +1,9 @@
1
+ import { UserRole } from "../enums";
2
+ export interface User {
3
+ id: number;
4
+ username: string;
5
+ email: string;
6
+ role: UserRole;
7
+ createdAt: Date;
8
+ updateAt: Date;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@nguyentrungkien/shared",
3
+ "version": "1.0.0",
4
+ "description": "shared enum & types",
5
+ "license": "ISC",
6
+ "author": "nguyentrungkien04921@gmail.com",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "keywords": [
13
+ "shared",
14
+ "types",
15
+ "enum"
16
+ ],
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "test": "echo \"Error: no test specified\" && exit 1",
22
+ "build": "tsc",
23
+ "watch": "tsc --watch"
24
+ },
25
+ "devDependencies": {
26
+ "typescript": "^5.9.2"
27
+ },
28
+ "dependencies": {}
29
+ }