Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hospital-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roshan Suvarnkar
hospital-service
Commits
a08309c2
Commit
a08309c2
authored
1 month ago
by
Manjunath Kumar
Browse files
Options
Downloads
Patches
Plain Diff
create-doctor-seed
parent
8b1a355d
No related branches found
No related tags found
1 merge request
!37
create-doctor-seed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/seed.ts
+204
-0
204 additions, 0 deletions
src/seed.ts
with
204 additions
and
0 deletions
src/seed.ts
+
204
−
0
View file @
a08309c2
...
...
@@ -1560,6 +1560,195 @@ const doctorQualificationsForeignKeys: ForeignKeyConfig<
},
];
//doctor_master
const
doctorMasterData
:
Array
<
{
name
:
string
;
doctor_email_id
:
string
;
doctor_contact
:
string
;
registration_no
:
string
;
hpr_code
:
string
;
pan_no
:
string
;
address
:
string
;
pincodeName
:
string
;
specialityName
:
string
;
latitude
:
number
;
longitude
:
number
;
speciality_id
?:
string
;
pincode_id
?:
string
;
userName
:
string
;
created_by
?:
string
;
updated_by
?:
string
;
}
>
=
[
{
name
:
'
Dr. Fatima Khan
'
,
doctor_email_id
:
'
f.khan@apollo.com
'
,
doctor_contact
:
'
+917845612378
'
,
registration_no
:
'
DL301246
'
,
hpr_code
:
'
DLHPR11224
'
,
pan_no
:
'
JKLPO9876M
'
,
address
:
'
New Delhi
'
,
pincodeName
:
'
400078
'
,
specialityName
:
'
General Practitioner (GP)
'
,
latitude
:
28.56789
,
longitude
:
77.21
,
userName
:
'
Prathviraj
'
,
},
{
name
:
'
Dr. Sneha Joshi
'
,
doctor_email_id
:
'
s.joshi@kokilaben.com
'
,
doctor_contact
:
'
+919987654321
'
,
registration_no
:
'
MH456321
'
,
hpr_code
:
'
MHHPR5533
'
,
pan_no
:
'
BBKPS4321H
'
,
address
:
'
Mumbai, Maharashtra
'
,
pincodeName
:
'
400033
'
,
specialityName
:
'
Pediatrician
'
,
latitude
:
19.0760
,
longitude
:
72.8777
,
userName
:
'
Prathviraj
'
},
{
name
:
'
Dr. Arvind Nair
'
,
doctor_email_id
:
'
a.nair@apollochennai.com
'
,
doctor_contact
:
'
+919999998888
'
,
registration_no
:
'
TN224466
'
,
hpr_code
:
'
TNHPR9922
'
,
pan_no
:
'
CCDPN3344E
'
,
address
:
'
Chennai, Tamil Nadu
'
,
pincodeName
:
'
400079
'
,
specialityName
:
'
Cardiologist
'
,
latitude
:
13.0827
,
longitude
:
80.2707
,
userName
:
'
Prathviraj
'
},
{
name
:
'
Dr. Reema Thakur
'
,
doctor_email_id
:
'
r.thakur@fortischd.com
'
,
doctor_contact
:
'
+917001002003
'
,
registration_no
:
'
PB102938
'
,
hpr_code
:
'
PBHPR3344
'
,
pan_no
:
'
EEMPQ5678N
'
,
address
:
'
Chandigarh
'
,
pincodeName
:
'
400604
'
,
specialityName
:
'
Ophthalmologist
'
,
latitude
:
30.7333
,
longitude
:
76.7794
,
userName
:
'
Prathviraj
'
},
{
name
:
'
Dr. Rajesh Shetty
'
,
doctor_email_id
:
'
rajesh.shetty@manipal.com
'
,
doctor_contact
:
'
+918765432101
'
,
registration_no
:
'
KA998877
'
,
hpr_code
:
'
KAHPR7766
'
,
pan_no
:
'
AABPS1111M
'
,
address
:
'
Udupi, Karnataka
'
,
pincodeName
:
'
400012
'
,
specialityName
:
'
Neurologist
'
,
latitude
:
13.339168
,
longitude
:
74.742142
,
userName
:
'
Prathviraj
'
}
];
const
doctorMasterForeignKeys
:
ForeignKeyConfig
<
(
typeof
doctorMasterData
)[
0
]
>
[]
=
[
{
parentModel
:
'
pincode_master
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
pincodeName
'
,
childForeignKeyField
:
'
pincode_id
'
,
},
{
parentModel
:
'
doctor_speciality_master
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
specialityName
'
,
childForeignKeyField
:
'
speciality_id
'
,
},
{
parentModel
:
'
user
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
userName
'
,
childForeignKeyField
:
'
created_by
'
,
},
{
parentModel
:
'
user
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
userName
'
,
childForeignKeyField
:
'
updated_by
'
,
},
];
//doctor_qualification seed
const
doctorQualificationData
:
Array
<
{
doctor_id
?:
string
;
doctorName
:
string
;
doctor_qualification_id
?:
string
;
doctorQualificationName
:
string
;
userName
:
string
;
created_by
?:
string
;
updated_by
?:
string
;
}
>
=
[
{
doctorName
:
'
Dr. Fatima Khan
'
,
doctorQualificationName
:
'
MBBS
'
,
userName
:
'
Prathviraj
'
,
},
{
doctorName
:
'
Dr. Sneha Joshi
'
,
doctorQualificationName
:
'
BMLT
'
,
userName
:
'
Prathviraj
'
,
},
{
doctorName
:
'
Dr. Arvind Nair
'
,
doctorQualificationName
:
'
MD
'
,
userName
:
'
Prathviraj
'
,
},
{
doctorName
:
'
Dr. Rajesh Shetty
'
,
doctorQualificationName
:
'
DGO
'
,
userName
:
'
Prathviraj
'
,
},
{
doctorName
:
'
Dr. Reema Thakur
'
,
doctorQualificationName
:
'
BDS
'
,
userName
:
'
Prathviraj
'
,
},
];
const
doctorQualificationForeignKeys
:
ForeignKeyConfig
<
(
typeof
doctorQualificationData
)[
0
]
>
[]
=
[
{
parentModel
:
'
doctor_master
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
doctorName
'
,
childForeignKeyField
:
'
doctor_id
'
,
},
{
parentModel
:
'
doctor_qualification_master
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
doctorQualificationName
'
,
childForeignKeyField
:
'
doctor_qualification_id
'
,
},
{
parentModel
:
'
user
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
userName
'
,
childForeignKeyField
:
'
created_by
'
,
},
{
parentModel
:
'
user
'
,
parentLookupKey
:
'
name
'
,
childReferenceKey
:
'
userName
'
,
childForeignKeyField
:
'
updated_by
'
,
},
];
/**
* Seeds the user model with initial data.
*/
...
...
@@ -1683,6 +1872,21 @@ async function run() {
doctorQualificationsForeignKeys
,
);
await
seedWithMultipleParents
(
prisma
,
'
doctor_master
'
,
doctorMasterData
,
doctorMasterForeignKeys
);
await
seedWithMultipleParents
(
prisma
,
'
doctor_qualifications
'
,
doctorQualificationData
,
doctorQualificationForeignKeys
);
console
.
log
(
'
Data seeded successfully.
'
);
}
catch
(
error
)
{
console
.
error
(
'
Error seeding data:
'
,
error
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment