Skip to content

Commit

Permalink
Merge branch 'dev' into eunice/resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
eunicechy committed Jan 22, 2021
2 parents e9e933a + f118190 commit 431969d
Show file tree
Hide file tree
Showing 28 changed files with 1,310 additions and 145 deletions.
138 changes: 138 additions & 0 deletions docs/PromotionInput.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
{
"promotionInput": {
"id": "6009f0cd3e809ad222fe06e9",
"promotionNm": "CNY Promo",
"promotionStart": "2021-01-29T15:24:51.425Z",
"promotionEnd": "2021-01-31T15:24:51.425Z",
"image": {
"id": "",
"imageSize": 123.12,
"imageURL": "https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.locusassignments.com%2Fmethods-of-sales-promotion-at-the-consumers-level%2F&psig=AOvVaw3CcIcjVCsAw8ANAJU8eWx2&ust=1611350730564000&source=images&cd=vfe&ved=0CAIQjRxqFwoTCKDKz7H7re4CFQAAAAAdAAAAABAD",
"imageFileNm": "image.png",
"imageType": "png"
},
"promotionService": [
{
"id": "",
"serviceNm": "battery renewal",
"isDispatchAvailable": true,
"isInHouseAvailable": true,
"estimatedServiceTime": 360000.0
}
],
"promotionBranch": [
{
"id": "",
"branchAddr": "UM Pantai Dalam",
"branchContactNo": "+60143360623"
}
],
"promoCode": "Ong ah",
"discountAmt": 0.52
}
}

// query{
// promotions(filter: "{}"){
// id
// promotionNm
// promotionStart
// promotionEnd
// image{
// imageURL
// imageSize
// }
// promotionService{
// estimatedServiceTime
// }
// promotionBranch{
// branchAddr
// }
// promoCode
// discountAmt
// }
// }

// query{
// promotion(id: "6009f06e986f5fd215abd071"){
// id
// promotionNm
// promotionStart
// promotionEnd
// image{
// imageURL
// imageSize
// }
// promotionService{
// estimatedServiceTime
// }
// promotionBranch{
// branchAddr
// }
// promoCode
// discountAmt
// }
// }

// mutation CreatePromotion($promotionInput: PromotionInput!){
// createPromotion(promotionInput: $promotionInput){
// id
// promotionNm
// promotionStart
// promotionEnd
// image{
// imageURL
// imageSize
// }
// promotionService{
// estimatedServiceTime
// }
// promotionBranch{
// branchAddr
// }
// promoCode
// discountAmt
// }
// }

// mutation{
// deletePromotion(id: "6009f06e986f5fd215abd071"){
// id
// promotionNm
// promotionStart
// promotionEnd
// image{
// imageURL
// imageSize
// }
// promotionService{
// estimatedServiceTime
// }
// promotionBranch{
// branchAddr
// }
// promoCode
// discountAmt
// }
// }

// mutation UpdatePromotion($promotionInput: PromotionInput!){
// updatePromotion(promotionInput: $promotionInput){
// id
// promotionNm
// promotionStart
// promotionEnd
// image{
// imageURL
// imageSize
// }
// promotionService{
// estimatedServiceTime
// }
// promotionBranch{
// branchAddr
// }
// promoCode
// discountAmt
// }
// }
59 changes: 59 additions & 0 deletions docs/ServiceInput.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"serviceInput": {
"id": "600a0c69d574e6d7928b04dc",
"serviceNm": "ABC - Brake belt replacement",
"isDispatchAvailable": true,
"isInHouseAvailable": true,
"estimatedServiceTime": 360000.0
}
}

// mutation CreateService($serviceInput: ServiceInput!){
// createService(serviceInput: $serviceInput){
// id
// isInHouseAvailable
// isDispatchAvailable
// estimatedServiceTime
// serviceNm
// }
// }

// mutation{
// deleteService(id: "600a0bc4993b90d755db3e7c"){
// id
// isInHouseAvailable
// isDispatchAvailable
// estimatedServiceTime
// serviceNm
// }
// }

// mutation UpdateService($serviceInput: ServiceInput!){
// updateService(serviceInput: $serviceInput){
// id
// serviceNm
// isInHouseAvailable
// isDispatchAvailable
// estimatedServiceTime
// }
// }

// query{
// services(filter: "{}"){
// id
// serviceNm
// isInHouseAvailable
// isDispatchAvailable
// estimatedServiceTime
// }
// }

// query{
// service(id: "600a0c69d574e6d7928b04dc"){
// id
// serviceNm
// isInHouseAvailable
// isDispatchAvailable
// estimatedServiceTime
// }
// }
16 changes: 16 additions & 0 deletions docs/UserInput.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"userInput": {
"id": null,
"type": "BRANDOWNER",
"firstName": "ROOT",
"lastName": "USER",
"password": "12345",
"dateOfBirth": "898531200000",
"contactNo": "+60143360623",
"email": "root@temp.com",
"ip": null,
"vehicle": null,
"employeeType": "NONE",
"favouriteBranch": null
}
}
49 changes: 49 additions & 0 deletions docs/VideoStorageInput.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// query{
// videoStorages(filter: "{}"){
// id
// videoURL
// videoSize
// videoType
// videoFileNm
// }
// }

// query{
// videoStorage(id: "600a75d18027d8df7e394660"){
// id
// videoURL
// videoSize
// videoType
// videoFileNm
// }
// }

// mutation UpdateVideoStorage($videoStorageInput: VideoStorageInput!){
// updateVideoStorage(videoStorageInput: $videoStorageInput){
// id
// videoURL
// videoSize
// videoType
// videoFileNm
// }
// }

// mutation CreateVideoStorage($videoStorageInput: VideoStorageInput!){
// createVideoStorage(videoStorageInput: $videoStorageInput){
// id
// videoURL
// videoSize
// videoType
// videoFileNm
// }
// }

{
"videoStorageInput": {
"id": null,
"videoSize": 123.12,
"videoURL": "https://www.youtube.com/watch?v=3fGQ8pF3wYU",
"videoType": "youtube",
"videoFileNm": "The Sad Reality"
}
}
4 changes: 4 additions & 0 deletions src/constants/Conversation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const CONVERSATION_TYPE = {
"PERSONAL": "PERSONAL",
"GROUP": "GROUP"
}
7 changes: 7 additions & 0 deletions src/constants/DispatchService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const DISPATCH_SERVICE_STATUS = {
"PENDING": "PENDING",
"REJECTED": "REJECTED",
"ACCEPTED": "ACCEPTED",
"COMPLETED": "COMPLETED",
"CANCELLED": "CANCELLED"
}
2 changes: 2 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { EMPLOYEE_TYPE, USER_TYPE } from "./User";
export { DISPATCH_SERVICE_STATUS } from "./DispatchService";
export { CONVERSATION_TYPE } from "./Conversation";
11 changes: 9 additions & 2 deletions src/models/Conversation.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import mongoose from "mongoose";
import mongoose, { Schema } from "mongoose";
import User from "./User";

const ConversationSchema = new mongoose.Schema({
conversationID: Number,
type: String,
conversationName: String,
members: [
{
type: Schema.Types.ObjectId,
ref: "User"
}
]
});

export default mongoose.model("Conversation", ConversationSchema);
28 changes: 24 additions & 4 deletions src/models/Promotion.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,31 @@ const PromotionSchema = new mongoose.Schema(
promotionStart: Date,
promotionEnd: Date,
promotionDesc: String,
ImageID: Number,
serviceID: [Number],
branchID: [Number],
image: {
_id: String,
imageSize: mongoose.Decimal128,
imageURL: String,
imageFileNm: String,
imageType: String,
},
promotionService: [
{
_id: String,
serviceNm: String,
isDispatchAvailable: Boolean,
isInHouseAvailable: Boolean,
estimatedServiceTime: mongoose.Decimal128,
},
],
promotionBranch: [
{
_id: String,
branchAddr: String,
branchContactNo: String,
},
],
promoCode: String,
discountAm: mongoose.Decimal128,
discountAmt: mongoose.Decimal128,
},
{
timestamps: true,
Expand Down
3 changes: 2 additions & 1 deletion src/models/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import mongoose from "mongoose";
const ServiceSchema = new mongoose.Schema(
{
serviceNm: String,
serviceType: String,
isDispatchAvailable: Boolean,
isInHouseAvailable: Boolean,
estimatedServiceTime: String,
estimatedServiceTime: mongoose.Decimal128,
},
{
timestamps: true,
Expand Down

0 comments on commit 431969d

Please sign in to comment.