@studyportals/campaign-management-api-interface 17.0.4-1 → 17.0.4-3
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/package.json +1 -1
- package/src/study-campaign-management-api.client.d.ts +2 -2
- package/src/study-campaign-management-api.client.js +8 -1
- package/src/study-campaign-management-api.client.js.map +1 -1
- package/src/validation/dto/studies/discount-item.dto.d.ts +9 -2
- package/src/validation/dto/studies/discount-item.dto.js +1 -1
- package/src/validation/dto/studies/discount-item.dto.js.map +1 -1
- package/src/validation/dto/studies/index.d.ts +2 -2
- package/src/validation/dto/studies/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@ import { StartDatesAndDeadlinesDto } from "./domain/studies/start-dates-and-dead
|
|
|
4
4
|
import { StartDateType } from "./domain/studies/enums/start-date-type.enum";
|
|
5
5
|
import { LinkDto } from "./domain/studies/link-dto";
|
|
6
6
|
import { SetLinksResponse } from "./domain/studies/set-links-response";
|
|
7
|
-
import {
|
|
7
|
+
import { DiscountItem, TuitionFeeDiscountIssue } from "./validation";
|
|
8
8
|
export declare class StudyCampaignManagementAPIClient {
|
|
9
9
|
private readonly baseUrl;
|
|
10
10
|
constructor(baseUrl: string);
|
|
11
11
|
setStartDatesAndDeadlines(startDateType: StartDateType, studyIds: number[], dates: StartDatesAndDeadlinesDto[], description?: string, jwt?: string): Promise<SetStartDatesAndDeadlinesDto>;
|
|
12
12
|
setLinks(studyIds: number[], homepageLink?: LinkDto, swappableLink?: LinkDto, jwt?: string): Promise<SetLinksResponse>;
|
|
13
13
|
setEnglishScores(studyIds: number[], ielts?: number | null, toeflInternet?: number | null, pte?: number | null, duolingo?: number | null, ote?: number | null, jwt?: string): Promise<void>;
|
|
14
|
-
setTuitionFeesDiscounts(studyIds: number[], discounts:
|
|
14
|
+
setTuitionFeesDiscounts(studyIds: number[], discounts: DiscountItem[], jwt: string): Promise<TuitionFeeDiscountIssue[]>;
|
|
15
15
|
private postRequest;
|
|
16
16
|
private buildBaseUrl;
|
|
17
17
|
}
|
|
@@ -55,7 +55,14 @@ let StudyCampaignManagementAPIClient = class StudyCampaignManagementAPIClient {
|
|
|
55
55
|
async setTuitionFeesDiscounts(studyIds, discounts, jwt) {
|
|
56
56
|
const sendData = new validation_1.SetTuitionFeeDiscountsDto();
|
|
57
57
|
sendData.studyIds = studyIds;
|
|
58
|
-
sendData.discounts = discounts
|
|
58
|
+
sendData.discounts = discounts.map(d => {
|
|
59
|
+
const discount = new validation_1.DiscountItemDto();
|
|
60
|
+
discount.type = d.type;
|
|
61
|
+
discount.value = d.value;
|
|
62
|
+
// Map 'noneea' is FE specific definition - needs translation for BE
|
|
63
|
+
discount.target = d.target === 'noneea' ? 'international' : d.target;
|
|
64
|
+
return discount;
|
|
65
|
+
});
|
|
59
66
|
await (0, class_validator_1.validateOrReject)(sendData);
|
|
60
67
|
const path = 'studies/set-tuition-fee-discounts';
|
|
61
68
|
const result = await this.postRequest(path, sendData, jwt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"study-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/study-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAK1B,yCAAuC;AAGvC,uDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"study-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/study-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAK1B,yCAAuC;AAGvC,uDAAiD;AACjD,6CAAiH;AACjH,qDAAmD;AAG5C,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC5C,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,yBAAyB,CAAC,aAA4B,EAAE,QAAkB,EAAE,KAAkC,EAAE,WAAoB,EAAE,MAAc,EAAE;QAClK,MAAM,QAAQ,GAAG;YAChB,aAAa;YACb,Q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C,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;YACvB,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;YACzB,oEAAoE;YACpE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAErE,OAAO,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,MAAM,IAAA,kCAAgB,EAAC,QAAQ,CAAC,CAAC;QAEjC,MAAM,IAAI,GAAG,mCAAmC,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC,IAAiC,CAAC;IACjD,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,EAAE,IAAS,EAAE,GAAG,GAAG,EAAE;QACnE,OAAO,IAAA,wBAAS,EAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;IAGO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AAtEY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;;GACA,gCAAgC,CAsE5C"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type FEDiscountTargets = 'eea' | 'local' | 'national' | 'international' | 'noneea';
|
|
2
|
+
export type RealDiscountTargets = Exclude<FEDiscountTargets, 'noneea'>;
|
|
3
|
+
export type DiscountItem = {
|
|
2
4
|
type: 'flat' | 'percentage';
|
|
3
5
|
value: number;
|
|
4
|
-
target:
|
|
6
|
+
target: FEDiscountTargets;
|
|
7
|
+
};
|
|
8
|
+
export declare class DiscountItemDto implements DiscountItem {
|
|
9
|
+
type: 'flat' | 'percentage';
|
|
10
|
+
value: number;
|
|
11
|
+
target: 'eea' | 'local' | 'national' | 'international';
|
|
5
12
|
}
|
|
@@ -23,7 +23,7 @@ __decorate([
|
|
|
23
23
|
__metadata("design:type", Number)
|
|
24
24
|
], DiscountItemDto.prototype, "value", void 0);
|
|
25
25
|
__decorate([
|
|
26
|
-
(0, class_validator_1.IsIn)(['eea', 'local', 'national', 'international'
|
|
26
|
+
(0, class_validator_1.IsIn)(['eea', 'local', 'national', 'international']),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
28
|
], DiscountItemDto.prototype, "target", void 0);
|
|
29
29
|
//# sourceMappingURL=discount-item.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discount-item.dto.js","sourceRoot":"","sources":["../../../../../src/validation/dto/studies/discount-item.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiD;
|
|
1
|
+
{"version":3,"file":"discount-item.dto.js","sourceRoot":"","sources":["../../../../../src/validation/dto/studies/discount-item.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiD;AAUjD,MAAa,eAAe;CAS3B;AATD,0CASC;AAPA;IADC,IAAA,sBAAI,EAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;;6CACD;AAG5B;IADC,IAAA,0BAAQ,GAAE;;8CACG;AAGd;IADC,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;;+CACG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiscountItemDto } from './discount-item.dto';
|
|
1
|
+
import { DiscountItem, DiscountItemDto, FEDiscountTargets } from './discount-item.dto';
|
|
2
2
|
import { SetTuitionFeeDiscountsDto } from './set-tuition-fee-discounts.dto';
|
|
3
3
|
import { TUITION_FEE_DISCOUNT_ISSUE_REASON, TuitionFeeDiscountIssue, TuitionFeeDiscountIssueReasonValue } from './tuition-fee-discount-issue.type';
|
|
4
|
-
export { DiscountItemDto, SetTuitionFeeDiscountsDto, TuitionFeeDiscountIssue, TuitionFeeDiscountIssueReasonValue, TUITION_FEE_DISCOUNT_ISSUE_REASON };
|
|
4
|
+
export { FEDiscountTargets, DiscountItem, DiscountItemDto, SetTuitionFeeDiscountsDto, TuitionFeeDiscountIssue, TuitionFeeDiscountIssueReasonValue, TUITION_FEE_DISCOUNT_ISSUE_REASON };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/validation/dto/studies/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/validation/dto/studies/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuF;AAOtF,gGAPsB,mCAAe,OAOtB;AANhB,mFAA4E;AAO3E,0GAPQ,yDAAyB,OAOR;AAN1B,uFAAmJ;AASlJ,kHATQ,mEAAiC,OASR"}
|