Skip to content

Commit

Permalink
계좌 소유주 이름 저장 & 마스킹 표시 (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-maki committed Mar 15, 2024
1 parent 614ae01 commit f583c16
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Warnings:
- Added the required column `bank_account_holder_name` to the `user_settlement_identities` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "posts" ALTER COLUMN "age_rating" SET DEFAULT 'ALL',
ALTER COLUMN "category" SET DEFAULT 'OTHER',
ALTER COLUMN "comment_qualification" SET DEFAULT 'ANY';

-- AlterTable
ALTER TABLE "revenue_withdrawals" ALTER COLUMN "state" SET DEFAULT 'PENDING';

-- AlterTable
ALTER TABLE "user_personal_identities" ALTER COLUMN "kind" SET DEFAULT 'PHONE';

-- AlterTable
ALTER TABLE "user_settlement_identities" ADD COLUMN "bank_account_holder_name" TEXT NOT NULL;

-- AlterTable
ALTER TABLE "users" ALTER COLUMN "role" SET DEFAULT 'USER';
1 change: 1 addition & 0 deletions apps/penxle.com/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ model UserSettlementIdentity {
encryptedResidentRegistrationNumberNonce String @map("encrypted_resident_registration_number_nonce")
bankCode String @map("bank_code")
bankAccountNumber String @map("bank_account_number")
bankAccountHolderName String @map("bank_account_holder_name")
@@map("user_settlement_identities")
}
Expand Down
1 change: 1 addition & 0 deletions apps/penxle.com/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ enum UserRole {
}

type UserSettlementIdentity {
bankAccountHolderName: String!
bankAccountNumber: String!
bankCode: String!
id: ID!
Expand Down
14 changes: 14 additions & 0 deletions apps/penxle.com/src/lib/server/graphql/schemas/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,19 @@ export const userSchema = defineSchema((builder) => {
id: t.exposeID('id'),
bankCode: t.exposeString('bankCode'),
bankAccountNumber: t.exposeString('bankAccountNumber'),
bankAccountHolderName: t.string({
resolve: async ({ bankAccountHolderName }) => {
if (bankAccountHolderName.length <= 1) {
return '*';
} else if (bankAccountHolderName.length === 2) {
return bankAccountHolderName.at(0) + '*';
} else {
return (
bankAccountHolderName.at(0) + '*'.repeat(bankAccountHolderName.length - 2) + bankAccountHolderName.at(-1)
);
}
},
}),
}),
});

Expand Down Expand Up @@ -1118,6 +1131,7 @@ export const userSchema = defineSchema((builder) => {
).toString('hex'),
bankCode: input.bankCode,
bankAccountNumber: input.bankAccountNumber,
bankAccountHolderName: accountHolderName,
},
});
}
Expand Down

0 comments on commit f583c16

Please sign in to comment.