Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.27.1 #873

Merged
merged 241 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 236 commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
d34cdbb
feat: Added Refactored Plan Details
Oct 17, 2024
c0622ef
feat: Added Payment Method Form UI
Oct 18, 2024
3f33143
feat: Added paymentMethodId as the query key
Oct 21, 2024
49c21a3
feat: Added PaymentMethodForm
Oct 21, 2024
11cdafe
feat: Added sm spacing in Stack
Oct 21, 2024
9eef1eb
feat: Passed necessary things as props in PaymentMethodForm
Oct 21, 2024
3366eea
feat: Added refatored UI in PaymentMethodOption
Oct 21, 2024
cf4df2a
feat: Added breakpoints in SimpleGrid
Oct 21, 2024
35985e3
feat: Added tax while displaying checkout data
Oct 21, 2024
b36a21e
feat: Refactored component to handle automatic payment initilization …
Oct 21, 2024
0beb1c5
feat: Added CODE optional
Oct 21, 2024
fb78e82
feat: Added new buisness logic of using newely added payment method f…
Oct 21, 2024
f00f1c9
feat: Added taxAmount,taxLabel and taxPercentage
Oct 21, 2024
0085d73
feat: Added jsx styled strokeWidth and strokeLinecap
Oct 22, 2024
65541f5
feat: Streamlined UI of PaymentMethodForm
Oct 22, 2024
d6e971b
feat: Added streamlined SelectCardModalCOntent
Oct 22, 2024
26af4be
feat: Added new Component AddNewPaymentMethodForm
Oct 22, 2024
7810f91
feat: Added styles for the PaymentMethods radio button
Oct 22, 2024
b5f4de1
feat: Added styles for the radio button
Oct 22, 2024
6354a44
feat: Added plan related constants
Oct 22, 2024
f9ee320
feat: Refactored custom hook
Oct 22, 2024
6143cb3
feat: Added StripeInput
Oct 22, 2024
a56d668
feat: Added email as prop
Oct 22, 2024
de1fd58
feat: Directly Opened the planModal and used destructured functon
Oct 22, 2024
df0613b
feat: Streamlined UI as per designs
Oct 22, 2024
432f8de
feat: Desctructured function onChoosePlanButtonClick from usePlanDetails
Oct 22, 2024
f5673bb
feat: Centered the modal
Oct 22, 2024
139536e
feat: Streamlined useCheckout hook
Oct 22, 2024
1e6085a
feat: Returned onChoosePlanButtonClick function
Oct 22, 2024
e445fa2
feat: Renamed selectedPaymentMethod to paymentMethodId
Oct 22, 2024
f48683f
feat: Corrected the clip-path to clipPath
Oct 22, 2024
34b79eb
feat: Added StripeInput
Oct 22, 2024
735459f
feat: Removed extra divider
Oct 22, 2024
cc324ae
feat: Removed the Divider
Oct 22, 2024
4d14e6c
feat: Added style to Box
Oct 22, 2024
38d718d
feat: Added Divider below the Plan Name
Oct 22, 2024
7640a8f
feat: Applied style to the text content
Oct 23, 2024
ea39a28
feat: Increased the Title order by 2
Oct 23, 2024
fe793ed
feat: Added colour faintYellow
Oct 23, 2024
00ae76d
feat: Added small padding and spacing
Oct 23, 2024
75ab3f9
fix: Review email
chavda-bhavik Oct 24, 2024
77a5e12
`fix:` Review email (#861)
chavda-bhavik Oct 24, 2024
134d83e
feat: Added route /payment-method/:paymentMethodId to update the paym…
Oct 24, 2024
f382b47
feat: Added ActiveSubscriptionContent
Oct 24, 2024
af84f64
feat: Added ChangeCardModalContent
Oct 24, 2024
c52b8d8
feat: Added PaymentModal
Oct 24, 2024
d8c3f1a
feat: Renamed PaymentModal
Oct 24, 2024
697e081
feat: Renamed to SubscribeToPlan
Oct 24, 2024
262b451
feat: If plan is starter or is cancelled the hide the button
Oct 24, 2024
a440b18
feat: Added styles for the plans
Oct 24, 2024
c0463c1
feat: Renamed onChoosePlanButtonClick to onOpenPaymentModal
Oct 24, 2024
c7d4126
feat: Streamlined imports
Oct 24, 2024
91e1847
feat: Added MODAL_KEYS CHANGE_CARD
Oct 24, 2024
7cd5183
feat: Added lightRed color as per design
Oct 24, 2024
3d376c7
feat: ADded optional planCode in hook
Oct 24, 2024
4f87a61
feat: Added optional paymentMethodId
Oct 24, 2024
e7060ed
feat: Added hook useUpdatePaymentMethod
Oct 24, 2024
995b098
feat: Added UPDATE_PAYMENT_METHOD in API_KEYS
Oct 24, 2024
3846dc4
feat: Added fixedCost and interval
Oct 24, 2024
3b6f372
feat: Added streamlined meta for plan
Oct 24, 2024
805d6fa
feat: File Renamed
Oct 25, 2024
1a837df
feat: File Renamed
Oct 25, 2024
830ff83
feat: COmponent name changed
Oct 25, 2024
0f89361
feat: Removed the functionality of direct pay after card add from use…
Oct 25, 2024
49821a0
feat: Removed the functionality of direct pay after card add from use…
Oct 25, 2024
df7cd07
feat: Added functionality to addcard and then subscribe immediately a…
Oct 25, 2024
74e727f
feat: Renamed useAddCard to useAddCardAndSubscribe
Oct 25, 2024
75cdf87
feat: Added custom hook to update the payment method
Oct 25, 2024
3db9f33
fix: Empty customization while signing up
chavda-bhavik Oct 25, 2024
cee4bc1
`fix:` Empty customization while signing up (#862)
chavda-bhavik Oct 25, 2024
e29e4de
feat: Add usecase UpdateSubscriptionPaymentMethod
Oct 25, 2024
6cb1348
feat: Add usecase UpdateSubscriptionPaymentMethod
Oct 25, 2024
118e229
feat: Add usecase UpdateSubscriptionPaymentMethod
Oct 25, 2024
f437ef8
feat: Logs and extra spacing removed
Oct 25, 2024
e5a637e
feat: Added functionality to update the payment method for future ren…
Oct 25, 2024
da14148
feat: Added Radio button styling as per design
Oct 25, 2024
6860da6
feat: Added API_KEYS UPDATE_SUBSCRIPTION_PAYMENT_METHOD
Oct 25, 2024
835a0e5
feat: Added logs
Oct 25, 2024
612eea0
feat: Added component CurrentCardSection
Oct 25, 2024
7e96551
feat: Refactored component to show tax for the plan brought
Oct 25, 2024
fdcbbc2
feat: Added new component CardForm
Oct 25, 2024
ab85691
feat: Added subfields tax and amount
Oct 25, 2024
91bd148
feat: Refactored the component and have subcomponents
Oct 25, 2024
00fa1bb
feat: Added optional ICardData
Oct 25, 2024
b5881b0
feat: Steamlined the hook to have better error handling
Oct 25, 2024
19a63a6
feat: Added UPDATE_SUBSCRIPTION_PAYMENT_METHOD
Oct 25, 2024
e6c950b
feat: Added updatePaymentMethodId
Oct 25, 2024
1095107
feat: Added optional tax
Oct 25, 2024
2b5610c
feat: Added optional amount
Oct 25, 2024
6856a01
feat: Added gap 0
Oct 25, 2024
a18ce0f
feat: Removed the ISubscriptionData from global
Oct 25, 2024
bbed3ce
feat: Used the ISubscriptionData
Oct 25, 2024
9980941
feat: Used the ISubscriptionData
Oct 25, 2024
c9996a5
feat: Added the billable metrics in meta
Oct 25, 2024
554c59f
feat: Took Button inside the Stack
Oct 25, 2024
441eeeb
feat: Wrapped the componet in Stack
Oct 25, 2024
57bc452
feat: Added loading states
Oct 25, 2024
1c26691
feat: Removed the black modal and the loader
Oct 25, 2024
4cb3c85
feat: Added LeftArrowIcon
Oct 26, 2024
5945c83
feat: Added back arrow icon as per the design
Oct 26, 2024
0a892dc
feat: Applied validations on form
Oct 26, 2024
af8104b
feat: Added negative margin
Oct 26, 2024
ea333b1
feat: Added Backbutton as per design
Oct 26, 2024
c7c5935
feat: Added negative margin
Oct 26, 2024
426058c
feat: Added refactored PaymentMethodForm
Oct 26, 2024
a44283a
feat: Removed cutom styling and changed the modal size to 50vw
Oct 26, 2024
b81bc94
feat: Added negative margin
Oct 26, 2024
632cdbd
feat: Added Error handling on the form
Oct 26, 2024
06c424f
feat: Handled error on stripe element
Oct 26, 2024
389ca75
feat: Renamed prorated refund to balance
Oct 26, 2024
d40f195
feat: Added black color to placeholder and the font
Oct 26, 2024
26ef5b6
feat: Removed the styling and the red border issue on modal
Oct 26, 2024
75e374e
feat: Sorted the paymentmethods based on the current selected by the …
Oct 26, 2024
0460766
feat: Added email of the user in the query key
Oct 26, 2024
ffaa478
feat: Added Streamlined PaymentMethod
Oct 26, 2024
70fa2fd
feat: Streamlined the Paymentmethod to have sorted
Oct 26, 2024
cb494a5
feat: Added some spacing and # as the masked last 4 digits
Oct 26, 2024
68f9845
feat: Added styling for the scrollbar
Nov 5, 2024
4aad90a
feat: Added styling for the scrollbar
Nov 5, 2024
18ad3a8
feat: Added the scrollbar
Nov 5, 2024
44e101f
feat: Added name of the currency
Nov 5, 2024
b785418
feat: SHown the checkout data even if user have not yet added any card
Nov 5, 2024
eebdfd5
feat: Added Handling of error messages on stripe element
Nov 5, 2024
b1ed209
feat: Passed the options to StripeElement
Nov 5, 2024
d254a7f
feat: shown the success message based on the status
Nov 5, 2024
b45a5e9
feat: Removed the modal title while opening the modal
Nov 5, 2024
8112fd2
feat: Had the modal contents at the center of the modal
Nov 5, 2024
7ab3552
feat: Merged next into current
Nov 5, 2024
f42c6be
feat: Added enum based plan comparision
Nov 5, 2024
96c6311
feat: Added red variant to the cancel plan button
Nov 5, 2024
d6ea00f
feat: Added proper label font sizing to the stripe elements
Nov 6, 2024
d817bbc
feat: Adde styles for the ActivePlanDetails and the Alert
Nov 6, 2024
d294259
feat: Added proper styling
Nov 6, 2024
8644be1
feat: Refeteching subscription on Cancel Plan
Nov 6, 2024
ab03975
feat: Added projectId in cancelPlan
Nov 6, 2024
d766d0c
feat: Added custom styling as useAlertStyles
Nov 6, 2024
d3ef9c6
feat: Removed the ability and had it in the ActivePlanDetails
Nov 6, 2024
1ad3b6b
feat: Used predefined colours from config
Nov 6, 2024
8400091
feat: Added toolTipLink
Nov 6, 2024
66c092f
feat: Dynamically rendering the toolTipLink based on value passed fro…
Nov 6, 2024
e87d2cb
feat: Added optional tooltipLinkin the PlanFeatureContent
Nov 6, 2024
36072cd
feat: Added tooltipLinksfor the plan features
Nov 6, 2024
11ddf7d
feat: Added goldenYellow color
Nov 6, 2024
ff30f50
feat: Given medium size the the icon
Nov 6, 2024
ab04e31
feat: SHon the Transactions and the access to change card button base…
Nov 6, 2024
6be59fd
feat: File deleted
Nov 6, 2024
ae80c10
feat: Given proper styling to plan details
Nov 6, 2024
f04b020
feat: Added READ as the ActionEnum
Nov 6, 2024
4564464
feat: Passing the form control and submit handler as props from the hook
Nov 6, 2024
f7c4dd7
feat: Removed the styling for message
Nov 6, 2024
f0c4189
feat: Removed the styling for message
Nov 6, 2024
74b9b06
feat: Given smaller spacing fro stack
Nov 6, 2024
cd5767e
feat: Given 800px width to the Card
Nov 6, 2024
062109b
feat: Added extra small gap on flex
Nov 6, 2024
96a6361
feat: Added extra small gap on flex
Nov 6, 2024
d2f9126
feat: Added extra small spacing in stack
Nov 6, 2024
6592bbf
feat: Added cancel of plan based on owner of the project or team
Nov 7, 2024
6e1bde2
feat: Added CancelSubscriptionDto as the body and passed projectId fr…
Nov 7, 2024
82ba5e9
feat: Added Dto CancelSubscriptionDto
Nov 7, 2024
dc4749e
feat: Passed Array having array value as the cancellation reason
Nov 7, 2024
bf78c16
feat: Moved MEMBERSHIP_CANCELLATION_REASONS to the shared default
Nov 7, 2024
92a3b09
feat: Removed email from passing as prop in useCancelPlan
Nov 7, 2024
deccdea
feat: Added cancellation reasons and passed in the body
Nov 7, 2024
ac76a13
feat: Added projectId as the parameter in the cancel subscription route
Nov 7, 2024
cfd4033
feat: Added user._projectId from @UserSession() user: IJwtPayload to…
Nov 7, 2024
12d70d0
feat: Added Team owner email for getting checkout details
Nov 7, 2024
c2381c3
feat: Added Team owner email for getting transaction history
Nov 7, 2024
661b638
feat: Added Team owner email for getting payment methods
Nov 7, 2024
ed657da
feat: Added Team owner email for ConfirmIntent
Nov 7, 2024
60d4a0e
feat: Added Team owner email in UpdatePaymentMethod
Nov 7, 2024
85bb7e8
feat: Added Team owner email while making Subscription or purchasing …
Nov 7, 2024
05bde17
feat: Added Team owner email while uodating the SubscriptionPaymentMe…
Nov 7, 2024
448241c
feat: Removed the projectId from parameter
Nov 7, 2024
c9398b0
feat: Passed projectId from props to the usePlanDetails
Nov 7, 2024
2b189bd
feat: Added projectId in interface
Nov 7, 2024
1284af5
feat: Removed projectId
Nov 7, 2024
06d3378
feat: Handled error message on the modal if user does not select any …
Nov 7, 2024
2989934
feat: Added MEMBERSHIP_CANCELLATION_REASONS in constants
Nov 7, 2024
cfd6974
feat: Removed projectId
Nov 7, 2024
4e35348
feat: Removed the profileInfo?.email from passing in the query key
Nov 7, 2024
8d28411
feat: Removed profileInfo?._projectId from invalidateQueries
Nov 7, 2024
4fa3927
feat: Removed projectId from passing in some routs and passed from th…
Nov 7, 2024
6ed5993
feat: Added email for the query key
Nov 7, 2024
5732325
feat: Added email as the query key
Nov 7, 2024
d64ce2f
feat: Added curreny while fetching the details of the active subscrip…
Nov 7, 2024
b60f3e0
feat: Changed the order to 3 from 4
Nov 7, 2024
e01c853
feat: Changed message of the current project
Nov 7, 2024
d75b92a
feat: Added the Choose the text title Choose the plan that works best…
Nov 7, 2024
b700177
feat: Removed the close button from the PlansModal
Nov 7, 2024
c8d1802
feat: Added the Alert at to of the plan details
Nov 8, 2024
6cbe17b
feat: Default exported createStyles
Nov 8, 2024
4ffbee3
feat: Added proper placeholder for the card element
Nov 8, 2024
ff4f313
feat: Removed non required border radius
Nov 8, 2024
84dd7f9
feat: Added placeholder as per design
Nov 8, 2024
fd0190c
feat: Added Text - As Per Your Current Card
Nov 8, 2024
9faa6c5
feat: Removed the currentColour
Nov 8, 2024
97b9049
feat: Added medium sizizing with dimmed text colour to the Text
Nov 8, 2024
cc88338
feat: default exported styles
Nov 8, 2024
03081cc
feat: Added proper import for ActivePlanDetails.styles
Nov 8, 2024
c1f8925
feat: Removed previously used styling for table
Nov 8, 2024
aaf37da
feat: Added md size to the InformationIcon
Nov 8, 2024
76389df
feat: Removed the email from the parameter
Nov 8, 2024
393b505
feat: Removed the email from updatePaymentMethod
Nov 8, 2024
395fb53
feat: Fixed cronjob issue
Nov 8, 2024
078295d
feat: Imports statements sorted
Nov 11, 2024
5d1ca29
feat: Conditionally hide the radio button in CurrentCardSection based…
Nov 11, 2024
95b16a9
feat: Passed true value to showRadio
Nov 11, 2024
bcc7a96
Feat/membership revision (#863)
chavda-bhavik Nov 11, 2024
748c845
feat: Added type info to element
Nov 11, 2024
8533609
feat: Added setAttribute
Nov 12, 2024
7bf5c3d
feat: Provided file in the showWidget
Nov 15, 2024
c99af85
feat: Provided file in the secondaryPayload
Nov 15, 2024
1735fbb
feat: Provided file type in the IProviderProps
Nov 15, 2024
5bb8f5b
feat: Added file and its type as File or Blob
Nov 15, 2024
650baef
feat: HAndled error and the fileError
Nov 15, 2024
82314d9
feat: Added allowedTypes for handling invaid file
Nov 15, 2024
d6f89b2
feat: Added download of user provided sample file
Nov 15, 2024
dbf57be
feat: Added file and type to it in the ICommonShowPayload interface
Nov 15, 2024
46c5416
feat: Added file in the context
Nov 15, 2024
bc4eefa
feat: Added file and its type as File or Blob in the IAppStore interface
Nov 15, 2024
a9fc92c
feat: Added function to validate the provided file
Nov 15, 2024
25decec
feat: Thrown error if duplicate keys found
Nov 15, 2024
30fe7cd
feat: Changed APIMessage COLUMN_KEY_DUPLICATED
Nov 15, 2024
7188263
feat: Provided error in exception
Nov 15, 2024
72976bd
feat: Renamed file to sampleFile
Nov 16, 2024
35233c8
feat: Removed extra filter while having parsedSchema
Nov 16, 2024
13e78ed
feat: Shown each duplicated key only once
Nov 16, 2024
f14fa62
feat: Taken new Set
Nov 16, 2024
73cc9f0
Feat/sample file upload (#868)
chavda-bhavik Nov 16, 2024
cb30581
Merge branch 'next' into feat/show-error-on-duplicate-key
chavda-bhavik Nov 16, 2024
8a3bdb2
Feat/show error on duplicate key (#867)
chavda-bhavik Nov 16, 2024
a32994a
feat: Added type info to span element (#865)
chavda-bhavik Nov 16, 2024
44f9558
feat: Added type info to span element (#865)
chavda-bhavik Nov 16, 2024
8e2205e
feat: Updated docker-compose images version
Nov 16, 2024
ac4b136
Merge branch 'next' into release/0.27.1
thisismayuresh Nov 16, 2024
34ab4dc
Release/0.27.1 (#869)
chavda-bhavik Nov 16, 2024
f48f94b
feat: Removed the mantine theme.fontSizes.lg size of the fontSize and…
Nov 18, 2024
6e84e4f
feat: Added new message for the user to select the cancellation Reasons
Nov 18, 2024
d4c8987
feat: Added modelId which was comming from the function
Nov 18, 2024
d095e96
feat: Wrapped the modals in the Elements
Nov 18, 2024
34dfecc
Fix/membership revision UI issue (#872)
chavda-bhavik Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@impler/api",
"version": "0.27.0",
"version": "0.27.1",
"author": "implerhq",
"license": "MIT",
"private": true,
Expand Down Expand Up @@ -47,7 +47,7 @@
"class-validator": "^0.14.0",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"cron": "^3.1.7",
"cron": "^3.1.9",
"date-fns": "^2.30.0",
"dayjs": "^1.11.11",
"dotenv": "^16.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ export class ValidRequest {
);
}

const columnKeysSet = new Set(parsedSchema.map((column) => column.key));
const columnKeysSet = new Set();
const duplicateKeys = parsedSchema.reduce((acc, item) => {
if (columnKeysSet.has(item.key)) acc.add(item.key);
columnKeysSet.add(item.key);

return acc;
}, new Set());
if (columnKeysSet.size !== parsedSchema.length) {
throw new UniqueColumnException(APIMessages.COLUMN_KEY_TAKEN);
throw new UniqueColumnException(
`${APIMessages.COLUMN_KEY_DUPLICATED} Duplicate Keys Found for ${[...duplicateKeys].join(', ')}`
);
}

for (const item of parsedSchema) {
Expand Down Expand Up @@ -115,6 +123,16 @@ export class ValidRequest {

return { success: true };
} catch (error) {
if (error instanceof UniqueColumnException) {
throw new HttpException(
{
message: error.message,
errorCode: error.getStatus(),
},
HttpStatus.UNPROCESSABLE_ENTITY
);
}

if (error instanceof DocumentNotFoundException) {
throw new HttpException(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class UpdateUserJob {

private scheduleRssImportJob(jobId: string, cronExpression: string) {
const job = new CronJob(cronExpression, () => this.userJobTriggerService.execute(jobId));
this.schedulerRegistry.addCronJob(this.nameService.getCronName(jobId), job);
this.schedulerRegistry.addCronJob(this.nameService.getCronName(jobId), job as any);

job.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { QueuesEnum } from '@impler/shared';
export class UserJobTriggerService {
constructor(private readonly queueService: QueueService) {}

async execute(_jobId: string) {
execute(_jobId: string) {
this.queueService.publishToQueue(QueuesEnum.GET_IMPORT_JOB_DATA, { _jobId });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export class UserJobResume {
const existingJob = this.schedulerRegistry.getCronJob(this.nameService.getCronName(_jobId));

if (existingJob) {
existingJob.setTime(new CronTime(cronExpression));
existingJob.setTime(new CronTime(cronExpression) as any);
existingJob.start();
} else {
const newJob = new CronJob(cronExpression, () => this.userJobTriggerService.execute(_jobId));
this.schedulerRegistry.addCronJob(this.nameService.getCronName(_jobId), newJob);

this.schedulerRegistry.addCronJob(this.nameService.getCronName(_jobId), newJob as any);
newJob.start();
}

Expand Down
7 changes: 3 additions & 4 deletions apps/api/src/app/review/review.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { APIMessages } from '@shared/constants';
import { JwtAuthGuard } from '@shared/framework/auth.gaurd';
import { validateUploadStatus } from '@shared/helpers/upload.helpers';
import { Defaults, ACCESS_KEY_NAME, UploadStatusEnum, ReviewDataTypesEnum, IJwtPayload } from '@impler/shared';
import { Defaults, ACCESS_KEY_NAME, UploadStatusEnum, ReviewDataTypesEnum } from '@impler/shared';

import {
Replace,
Expand All @@ -29,7 +29,6 @@ import {
UpdateRecords,
} from './usecases';

import { UserSession } from '@shared/framework/user.decorator';
import { validateNotFound } from '@shared/helpers/common.helper';
import { DeleteRecordsDto, UpdateRecordDto, ReplaceDto } from './dtos';
import { PaginationResponseDto } from '@shared/dtos/pagination-response.dto';
Expand Down Expand Up @@ -124,7 +123,7 @@ export class ReviewController {
@ApiOperation({
summary: 'Confirm review data for uploaded file',
})
async doConfirmReview(@UserSession() user: IJwtPayload, @Param('uploadId', ValidateMongoId) _uploadId: string) {
async doConfirmReview(@Param('uploadId', ValidateMongoId) _uploadId: string) {
const uploadInformation = await this.getUpload.execute({
uploadId: _uploadId,
select: 'status _validDataFileId _invalidDataFileId totalRecords invalidRecords _templateId',
Expand All @@ -136,7 +135,7 @@ export class ReviewController {
// upload files with status reviewing can only be confirmed
validateUploadStatus(uploadInformation.status as UploadStatusEnum, [UploadStatusEnum.REVIEWING]);

return this.startProcess.execute(_uploadId, user.email);
return this.startProcess.execute(_uploadId);
}

@Put(':uploadId/record')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class StartProcess {
private paymentAPIService: PaymentAPIService
) {}

async execute(_uploadId: string, email: string) {
async execute(_uploadId: string) {
let uploadInfo = await this.uploadRepository.getUploadWithTemplate(_uploadId, ['destination']);
let importedData;
const destination = (uploadInfo._templateId as unknown as TemplateEntity)?.destination;
Expand Down Expand Up @@ -72,7 +72,7 @@ export class StartProcess {
uploadedFileId: uploadInfo._uploadedFileId,
});

return { uploadInfo, importedData, email };
return { uploadInfo, importedData };
}

async getImportedData({
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/app/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const APIMessages = {
INVALID_AUTH_TOKEN: 'Invalid authentication token',
INVALID_RSS_URL: 'The Specified URL doesn`t contain any RSS XML Feed, Please enter a Valid RSS XML URL',
COLUMN_KEY_TAKEN: 'Column with the same key already exists. Please provide a unique key from "Validations".',
COLUMN_KEY_DUPLICATED: 'Column with the same key already exists. Please provide a unique key.',
COLUMN_KEY_DUPLICATED: 'Column with the same key already exists. Please use a unique key in column.',
ERROR_DURING_VALIDATION:
'Something went wrong while validating data. Data is not imported yet, but team is informed about issue. Please try again after sometime.',
FEATURE_UNAVAILABLE: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class UpdateTemplateColumns {
{ _templateId },
'isRecordFormatUpdated isCombinedFormatUpdated'
);
if (!customization.isRecordFormatUpdated && !customization.isCombinedFormatUpdated) {
if (customization && !customization.isRecordFormatUpdated && !customization.isCombinedFormatUpdated) {
await this.updateCustomization.createOrReset(_templateId, {
recordVariables: this.listRecordVariables(userColumns),
destination: template.destination,
Expand Down
7 changes: 7 additions & 0 deletions apps/api/src/app/user/dto/cancel-subscription.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { IsArray, IsString } from 'class-validator';

export class CancelSubscriptionDto {
@IsArray()
@IsString({ each: true })
reasons: string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ import * as dayjs from 'dayjs';
import { Injectable } from '@nestjs/common';
import { DATE_FORMATS } from '@shared/constants';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class CancelSubscription {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute(userEmail: string) {
const cancelledSubscription = await this.paymentApiService.cancelSubscription(userEmail);
cancelledSubscription.expiryDate = dayjs(cancelledSubscription.expiryDate).format(DATE_FORMATS.COMMON);
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
async execute(projectId: string, cancellationReasons: string[]) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
const canceledSubscription = await this.paymentApiService.cancelSubscription(teamOwner._userId.email);

return cancelledSubscription;
canceledSubscription.expiryDate = dayjs(canceledSubscription.expiryDate).format(DATE_FORMATS.COMMON);

return canceledSubscription;
}
}
16 changes: 12 additions & 4 deletions apps/api/src/app/user/usecases/checkout/checkout.usecase.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
import { Injectable } from '@nestjs/common';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class Checkout {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute({
externalId,
projectId,
paymentMethodId,
planCode,
couponCode,
}: {
externalId: string;
projectId: string;
planCode: string;
paymentMethodId: string;
couponCode?: string;
}) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);

return this.paymentApiService.checkout({
externalId: externalId,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
externalId: teamOwner._userId.email,
planCode: planCode,
paymentMethodId: paymentMethodId,
couponCode: couponCode,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { Injectable } from '@nestjs/common';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class GetTransactionHistory {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute(email: string) {
const transactions = await this.paymentApiService.getTransactionHistory(email);
async execute(projectId: string) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
const transactions = await this.paymentApiService.getTransactionHistory(teamOwner._userId.email);

return transactions.map((transactionItem) => ({
transactionDate: transactionItem.transactionDate,
Expand Down
4 changes: 4 additions & 0 deletions apps/api/src/app/user/usecases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { GetTransactionHistory } from './get-transaction-history/get-transaction
import { ApplyCoupon } from './apply-coupon/apply-coupon.usecase';
import { Checkout } from './checkout/checkout.usecase';
import { Subscription } from './subscription/subscription.usecase';
import { UpdateSubscriptionPaymentMethod } from './subscription/update-payment-method.usecase';

export const USE_CASES = [
GetImportCounts,
Expand All @@ -22,6 +23,8 @@ export const USE_CASES = [
ApplyCoupon,
Checkout,
Subscription,
UpdatePaymentMethod,
UpdateSubscriptionPaymentMethod,
//
];

Expand All @@ -37,4 +40,5 @@ export {
ApplyCoupon,
Checkout,
Subscription,
UpdateSubscriptionPaymentMethod,
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Injectable } from '@nestjs/common';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class RetrievePaymentMethods {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute(email: string) {
return await this.paymentApiService.retriveUserPaymentMethods(email);
async execute(projectId: string) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
return await this.paymentApiService.retriveUserPaymentMethods(teamOwner._userId.email);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import { Injectable } from '@nestjs/common';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class ConfirmIntentId {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute(email: string, intentId: string) {
return await this.paymentApiService.confirmPaymentIntentId(email, intentId);
async execute(projectId: string, intentId: string) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore

return await this.paymentApiService.confirmPaymentIntentId(teamOwner._userId.email, intentId);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { Injectable } from '@nestjs/common';
import { PaymentAPIService } from '@impler/services';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class UpdatePaymentMethod {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute(email: string, paymentId: string) {
return await this.paymentApiService.updatePaymentMethod(email, paymentId);
async execute(projectId: string, paymentMethodId: string) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore

return await this.paymentApiService.updatePaymentMethod(teamOwner._userId.email, paymentMethodId);
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import { PaymentAPIService } from '@impler/services';
import { Injectable } from '@nestjs/common';
import { EnvironmentRepository } from '@impler/dal';

@Injectable()
export class Subscription {
constructor(private paymentApiService: PaymentAPIService) {}
constructor(
private paymentApiService: PaymentAPIService,
private environmentRepository: EnvironmentRepository
) {}

async execute({
email,
projectId,
planCode,
selectedPaymentMethod,
couponCode,
}: {
email: string;
projectId: string;
planCode: string;
selectedPaymentMethod: string;
couponCode?: string;
}) {
const teamOwner = await this.environmentRepository.getTeamOwnerDetails(projectId);

return await this.paymentApiService.subscribe({
planCode,
email,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
email: teamOwner._userId.email,
selectedPaymentMethod,
couponCode,
});
Expand Down
Loading
Loading