Enforce claim beneficiary access and retire unused legacy APIs

This commit is contained in:
SepehrYahyaee
2026-10-05 14:39:51 +03:30
parent 0735333467
commit a3f9aab8fb
104 changed files with 6864 additions and 13223 deletions
-8
View File
@@ -1,8 +0,0 @@
export interface PlateType {
nationalCodeOfInsurer: string;
userId: string;
leftDigits: number;
centerAlphabet: string;
centerDigits: number;
ir: number;
}
+3 -23
View File
@@ -19,7 +19,9 @@ export class PlatesService {
async addPlate(currentUser, body: AddPlateDto) {
const { plate, nationalCodeOfInsurer } = body;
const normalizedAlphabet = this.plateNormalizer.normalizePlateText(String(plate.centerAlphabet || ""));
const normalizedAlphabet = this.plateNormalizer.normalizePlateText(
String(plate.centerAlphabet || ""),
);
const duplicate = await this.plateDbService.findOne({
userId: currentUser,
leftDigits: plate.leftDigits,
@@ -45,28 +47,6 @@ export class PlatesService {
};
}
private async checkUniquePlate(plate): Promise<boolean> {
const {
userId,
leftDigits,
centerAlphabet,
centerDigits,
ir,
nationalCodeOfInsurer,
} = plate;
const found = await this.plateDbService.findOne({
leftDigits,
centerAlphabet,
centerDigits,
userId,
nationalCodeOfInsurer,
ir,
});
return !found;
}
async deletePlate(id: Types.ObjectId) {
const deleted = await this.plateDbService.findAndRemove(id);
if (!deleted) throw new NotFoundException("Plate not found");