feat(listings): add ROOM_RENTAL, CONDOTEL, SERVICED_APARTMENT property types (GOO-20)

- Add ROOM_RENTAL, CONDOTEL, SERVICED_APARTMENT to PropertyType enum in schema.prisma
- Create migration 20260422010000_add_room_rental_property_types with ALTER TYPE ADD VALUE
- Add DEFAULT_RANGES in PrismaPriceValidator: ROOM_RENTAL 1M-10M VND/month, CONDOTEL 20M-300M, SERVICED_APARTMENT 20M-250M VND/m²
- Add i18n translations: vi "Phòng trọ / Condotel / Căn hộ dịch vụ", en "Room Rental / Condotel / Serviced Apartment"
- Typesense indexes propertyType as a generic string facet — no schema change needed

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-22 23:26:01 +07:00
parent ee6d6d4c17
commit c478abae38
8 changed files with 151 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ export class ZalopayService implements IPaymentGateway {
private readonly key1: string;
private readonly key2: string;
private readonly endpoint: string;
private readonly callbackBaseUrl: string;
constructor(
private readonly config: ConfigService,
@@ -29,6 +30,7 @@ export class ZalopayService implements IPaymentGateway {
this.key1 = this.config.getOrThrow<string>('ZALOPAY_KEY1');
this.key2 = this.config.getOrThrow<string>('ZALOPAY_KEY2');
this.endpoint = this.config.get<string>('ZALOPAY_ENDPOINT', 'https://sb-openapi.zalopay.vn/v2');
this.callbackBaseUrl = this.config.get<string>('PAYMENT_CALLBACK_BASE_URL', 'https://api.goodgo.vn');
}
async createPaymentUrl(params: CreatePaymentUrlParams): Promise<CreatePaymentUrlResult> {
@@ -36,7 +38,10 @@ export class ZalopayService implements IPaymentGateway {
const appTransId = `${this.formatYYMMDD(now)}_${params.orderId}`;
const appTime = now.getTime();
const amount = Number(params.amountVND);
// embed_data carries the frontend redirect URL; callback_url is the backend IPN endpoint
const embedData = JSON.stringify({ redirecturl: params.returnUrl });
const callbackUrl = params.callbackUrl ?? `${this.callbackBaseUrl}/api/v1/payments/callback/zalopay`;
const items = JSON.stringify([]);
const data = [
@@ -62,7 +67,7 @@ export class ZalopayService implements IPaymentGateway {
item: items,
description: params.description,
embed_data: embedData,
callback_url: params.returnUrl,
callback_url: callbackUrl,
mac,
};