Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Collection
- const Client = {
- _id: ObjectId(),
- client_name: '',
- mobile_nos: [], // Array of mobile numbers
- organisation: ObjectId(), // Nullable, references Organisation with auto-population
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Employee = {
- _id: ObjectId(),
- employee_id: '', // Unique employee identifier
- employee_name: '',
- email: '',
- role: '',
- addresses: [], // Array of addresses
- mobile_nos: [], // Array of mobile numbers
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Login = {
- _id: ObjectId(),
- employee_id: '', // Employee reference
- password: '', // Hashed password for security
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Organisation = {
- _id: ObjectId(),
- organisation_name: '',
- mobile_nos: [], // Array of mobile numbers
- addresses: [], // Array of addresses
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Project = {
- _id: ObjectId(),
- project_title: '',
- details: '', // Project details
- deadline: Date(), // Deadline for project completion
- client: ObjectId(), // References Client with auto-population
- project_received_date: Date(), // Date the project was received
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Task = {
- _id: ObjectId(),
- task_title: '',
- details: '', // Task details
- deadline: Date(), // Task deadline
- project: ObjectId(), // References Project with auto-population
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- const Team = {
- _id: ObjectId(),
- project: ObjectId(), // References Project with auto-population
- team: [], // Array of Employee IDs with auto-population
- leader: ObjectId(), // References Employee as leader with auto-population
- recordstatus: Int, // Status of the record (Consider using enums)
- timestamp: Date(), // Time of creation or last update
- };
- //PROJECT FILE STRUCTURE
- /src
- ├── /database
- │ └── db.js
- ├── /graphql
- │ ├── /resolvers
- │ │ ├── /mutation
- │ │ │ └── /organisation
- │ │ │ ├── add.organisation.js
- │ │ │ ├── delete.organisation.js
- │ │ │ ├── organisation.index.js
- │ │ │ ├── update.organisation.js
- │ │ │ └── mutation.index.js
- │ │ ├── /queries
- │ │ │ └── /organisation
- │ │ │ ├── get.organisation.js
- │ │ │ ├── organisation.index.js
- │ │ │ └── query.index.js
- │ │ └── resolver.index.js
- │ ├── /typeDefs
- │ │ ├── /inputs
- │ │ │ └── organisation.input.gql
- │ │ ├── /mutations
- │ │ │ └── mutation.index.js
- │ │ ├── /queries
- │ │ │ └── query.index.js
- │ │ ├── /types
- │ │ │ ├── organisation.type.gql
- │ │ │ ├── response.type.gql
- │ │ │ └── type.index.js
- │ │ └── typedef.index.js
- │ └── graphql.index.js
- ├── /models
- │ ├── client.model.js
- │ ├── employee.model.js
- │ ├── login.model.js
- │ ├── organisation.model.js
- │ ├── project.model.js
- │ ├── task.model.js
- │ └── team.model.js
- ├── /utils
- │ ├── recordStatus.js
- │ └── response.js
- ├── app.js
- └── server.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement