@glissandoo/lib 1.95.2 → 1.97.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.
- package/functions/partnership.d.ts +24 -15
- package/functions/partnershipPartner.d.ts +4 -2
- package/helpers/collections.d.ts +5 -5
- package/helpers/collections.js +5 -5
- package/helpers/errors.d.ts +2 -1
- package/helpers/errors.js +1 -0
- package/helpers/types.d.ts +1 -0
- package/helpers/types.js +15 -1
- package/models/Customer/basic.js +2 -4
- package/models/Federation/index.js +2 -4
- package/models/Partnership/Partner/index.d.ts +17 -4
- package/models/Partnership/Partner/index.js +32 -13
- package/models/Partnership/Partner/types.d.ts +18 -11
- package/models/Partnership/Payment/index.d.ts +18 -11
- package/models/Partnership/Payment/index.js +39 -13
- package/models/Partnership/Payment/types.d.ts +22 -25
- package/models/Partnership/Payment/types.js +5 -8
- package/models/Partnership/Plan/index.d.ts +19 -7
- package/models/Partnership/Plan/index.js +61 -14
- package/models/Partnership/Plan/types.d.ts +11 -14
- package/models/Partnership/Plan/types.js +5 -8
- package/models/Partnership/SepaPaymentGroup/index.d.ts +12 -0
- package/models/Partnership/SepaPaymentGroup/index.js +34 -0
- package/models/Partnership/SepaPaymentGroup/types.d.ts +11 -0
- package/models/Partnership/Subscription/index.d.ts +9 -13
- package/models/Partnership/Subscription/index.js +18 -31
- package/models/Partnership/Subscription/types.d.ts +9 -18
- package/models/Partnership/Subscription/types.js +0 -7
- package/models/Partnership/basic.d.ts +1 -2
- package/models/Partnership/basic.js +2 -7
- package/models/Partnership/index.d.ts +9 -3
- package/models/Partnership/index.js +10 -4
- package/models/Partnership/types.d.ts +11 -3
- package/package.json +1 -1
- package/functions/partner.d.ts +0 -64
- package/helpers/payments.d.ts +0 -2
- package/helpers/payments.js +0 -9
- package/models/Partnership/Partner/basic.d.ts +0 -13
- package/models/Partnership/Partner/basic.js +0 -39
- package/models/Partnership/Partner/tiny.d.ts +0 -7
- package/models/Partnership/Partner/tiny.js +0 -21
- package/models/Partnership/Payment/basic.d.ts +0 -16
- package/models/Partnership/Payment/basic.js +0 -53
- package/models/Partnership/Plan/basic.d.ts +0 -18
- package/models/Partnership/Plan/basic.js +0 -65
- /package/{functions/partner.js → models/Partnership/SepaPaymentGroup/types.js} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import Model, { DocumentModel } from '../../Model';
|
|
2
|
-
import { PaymentBasicData, PaymentType } from './types';
|
|
3
|
-
export default class PaymentBasic<D> extends Model<D & PaymentBasicData> {
|
|
4
|
-
constructor(doc: DocumentModel);
|
|
5
|
-
get basicInfo(): PaymentBasicData;
|
|
6
|
-
get title(): string;
|
|
7
|
-
get amount(): number;
|
|
8
|
-
get displayAmount(): string;
|
|
9
|
-
get lastAction(): import("./types").PaymentHistory;
|
|
10
|
-
get lastActionStatus(): import("./types").PaymentStatus;
|
|
11
|
-
get lastActionAt(): Date;
|
|
12
|
-
get type(): PaymentType;
|
|
13
|
-
get isRecurrent(): boolean;
|
|
14
|
-
get isOneTime(): boolean;
|
|
15
|
-
get createdAt(): FirebaseFirestore.Timestamp;
|
|
16
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const date_fns_1 = require("date-fns");
|
|
7
|
-
const Model_1 = __importDefault(require("../../Model"));
|
|
8
|
-
const types_1 = require("./types");
|
|
9
|
-
class PaymentBasic extends Model_1.default {
|
|
10
|
-
constructor(doc) {
|
|
11
|
-
super(doc);
|
|
12
|
-
}
|
|
13
|
-
get basicInfo() {
|
|
14
|
-
return {
|
|
15
|
-
title: this.title,
|
|
16
|
-
amount: this.amount,
|
|
17
|
-
lastAction: this.lastAction,
|
|
18
|
-
createdAt: this.createdAt,
|
|
19
|
-
type: this.type,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
get title() {
|
|
23
|
-
return this.data.title;
|
|
24
|
-
}
|
|
25
|
-
get amount() {
|
|
26
|
-
return this.data.amount;
|
|
27
|
-
}
|
|
28
|
-
get displayAmount() {
|
|
29
|
-
return `${this.amount} €`;
|
|
30
|
-
}
|
|
31
|
-
get lastAction() {
|
|
32
|
-
return this.data.lastAction;
|
|
33
|
-
}
|
|
34
|
-
get lastActionStatus() {
|
|
35
|
-
return this.lastAction.status;
|
|
36
|
-
}
|
|
37
|
-
get lastActionAt() {
|
|
38
|
-
return (0, date_fns_1.fromUnixTime)(this.lastAction.timestamp);
|
|
39
|
-
}
|
|
40
|
-
get type() {
|
|
41
|
-
return this.data.type;
|
|
42
|
-
}
|
|
43
|
-
get isRecurrent() {
|
|
44
|
-
return this.type === types_1.PaymentType.Recurring;
|
|
45
|
-
}
|
|
46
|
-
get isOneTime() {
|
|
47
|
-
return this.type === types_1.PaymentType.OneTime;
|
|
48
|
-
}
|
|
49
|
-
get createdAt() {
|
|
50
|
-
return this.data.createdAt;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.default = PaymentBasic;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Model, { DocumentModel } from '../../Model';
|
|
2
|
-
import { PartnershipPlanBasicData } from './types';
|
|
3
|
-
export default class PartnershipPlanBasic<D> extends Model<D & PartnershipPlanBasicData> {
|
|
4
|
-
constructor(doc: DocumentModel);
|
|
5
|
-
get basicInfo(): PartnershipPlanBasicData;
|
|
6
|
-
private setPaymentDay;
|
|
7
|
-
private setPaymentMonth;
|
|
8
|
-
private setPaymentDate;
|
|
9
|
-
getNextPaymentDate(base: Date): Date;
|
|
10
|
-
getFirstPaymentDate(): Date;
|
|
11
|
-
get name(): string;
|
|
12
|
-
get price(): number;
|
|
13
|
-
get displayPrice(): string;
|
|
14
|
-
get description(): string;
|
|
15
|
-
get schedule(): import("./types").PlanScheduleType;
|
|
16
|
-
get isAnnuallySchedule(): boolean;
|
|
17
|
-
get isPaymentDayEndOfMonth(): boolean;
|
|
18
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const date_fns_1 = require("date-fns");
|
|
7
|
-
const lodash_1 = require("lodash");
|
|
8
|
-
const Model_1 = __importDefault(require("../../Model"));
|
|
9
|
-
const types_1 = require("./types");
|
|
10
|
-
class PartnershipPlanBasic extends Model_1.default {
|
|
11
|
-
constructor(doc) {
|
|
12
|
-
super(doc);
|
|
13
|
-
}
|
|
14
|
-
get basicInfo() {
|
|
15
|
-
return {
|
|
16
|
-
name: this.name,
|
|
17
|
-
price: this.price,
|
|
18
|
-
description: this.description,
|
|
19
|
-
schedule: this.schedule,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
setPaymentDay(date) {
|
|
23
|
-
return this.isPaymentDayEndOfMonth
|
|
24
|
-
? (0, date_fns_1.endOfMonth)(date)
|
|
25
|
-
: (0, date_fns_1.setDate)(date, this.schedule.paymentDay);
|
|
26
|
-
}
|
|
27
|
-
setPaymentMonth(date) {
|
|
28
|
-
return (0, lodash_1.isNumber)(this.schedule.paymentMonth) && this.isAnnuallySchedule
|
|
29
|
-
? (0, date_fns_1.setMonth)(date, this.schedule.paymentMonth)
|
|
30
|
-
: date;
|
|
31
|
-
}
|
|
32
|
-
setPaymentDate(date) {
|
|
33
|
-
return this.setPaymentMonth(this.setPaymentDay(date));
|
|
34
|
-
}
|
|
35
|
-
getNextPaymentDate(base) {
|
|
36
|
-
const newDate = (0, date_fns_1.addMonths)(base, this.schedule.period);
|
|
37
|
-
return this.setPaymentDate(newDate);
|
|
38
|
-
}
|
|
39
|
-
getFirstPaymentDate() {
|
|
40
|
-
const newDate = this.setPaymentDate(new Date());
|
|
41
|
-
return (0, date_fns_1.isPast)(newDate) ? (0, date_fns_1.addMonths)(newDate, this.isAnnuallySchedule ? 12 : 1) : newDate;
|
|
42
|
-
}
|
|
43
|
-
get name() {
|
|
44
|
-
return this.data.name;
|
|
45
|
-
}
|
|
46
|
-
get price() {
|
|
47
|
-
return this.data.price;
|
|
48
|
-
}
|
|
49
|
-
get displayPrice() {
|
|
50
|
-
return `${this.price} €`;
|
|
51
|
-
}
|
|
52
|
-
get description() {
|
|
53
|
-
return this.data.description;
|
|
54
|
-
}
|
|
55
|
-
get schedule() {
|
|
56
|
-
return this.data.schedule;
|
|
57
|
-
}
|
|
58
|
-
get isAnnuallySchedule() {
|
|
59
|
-
return this.schedule.period === types_1.PlanSchedulePeriod.Annually;
|
|
60
|
-
}
|
|
61
|
-
get isPaymentDayEndOfMonth() {
|
|
62
|
-
return this.schedule.paymentDay === -1;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.default = PartnershipPlanBasic;
|
|
File without changes
|