140 lines
5.1 KiB
TypeScript
140 lines
5.1 KiB
TypeScript
/**
|
|
* api ระบบจัดการข้อมูลหลัก
|
|
* เมนูย่อย: ข้อมูลเกี่ยวกับบุคคล
|
|
*/
|
|
import env from "../index";
|
|
const person = `${env.API_URI}/metadata/main/`;
|
|
const province = `${env.API_URI}/metadata/province/`;
|
|
const district = `${env.API_URI}/metadata/district/`;
|
|
const subDistrict = `${env.API_URI}/metadata/sub-district/`;
|
|
const prefix = `${env.API_URI}/metadata/prefix/`;
|
|
const bloodGroup = `${env.API_URI}/metadata/blood-group/`;
|
|
const educationLevel = `${env.API_URI}/metadata/education-level/`;
|
|
const gender = `${env.API_URI}/metadata/gender/`;
|
|
const relationship = `${env.API_URI}/metadata/relationship/`;
|
|
const religion = `${env.API_URI}/metadata/religion/`;
|
|
|
|
const orgRelationship = `${env.API_URI}/org/metadata/relationship/`;
|
|
const orgPrefix = `${env.API_URI}/org/metadata/prefix/`;
|
|
const orgRank = `${env.API_URI}/org/metadata/rank/`;
|
|
const orgBloodGroup = `${env.API_URI}/org/metadata/bloodGroup/`;
|
|
const orgGender = `${env.API_URI}/org/metadata/gender/`;
|
|
const orgReligion = `${env.API_URI}/org/metadata/religion/`;
|
|
const orgEducationLevel = `${env.API_URI}/org/metadata/educationLevel/`;
|
|
|
|
const orgProvince = `${env.API_URI}/org/metadata/province`;
|
|
const orgDistrict = `${env.API_URI}/org/metadata/district`;
|
|
const orgSubDistrict = `${env.API_URI}/org/metadata/subDistrict`;
|
|
|
|
export default {
|
|
person: `${person}person`,
|
|
|
|
/**
|
|
* api จังหวัด
|
|
*/
|
|
province,
|
|
listProvinceHistory: `${province}history`,
|
|
listProvinceHistoryId: (id: string) => `${province}history/${id}`,
|
|
listProvincePublished: `${province}history/published`,
|
|
listProvincePublishedHistory: `${province}history/published-history`,
|
|
|
|
/**
|
|
* api เขต
|
|
*/
|
|
listDistrict: (id: string) => `${district}${id}`,
|
|
listDistrictHistory: `${district}history`,
|
|
listDistrictHistoryId: (id: string | string[]) => `${district}history/${id}`,
|
|
listDistrictPublishedId: (id: string) => `${district}history/published/${id}`,
|
|
listDistrictPublishedHistory: (id: string | string[]) =>
|
|
`${district}history/published-history/${id}`,
|
|
|
|
/**
|
|
* api แขวง
|
|
*/
|
|
listSubDistrict: (id: string) => `${subDistrict}${id}`,
|
|
listSubDistrictHistory: `${subDistrict}history`,
|
|
listSubDistrictHistoryProvinceId: (
|
|
provinceId: string | string[],
|
|
district: string | string[]
|
|
) => `${subDistrict}history/${provinceId}/${district}`,
|
|
listSubDistrictHistoryId: (id: string | string[]) =>
|
|
`${subDistrict}history/${id}`,
|
|
listSubDistrictPublishedId: (id: string) =>
|
|
`${subDistrict}history/published/${id}`,
|
|
listSubDistrictPublishedHistory: (id: string | string[]) =>
|
|
`${subDistrict}history/published-history/${id}`,
|
|
|
|
/**
|
|
* api คำนำหน้าชื่อ
|
|
*/
|
|
prefix,
|
|
listPrefixHistory: `${prefix}history`,
|
|
listPrefixHistoryId: (id: string) => `${prefix}history/${id}`,
|
|
listPrefixPublished: `${prefix}history/published`,
|
|
listPrefixPublishedHistory: `${prefix}history/published-history`,
|
|
|
|
/**
|
|
* api เพศ
|
|
*/
|
|
gender,
|
|
listGenderHistory: `${gender}history`,
|
|
listGenderHistoryId: (id: string) => `${gender}history/${id}`,
|
|
listGenderPublished: `${gender}history/published`,
|
|
listGenderPublishedHistory: `${gender}history/published-history`,
|
|
|
|
/**
|
|
* api สถานภาพ
|
|
*/
|
|
relationship,
|
|
listRelationshipHistory: `${relationship}history`,
|
|
listRelationshipHistoryId: (id: string) => `${relationship}history/${id}`,
|
|
listRelationshipPublished: `${relationship}history/published`,
|
|
listRelationshipPublishedHistory: `${relationship}history/published-history`,
|
|
|
|
/**
|
|
* api กลุ่มเลือด
|
|
*/
|
|
bloodGroup,
|
|
listBloodGroupHistory: `${bloodGroup}history`,
|
|
listBloodGroupHistoryId: (id: string) => `${bloodGroup}history/${id}`,
|
|
listBloodGroupPublished: `${bloodGroup}history/published`,
|
|
listBloodGroupPublishedHistory: `${bloodGroup}history/published-history`,
|
|
|
|
/**
|
|
* api ศาสนา
|
|
*/
|
|
religion,
|
|
listReligionHistory: `${religion}history`,
|
|
listReligionHistoryId: (id: string) => `${religion}history/${id}`,
|
|
listReligionPublished: `${religion}history/published`,
|
|
listReligionPublishedHistory: `${religion}history/published-history`,
|
|
|
|
/**
|
|
* api ระดับการศึกษา
|
|
*/
|
|
educationLevel,
|
|
listEducationLevelHistory: `${educationLevel}history`,
|
|
listEducationLevelHistoryId: (id: string) => `${educationLevel}history/${id}`,
|
|
listEducationLevelPublished: `${educationLevel}history/published`,
|
|
listEducationLevelPublishedHistory: `${educationLevel}history/published-history`,
|
|
|
|
// API ใหม่
|
|
orgRelationship,
|
|
orgRelationshipId: (id: string) => `${orgRelationship}${id}`,
|
|
orgPrefix,
|
|
orgPrefixId: (id: string) => `${orgPrefix}${id}`,
|
|
orgRank,
|
|
orgRankId: (id: string) => `${orgRank}${id}`,
|
|
orgBloodGroup,
|
|
orgBloodGroupId: (id: string) => `${orgBloodGroup}${id}`,
|
|
orgGender,
|
|
orgGenderId: (id: string) => `${orgGender}${id}`,
|
|
orgReligion,
|
|
orgReligionId: (id: string) => `${orgReligion}${id}`,
|
|
orgEducationLevel,
|
|
orgEducationLevelId: (id: string) => `${orgEducationLevel}${id}`,
|
|
|
|
orgProvince,
|
|
orgDistrict,
|
|
orgSubDistrict,
|
|
};
|