All files / src/domains/hr/payroll/compliance/schemas compliance.schema.ts

0% Statements 0/27
0% Branches 0/16
100% Functions 0/0
0% Lines 0/23

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48                                                                                               
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Schema as MongooseSchema } from 'mongoose';
 
@Schema({ collection: 'statutory_rule_registries', timestamps: true })
export class StatutoryRuleRegistry extends Document {
  @Prop({ required: true }) providerKey!: string;
  @Prop({ required: true }) countryCode!: string;
  @Prop({ required: true }) ruleCode!: string;
  @Prop({ required: true }) ruleName!: string;
  @Prop({ type: MongooseSchema.Types.Mixed, required: true })
  rateConfig!: Record<string, unknown>;
  @Prop({ required: true }) effectiveFrom!: Date;
  @Prop() effectiveTo?: Date;
  @Prop({ default: true }) isActive!: boolean;
}
export const StatutoryRuleRegistrySchema = SchemaFactory.createForClass(
  StatutoryRuleRegistry,
);
StatutoryRuleRegistrySchema.index({
  providerKey: 1,
  countryCode: 1,
  ruleCode: 1,
  effectiveFrom: -1,
});
 
@Schema({ collection: 'tax_rule_registries', timestamps: true })
export class TaxRuleRegistry extends Document {
  @Prop({ required: true }) providerKey!: string;
  @Prop({ required: true }) countryCode!: string;
  @Prop({ required: true }) ruleCode!: string;
  @Prop({ required: true }) ruleName!: string;
  @Prop({ type: MongooseSchema.Types.Mixed, required: true })
  slabConfig!: Record<string, unknown>;
  @Prop({ required: true }) financialYear!: string;
  @Prop({ default: true }) isActive!: boolean;
}
export const TaxRuleRegistrySchema =
  SchemaFactory.createForClass(TaxRuleRegistry);
TaxRuleRegistrySchema.index({
  providerKey: 1,
  countryCode: 1,
  financialYear: 1,
});
 
// ────────────────────────────────────────────────────────────────
// 16. PAYROLL LOCK & REOPEN
// ────────────────────────────────────────────────────────────────