-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: amount transaction log menstrual subscription (#229)
fix amount transaction log menstrual subscription
- Loading branch information
1 parent
d495e43
commit 1f59bf7
Showing
37 changed files
with
302 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/common/transaction-status/models/transaction-status.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; | ||
import { TransactionStatusList } from './transaction-status.list'; | ||
|
||
@Entity({ name: 'transaction_status' }) | ||
export class TransactionStatus { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
id_type: number; | ||
|
||
@Column() | ||
transaction_status: TransactionStatusList; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/common/transaction-status/models/transaction-status.list.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export enum TransactionStatusList { | ||
Cancelled = 'Cancelled', | ||
CustomerAddDataAsBounty = 'Customer Add Data as Bounty', | ||
CustomerStakeRequestService = 'Customer Stake Request Service', | ||
Excess = 'Excess', | ||
Failed = 'Failed', | ||
Finalized = 'Finalized', | ||
Fulfilled = 'Fulfilled', | ||
LabProvideRequestedService = 'Lab Provide Requested Service', | ||
LabVerified = 'Lab Verified', | ||
Paid = 'Paid', | ||
Partial = 'Partial', | ||
Refunded = 'Refunded', | ||
RegisteredUser = 'Registered User', | ||
Rejected = 'Rejected', | ||
Revoked = 'Revoked', | ||
ServiceCharge = 'Service Charge', | ||
Stake = 'Stake', | ||
Staked = 'Staked', | ||
Unpaid = 'Unpaid', | ||
Unstake = 'Unstake', | ||
Unstaked = 'Unstaked', | ||
Unverified = 'Unverified', | ||
Verified = 'Verified', | ||
WaitingForUnstake = 'Waiting For Unstake', | ||
WaitingForUnstaked = 'Waiting For Unstaked', | ||
} |
12 changes: 12 additions & 0 deletions
12
src/common/transaction-status/transaction-status.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { TransactionStatus } from './models/transaction-status.entity'; | ||
import { TransactionStatusService } from './transaction-status.service'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([TransactionStatus])], | ||
exports: [TypeOrmModule, TransactionStatusService], | ||
controllers: [], | ||
providers: [TransactionStatusService], | ||
}) | ||
export class TransactionStatusModule {} |
25 changes: 25 additions & 0 deletions
25
src/common/transaction-status/transaction-status.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { Repository } from 'typeorm'; | ||
import { TransactionStatus } from './models/transaction-status.entity'; | ||
import { TransactionStatusList } from './models/transaction-status.list'; | ||
|
||
@Injectable() | ||
export class TransactionStatusService { | ||
constructor( | ||
@InjectRepository(TransactionStatus) | ||
private readonly transactionStatusRepository: Repository<TransactionStatus>, | ||
) {} | ||
|
||
async getTransactionStatus( | ||
idType: number, | ||
transactionStatus: TransactionStatusList, | ||
) { | ||
return await this.transactionStatusRepository.findOne({ | ||
where: { | ||
id_type: idType, | ||
transaction_status: transactionStatus, | ||
}, | ||
}); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/common/transaction-type/models/transaction-type.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'; | ||
import { TransactionTypeList } from './transaction-type.list'; | ||
|
||
@Entity({ name: 'transaction_types' }) | ||
export class TransactionType { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
type: TransactionTypeList; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/common/transaction-type/models/transaction-type.list.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export enum TransactionTypeList { | ||
GeneticAnalysisOrder = 'Genetic Analysis Order', | ||
GeneticAnalyst = 'Genetic Analyst', | ||
Lab = 'Lab', | ||
Order = 'Order', | ||
Reward = 'Reward', | ||
StakingGeneticAnalyst = 'Staking Genetic Analyst', | ||
StakingLab = 'Staking Lab', | ||
StakingRequestService = 'Staking Request Service', | ||
MenstrualCalendar = 'Menstrual Calendar', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { TransactionType } from './models/transaction-type.entity'; | ||
import { TransactionTypeService } from './transaction-type.service'; | ||
|
||
@Module({ | ||
imports: [TypeOrmModule.forFeature([TransactionType])], | ||
exports: [TypeOrmModule, TransactionTypeService], | ||
controllers: [], | ||
providers: [TransactionTypeService], | ||
}) | ||
export class TransactionTypeModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { Repository } from 'typeorm'; | ||
import { TransactionType } from './models/transaction-type.entity'; | ||
import { TransactionTypeList } from './models/transaction-type.list'; | ||
|
||
@Injectable() | ||
export class TransactionTypeService { | ||
constructor( | ||
@InjectRepository(TransactionType) | ||
private readonly transactionTypeRepository: Repository<TransactionType>, | ||
) {} | ||
|
||
async getTransactionType(type: TransactionTypeList) { | ||
return await this.transactionTypeRepository.findOne({ | ||
where: { | ||
type: type, | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.