@goweekdays/core 0.0.22 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c66ec60: Paypal integration patch
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 2018818: Add paypal integration
14
+
3
15
  ## 0.0.22
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -827,8 +827,8 @@ type TSubscription = {
827
827
  _id?: ObjectId;
828
828
  user?: ObjectId | string;
829
829
  org?: ObjectId | string;
830
- customerId: string;
831
- paymentMethodId: string;
830
+ customerId?: string;
831
+ paymentMethodId?: string;
832
832
  amount: number;
833
833
  description?: string;
834
834
  currency: string;
@@ -934,6 +934,27 @@ declare const addressSchema: Joi.ObjectSchema<any>;
934
934
  declare function MAddress(value: any): TAddress;
935
935
 
936
936
  declare function useSubscriptionService(): {
937
+ subscribe: (value: {
938
+ user: string;
939
+ currency: string;
940
+ perSeatPrice: number;
941
+ seats: number;
942
+ transactionId: string;
943
+ promoCode?: string | undefined;
944
+ org: {
945
+ name: string;
946
+ type: string;
947
+ email: string;
948
+ busInst?: string;
949
+ contact: string;
950
+ description: string;
951
+ };
952
+ }) => Promise<{
953
+ message: string;
954
+ data: {
955
+ org: string;
956
+ };
957
+ }>;
937
958
  getByUserId: (id: string) => Promise<any>;
938
959
  getStatusByUser: (user: string) => Promise<string>;
939
960
  createAffiliateSubscription: (value: {
@@ -983,6 +1004,7 @@ declare function useSubscriptionService(): {
983
1004
  };
984
1005
 
985
1006
  declare function useSubscriptionController(): {
1007
+ subscribe: (req: Request, res: Response, next: NextFunction) => Promise<void>;
986
1008
  add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
987
1009
  getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
988
1010
  getByOrgId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -1429,6 +1451,8 @@ declare function useXenditService(): {
1429
1451
  eWalletLinkOnly: (value: Record<string, any>) => Promise<any>;
1430
1452
  directDebitLinkOnly: (value: Record<string, any>) => Promise<any>;
1431
1453
  cardLinkOnly: (value: Record<string, any>) => Promise<any>;
1454
+ getPaymentMethodsByCustomerId: (customerId: string) => Promise<any>;
1455
+ updatePaymentMethodStatusById: (id: string, status: string) => Promise<any>;
1432
1456
  };
1433
1457
 
1434
1458
  type TPaymentMethod$1 = {
@@ -1492,6 +1516,8 @@ declare function usePaymentMethodController(): {
1492
1516
  getByOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1493
1517
  linkOnly: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1494
1518
  getPaymentMethodById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1519
+ getPaymentMethodsByCustomerId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1520
+ updatePaymentMethodStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1495
1521
  };
1496
1522
 
1497
1523
  declare function useAddressRepo(): {
@@ -1499,7 +1525,7 @@ declare function useAddressRepo(): {
1499
1525
  add: (value: TAddress, session?: ClientSession) => Promise<ObjectId>;
1500
1526
  getByUserId: (user: string | ObjectId) => Promise<TAddress | null>;
1501
1527
  getByOrgId: (org: string | ObjectId) => Promise<TAddress | null>;
1502
- updateById: (_id: string | ObjectId, value: Pick<TAddress, "country" | "city" | "address" | "continuedAddress" | "province" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
1528
+ updateById: (_id: string | ObjectId, value: Pick<TAddress, "org" | "country" | "city" | "address" | "continuedAddress" | "province" | "postalCode" | "taxId">, session?: ClientSession) => Promise<string>;
1503
1529
  };
1504
1530
 
1505
1531
  declare function useAddressController(): {
@@ -1743,6 +1769,7 @@ declare const TInvoice: z.ZodObject<{
1743
1769
  seats?: number | undefined;
1744
1770
  }>, "many">;
1745
1771
  metadata: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodObject<{
1772
+ transactionId: z.ZodOptional<z.ZodString>;
1746
1773
  userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1747
1774
  orgId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1748
1775
  billingCycle: z.ZodOptional<z.ZodEnum<["monthly", "yearly", "quarterly"]>>;
@@ -1753,6 +1780,7 @@ declare const TInvoice: z.ZodObject<{
1753
1780
  description?: string | undefined;
1754
1781
  userId?: string | ObjectId | undefined;
1755
1782
  orgId?: string | ObjectId | undefined;
1783
+ transactionId?: string | undefined;
1756
1784
  currency?: string | undefined;
1757
1785
  subscriptionId?: string | ObjectId | undefined;
1758
1786
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1760,6 +1788,7 @@ declare const TInvoice: z.ZodObject<{
1760
1788
  description?: string | undefined;
1761
1789
  userId?: string | ObjectId | undefined;
1762
1790
  orgId?: string | ObjectId | undefined;
1791
+ transactionId?: string | undefined;
1763
1792
  currency?: string | undefined;
1764
1793
  subscriptionId?: string | ObjectId | undefined;
1765
1794
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1767,6 +1796,7 @@ declare const TInvoice: z.ZodObject<{
1767
1796
  description?: string | undefined;
1768
1797
  userId?: string | ObjectId | undefined;
1769
1798
  orgId?: string | ObjectId | undefined;
1799
+ transactionId?: string | undefined;
1770
1800
  currency?: string | undefined;
1771
1801
  subscriptionId?: string | ObjectId | undefined;
1772
1802
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1774,6 +1804,7 @@ declare const TInvoice: z.ZodObject<{
1774
1804
  description?: string | undefined;
1775
1805
  userId?: string | ObjectId | undefined;
1776
1806
  orgId?: string | ObjectId | undefined;
1807
+ transactionId?: string | undefined;
1777
1808
  currency?: string | undefined;
1778
1809
  subscriptionId?: string | ObjectId | undefined;
1779
1810
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1799,6 +1830,7 @@ declare const TInvoice: z.ZodObject<{
1799
1830
  description?: string | undefined;
1800
1831
  userId?: string | ObjectId | undefined;
1801
1832
  orgId?: string | ObjectId | undefined;
1833
+ transactionId?: string | undefined;
1802
1834
  currency?: string | undefined;
1803
1835
  subscriptionId?: string | ObjectId | undefined;
1804
1836
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1823,6 +1855,7 @@ declare const TInvoice: z.ZodObject<{
1823
1855
  description?: string | undefined;
1824
1856
  userId?: string | ObjectId | undefined;
1825
1857
  orgId?: string | ObjectId | undefined;
1858
+ transactionId?: string | undefined;
1826
1859
  currency?: string | undefined;
1827
1860
  subscriptionId?: string | ObjectId | undefined;
1828
1861
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1851,6 +1884,7 @@ declare function useInvoiceModel(db: Db): {
1851
1884
  description?: string | undefined;
1852
1885
  userId?: string | ObjectId | undefined;
1853
1886
  orgId?: string | ObjectId | undefined;
1887
+ transactionId?: string | undefined;
1854
1888
  currency?: string | undefined;
1855
1889
  subscriptionId?: string | ObjectId | undefined;
1856
1890
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1882,6 +1916,7 @@ declare function useInvoiceRepo(): {
1882
1916
  description?: string | undefined;
1883
1917
  userId?: string | ObjectId | undefined;
1884
1918
  orgId?: string | ObjectId | undefined;
1919
+ transactionId?: string | undefined;
1885
1920
  currency?: string | undefined;
1886
1921
  subscriptionId?: string | ObjectId | undefined;
1887
1922
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1908,6 +1943,7 @@ declare function useInvoiceRepo(): {
1908
1943
  description?: string | undefined;
1909
1944
  userId?: string | ObjectId | undefined;
1910
1945
  orgId?: string | ObjectId | undefined;
1946
+ transactionId?: string | undefined;
1911
1947
  currency?: string | undefined;
1912
1948
  subscriptionId?: string | ObjectId | undefined;
1913
1949
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1944,6 +1980,7 @@ declare function useInvoiceRepo(): {
1944
1980
  description?: string | undefined;
1945
1981
  userId?: string | ObjectId | undefined;
1946
1982
  orgId?: string | ObjectId | undefined;
1983
+ transactionId?: string | undefined;
1947
1984
  currency?: string | undefined;
1948
1985
  subscriptionId?: string | ObjectId | undefined;
1949
1986
  billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
@@ -1962,13 +1999,13 @@ declare function useInvoiceController(): {
1962
1999
  getByDueDateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1963
2000
  };
1964
2001
 
1965
- declare const TPaymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE"]>;
2002
+ declare const TPaymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
1966
2003
  type TPaymentMethodType = z.infer<typeof TPaymentMethod>;
1967
2004
  declare const TPayment: z.ZodObject<{
1968
2005
  _id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
1969
2006
  invoiceId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1970
2007
  amount: z.ZodNumber;
1971
- paymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE"]>;
2008
+ paymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
1972
2009
  status: z.ZodEnum<["pending", "completed", "failed", "refunded"]>;
1973
2010
  metadata: z.ZodEffects<z.ZodObject<{
1974
2011
  userId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>]>>;
@@ -2036,7 +2073,7 @@ declare const TPayment: z.ZodObject<{
2036
2073
  payment?: string | undefined;
2037
2074
  subscriptionId?: string | ObjectId | undefined;
2038
2075
  };
2039
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2076
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2040
2077
  invoiceId: string;
2041
2078
  amount: number;
2042
2079
  _id?: string | ObjectId | undefined;
@@ -2055,7 +2092,7 @@ declare const TPayment: z.ZodObject<{
2055
2092
  payment?: string | undefined;
2056
2093
  subscriptionId?: string | ObjectId | undefined;
2057
2094
  };
2058
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2095
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2059
2096
  amount: number;
2060
2097
  _id?: string | ObjectId | undefined;
2061
2098
  updatedAt?: Date | undefined;
@@ -2318,7 +2355,7 @@ declare function usePaymentModel(db: Db): {
2318
2355
  payment?: string | undefined;
2319
2356
  subscriptionId?: string | ObjectId | undefined;
2320
2357
  };
2321
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2358
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2322
2359
  invoiceId: string;
2323
2360
  amount: number;
2324
2361
  _id?: string | ObjectId | undefined;
@@ -2338,7 +2375,7 @@ declare function usePaymentModel(db: Db): {
2338
2375
  payment?: string | undefined;
2339
2376
  subscriptionId?: string | ObjectId | undefined;
2340
2377
  };
2341
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2378
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2342
2379
  invoiceId: string;
2343
2380
  amount: number;
2344
2381
  _id?: string | ObjectId | undefined;
@@ -2358,7 +2395,7 @@ declare function usePaymentModel(db: Db): {
2358
2395
  payment?: string | undefined;
2359
2396
  subscriptionId?: string | ObjectId | undefined;
2360
2397
  };
2361
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2398
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2362
2399
  invoiceId: string;
2363
2400
  amount: number;
2364
2401
  _id?: string | ObjectId | undefined;
@@ -2397,7 +2434,7 @@ declare function usePaymentRepo(): {
2397
2434
  payment?: string | undefined;
2398
2435
  subscriptionId?: string | ObjectId | undefined;
2399
2436
  };
2400
- paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER";
2437
+ paymentMethod: "EWALLET" | "QR_CODE" | "CARD" | "DIRECT_DEBIT" | "VIRTUAL_ACCOUNT" | "OVER_THE_COUNTER" | "PAYPAL";
2401
2438
  invoiceId: string;
2402
2439
  amount: number;
2403
2440
  _id?: string | ObjectId | undefined;