Skip to content

Commit

Permalink
Merge pull request #1874 from DFXswiss/develop
Browse files Browse the repository at this point in the history
[NOTASK] SupportIssueReason, remove unused code, improve kyc ident check
  • Loading branch information
Yannick1712 authored Dec 31, 2024
2 parents b0fb6d8 + 81d6adb commit c1d2dc0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
6 changes: 4 additions & 2 deletions src/subdomains/generic/kyc/services/kyc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,14 +891,16 @@ export class KycService {
if (!Util.isSameName(identStep.userData.firstname, data.firstname)) errors.push(KycError.FIRST_NAME_NOT_MATCHING);
if (
!Util.isSameName(identStep.userData.surname, data.lastname) &&
!Util.isSameName(identStep.userData.surname, data.birthname)
!Util.isSameName(identStep.userData.surname, data.birthname) &&
(data.lastname || !Util.isSameName(identStep.userData.surname, data.firstname))
)
errors.push(KycError.LAST_NAME_NOT_MATCHING);

if (
(Util.isSameName(identStep.userData.firstname, data.lastname) ||
Util.isSameName(identStep.userData.firstname, data.birthname)) &&
Util.isSameName(identStep.userData.surname, data.firstname)
Util.isSameName(identStep.userData.surname, data.firstname) &&
errors.some((e) => [KycError.FIRST_NAME_NOT_MATCHING, KycError.LAST_NAME_NOT_MATCHING].includes(e))
)
errors.push(KycError.REVERSED_NAMES);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class BankDataService {
if ([BankDataType.IDENT, BankDataType.USER].includes(entity.type)) return;

const existing = await this.bankDataRepo.findOne({
where: { iban: entity.iban, approved: true },
where: { id: Not(entity.id), iban: entity.iban, approved: true },
relations: { userData: true },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,6 @@ export class CryptoInput extends IEntity {
return this;
}

fail(purpose: PayInPurpose): this {
this.purpose = purpose;
this.status = PayInStatus.FAILED;

return this;
}

ignore(purpose: PayInPurpose, route: DepositRouteType): this {
this.purpose = purpose;
this.route = route;
Expand Down
8 changes: 0 additions & 8 deletions src/subdomains/supporting/payin/services/payin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ export class PayInService {
await this.payInRepository.save(payIn);
}

async failedPayIn(payIn: CryptoInput, purpose: PayInPurpose): Promise<void> {
const _payIn = await this.payInRepository.findOneBy({ id: payIn.id });

_payIn.fail(purpose);

await this.payInRepository.save(_payIn);
}

async ignorePayIn(payIn: CryptoInput, purpose: PayInPurpose, route: DepositRouteType): Promise<void> {
const _payIn = await this.payInRepository.findOneBy({ id: payIn.id });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export enum SupportIssueType {

export enum SupportIssueReason {
OTHER = 'Other',
DATA_REQUEST = 'DataRequest',

// transaction
FUNDS_NOT_RECEIVED = 'FundsNotReceived',
Expand Down

0 comments on commit c1d2dc0

Please sign in to comment.