Chuyển tới nội dung chính

API CV Profiles

Tiền tố /api/v1/cv-profiles. Controller: cv-profiles.controller.ts. Module: cv-profiles. Collection: cv-profiles.

@UseGuards(JwtAuthGuard) ở cấp class: mọi route cần đăng nhập. Các route me thao tác trên CV của chính người gọi.

Danh sách route​

RouteAuthMô tả
POST /api/v1/cv-profiles/upsertĐăng nhập (mọi vai trò)Tạo hoặc cập nhật CV của mình, kèm ảnh đại diện
GET /api/v1/cv-profiles/meĐăng nhập (mọi vai trò)Lấy CV của mình
GET /api/v1/cv-profiles/checkĐăng nhập (mọi vai trò)Kiểm tra mình đã có CV chưa
PUT /api/v1/cv-profiles/meĐăng nhập (mọi vai trò)Cập nhật CV của mình
DELETE /api/v1/cv-profiles/meĐăng nhập (mọi vai trò)Xóa thật CV của mình
POST /api/v1/cv-profiles/me/deactivateĐăng nhập (mọi vai trò)Tắt CV của mình, không dùng để nộp hồ sơ
POST /api/v1/cv-profiles/me/activateĐăng nhập (mọi vai trò)Bật lại CV của mình
GET /api/v1/cv-profiles/:idĐăng nhập, vai trò: SUPER ADMINLấy CV bất kỳ theo ID
GET /api/v1/cv-profilesĐăng nhập, vai trò: SUPER ADMINLiệt kê mọi CV có phân trang

Ghi chú​

  • POST /cv-profiles/upsert nhận dữ liệu CV kèm ảnh đại diện (theo Swagger "with Avatar Upload"); dữ liệu được chuẩn hóa về dạng chuẩn rồi tạo hoặc cập nhật, và đồng bộ họ tên, email, ảnh với tài khoản.
  • Mỗi người một CV. isActive = false chặn nộp hồ sơ bằng CV này.
  • DELETE /cv-profiles/me xóa thật (không xóa mềm).
  • Phân trang không đồng nhất: GET /cv-profiles trả { data, total, page, limit }, khác dạng result + meta.pagination của phần còn lại (api-overview).
  • Mọi trường ngày trong CV là chuỗi, không phải Date.

Chi tiết từng route​

POST /api/v1/cv-profiles/upsert​

Tạo hoặc cập nhật CV của mình, kèm ảnh đại diện

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: upsertCvProfile trong cv-profiles.controller.ts
  • Mã thành công: HttpStatus.OK, message = "CV Profile saved successfully"

Body: field cvData kiểu string

Upload: nhận file qua multipart/form-data (@UploadedFile).

Phản hồi theo Swagger

MãMô tả
200CV Profile saved successfully with avatar URL
400Bad Request - Invalid file type or validation failed
401Unauthorized - Invalid or missing JWT token

GET /api/v1/cv-profiles/me​

Lấy CV của mình

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: getCurrentUserCv trong cv-profiles.controller.ts
  • Mã thành công: 200, message = "CV Profile retrieved successfully"

Phản hồi theo Swagger

MãMô tả
200CV Profile retrieved successfully
401Unauthorized - Invalid or missing JWT token

GET /api/v1/cv-profiles/check​

Kiểm tra mình đã có CV chưa

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: checkCvProfileExists trong cv-profiles.controller.ts
  • Mã thành công: 200, message = "CV Profile check completed"

Phản hồi theo Swagger

MãMô tả
200Check completed successfully
401Unauthorized - Invalid or missing JWT token

PUT /api/v1/cv-profiles/me​

Cập nhật CV của mình

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: updateCurrentUserCv trong cv-profiles.controller.ts
  • Mã thành công: 200, message = "CV Profile updated successfully"

Body: CreateCvProfileDto (create-cv-profile.dto.ts)

FieldKiểuBắt buộcValidationVí dụ
personalInfoPersonalInfoDtoCóValidateNested—
educationEducationDto[]KhôngIsArray, ValidateNested[ { id: 'edu-1', school: 'Đại học Bách Khoa TPHCM', degree: …
experienceExperienceDto[]KhôngIsArray, ValidateNested[ { id: 'exp-1', company: 'Tech Corp', position: 'Senior Bac…
skillsSkillDto[]KhôngIsArray, ValidateNested[ { id: 'skill-1', name: 'NestJS', level: 'Advanced' }, { id…
languagesLanguageDto[]KhôngIsArray, ValidateNested[ { id: 'lang-1', name: 'Vietnamese', proficiency: 'Native' …
projectsProjectDto[]KhôngIsArray, ValidateNested[ { id: 'proj-1', name: 'E-commerce Platform', description: …
certificatesCertificateDto[]KhôngIsArray, ValidateNested[ { id: 'cert-1', name: 'AWS Certified Developer', issuer: '…
awardsAwardDto[]KhôngIsArray, ValidateNested[ { id: 'award-1', name: 'Best Developer 2023', date: '2023-…

Kiểu lồng PersonalInfoDto

FieldKiểuBắt buộcValidationVí dụ
fullNamestringCóIsString, MaxLength(100)'Nguyễn Văn A'
titlestringKhôngIsString, MaxLength(100)'Senior Full Stack Developer'
avatarstringKhôngIsString, MaxLength(500)'http://localhost:8000/images/avatar/profile-1234567890.jpg'
phonestringCóIsString, MaxLength(20)'0123456789'
emailstringKhôngIsEmail'nguyenvana@example.com'
birthdaystringKhôngIsString'1995-05-15'
genderstringKhôngIsString, MaxLength(20)'Nam'
addressstringKhôngIsString, MaxLength(200)'123 Đường ABC, Quận 1, TPHCM'
personalLinkstringKhôngIsString, MaxLength(200)'https://linkedin.com/in/nguyenvana'
biostringKhôngIsString, MaxLength(1000)'Experienced Full Stack Developer with 5+ years of experienc…

Kiểu lồng EducationDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'edu-1'
schoolstringCóIsString, MaxLength(200)'Đại học Bách Khoa TPHCM'
degreestringCóIsString, MaxLength(100)'Bachelor of Engineering'
fieldstringCóIsString, MaxLength(100)'Computer Science'
startDatestringCóIsString'2013-09-01'
endDatestringCóIsString'2017-06-30'
descriptionstringKhôngIsString, MaxLength(1000)'GPA: 3.8/4.0 - Graduated with honors'

Kiểu lồng ExperienceDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'exp-1'
companystringCóIsString, MaxLength(100)'Tech Corp Vietnam'
positionstringCóIsString, MaxLength(100)'Senior Backend Developer'
startDatestringCóIsNotEmpty, IsString'2020-01-01'
endDatestringCóIsNotEmpty, IsString'2023-12-31'
descriptionstringKhôngIsString, MaxLength(1000)'Developed and maintained microservices using NestJS, MongoD…

Kiểu lồng SkillDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'skill-1'
namestringCóIsString, MaxLength(100)'NestJS'
levelstringCóIsString, MaxLength(50)'Advanced'

Kiểu lồng LanguageDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'lang-1'
namestringCóIsString, MaxLength(50)'English'
proficiencystringCóIsString, MaxLength(50)'Fluent'

Kiểu lồng ProjectDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'proj-1'
namestringCóIsString, MaxLength(200)'E-commerce Platform'
descriptionstringKhôngIsString, MaxLength(1000)'Full-stack e-commerce solution with payment integration and…
positionstringCóIsString, MaxLength(100)'Lead Developer'
linkstringKhôngIsString, MaxLength(200)'https://github.com/username/ecommerce'

Kiểu lồng CertificateDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'cert-1'
namestringCóIsString, MaxLength(200)'AWS Certified Developer - Associate'
issuerstringCóIsString, MaxLength(200)'Amazon Web Services'
datestringCóIsString'2022-06-15'

Kiểu lồng AwardDto

FieldKiểuBắt buộcValidationVí dụ
idstringCóIsString'award-1'
namestringCóIsString, MaxLength(200)'Best Developer of the Year'
datestringCóIsString'2023-12-01'
descriptionstringKhôngIsString, MaxLength(500)'Awarded for outstanding performance and innovation in backe…

Phản hồi theo Swagger

MãMô tả
200CV Profile updated successfully
400Bad Request - Validation failed
401Unauthorized - Invalid or missing JWT token

DELETE /api/v1/cv-profiles/me​

Xóa thật CV của mình

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: deleteCurrentUserCv trong cv-profiles.controller.ts
  • Mã thành công: HttpStatus.NO_CONTENT

Phản hồi theo Swagger

MãMô tả
204CV Profile deleted successfully
404CV Profile not found
401Unauthorized - Invalid or missing JWT token

POST /api/v1/cv-profiles/me/deactivate​

Tắt CV của mình, không dùng để nộp hồ sơ

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: deactivateCvProfile trong cv-profiles.controller.ts
  • Mã thành công: 201, message = "CV Profile deactivated successfully"

Phản hồi theo Swagger

MãMô tả
200CV Profile deactivated successfully
404CV Profile not found
401Unauthorized - Invalid or missing JWT token

POST /api/v1/cv-profiles/me/activate​

Bật lại CV của mình

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: activateCvProfile trong cv-profiles.controller.ts
  • Mã thành công: 201, message = "CV Profile activated successfully"

Phản hồi theo Swagger

MãMô tả
200CV Profile activated successfully
404CV Profile not found
401Unauthorized - Invalid or missing JWT token

GET /api/v1/cv-profiles/:id​

Lấy CV bất kỳ theo ID. Không có kiểm tra quyền (xem cảnh báo)

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: getCvProfileById trong cv-profiles.controller.ts
  • Mã thành công: 200, message = "CV Profile retrieved successfully"

Path params

TênKiểuMô tả
idstringCV Profile ID (MongoDB ObjectId)

Phản hồi theo Swagger

MãMô tả
200CV Profile retrieved successfully
400Bad Request - Invalid ID format
404CV Profile not found
401Unauthorized - Invalid or missing JWT token

GET /api/v1/cv-profiles​

Liệt kê mọi CV có phân trang. Không có kiểm tra quyền (xem cảnh báo)

  • Auth: Đăng nhập (mọi vai trò)
  • Handler: getAllCvProfiles trong cv-profiles.controller.ts
  • Mã thành công: 200, message = "CV Profiles retrieved successfully"

Query

TênBắt buộcMô tảVí dụ
pageKhôngPage number (default: 1)1
limitKhôngItems per page (default: 10)10

Phản hồi theo Swagger

MãMô tả
200CV Profiles retrieved successfully
401Unauthorized - Invalid or missing JWT token
403Forbidden - Admin access required