@next-k8s/tickets 1.0.9 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +32 -0
- package/package.json +6 -4
- package/src/models/ticket.ts +3 -3
- package/src/routes/__test__/create.test.ts +2 -9
- package/src/routes/index.ts +0 -2
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,38 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.0.13](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/tickets@1.0.12...@next-k8s/tickets@1.0.13) (2022-07-07)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @next-k8s/tickets
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
## [1.0.12](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/tickets@1.0.11...@next-k8s/tickets@1.0.12) (2022-07-07)
|
15
|
+
|
16
|
+
**Note:** Version bump only for package @next-k8s/tickets
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
## [1.0.11](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/tickets@1.0.10...@next-k8s/tickets@1.0.11) (2022-07-06)
|
23
|
+
|
24
|
+
**Note:** Version bump only for package @next-k8s/tickets
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
## [1.0.10](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/tickets@1.0.9...@next-k8s/tickets@1.0.10) (2022-07-06)
|
31
|
+
|
32
|
+
**Note:** Version bump only for package @next-k8s/tickets
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
6
38
|
## [1.0.9](https://github.com/mathiscode/next-k8s-boilerplate/compare/@next-k8s/tickets@1.0.8...@next-k8s/tickets@1.0.9) (2022-07-06)
|
7
39
|
|
8
40
|
**Note:** Version bump only for package @next-k8s/tickets
|
package/package.json
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@next-k8s/tickets",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.13",
|
4
4
|
"main": "index.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"scripts": {
|
7
7
|
"start": "ts-node-dev --transpile-only --exit-child --watch src src/index.ts",
|
8
8
|
"build": "tsc",
|
9
9
|
"test": "jest --no-cache",
|
10
|
-
"test:watch": "jest --watchAll --no-cache"
|
10
|
+
"test:watch": "jest --watchAll --no-cache",
|
11
|
+
"docker:build": "docker build -t mathiscode/k8s-boilerplate-service-tickets .",
|
12
|
+
"docker:push": "docker push mathiscode/k8s-boilerplate-service-tickets"
|
11
13
|
},
|
12
14
|
"publishConfig": {
|
13
15
|
"access": "public"
|
@@ -23,7 +25,7 @@
|
|
23
25
|
]
|
24
26
|
},
|
25
27
|
"dependencies": {
|
26
|
-
"@next-k8s/common": "^0.1.
|
28
|
+
"@next-k8s/common": "^0.1.27",
|
27
29
|
"@types/cookie-session": "^2.0.44",
|
28
30
|
"@types/express": "^4.17.13",
|
29
31
|
"@types/jsonwebtoken": "^8.5.8",
|
@@ -49,5 +51,5 @@
|
|
49
51
|
"supertest": "^6.2.3",
|
50
52
|
"ts-jest": "^28.0.4"
|
51
53
|
},
|
52
|
-
"gitHead": "
|
54
|
+
"gitHead": "a0407c9cfebfc8ff6880bef9239f61514d37a62c"
|
53
55
|
}
|
package/src/models/ticket.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import mongoose from 'mongoose'
|
1
|
+
import mongoose, { ObjectId } from 'mongoose'
|
2
2
|
|
3
3
|
interface TicketAttributes {
|
4
4
|
title: String;
|
5
5
|
price: Number;
|
6
|
-
owner:
|
6
|
+
owner: string;
|
7
7
|
createdAt?: Date;
|
8
8
|
updatedAt?: Date;
|
9
9
|
}
|
@@ -20,7 +20,7 @@ const ticketSchema = new mongoose.Schema({
|
|
20
20
|
},
|
21
21
|
|
22
22
|
owner: {
|
23
|
-
type:
|
23
|
+
type: mongoose.Schema.Types.ObjectId,
|
24
24
|
required: true
|
25
25
|
}
|
26
26
|
}, {
|
@@ -1,16 +1,9 @@
|
|
1
1
|
import request from 'supertest'
|
2
|
+
import { getTokenCookie } from '@next-k8s/common'
|
2
3
|
import app from '../../app'
|
3
4
|
import Ticket from '../../models/ticket'
|
4
5
|
import natsClient from '../../nats-client'
|
5
|
-
import { createTicket
|
6
|
-
|
7
|
-
// const createTicket = (cookie?: string, title = 'Test Event', price = 20000, expectedStatusCode = 201) => {
|
8
|
-
// return request(app)
|
9
|
-
// .post('/api/tickets')
|
10
|
-
// .set('Cookie', cookie ? [cookie] : [])
|
11
|
-
// .send({ title, price })
|
12
|
-
// .expect(expectedStatusCode)
|
13
|
-
// }
|
6
|
+
import { createTicket } from '../../test/utils'
|
14
7
|
|
15
8
|
describe('[Create New Ticket] Route: /api/tickets', () => {
|
16
9
|
it('should be a valid route', async () => {
|