@managemint-solutions/entities 1.1.12 → 1.1.15

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,25 @@
1
+ export declare enum BillingStatus {
2
+ PENDING_CUSTOMER_CREATION = "pending_customer_creation",
3
+ PENDING_PLAN_CREATION = "pending_plan_creation",
4
+ PENDING_INITIAL_PAYMENT = "pending_initial_payment",
5
+ PENDING_SUBSCRIPTION_CREATION = "pending_subscription_creation",
6
+ ACTIVE = "active",
7
+ PAYMENT_FAILED = "payment_failed",
8
+ CANCELLATION_SCHEDULED = "cancellation_scheduled",
9
+ CANCELLED = "cancelled"
10
+ }
11
+ export declare enum BillingTransactionType {
12
+ INITIAL = "initial",
13
+ PRORATA = "prorata",
14
+ RENEWAL = "renewal",
15
+ REINSTATEMENT = "reinstatement"
16
+ }
17
+ export declare enum BillingTransactionStatus {
18
+ INITIALIZED = "initialized",
19
+ PENDING_PAYMENT = "pending_payment",
20
+ PROCESSING_WEBHOOK = "processing_webhook",
21
+ PAID = "paid",
22
+ FAILED = "failed",
23
+ CANCELLED = "cancelled",
24
+ EXPIRED = "expired"
25
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillingTransactionStatus = exports.BillingTransactionType = exports.BillingStatus = void 0;
4
+ var BillingStatus;
5
+ (function (BillingStatus) {
6
+ BillingStatus["PENDING_CUSTOMER_CREATION"] = "pending_customer_creation";
7
+ BillingStatus["PENDING_PLAN_CREATION"] = "pending_plan_creation";
8
+ BillingStatus["PENDING_INITIAL_PAYMENT"] = "pending_initial_payment";
9
+ BillingStatus["PENDING_SUBSCRIPTION_CREATION"] = "pending_subscription_creation";
10
+ BillingStatus["ACTIVE"] = "active";
11
+ BillingStatus["PAYMENT_FAILED"] = "payment_failed";
12
+ BillingStatus["CANCELLATION_SCHEDULED"] = "cancellation_scheduled";
13
+ BillingStatus["CANCELLED"] = "cancelled";
14
+ })(BillingStatus || (exports.BillingStatus = BillingStatus = {}));
15
+ ;
16
+ var BillingTransactionType;
17
+ (function (BillingTransactionType) {
18
+ BillingTransactionType["INITIAL"] = "initial";
19
+ BillingTransactionType["PRORATA"] = "prorata";
20
+ BillingTransactionType["RENEWAL"] = "renewal";
21
+ BillingTransactionType["REINSTATEMENT"] = "reinstatement";
22
+ })(BillingTransactionType || (exports.BillingTransactionType = BillingTransactionType = {}));
23
+ ;
24
+ var BillingTransactionStatus;
25
+ (function (BillingTransactionStatus) {
26
+ BillingTransactionStatus["INITIALIZED"] = "initialized";
27
+ BillingTransactionStatus["PENDING_PAYMENT"] = "pending_payment";
28
+ BillingTransactionStatus["PROCESSING_WEBHOOK"] = "processing_webhook";
29
+ BillingTransactionStatus["PAID"] = "paid";
30
+ BillingTransactionStatus["FAILED"] = "failed";
31
+ BillingTransactionStatus["CANCELLED"] = "cancelled";
32
+ BillingTransactionStatus["EXPIRED"] = "expired";
33
+ })(BillingTransactionStatus || (exports.BillingTransactionStatus = BillingTransactionStatus = {}));
34
+ ;
@@ -0,0 +1,9 @@
1
+ export type CreateBillingEventDto = {
2
+ organization_id: string;
3
+ billing_transaction_id: string | null;
4
+ event_type: string;
5
+ event_source: string;
6
+ created_by: string | null;
7
+ idempotency_key: string | null;
8
+ details: object;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,4 @@
1
1
  import { Modules } from "../../modules/enum";
2
- import { PaymentIntervals } from "../../payments/enums";
3
2
  import { OrganizationTypes } from "../enum";
4
3
  export type CreateOrganizationDto = {
5
4
  org_type: OrganizationTypes;
@@ -36,7 +35,6 @@ export type CreateOrganizationDto = {
36
35
  owner_profile_image?: string | null;
37
36
  modules: Modules[];
38
37
  seats_needed: number;
39
- payment_frequency: PaymentIntervals.MONTHLY;
40
38
  };
41
39
  export type UpdateOrganizationDto = {
42
40
  type?: OrganizationTypes;
@@ -1,8 +1,7 @@
1
1
  import { UUID } from 'crypto';
2
2
  import { Modules } from '../modules/enum/index';
3
3
  import { UserIdentity } from '../users';
4
- import { SubscriptionCancellationStatus, SubscriptionReinstateStatus } from '../subscription/enum';
5
- import { PaymentStatuses } from '../payments/enums';
4
+ import { BillingStatus } from '../billing/enum';
6
5
  export type OrganizationEntity = {
7
6
  mms_id: UUID;
8
7
  created_at: Date;
@@ -42,10 +41,9 @@ export type OrganizationEntity = {
42
41
  payment_frequency: string;
43
42
  last_payment_date: Date;
44
43
  next_payment_date: Date;
45
- payment_status: PaymentStatuses;
44
+ payment_status: BillingStatus;
46
45
  payment_status_updated_at: Date;
47
- seats: number;
48
- cancellation_status: SubscriptionCancellationStatus;
49
- reinstate_status: SubscriptionReinstateStatus;
46
+ active_seat_count: number;
47
+ paid_seat_count: number;
50
48
  card_expiring_soon: boolean;
51
49
  };
@@ -1,39 +1,25 @@
1
- export declare enum PaymentStatuses {
2
- PAID = "paid",
3
- AWAITING_INITIAL_PAYMENT = "awaiting initial payment",
4
- INITIAL_AMOUNT_PAID = "initial amount paid",
5
- INITIAL_PAYMENT_FAILED = "initial payment failed",
6
- AWAITING_PLAN = "awaiting plan",
7
- AWAITING_SUBSCRIPTION = "awaiting subscription",
8
- SUBSCRIPTION_PAYMENT_FAILED = "subscription payment failed",
1
+ export declare enum BillingStatus {
2
+ PENDING_CUSTOMER_CREATION = "pending_customer_creation",
3
+ PENDING_PLAN_CREATION = "pending_plan_creation",
4
+ PENDING_INITIAL_PAYMENT = "pending_initial_payment",
5
+ PENDING_SUBSCRIPTION_CREATION = "pending_subscription_creation",
6
+ ACTIVE = "active",
7
+ PAYMENT_FAILED = "payment_failed",
8
+ CANCELLATION_SCHEDULED = "cancellation_scheduled",
9
9
  CANCELLED = "cancelled"
10
10
  }
11
- export declare enum PaymentIntervals {
12
- HOURLY = "hourly",
13
- DAILY = "daily",
14
- WEEKLY = "weekly",
15
- MONTHLY = "monthly",
16
- QUARTERLY = "quarterly",
17
- BIANNUALLY = "biannually",
18
- ANNUALLY = "annually"
19
- }
20
- export declare enum PlanUpdateStatuses {
21
- NONE = "none",
22
- NEW_PLAN_REQUESTED = "new_plan_requested",
23
- PRO_RATA_CHARGED = "pro_rata_charged",
24
- PLAN_UPDATED = "plan_updated",
25
- COMPLETED = "completed"
11
+ export declare enum BillingTransactionType {
12
+ INITIAL = "initial",
13
+ PRORATA = "prorata",
14
+ RENEWAL = "renewal",
15
+ REINSTATEMENT = "reinstatement"
26
16
  }
27
- export declare enum PaystackWebhookEvents {
28
- CHARGE_SUCCESS = "charge.success",
29
- SUBSCRIPTION_CREATE = "subscription.create",
30
- SUBSCRIPTION_NOT_RENEW = "subscription.not_renew",
31
- SUBSCRIPTION_EXPIRING_CARDS = "subscription.expiring_cards",
32
- INVOICE_PAYMENT_FAILED = "invoice.payment_failed",
33
- INVOICE_CREATE = "invoice.create",
34
- INVOICE_UPDATE = "invoice.update",
35
- REFUND_PROCESSED = "refund.processed"
36
- }
37
- export declare enum PaystackMetadataActions {
38
- INITIAL_PAYMENT = "initial-payment"
17
+ export declare enum BillingTransactionStatus {
18
+ INITIALIZED = "initialized",
19
+ PENDING_PAYMENT = "pending_payment",
20
+ PROCESSING_WEBHOOK = "processing_webhook",
21
+ PAID = "paid",
22
+ FAILED = "failed",
23
+ CANCELLED = "cancelled",
24
+ EXPIRED = "expired"
39
25
  }
@@ -1,54 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PaystackMetadataActions = exports.PaystackWebhookEvents = exports.PlanUpdateStatuses = exports.PaymentIntervals = exports.PaymentStatuses = void 0;
4
- var PaymentStatuses;
5
- (function (PaymentStatuses) {
6
- PaymentStatuses["PAID"] = "paid";
7
- PaymentStatuses["AWAITING_INITIAL_PAYMENT"] = "awaiting initial payment";
8
- PaymentStatuses["INITIAL_AMOUNT_PAID"] = "initial amount paid";
9
- PaymentStatuses["INITIAL_PAYMENT_FAILED"] = "initial payment failed";
10
- PaymentStatuses["AWAITING_PLAN"] = "awaiting plan";
11
- PaymentStatuses["AWAITING_SUBSCRIPTION"] = "awaiting subscription";
12
- PaymentStatuses["SUBSCRIPTION_PAYMENT_FAILED"] = "subscription payment failed";
13
- PaymentStatuses["CANCELLED"] = "cancelled";
14
- })(PaymentStatuses || (exports.PaymentStatuses = PaymentStatuses = {}));
15
- ;
16
- var PaymentIntervals;
17
- (function (PaymentIntervals) {
18
- PaymentIntervals["HOURLY"] = "hourly";
19
- PaymentIntervals["DAILY"] = "daily";
20
- PaymentIntervals["WEEKLY"] = "weekly";
21
- PaymentIntervals["MONTHLY"] = "monthly";
22
- PaymentIntervals["QUARTERLY"] = "quarterly";
23
- PaymentIntervals["BIANNUALLY"] = "biannually";
24
- PaymentIntervals["ANNUALLY"] = "annually";
25
- })(PaymentIntervals || (exports.PaymentIntervals = PaymentIntervals = {}));
26
- ;
27
- var PlanUpdateStatuses;
28
- (function (PlanUpdateStatuses) {
29
- PlanUpdateStatuses["NONE"] = "none";
30
- PlanUpdateStatuses["NEW_PLAN_REQUESTED"] = "new_plan_requested";
31
- // DOWNGRADE_CRON_JOB_CREATED = 'downgrade_cron_job_created',
32
- PlanUpdateStatuses["PRO_RATA_CHARGED"] = "pro_rata_charged";
33
- PlanUpdateStatuses["PLAN_UPDATED"] = "plan_updated";
34
- // UPGRADE_CRON_JOB_CREATED = 'upgrade_cron_job_created',
35
- PlanUpdateStatuses["COMPLETED"] = "completed";
36
- })(PlanUpdateStatuses || (exports.PlanUpdateStatuses = PlanUpdateStatuses = {}));
37
- ;
38
- var PaystackWebhookEvents;
39
- (function (PaystackWebhookEvents) {
40
- PaystackWebhookEvents["CHARGE_SUCCESS"] = "charge.success";
41
- PaystackWebhookEvents["SUBSCRIPTION_CREATE"] = "subscription.create";
42
- PaystackWebhookEvents["SUBSCRIPTION_NOT_RENEW"] = "subscription.not_renew";
43
- PaystackWebhookEvents["SUBSCRIPTION_EXPIRING_CARDS"] = "subscription.expiring_cards";
44
- PaystackWebhookEvents["INVOICE_PAYMENT_FAILED"] = "invoice.payment_failed";
45
- PaystackWebhookEvents["INVOICE_CREATE"] = "invoice.create";
46
- PaystackWebhookEvents["INVOICE_UPDATE"] = "invoice.update";
47
- PaystackWebhookEvents["REFUND_PROCESSED"] = "refund.processed";
48
- })(PaystackWebhookEvents || (exports.PaystackWebhookEvents = PaystackWebhookEvents = {}));
49
- ;
50
- var PaystackMetadataActions;
51
- (function (PaystackMetadataActions) {
52
- PaystackMetadataActions["INITIAL_PAYMENT"] = "initial-payment";
53
- })(PaystackMetadataActions || (exports.PaystackMetadataActions = PaystackMetadataActions = {}));
54
- ;
3
+ exports.BillingTransactionStatus = exports.BillingTransactionType = exports.BillingStatus = void 0;
4
+ var BillingStatus;
5
+ (function (BillingStatus) {
6
+ BillingStatus["PENDING_CUSTOMER_CREATION"] = "pending_customer_creation";
7
+ BillingStatus["PENDING_PLAN_CREATION"] = "pending_plan_creation";
8
+ BillingStatus["PENDING_INITIAL_PAYMENT"] = "pending_initial_payment";
9
+ BillingStatus["PENDING_SUBSCRIPTION_CREATION"] = "pending_subscription_creation";
10
+ BillingStatus["ACTIVE"] = "active";
11
+ BillingStatus["PAYMENT_FAILED"] = "payment_failed";
12
+ BillingStatus["CANCELLATION_SCHEDULED"] = "cancellation_scheduled";
13
+ BillingStatus["CANCELLED"] = "cancelled";
14
+ })(BillingStatus || (exports.BillingStatus = BillingStatus = {}));
15
+ var BillingTransactionType;
16
+ (function (BillingTransactionType) {
17
+ BillingTransactionType["INITIAL"] = "initial";
18
+ BillingTransactionType["PRORATA"] = "prorata";
19
+ BillingTransactionType["RENEWAL"] = "renewal";
20
+ BillingTransactionType["REINSTATEMENT"] = "reinstatement";
21
+ })(BillingTransactionType || (exports.BillingTransactionType = BillingTransactionType = {}));
22
+ var BillingTransactionStatus;
23
+ (function (BillingTransactionStatus) {
24
+ BillingTransactionStatus["INITIALIZED"] = "initialized";
25
+ BillingTransactionStatus["PENDING_PAYMENT"] = "pending_payment";
26
+ BillingTransactionStatus["PROCESSING_WEBHOOK"] = "processing_webhook";
27
+ BillingTransactionStatus["PAID"] = "paid";
28
+ BillingTransactionStatus["FAILED"] = "failed";
29
+ BillingTransactionStatus["CANCELLED"] = "cancelled";
30
+ BillingTransactionStatus["EXPIRED"] = "expired";
31
+ })(BillingTransactionStatus || (exports.BillingTransactionStatus = BillingTransactionStatus = {}));
@@ -152,6 +152,16 @@ export interface Permissions {
152
152
  owner: boolean;
153
153
  };
154
154
  }
155
- export interface LoggedInUser extends UserEntity, Permissions {
156
- alerts: Record<string, boolean>;
155
+ export interface Alerts {
156
+ alerts: {
157
+ pending_customer_creation: boolean;
158
+ pending_plan_creation: boolean;
159
+ pending_initial_payment: boolean;
160
+ initial_payment_processing: boolean;
161
+ subscription_creation_failed: boolean;
162
+ pending_cancellation: boolean;
163
+ cancelled: boolean;
164
+ };
165
+ }
166
+ export interface LoggedInUser extends UserEntity, Permissions, Alerts {
157
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managemint-solutions/entities",
3
- "version": "1.1.12",
3
+ "version": "1.1.15",
4
4
  "description": "Entity types used by both the api and portal",
5
5
  "homepage": "https://github.com/ManageMint-Solutions/managemint-solutions-entities#readme",
6
6
  "bugs": {