transform core api codes into this project, update modules as admin/pos context modules
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common'
|
||||
import { TranslateService } from './translate.service'
|
||||
|
||||
@Controller('admin/translates')
|
||||
export class TranslateController {
|
||||
constructor(private readonly translateService: TranslateService) {}
|
||||
|
||||
@Get()
|
||||
async getTranslations() {
|
||||
return this.translateService.getTranslations()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { TranslateController } from './translate.controller'
|
||||
import { TranslateService } from './translate.service'
|
||||
|
||||
@Module({
|
||||
controllers: [TranslateController],
|
||||
providers: [TranslateService],
|
||||
exports: [TranslateService],
|
||||
})
|
||||
export class AdminTranslateModule {}
|
||||
@@ -0,0 +1,68 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
|
||||
@Injectable()
|
||||
export class TranslateService {
|
||||
getTranslations() {
|
||||
return ResponseMapper.single({
|
||||
attributes: {
|
||||
id: 'شناسه',
|
||||
username: 'نام کاربری',
|
||||
status: 'وضعیت',
|
||||
created_at: 'تاریخ ایجاد',
|
||||
updated_at: 'تاریخ بروزرسانی',
|
||||
actions: 'عملیات',
|
||||
first_name: 'نام',
|
||||
last_name: 'نام خانوادگی',
|
||||
mobile_number: 'تلفن همراه',
|
||||
national_code: 'کد ملی',
|
||||
name: 'عنوان',
|
||||
os_version: 'نسخه سیستم عامل',
|
||||
code: 'کد شناسایی',
|
||||
fullname: 'نام کامل',
|
||||
'brand.name': 'عنوان برند',
|
||||
'pos.name': 'عنوان صنف',
|
||||
'pos.complex.name': 'عنوان مجموعه',
|
||||
'pos.devices.name': 'عنوان دستگاه',
|
||||
'pos.provider.name': 'عنوان ارایهدهنده',
|
||||
goods_count: 'تعداد کالاها',
|
||||
brand: 'برند',
|
||||
licenses: 'لایسنس',
|
||||
business_activity: 'فعالیت اقتصادی',
|
||||
user: 'کاربر',
|
||||
},
|
||||
singular: {
|
||||
users: 'کاربر',
|
||||
devices: 'دستگاه',
|
||||
device_brands: 'برند',
|
||||
guilds: 'صنف',
|
||||
guild_goods: 'کالا',
|
||||
guild_good_categories: 'دستهبندی کالا',
|
||||
partners: 'شریک تجاری',
|
||||
partner_accounts: 'حساب',
|
||||
partner_licenses: 'مجوز',
|
||||
providers: 'ارائهدهنده',
|
||||
provider_accounts: 'حساب',
|
||||
accounts: 'حساب کاربری',
|
||||
licenses: 'لایسنس',
|
||||
business_activities: 'فعالیت اقتصادی',
|
||||
},
|
||||
plural: {
|
||||
users: 'کاربران',
|
||||
devices: 'دستگاهها',
|
||||
device_brands: 'برندها',
|
||||
guilds: 'اصناف',
|
||||
guild_goods: 'کالاها',
|
||||
guild_good_categories: 'دستهبندی کالاها',
|
||||
partners: 'شرکای تجاری',
|
||||
partner_accounts: 'حسابهای شریک تجاری',
|
||||
partner_licenses: 'مجوزهای داده شده',
|
||||
providers: 'ارائهدهندگان',
|
||||
provider_accounts: 'حسابهای ارائهدهنده',
|
||||
accounts: 'حسابهای کاربری',
|
||||
licenses: 'لایسنسها',
|
||||
business_activities: 'فعالیتهای اقتصادی',
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user