Browse Source

Initial commit from Saptaswa

master
Satyendra Hari 3 years ago
commit
ecbcd143ed
738 changed files with 194880 additions and 0 deletions
  1. BIN
      docs/Project Documentation For POC Distance.docx
  2. +23
    -0
      src/app/.gitignore
  3. +70
    -0
      src/app/README.md
  4. +25774
    -0
      src/app/package-lock.json
  5. +40
    -0
      src/app/package.json
  6. +5002
    -0
      src/app/public/bootstrap/css/bootstrap-grid.css
  7. +1
    -0
      src/app/public/bootstrap/css/bootstrap-grid.css.map
  8. +7
    -0
      src/app/public/bootstrap/css/bootstrap-grid.min.css
  9. +1
    -0
      src/app/public/bootstrap/css/bootstrap-grid.min.css.map
  10. +5001
    -0
      src/app/public/bootstrap/css/bootstrap-grid.rtl.css
  11. +1
    -0
      src/app/public/bootstrap/css/bootstrap-grid.rtl.css.map
  12. +7
    -0
      src/app/public/bootstrap/css/bootstrap-grid.rtl.min.css
  13. +1
    -0
      src/app/public/bootstrap/css/bootstrap-grid.rtl.min.css.map
  14. +426
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.css
  15. +1
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.css.map
  16. +8
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.min.css
  17. +1
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.min.css.map
  18. +423
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.rtl.css
  19. +1
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.rtl.css.map
  20. +8
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.rtl.min.css
  21. +1
    -0
      src/app/public/bootstrap/css/bootstrap-reboot.rtl.min.css.map
  22. +4752
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.css
  23. +1
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.css.map
  24. +7
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.min.css
  25. +1
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.min.css.map
  26. +4743
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.rtl.css
  27. +1
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.rtl.css.map
  28. +7
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.rtl.min.css
  29. +1
    -0
      src/app/public/bootstrap/css/bootstrap-utilities.rtl.min.css.map
  30. +10837
    -0
      src/app/public/bootstrap/css/bootstrap.css
  31. +1
    -0
      src/app/public/bootstrap/css/bootstrap.css.map
  32. +7
    -0
      src/app/public/bootstrap/css/bootstrap.min.css
  33. +1
    -0
      src/app/public/bootstrap/css/bootstrap.min.css.map
  34. +10813
    -0
      src/app/public/bootstrap/css/bootstrap.rtl.css
  35. +1
    -0
      src/app/public/bootstrap/css/bootstrap.rtl.css.map
  36. +7
    -0
      src/app/public/bootstrap/css/bootstrap.rtl.min.css
  37. +1
    -0
      src/app/public/bootstrap/css/bootstrap.rtl.min.css.map
  38. +6748
    -0
      src/app/public/bootstrap/js/bootstrap.bundle.js
  39. +1
    -0
      src/app/public/bootstrap/js/bootstrap.bundle.js.map
  40. +7
    -0
      src/app/public/bootstrap/js/bootstrap.bundle.min.js
  41. +1
    -0
      src/app/public/bootstrap/js/bootstrap.bundle.min.js.map
  42. +4967
    -0
      src/app/public/bootstrap/js/bootstrap.esm.js
  43. +1
    -0
      src/app/public/bootstrap/js/bootstrap.esm.js.map
  44. +7
    -0
      src/app/public/bootstrap/js/bootstrap.esm.min.js
  45. +1
    -0
      src/app/public/bootstrap/js/bootstrap.esm.min.js.map
  46. +5016
    -0
      src/app/public/bootstrap/js/bootstrap.js
  47. +1
    -0
      src/app/public/bootstrap/js/bootstrap.js.map
  48. +7
    -0
      src/app/public/bootstrap/js/bootstrap.min.js
  49. +1
    -0
      src/app/public/bootstrap/js/bootstrap.min.js.map
  50. BIN
      src/app/public/favicon.ico
  51. +25
    -0
      src/app/public/index.html
  52. BIN
      src/app/public/logo192.png
  53. BIN
      src/app/public/logo512.png
  54. +25
    -0
      src/app/public/manifest.json
  55. +3
    -0
      src/app/public/robots.txt
  56. +10
    -0
      src/app/src/App.js
  57. +33
    -0
      src/app/src/assets/css/home.css
  58. +23
    -0
      src/app/src/component/distanceDetails.js
  59. +187
    -0
      src/app/src/component/home.js
  60. +3
    -0
      src/app/src/config.js
  61. +4
    -0
      src/app/src/constant.js
  62. +11
    -0
      src/app/src/constraints/validation.js
  63. +19
    -0
      src/app/src/index.js
  64. +13
    -0
      src/app/src/reportWebVitals.js
  65. +13
    -0
      src/app/src/router.js
  66. +23
    -0
      src/app/src/services/homeService.js
  67. +5
    -0
      src/app/src/setupTests.js
  68. +63
    -0
      src/app_service/.gitattributes
  69. +50
    -0
      src/app_service/.gitignore
  70. +363
    -0
      src/app_service/.gitignore.bak
  71. BIN
      src/app_service/.vs/DistanceCalculator/DesignTimeBuild/.dtbcache.v2
  72. +1024
    -0
      src/app_service/.vs/DistanceCalculator/config/applicationhost.config
  73. BIN
      src/app_service/.vs/DistanceCalculator/v16/.suo
  74. +25
    -0
      src/app_service/Business/Business.csproj
  75. +14
    -0
      src/app_service/Business/BusinessServiceBinding.cs
  76. +16
    -0
      src/app_service/Business/Services/Abstract/IDistanceService.cs
  77. +106
    -0
      src/app_service/Business/Services/Concrete/DistanceService.cs
  78. +19
    -0
      src/app_service/Business/ViewModels/DistanceModel.cs
  79. +28
    -0
      src/app_service/Business/ViewModels/DistanceResult.cs
  80. +3564
    -0
      src/app_service/Business/bin/Debug/netcoreapp3.1/Business.deps.json
  81. BIN
      src/app_service/Business/bin/Debug/netcoreapp3.1/Business.dll
  82. BIN
      src/app_service/Business/bin/Debug/netcoreapp3.1/Business.pdb
  83. BIN
      src/app_service/Business/bin/Debug/netcoreapp3.1/Common.dll
  84. BIN
      src/app_service/Business/bin/Debug/netcoreapp3.1/Common.pdb
  85. +4109
    -0
      src/app_service/Business/bin/Release/netcoreapp3.1/Business.deps.json
  86. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Business.dll
  87. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Business.pdb
  88. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Common.dll
  89. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Common.pdb
  90. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Data.dll
  91. BIN
      src/app_service/Business/bin/Release/netcoreapp3.1/Data.pdb
  92. +5
    -0
      src/app_service/Business/bin/Release/netcoreapp3.1/Migrations/SqlScripts/Down_MacroDataExcelUploadTransform.sql
  93. +56
    -0
      src/app_service/Business/bin/Release/netcoreapp3.1/Migrations/SqlScripts/Up_MacroDataExcelUploadTransform.sql
  94. +212
    -0
      src/app_service/Business/obj/Business.csproj.nuget.dgspec.json
  95. +22
    -0
      src/app_service/Business/obj/Business.csproj.nuget.g.props
  96. +6
    -0
      src/app_service/Business/obj/Business.csproj.nuget.g.targets
  97. +4
    -0
      src/app_service/Business/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs
  98. +23
    -0
      src/app_service/Business/obj/Debug/netcoreapp3.1/Business.AssemblyInfo.cs
  99. +1
    -0
      src/app_service/Business/obj/Debug/netcoreapp3.1/Business.AssemblyInfoInputs.cache
  100. +3
    -0
      src/app_service/Business/obj/Debug/netcoreapp3.1/Business.GeneratedMSBuildEditorConfig.editorconfig

BIN
docs/Project Documentation For POC Distance.docx View File


+ 23
- 0
src/app/.gitignore View File

@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

+ 70
- 0
src/app/README.md View File

@ -0,0 +1,70 @@
# Getting Started with Create React App
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

+ 25774
- 0
src/app/package-lock.json
File diff suppressed because it is too large
View File


+ 40
- 0
src/app/package.json View File

@ -0,0 +1,40 @@
{
"name": "distance-identifier",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"axios": "^0.25.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

+ 5002
- 0
src/app/public/bootstrap/css/bootstrap-grid.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-grid.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap-grid.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-grid.min.css.map
File diff suppressed because it is too large
View File


+ 5001
- 0
src/app/public/bootstrap/css/bootstrap-grid.rtl.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-grid.rtl.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap-grid.rtl.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-grid.rtl.min.css.map
File diff suppressed because it is too large
View File


+ 426
- 0
src/app/public/bootstrap/css/bootstrap-reboot.css View File

@ -0,0 +1,426 @@
/*!
* Bootstrap Reboot v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

+ 1
- 0
src/app/public/bootstrap/css/bootstrap-reboot.css.map
File diff suppressed because it is too large
View File


+ 8
- 0
src/app/public/bootstrap/css/bootstrap-reboot.min.css View File

@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.min.css.map */

+ 1
- 0
src/app/public/bootstrap/css/bootstrap-reboot.min.css.map
File diff suppressed because it is too large
View File


+ 423
- 0
src/app/public/bootstrap/css/bootstrap-reboot.rtl.css View File

@ -0,0 +1,423 @@
/*!
* Bootstrap Reboot v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
direction: ltr ;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: #6c757d;
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]::-webkit-calendar-picker-indicator {
display: none;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
outline-offset: -2px;
-webkit-appearance: textfield;
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::file-selector-button {
font: inherit;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */

+ 1
- 0
src/app/public/bootstrap/css/bootstrap-reboot.rtl.css.map
File diff suppressed because it is too large
View File


+ 8
- 0
src/app/public/bootstrap/css/bootstrap-reboot.rtl.min.css View File

@ -0,0 +1,8 @@
/*!
* Bootstrap Reboot v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-right:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-right:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:right}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:right;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:right}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}[type=email],[type=number],[type=tel],[type=url]{direction:ltr}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}
/*# sourceMappingURL=bootstrap-reboot.rtl.min.css.map */

+ 1
- 0
src/app/public/bootstrap/css/bootstrap-reboot.rtl.min.css.map
File diff suppressed because it is too large
View File


+ 4752
- 0
src/app/public/bootstrap/css/bootstrap-utilities.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-utilities.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap-utilities.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-utilities.min.css.map
File diff suppressed because it is too large
View File


+ 4743
- 0
src/app/public/bootstrap/css/bootstrap-utilities.rtl.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-utilities.rtl.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap-utilities.rtl.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap-utilities.rtl.min.css.map
File diff suppressed because it is too large
View File


+ 10837
- 0
src/app/public/bootstrap/css/bootstrap.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap.min.css.map
File diff suppressed because it is too large
View File


+ 10813
- 0
src/app/public/bootstrap/css/bootstrap.rtl.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap.rtl.css.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/css/bootstrap.rtl.min.css
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/css/bootstrap.rtl.min.css.map
File diff suppressed because it is too large
View File


+ 6748
- 0
src/app/public/bootstrap/js/bootstrap.bundle.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.bundle.js.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/js/bootstrap.bundle.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.bundle.min.js.map
File diff suppressed because it is too large
View File


+ 4967
- 0
src/app/public/bootstrap/js/bootstrap.esm.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.esm.js.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/js/bootstrap.esm.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.esm.min.js.map
File diff suppressed because it is too large
View File


+ 5016
- 0
src/app/public/bootstrap/js/bootstrap.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.js.map
File diff suppressed because it is too large
View File


+ 7
- 0
src/app/public/bootstrap/js/bootstrap.min.js
File diff suppressed because it is too large
View File


+ 1
- 0
src/app/public/bootstrap/js/bootstrap.min.js.map
File diff suppressed because it is too large
View File


BIN
src/app/public/favicon.ico View File

Before After

+ 25
- 0
src/app/public/index.html View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="stylesheet" href="%PUBLIC_URL%/bootstrap/css/bootstrap.min.css">
<script src="%PUBLIC_URL%/bootstrap/js/bootstrap.min.js"></script>
<title>Distance Identifire</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

BIN
src/app/public/logo192.png View File

Before After
Width: 192  |  Height: 192  |  Size: 5.2 KiB

BIN
src/app/public/logo512.png View File

Before After
Width: 512  |  Height: 512  |  Size: 9.4 KiB

+ 25
- 0
src/app/public/manifest.json View File

@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

+ 3
- 0
src/app/public/robots.txt View File

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

+ 10
- 0
src/app/src/App.js View File

@ -0,0 +1,10 @@
import Router from "./router";
function App() {
return (
<>
<Router />
</>
);
}
export default App;

+ 33
- 0
src/app/src/assets/css/home.css View File

@ -0,0 +1,33 @@
#formPin:focus, #toPin:focus, [type='submit'].btn-success{
box-shadow: none !important;
}
.errMsg{
color: #dc3545;
font-size: 13px;
}
.inputBox{
position: relative;
}
.autoList{
background-color: #fff;
max-height: 250px;
width: 93%;
border: 1px solid #ced4da;
border-radius: 5px;
position: absolute;
overflow-y: auto;
}
.autoList p{
margin-bottom: 0;
padding: 3px 0 3px 5px;
}
.autoList p:hover{
background-color: #ced4da;
}
.errorMsg{
color: #dc3545;
text-align: center;
}
.fromcontainer{
border: 1px solid #ced4da;
}

+ 23
- 0
src/app/src/component/distanceDetails.js View File

@ -0,0 +1,23 @@
const DistanceDetails = (props)=>{
return(
<table className="table table-bordered">
<tbody>
<tr>
<th>Distance between two cities: </th>
<td>{props.data.distance} {props.data.unit}</td>
</tr>
<tr>
<th>Associated city for zip code: {props.from}</th>
<td>{props.data.sourceAssociateCity}</td>
</tr>
<tr>
<th>Associated city for zip code: {props.to}</th>
<td>{props.data.destinationAssociateCity}</td>
</tr>
</tbody>
</table>
)
}
export default DistanceDetails;

+ 187
- 0
src/app/src/component/home.js View File

@ -0,0 +1,187 @@
import { useState } from "react";
import axios from "axios";
import {API} from "../config";
import "../assets/css/home.css";
import {validZip} from "../constraints/validation";
import {colorCode} from "../constant";
import DistanceDetails from "./distanceDetails";
import { getDistance, getZipCode } from "../services/homeService";
const Home = ()=>{
const [fromValidPin, setFromValidpin] = useState(undefined);
const [toValidPin, setToValidpin] = useState(undefined);
const [tabData,settabData] = useState();
const [isError,setIsError] = useState();
const [autoCompleteFrom,setAutoCompleteFrom] = useState();
const [valueFrom,setValueFrom] = useState();
const [autoCompleteTo,setAutoCompleteTo] = useState();
const [valueTo,setValueTo] = useState();
const checkValidationFrom = async (value)=>{
settabData("");
setIsError("");
let result = validZip(value && value!==null && value.trim());
setFromValidpin(result);
let val = value && value!==null && value.trim();
setValueFrom(val);
if(result === undefined && val.length>1){
await getZipCode(val)
.then(response=>{
if(response.status === 0){
setAutoCompleteFrom("");
setIsError(response.message+" for source")
}
setAutoCompleteFrom(response.data && response.data.data);
})
.catch(error=>{
setIsError(error.response.data.message)
})
}
else{
setAutoCompleteFrom("");
}
}
const valueSet = (zip,loc)=>{
if(loc==="from"){
setValueFrom(zip);
setAutoCompleteFrom("");
}
else{
setValueTo(zip);
setAutoCompleteTo("");
}
}
const checkValidationTo = async (value)=>{
settabData("");
setIsError("");
let result = validZip(value && value!==null && value.trim());
setToValidpin(result);
let val = value && value!==null && value.trim();
setValueTo(val);
if(result === undefined && val.length>1){
await getZipCode(val)
.then(response=>{
if(response.status === 0){
setAutoCompleteTo("");
setIsError(response.message+" for destination")
}
setAutoCompleteTo(response.data && response.data.data);
})
.catch(error=>{
setIsError(error.response.data.message)
})
}
else{
setAutoCompleteTo("");
}
}
const onSubmit = async (e) => {
e.preventDefault();
setAutoCompleteTo("");
setAutoCompleteFrom("");
setIsError("");
if(fromValidPin === undefined && toValidPin === undefined){
let data = {
from: e.target[0] && e.target[0].value && e.target[0].value!==null && e.target[0].value.trim(),
to: e.target[1] && e.target[1].value && e.target[1].value!==null && e.target[1].value.trim()
}
await getDistance(data)
.then(response=>{
if(response.status === 0){
setIsError(response.message)
}
settabData(response.data && response.data.data);
})
.catch(error=>{
setIsError(error.response.data.message)
})
}
};
return(
<>
<div className="container mt-3">
<form className="row fromcontainer p-4" onSubmit={onSubmit}>
<div className="col-md-5 inputBox">
<label htmlFor="formPin" className="form-label">Source</label>
<input type="text"
style={{borderColor: fromValidPin ? colorCode.inValidColor : colorCode.validColor}}
className="form-control"
autoComplete="off"
id="formPin"
value={valueFrom}
placeholder="Enter Zip Code"
name="formPin"
onChange={(e)=>checkValidationFrom(e.target.value)}
/>
{
autoCompleteFrom && autoCompleteFrom!==null && autoCompleteFrom.length>0 &&
<div className="autoList">
{
autoCompleteFrom.map((item,i)=>{
return(
<p key={i} onClick={()=>{valueSet(item.zipCode,"from")}}>{item.zipCode}</p>
)
})
}
</div>
}
{fromValidPin && <p className="errMsg">{fromValidPin}</p>}
</div>
<div className="col-md-5 inputBox">
<label htmlFor="toPin" className="form-label">Destination</label>
<input type="text"
style={{borderColor: toValidPin ? colorCode.inValidColor : colorCode.validColor}}
className="form-control"
id="toPin"
autoComplete="off"
value={valueTo}
placeholder="Enter Zip Code"
name="toPin"
onChange={(e)=>checkValidationTo(e.target.value)}
/>
{
autoCompleteTo && autoCompleteTo!==null && autoCompleteTo.length>0 &&
<div className="autoList">
{
autoCompleteTo.map((item,i)=>{
return(
<p key={i} onClick={()=>{valueSet(item.zipCode,"to")}}>{item.zipCode}</p>
)
})
}
</div>
}
{setToValidpin && <p className="errMsg">{toValidPin}</p>}
</div>
<div className="col-md-2 mt-4 pt-2">
<button type="submit" className="btn btn-success w-100">Get Distance</button>
</div>
</form>
</div>
{
isError &&
<div className="container">
<div className="row">
<div className="col-md-12 mt-3">
<div className="errorMsg">
<strong>{isError}</strong>
</div>
</div>
</div>
</div>
}
{
tabData &&
<div className="container mt-3">
<div className="row d-flex justify-content-center">
<div className="col-md-12">
<DistanceDetails data={tabData} from={valueFrom} to={valueTo}/>
</div>
</div>
</div>
}
</>
)
}
export default Home;

+ 3
- 0
src/app/src/config.js View File

@ -0,0 +1,3 @@
export const API = {
getDistance: "https://localhost:44314/api/Distance"
}

+ 4
- 0
src/app/src/constant.js View File

@ -0,0 +1,4 @@
export const colorCode = {
validColor: "#ced4da",
inValidColor: "#dc3545"
}

+ 11
- 0
src/app/src/constraints/validation.js View File

@ -0,0 +1,11 @@
export const validZip = (value)=>{
if(value && value !== null){
if(value.match(/^[0-9]+$/)){
return undefined;
}
else
return 'Enter Valid Zip Code';
}
else
return undefined;
}

+ 19
- 0
src/app/src/index.js View File

@ -0,0 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter } from "react-router-dom";
ReactDOM.render(
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

+ 13
- 0
src/app/src/reportWebVitals.js View File

@ -0,0 +1,13 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};
export default reportWebVitals;

+ 13
- 0
src/app/src/router.js View File

@ -0,0 +1,13 @@
import { Routes, Route } from "react-router-dom";
import Home from "./component/home";
const Router = ()=>{
return(
<Routes>
<Route exact path="/" element={<Home />} />
{/* <Route path="about" element={<About />} /> */}
</Routes>
)
}
export default Router;

+ 23
- 0
src/app/src/services/homeService.js View File

@ -0,0 +1,23 @@
import axios from "axios";
import {API} from "../config";
export const getDistance = (values)=>{
return axios.get(`${API.getDistance}/Get?source=${values.from}&destination=${values.to}`)
.then((response)=>{
return response;
})
.catch((error)=>{
return error.response.data;
})
}
export const getZipCode = (value)=>{
return axios.get(`${API.getDistance}/Search?zipCode=${value}`)
.then((response)=>{
return response;
})
.catch((error)=>{
return error.response.data;
})
}

+ 5
- 0
src/app/src/setupTests.js View File

@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

+ 63
- 0
src/app_service/.gitattributes View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

+ 50
- 0
src/app_service/.gitignore View File

@ -0,0 +1,50 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Node artifact files
node_modules/
dist/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# JetBrains IDE
.idea/
# Unit test reports
TEST*.xml
# Generated by MacOS
.DS_Store
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

+ 363
- 0
src/app_service/.gitignore.bak View File

@ -0,0 +1,363 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

BIN
src/app_service/.vs/DistanceCalculator/DesignTimeBuild/.dtbcache.v2 View File


+ 1024
- 0
src/app_service/.vs/DistanceCalculator/config/applicationhost.config
File diff suppressed because it is too large
View File


BIN
src/app_service/.vs/DistanceCalculator/v16/.suo View File


+ 25
- 0
src/app_service/Business/Business.csproj View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ExcelDataReader" Version="3.6.0" />
<PackageReference Include="libphonenumber-csharp" Version="8.10.20" />
<PackageReference Include="MailKit" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.6" />
<PackageReference Include="MongoDB.Driver" Version="2.14.1" />
<PackageReference Include="SendGrid" Version="9.10.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.ServiceModel.Syndication" Version="5.0.0" />
<PackageReference Include="System.Xml.XDocument" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>
</Project>

+ 14
- 0
src/app_service/Business/BusinessServiceBinding.cs View File

@ -0,0 +1,14 @@
using Business.Services.Abstract;
using Business.Services.Concrete;
using Microsoft.Extensions.DependencyInjection;
namespace Business
{
public class BusinessServiceBinding
{
public static void BindServices(IServiceCollection services)
{
services.AddScoped<IDistanceService,DistanceService>();
}
}
}

+ 16
- 0
src/app_service/Business/Services/Abstract/IDistanceService.cs View File

@ -0,0 +1,16 @@
using Business.ViewModels;
using Common.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Business.Services.Abstract
{
public interface IDistanceService
{
Task<ErrorModel<DistanceModel>> CalculateDistance(string Source, string destination);
Task<ErrorModel<List<ZipModel>>> GetPostalCode(string zipCode);
}
}

+ 106
- 0
src/app_service/Business/Services/Concrete/DistanceService.cs View File

@ -0,0 +1,106 @@
using Business.ViewModels;
using Business.Services.Abstract;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using MongoDB.Driver;
using Common.Models;
using Microsoft.Extensions.Options;
using Common.Utility;
using Common.Configuration;
namespace Business.Services.Concrete
{
public class DistanceService : IDistanceService
{
private readonly IMongoCollection<DistanceResult> _distance;
private readonly DatabaseConfiguration _settings;
public DistanceService(IOptions<DatabaseConfiguration> settings)
{
_settings = settings.Value;
var client = new MongoClient(_settings.ConnectionString);
var database = client.GetDatabase(_settings.DatabaseName);
_distance = database.GetCollection<DistanceResult>("PocZip");
}
public async Task<ErrorModel<DistanceModel>> CalculateDistance(string source, string destination)
{
var vResult = new ErrorModel<DistanceModel>(null);
Distance distance = new Distance();
double distanceinmiles = 0.00;
List<DistanceResult> items;
DistanceResult drt = new DistanceResult();
DistanceResult drt1 = new DistanceResult();
try
{
items = await _distance.Find(c => true).ToListAsync();
items.ToList().ForEach(item =>
{
if ((source == item.ZipCode) && !string.IsNullOrEmpty(item.City))
{
drt.Latitude = item.Latitude;
drt.Longitude = item.Longitude;
drt.ZipCode = item.ZipCode;
drt.City = item.City;
}
if ((destination == item.ZipCode) && !string.IsNullOrEmpty(item.City))
{
drt1.Latitude = item.Latitude;
drt1.Longitude = item.Longitude;
drt1.ZipCode = item.ZipCode;
drt1.City = item.City;
}
});
distanceinmiles = distance.CalculateDistance(drt.Latitude, drt1.Latitude, drt.Longitude, drt1.Longitude);
DistanceModel model = new DistanceModel();
model.Distance = distanceinmiles;
model.Unit = "km";
model.SourceAssociateCity = drt.City;
model.DestinationAssociateCity = drt1.City;
vResult.Data = model;
}
catch (Exception ex)
{
ex.Message.ToString();
}
return vResult;
}
public async Task<ErrorModel<List<ZipModel>>> GetPostalCode(string zipCode)
{
var vResult = new ErrorModel<List<ZipModel>>(null);
List<DistanceResult> items;
List<ZipModel> models = new List<ZipModel>();
DistanceResult drt = new DistanceResult();
try
{
items = await _distance.Find(c => true).ToListAsync();
items.ToList().ForEach(item =>
{
ZipModel zipmodel = new ZipModel();
if ((item.ZipCode.ToString().StartsWith(zipCode.ToString())) && (!string.IsNullOrEmpty(item.City)))
{
zipmodel.ZipCode = item.ZipCode;
models.Add(zipmodel);
}
vResult.Data = models;
});
}
catch (Exception ex)
{
ex.Message.ToString();
}
return vResult;
}
}
}

+ 19
- 0
src/app_service/Business/ViewModels/DistanceModel.cs View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Business.ViewModels
{
public class DistanceModel
{
public double Distance { get; set; }
public string Unit { get; set; }
public string SourceAssociateCity { get; set; }
public string DestinationAssociateCity { get; set; }
}
public class ZipModel
{
public string ZipCode { get; set; }
}
}

+ 28
- 0
src/app_service/Business/ViewModels/DistanceResult.cs View File

@ -0,0 +1,28 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Text;
namespace Business.ViewModels
{
public class DistanceResult
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
public string ZipCode { get; set; }
public double Latitude { get; set; }
public double Longitude { get; set; }
public string City { get; set; }
public string CountryCode { get; set; }
public string State { get; set; }
public string Province { get; set; }
public string Community { get; set; }
public string CommunityCode { get; set; }
public string Accuracy { get; set; }
public string Country { get; set; }
public string Continent { get; set; }
}
}

+ 3564
- 0
src/app_service/Business/bin/Debug/netcoreapp3.1/Business.deps.json
File diff suppressed because it is too large
View File


BIN
src/app_service/Business/bin/Debug/netcoreapp3.1/Business.dll View File


BIN
src/app_service/Business/bin/Debug/netcoreapp3.1/Business.pdb View File


BIN
src/app_service/Business/bin/Debug/netcoreapp3.1/Common.dll View File


BIN
src/app_service/Business/bin/Debug/netcoreapp3.1/Common.pdb View File


+ 4109
- 0
src/app_service/Business/bin/Release/netcoreapp3.1/Business.deps.json
File diff suppressed because it is too large
View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Business.dll View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Business.pdb View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Common.dll View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Common.pdb View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Data.dll View File


BIN
src/app_service/Business/bin/Release/netcoreapp3.1/Data.pdb View File


+ 5
- 0
src/app_service/Business/bin/Release/netcoreapp3.1/Migrations/SqlScripts/Down_MacroDataExcelUploadTransform.sql View File

@ -0,0 +1,5 @@
DROP PROCEDURE [dbo].[sp_TransformExcelUploadToDatapoints]
GO
DROP PROCEDURE [dbo].[sp_ClearMacroDataUploads]
GO

+ 56
- 0
src/app_service/Business/bin/Release/netcoreapp3.1/Migrations/SqlScripts/Up_MacroDataExcelUploadTransform.sql View File

@ -0,0 +1,56 @@
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_ClearMacroDataUploads]
AS
BEGIN
SET NOCOUNT ON
DELETE FROM MacroDataUploads
END
GO
CREATE PROCEDURE [dbo].[sp_TransformExcelUploadToDatapoints]
(
@MacroDataUploadId int
)
AS
BEGIN
SET NOCOUNT ON
merge MacroDataPoints as TARGET
using
(
select
@MacroDataUploadId as [MacroDataUploadId],
u.[DataValue] as [Value],
u.[CountryCode] as [CountryCode],
t.[Id] as [MacroDataPointTypeId],
u.[DateTime] as [DateTime],
s.[Id] as [MacroDataPointSourceId],
case when u.[Estimate] = 'Real' then 0 else 1 end as [IsEstimate]
from MacroDataUploads u
join MacroDataTypes t on t.[Datapoint] = u.[Datapoint]
join MacroDataSources s on s.[Description] = u.[Source]
) AS SOURCE
ON (
TARGET.CountryCode = SOURCE.CountryCode
and TARGET.MacroDataPointTypeId = SOURCE.[MacroDataPointTypeId]
and TARGET.[DateTime] = SOURCE.[DateTime]
and TARGET.MacroDataPointSourceId = SOURCE.MacroDataPointSourceId
)
WHEN MATCHED AND
TARGET.[Value] <> SOURCE.[Value] OR TARGET.[IsEstimate] <> SOURCE.[IsEstimate]
THEN
UPDATE SET TARGET.[MacroDataUploadId] = SOURCE.[MacroDataUploadId], TARGET.[Value] = SOURCE.[Value], TARGET.[IsEstimate] = SOURCE.[IsEstimate]
WHEN NOT MATCHED BY TARGET
THEN INSERT ([MacroDataUploadId],[Value],[CountryCode],[MacroDataPointTypeId],[DateTime],[MacroDataPointSourceId],[IsEstimate])
VALUES (SOURCE.[MacroDataUploadId],SOURCE.[Value],SOURCE.[CountryCode],SOURCE.[MacroDataPointTypeId],SOURCE.[DateTime],SOURCE.[MacroDataPointSourceId],SOURCE.[IsEstimate]);
END
GO

+ 212
- 0
src/app_service/Business/obj/Business.csproj.nuget.dgspec.json View File

@ -0,0 +1,212 @@
{
"format": 1,
"restore": {
"D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Business\\Business.csproj": {}
},
"projects": {
"D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Business\\Business.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Business\\Business.csproj",
"projectName": "Business",
"projectPath": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Business\\Business.csproj",
"packagesPath": "C:\\Users\\Technocraft\\.nuget\\packages\\",
"outputPath": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Business\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
],
"configFilePaths": [
"C:\\Users\\Technocraft\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"projectReferences": {
"D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\Common.csproj": {
"projectPath": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\Common.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"dependencies": {
"ExcelDataReader": {
"target": "Package",
"version": "[3.6.0, )"
},
"MailKit": {
"target": "Package",
"version": "[2.1.3, )"
},
"Microsoft.AspNetCore.Identity": {
"target": "Package",
"version": "[2.2.0, )"
},
"Microsoft.Extensions.Hosting": {
"target": "Package",
"version": "[3.1.6, )"
},
"MongoDB.Driver": {
"target": "Package",
"version": "[2.14.1, )"
},
"SendGrid": {
"target": "Package",
"version": "[9.10.0, )"
},
"System.Configuration.ConfigurationManager": {
"target": "Package",
"version": "[5.0.0, )"
},
"System.Linq": {
"target": "Package",
"version": "[4.3.0, )"
},
"System.ServiceModel.Syndication": {
"target": "Package",
"version": "[5.0.0, )"
},
"System.Xml.XDocument": {
"target": "Package",
"version": "[4.3.0, )"
},
"libphonenumber-csharp": {
"target": "Package",
"version": "[8.10.20, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.405\\RuntimeIdentifierGraph.json"
}
}
},
"D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\Common.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\Common.csproj",
"projectName": "Common",
"projectPath": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\Common.csproj",
"packagesPath": "C:\\Users\\Technocraft\\.nuget\\packages\\",
"outputPath": "D:\\Work\\SentientGeeks\\POC\\DistanceCalculator\\Common\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet\\"
],
"configFilePaths": [
"C:\\Users\\Technocraft\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config",
"C:\\Program Files (x86)\\NuGet\\Config\\Xamarin.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp3.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp3.1": {
"targetAlias": "netcoreapp3.1",
"dependencies": {
"Azure.Storage.Blobs": {
"target": "Package",
"version": "[12.10.0, )"
},
"Microsoft.AspNet.WebApi.Core": {
"target": "Package",
"version": "[5.2.7, )"
},
"Microsoft.AspNetCore.Http": {
"target": "Package",
"version": "[2.2.2, )"
},
"Microsoft.AspNetCore.Mvc.Core": {
"target": "Package",
"version": "[2.2.5, )"
},
"Microsoft.Extensions.Configuration": {
"target": "Package",
"version": "[3.1.6, )"
},
"Microsoft.Extensions.DependencyInjection": {
"target": "Package",
"version": "[3.1.6, )"
},
"Microsoft.IdentityModel.Tokens": {
"target": "Package",
"version": "[6.13.1, )"
},
"System.IdentityModel.Tokens.Jwt": {
"target": "Package",
"version": "[6.13.1, )"
},
"WindowsAzure.Storage": {
"target": "Package",
"version": "[9.3.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.405\\RuntimeIdentifierGraph.json"
}
}
}
}
}

+ 22
- 0
src/app_service/Business/obj/Business.csproj.nuget.g.props View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Technocraft\.nuget\packages\;C:\Program Files (x86)\Microsoft\Xamarin\NuGet\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Technocraft\.nuget\packages\" />
<SourceRoot Include="C:\Program Files (x86)\Microsoft\Xamarin\NuGet\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgNewtonsoft_Json Condition=" '$(PkgNewtonsoft_Json)' == '' ">C:\Users\Technocraft\.nuget\packages\newtonsoft.json\10.0.2</PkgNewtonsoft_Json>
</PropertyGroup>
</Project>

+ 6
- 0
src/app_service/Business/obj/Business.csproj.nuget.g.targets View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>

+ 4
- 0
src/app_service/Business/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]

+ 23
- 0
src/app_service/Business/obj/Debug/netcoreapp3.1/Business.AssemblyInfo.cs View File

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Business")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Business")]
[assembly: System.Reflection.AssemblyTitleAttribute("Business")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

+ 1
- 0
src/app_service/Business/obj/Debug/netcoreapp3.1/Business.AssemblyInfoInputs.cache View File

@ -0,0 +1 @@
4faf343f83fe4ecc4cccc443e97716d83733f999

+ 3
- 0
src/app_service/Business/obj/Debug/netcoreapp3.1/Business.GeneratedMSBuildEditorConfig.editorconfig View File

@ -0,0 +1,3 @@
is_global = true
build_property.RootNamespace = Business
build_property.ProjectDir = D:\Work\SentientGeeks\POC\DistanceCalculator\Business\

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save