@bpd-library/utilities 1.4.1-beta.3 → 1.4.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,9 +4,6 @@ const constructionNumberStatus = (constructionNumber) => {
|
|
|
4
4
|
const { status: propertyTypeStatus } = propertyType || {};
|
|
5
5
|
const { status: apartmentBuildingStatus } = constructionNumber.apartmentBuilding || {};
|
|
6
6
|
const { status: projectPhaseStatus, isRental } = constructionNumber.projectPhase || {};
|
|
7
|
-
if (propertyTypeStatus === 'AssigningOn' || apartmentBuildingStatus === 'AssigningOn') {
|
|
8
|
-
return availabilityStatus === 'Reserved' ? 'Reserved' : 'AssigningOn';
|
|
9
|
-
}
|
|
10
7
|
if (projectPhaseStatus === 'InPreparation') {
|
|
11
8
|
return availabilityStatus === 'Reserved' ? 'Reserved' : 'InPreparation';
|
|
12
9
|
}
|
|
@@ -20,9 +17,11 @@ const constructionNumberStatus = (constructionNumber) => {
|
|
|
20
17
|
}
|
|
21
18
|
return 'Reserved';
|
|
22
19
|
case 'InOption':
|
|
23
|
-
return 'InOption';
|
|
24
20
|
case 'Available':
|
|
25
|
-
|
|
21
|
+
if (propertyTypeStatus === 'AssigningOn' || apartmentBuildingStatus === 'AssigningOn') {
|
|
22
|
+
return 'AssigningOn';
|
|
23
|
+
}
|
|
24
|
+
return availabilityStatus;
|
|
26
25
|
case 'Sold':
|
|
27
26
|
return isRental ? 'Rented' : 'Sold';
|
|
28
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construction-number-status.js","sourceRoot":"","sources":["../../../src/extended-api-models/status/construction-number-status.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,wBAAwB,GAAG,CAC7B,kBAA8C,EACD,EAAE;IAC/C,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,kBAAkB,CAAC;IAC9E,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,YAAY,IAAI,EAAE,CAAC;IAC1D,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAAC,iBAAiB,IAAI,EAAE,CAAC;IACvF,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,GAAG,kBAAkB,CAAC,YAAY,IAAI,EAAE,CAAC;IAEvF,IAAI,kBAAkB,KAAK,
|
|
1
|
+
{"version":3,"file":"construction-number-status.js","sourceRoot":"","sources":["../../../src/extended-api-models/status/construction-number-status.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,wBAAwB,GAAG,CAC7B,kBAA8C,EACD,EAAE;IAC/C,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,GAAG,kBAAkB,CAAC;IAC9E,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,YAAY,IAAI,EAAE,CAAC;IAC1D,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAAC,iBAAiB,IAAI,EAAE,CAAC;IACvF,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,GAAG,kBAAkB,CAAC,YAAY,IAAI,EAAE,CAAC;IAEvF,IAAI,kBAAkB,KAAK,eAAe,EAAE;QACxC,OAAO,kBAAkB,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC;KAC3E;IAED,IAAI,kBAAkB,KAAK,MAAM;QAAE,OAAO,mBAAmB,CAAC;IAE9D,QAAQ,kBAAkB,EAAE;QACxB,KAAK,UAAU;YACX,IACI,kBAAkB,KAAK,QAAQ,KAC/B,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,cAAc,CAAA;gBAC5B,aAAa,CAAC,YAAY,CAAC,cAAc,CAAC,EAC5C;gBACE,OAAO,UAAU,CAAC;aACrB;YACD,OAAO,UAAU,CAAC;QACtB,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW;YACZ,IAAI,kBAAkB,KAAK,aAAa,IAAI,uBAAuB,KAAK,aAAa,EAAE;gBACnF,OAAO,aAAa,CAAC;aACxB;YACD,OAAO,kBAAkB,CAAC;QAC9B,KAAK,MAAM;YACP,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;KAC3C;IAED,OAAO;AACX,CAAC,CAAC;AAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC","sourcesContent":["import {\n ExtendedConstructionNumber,\n GeneratedConstructionNumberStatus,\n} from '../../api-utilities/api-utilities.types';\nimport { hasDatePassed } from '../../date';\n\nconst constructionNumberStatus = (\n constructionNumber: ExtendedConstructionNumber,\n): GeneratedConstructionNumberStatus | undefined => {\n const { projectPhase, availabilityStatus, propertyType } = constructionNumber;\n const { status: propertyTypeStatus } = propertyType || {};\n const { status: apartmentBuildingStatus } = constructionNumber.apartmentBuilding || {};\n const { status: projectPhaseStatus, isRental } = constructionNumber.projectPhase || {};\n\n if (projectPhaseStatus === 'InPreparation') {\n return availabilityStatus === 'Reserved' ? 'Reserved' : 'InPreparation';\n }\n\n if (projectPhaseStatus === 'Sold') return 'UnderConstruction';\n\n switch (availabilityStatus) {\n case 'Reserved':\n if (\n projectPhaseStatus === 'OnSale' &&\n projectPhase?.allocationDate &&\n hasDatePassed(projectPhase.allocationDate)\n ) {\n return 'InOption';\n }\n return 'Reserved';\n case 'InOption':\n case 'Available':\n if (propertyTypeStatus === 'AssigningOn' || apartmentBuildingStatus === 'AssigningOn') {\n return 'AssigningOn';\n }\n return availabilityStatus;\n case 'Sold':\n return isRental ? 'Rented' : 'Sold';\n }\n\n return;\n};\n\nexport { constructionNumberStatus };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpd-library/utilities",
|
|
3
|
-
"version": "1.4.1-beta.
|
|
3
|
+
"version": "1.4.1-beta.4",
|
|
4
4
|
"description": "Description",
|
|
5
5
|
"url": "https://github.com/{repo name}",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "0a27462fb5b00d79dc19c43116e35dfd482c0684",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@atomify/core": "2.4.1",
|
|
51
51
|
"@atomify/hooks": "1.1.11",
|
|
52
52
|
"@atomify/jsx": "1.7.1",
|
|
53
53
|
"@atomify/kit": "1.1.11",
|
|
54
|
-
"@bpd-library/types": "^1.4.1-beta.
|
|
54
|
+
"@bpd-library/types": "^1.4.1-beta.4",
|
|
55
55
|
"qs": "^6.9.4",
|
|
56
56
|
"query-string": "5"
|
|
57
57
|
}
|